Skip to content

Commit

Permalink
Permit to build bindings against an external gz-math
Browse files Browse the repository at this point in the history
Signed-off-by: Silvio Traversaro <[email protected]>
  • Loading branch information
traversaro authored Sep 26, 2024
1 parent eeb17ea commit d02282e
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/python_pybind11/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# Detect if we are doing a standalone build of the bindings, using an external gz-math
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
cmake_minimum_required(VERSION 3.16)
set(GZ_MATH_VER 8)
project(gz-math${GZ_MATH_VER}-python VERSION ${GZ_MATH_VER})
find_package(Python3 COMPONENTS Interpreter Development REQUIRED)
find_package(pybind11 REQUIRED)
find_package(gz-math${PROJECT_VERSION_MAJOR} REQUIRED)
set(PROJECT_LIBRARY_TARGET_NAME "gz-math${PROJECT_VERSION_MAJOR}::gz-math${PROJECT_VERSION_MAJOR}")
include(CTest)
if(BUILD_TESTING)
enable_testing()
endif()
endif()

message(STATUS "Building pybind11 interfaces")
set(BINDINGS_MODULE_NAME "math${PROJECT_VERSION_MAJOR}")
# Split from main extension and converted to pybind11
Expand Down

0 comments on commit d02282e

Please sign in to comment.