From bbed9bdfb214da7c6c6909582971bd8b877f87c2 Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Wed, 26 Jun 2024 20:32:12 +0200 Subject: [PATCH 1/3] CMake: allow use of installed pybind11 --- bindings/python/CMakeLists.txt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/bindings/python/CMakeLists.txt b/bindings/python/CMakeLists.txt index 252063b87..c5a9f5851 100644 --- a/bindings/python/CMakeLists.txt +++ b/bindings/python/CMakeLists.txt @@ -14,9 +14,12 @@ else() ${CMAKE_INSTALL_PREFIX}/${PYTHON_SITELIB}/${PROJECT_NAME}) endif() -file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/external/pybind11) -add_subdirectory(external/pybind11 - ${CMAKE_CURRENT_BINARY_DIR}/external/pybind11) +find_package(pybind11 CONFIG) +if(NOT pybind11_FOUND) + file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/external/pybind11) + add_subdirectory(external/pybind11 + ${CMAKE_CURRENT_BINARY_DIR}/external/pybind11) +endif() add_custom_target(${PROJECT_NAME}_python) From 9dfef3a44baffa4afc5ed0ef443050e57bcbf333 Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Wed, 26 Jun 2024 20:40:47 +0200 Subject: [PATCH 2/3] CMake: modernize cereal use --- bindings/python/CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bindings/python/CMakeLists.txt b/bindings/python/CMakeLists.txt index c5a9f5851..9f2f93d30 100644 --- a/bindings/python/CMakeLists.txt +++ b/bindings/python/CMakeLists.txt @@ -95,8 +95,7 @@ function(CREATE_PYTHON_TARGET target_name COMPILE_OPTIONS dependencies) endif(BUILD_WITH_OPENMP_SUPPORT) if(cereal_FOUND) - target_include_directories(${target_name} SYSTEM - PRIVATE ${CEREAL_INCLUDE_DIRS}) + target_link_libraries(${target_name} PRIVATE cereal::cereal) else() target_include_directories( ${target_name} SYSTEM From b0e626c8a8f83eec343f8cfe9aac20eaa9a74a6d Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Wed, 26 Jun 2024 20:51:41 +0200 Subject: [PATCH 3/3] changelog: sync --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 867375bff..2f1395f0b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [Unreleased] ### Added -* Allow use of installed cereal and jrl-cmakemodules via cmake +* Allow use of installed pybind11, cereal and jrl-cmakemodules via cmake * Add compatibility with jrl-cmakemodules workspace ([#339](https://github.com/Simple-Robotics/proxsuite/pull/339)) * Specifically mention that timings are in microseconds ([#340](https://github.com/Simple-Robotics/proxsuite/pull/340)) * Fix cereal include directory in cmake ([#340](https://github.com/Simple-Robotics/proxsuite/pull/340))