Skip to content

Commit

Permalink
Support compilation of bindings as standalone project
Browse files Browse the repository at this point in the history
Signed-off-by: Silvio Traversaro <[email protected]>
  • Loading branch information
traversaro authored and scpeters committed Nov 5, 2024
1 parent e6e6c6f commit 87c80e7
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions python/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-transport
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
cmake_minimum_required(VERSION 3.16)
set(GZ_TRANSPORT_VER 14)
project(gz-transport${GZ_TRANSPORT_VER}-python VERSION ${GZ_TRANSPORT_VER})
find_package(Python3 COMPONENTS Interpreter Development REQUIRED)
find_package(pybind11 REQUIRED)
find_package(gz-transport${PROJECT_VERSION_MAJOR} REQUIRED)
set(PROJECT_LIBRARY_TARGET_NAME "gz-transport${PROJECT_VERSION_MAJOR}::gz-transport${PROJECT_VERSION_MAJOR}")
include(CTest)
if(BUILD_TESTING)
enable_testing()
endif()
endif()

if(USE_SYSTEM_PATHS_FOR_PYTHON_INSTALLATION)
if(NOT Python3_SITEARCH)
# Get install variable from Python3 module
Expand Down

0 comments on commit 87c80e7

Please sign in to comment.