Commit 23c4160a authored by Joseph Mirabel's avatar Joseph Mirabel
Browse files

[pybind11] Let CMake download pybind11

parent 7e06d464
find_package(pybind11 REQUIRED)
if(CMAKE_VERSION VERSION_GREATER 3.11)
include(FetchContent)
FetchContent_Declare(pybind11
GIT_REPOSITORY https://github.com/pybind/pybind11
GIT_TAG v2.8.0)
FetchContent_GetProperties(pybind11)
if(NOT pybind11_POPULATED)
FetchContent_Populate(pybind11)
add_subdirectory(${pybind11_SOURCE_DIR} ${pybind11_BINARY_DIR})
pybind11_add_module(cpp2pybind11 cpp2pybind11.cpp)
target_link_libraries(cpp2pybind11 PRIVATE pinocchio_pywrap)
if(CMAKE_CXX_STANDARD LESS 14)
message(STATUS "CXX_STANDARD for cpp2pybind11 set changed from ${CMAKE_CXX_STANDARD} to 14")
set_target_properties(cpp2pybind11 PROPERTIES CXX_STANDARD 14)
pybind11_add_module(cpp2pybind11 cpp2pybind11.cpp)
target_link_libraries(cpp2pybind11 PRIVATE pinocchio_pywrap)
if(CMAKE_CXX_STANDARD LESS 14)
message(STATUS "CXX_STANDARD for cpp2pybind11 set changed from ${CMAKE_CXX_STANDARD} to 14")
set_target_properties(cpp2pybind11 PROPERTIES CXX_STANDARD 14)
endif()
endif()
endif()
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment