|
1 | | -if(CMAKE_VERSION VERSION_GREATER 4.11) |
2 | | - include(FetchContent) |
3 | | - FetchContent_Declare( |
4 | | - pybind11 |
5 | | - GIT_REPOSITORY https://github.com/pybind/pybind11 |
6 | | - GIT_TAG v2.10.0) |
7 | | - FetchContent_GetProperties(pybind11) |
8 | | - if(NOT pybind11_POPULATED) |
9 | | - FetchContent_Populate(pybind11) |
10 | | - add_subdirectory(${pybind11_SOURCE_DIR} ${pybind11_BINARY_DIR}) |
| 1 | +include(FetchContent) |
| 2 | +FetchContent_Declare( |
| 3 | + pybind11 |
| 4 | + GIT_REPOSITORY https://github.com/pybind/pybind11 |
| 5 | + GIT_TAG v3.0.1) |
| 6 | +FetchContent_GetProperties(pybind11) |
| 7 | +if(NOT pybind11_POPULATED) |
| 8 | + FetchContent_Populate(pybind11) |
| 9 | + add_subdirectory(${pybind11_SOURCE_DIR} ${pybind11_BINARY_DIR}) |
11 | 10 |
|
12 | | - # pybind11_add_module(cpp2pybind11 cpp2pybind11.cpp) |
13 | | - # |
14 | | - # BUG: might not work out of the box on OSX with conda: |
15 | | - # https://github.com/pybind/pybind11/issues/3081 |
16 | | - if(NOT BUILD_TESTING) |
17 | | - add_library(cpp2pybind11 MODULE EXCLUDE_FROM_ALL cpp2pybind11.cpp) |
18 | | - else() |
19 | | - add_library(cpp2pybind11 MODULE cpp2pybind11.cpp) |
20 | | - endif() |
21 | | - add_dependencies(build_tests cpp2pybind11) |
22 | | - target_link_libraries(cpp2pybind11 PRIVATE pinocchio_pywrap_default pybind11::module) |
23 | | - target_include_directories(cpp2pybind11 SYSTEM PUBLIC ${EIGEN3_INCLUDE_DIR}) |
24 | | - set_target_properties(cpp2pybind11 PROPERTIES PREFIX "" SUFFIX ${PYTHON_EXT_SUFFIX}) |
| 11 | + # pybind11_add_module(cpp2pybind11 cpp2pybind11.cpp) |
| 12 | + # |
| 13 | + # BUG: might not work out of the box on OSX with conda: |
| 14 | + # https://github.com/pybind/pybind11/issues/3081 |
| 15 | + if(NOT BUILD_TESTING) |
| 16 | + add_library(cpp2pybind11 MODULE EXCLUDE_FROM_ALL cpp2pybind11.cpp) |
| 17 | + else() |
| 18 | + add_library(cpp2pybind11 MODULE cpp2pybind11.cpp) |
| 19 | + endif() |
| 20 | + add_dependencies(build_tests cpp2pybind11) |
| 21 | + target_link_libraries(cpp2pybind11 PRIVATE pinocchio_pywrap_default pybind11::module |
| 22 | + Eigen3::Eigen) |
| 23 | + set_target_properties(cpp2pybind11 PROPERTIES PREFIX "" SUFFIX ${PYTHON_EXT_SUFFIX}) |
25 | 24 |
|
26 | | - if(CMAKE_CXX_STANDARD LESS 14) |
27 | | - message(STATUS "CXX_STANDARD for cpp2pybind11 changed from ${CMAKE_CXX_STANDARD} to 14") |
28 | | - set_target_properties(cpp2pybind11 PROPERTIES CXX_STANDARD 14) |
29 | | - endif() |
| 25 | + if(CMAKE_CXX_STANDARD LESS 14) |
| 26 | + message(STATUS "CXX_STANDARD for cpp2pybind11 changed from ${CMAKE_CXX_STANDARD} to 14") |
| 27 | + set_target_properties(cpp2pybind11 PROPERTIES CXX_STANDARD 14) |
| 28 | + endif() |
30 | 29 |
|
31 | | - if(WIN32) |
32 | | - target_compile_definitions(cpp2pybind11 PRIVATE -DNOMINMAX) |
33 | | - endif(WIN32) |
| 30 | + if(WIN32) |
| 31 | + target_compile_definitions(cpp2pybind11 PRIVATE -DNOMINMAX) |
| 32 | + endif(WIN32) |
34 | 33 |
|
35 | | - add_python_unit_test("test-py-cpp2pybind11" "unittest/python/pybind11/test-cpp2pybind11.py" |
36 | | - "bindings/python" "unittest/python/pybind11") |
37 | | - endif() |
| 34 | + add_python_unit_test("test-py-cpp2pybind11" "unittest/python/pybind11/test-cpp2pybind11.py" |
| 35 | + "bindings/python" "unittest/python/pybind11") |
38 | 36 | endif() |
0 commit comments