diff --git a/CMakeLists.txt b/CMakeLists.txt index b8ca093..953a5df 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,4 +4,10 @@ project(test_pybind11 VERSION 1.0 DESCRIPTION "a default project" LANGUAGES CXX) file(GLOB_RECURSE SRC src/*.cpp) find_package(Python 3.12.3 COMPONENTS Interpreter Development REQUIRED) find_package(pybind11 CONFIG REQUIRED) + pybind11_add_module(${PROJECT_NAME} ${SRC}) + +add_subdirectory(glfw) +target_link_libraries(${PROJECT_NAME} PRIVATE glfw) +find_package(OpenGl REQUIRED) +target_link_libraries(${PROJECT_NAME} PRIVATE OpenGL::GL) \ No newline at end of file diff --git a/make.py b/make.py index 6fa97a6..6ee2226 100644 --- a/make.py +++ b/make.py @@ -8,6 +8,10 @@ from pymake import * .file("SRC",glob_recurse,"src/*.cpp") .just_add("""find_package(Python 3.12.3 COMPONENTS Interpreter Development REQUIRED)""") .just_add("find_package(pybind11 CONFIG REQUIRED)") + .add_subdirectory("glfw") + .target_link_libraries(var(project_name),"glfw") + .find_package("OpenGl") + .target_link_libraries(var(project_name),"OpenGL::GL") .pybind11_add_module(var(project_name),var("SRC")) .write() ) \ No newline at end of file diff --git a/src/main.cpp b/src/main.cpp index 3062176..869ae38 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,17 +1,9 @@ #include #include +#include -int add(int i, int j) { - return i + j; -} - -std::vector sort_num(std::vector array){ - std::sort(array.begin(),array.end()); - return array; -} PYBIND11_MODULE(test_pybind11, m) { - m.doc() = "pybind11 example plugin"; // optional module docstring - m.def("sort_num",&sort_num,"A function to sort INT numbers"); - m.def("add", &add, "A function that adds two numbers"); + m.doc() = "glpy a python opengl project"; // optional module docstring + } \ No newline at end of file