diff --git a/src/pymake/cmake.py b/src/pymake/cmake.py index 134d9f4..c0425bf 100644 --- a/src/pymake/cmake.py +++ b/src/pymake/cmake.py @@ -56,4 +56,12 @@ class cmake: def add_subdirectory(self,path:str)->Self: self.__write_stack__.append(f"add_subdirectory({path})") - return self \ No newline at end of file + return self + def pybind11_add_module(self, project_name:str=var(project_name), *source:str)->Self: + """ + cmake_minimum_required(VERSION 3.5...3.27) + project(example LANGUAGES CXX) + add_subdirectory(pybind11) + pybind11_add_module(example example.cpp) + """ + self.__write_stack__.append(f"pybind11_add_module({project_name} {args_to_str(source)})") diff --git a/tests/generate_pybind11.py b/tests/generate_pybind11.py index 0fc6472..f0a289c 100644 --- a/tests/generate_pybind11.py +++ b/tests/generate_pybind11.py @@ -3,5 +3,6 @@ from pymake import cmake ( cmake("3.15") + # TODO .write() ) \ No newline at end of file