From 30c368d1583db23f327aa67c422f05a3f670a8ee Mon Sep 17 00:00:00 2001 From: resserops Date: Tue, 12 May 2026 15:46:16 +0800 Subject: [PATCH] build: add pybind11 as git submodule --- .gitmodules | 3 +++ CMakeLists.txt | 1 + third_party/cmake/pybind11.cmake | 7 +++++++ third_party/pybind11 | 1 + 4 files changed, 12 insertions(+) create mode 100644 third_party/cmake/pybind11.cmake create mode 160000 third_party/pybind11 diff --git a/.gitmodules b/.gitmodules index b98b36b..478789e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -16,3 +16,6 @@ [submodule "third_party/matplotplusplus"] path = third_party/matplotplusplus url = https://github.com/alandefreitas/matplotplusplus.git +[submodule "third_party/pybind11"] + path = third_party/pybind11 + url = https://github.com/pybind/pybind11.git diff --git a/CMakeLists.txt b/CMakeLists.txt index e49e794..1b5de2f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,6 +31,7 @@ include(${oops_3rd_cmake_dir}/argparse.cmake) include(${oops_3rd_cmake_dir}/fmt.cmake) include(${oops_3rd_cmake_dir}/scnlib.cmake) include(${oops_3rd_cmake_dir}/glob.cmake) +include(${oops_3rd_cmake_dir}/pybind11.cmake) include(${oops_3rd_cmake_dir}/matplotplusplus.cmake) if(ENABLE_TEST) include(${oops_3rd_cmake_dir}/googletest.cmake) diff --git a/third_party/cmake/pybind11.cmake b/third_party/cmake/pybind11.cmake new file mode 100644 index 0000000..f81ba35 --- /dev/null +++ b/third_party/cmake/pybind11.cmake @@ -0,0 +1,7 @@ +# pybind11-3.0.4 d03662f0 +set(lib_dir ${oops_3rd_dir}/pybind11) +if(NOT EXISTS "${lib_dir}/CMakeLists.txt") + execute_process(COMMAND git submodule update --init --recursive ${lib_dir}) +endif() + +add_subdirectory(${lib_dir}) diff --git a/third_party/pybind11 b/third_party/pybind11 new file mode 160000 index 0000000..d03662f --- /dev/null +++ b/third_party/pybind11 @@ -0,0 +1 @@ +Subproject commit d03662f0984f652b60e7ddce53d3868002275197