Skip to content

Commit

Permalink
Fix python install path
Browse files Browse the repository at this point in the history
Use CMAKE_INSTALL_LIBDIR from GNUInstallDirs instead
of GZ_LIB_INSTALL_DIR, which won't be available if
only building python bindings.

Signed-off-by: Steve Peters <[email protected]>
  • Loading branch information
scpeters committed Nov 5, 2024
1 parent 87c80e7 commit f11c332
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
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(GNUInstallDirs)
include(CTest)
if(BUILD_TESTING)
enable_testing()
Expand All @@ -27,7 +28,7 @@ if(USE_SYSTEM_PATHS_FOR_PYTHON_INSTALLATION)
endif()
else()
# If not a system installation, respect local paths
set(GZ_PYTHON_INSTALL_PATH ${GZ_LIB_INSTALL_DIR}/python)
set(GZ_PYTHON_INSTALL_PATH ${CMAKE_INSTALL_LIBDIR}/python)
endif()

set(GZ_PYTHON_INSTALL_PATH "${GZ_PYTHON_INSTALL_PATH}/gz")
Expand Down

0 comments on commit f11c332

Please sign in to comment.