Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Guilhem Saurel
pinocchio
Commits
23c4160a
Commit
23c4160a
authored
Oct 12, 2021
by
Joseph Mirabel
Browse files
[pybind11] Let CMake download pybind11
parent
7e06d464
Changes
1
Hide whitespace changes
Inline
Side-by-side
unittest/python/pybind11/CMakeLists.txt
View file @
23c4160a
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
()
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment