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 Oct 11, 2024
1 parent 646de60 commit d2bae80
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/python_pybind11/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-math${PROJECT_VERSION_MAJOR} REQUIRED)
set(PROJECT_LIBRARY_TARGET_NAME "gz-math${PROJECT_VERSION_MAJOR}::gz-math${PROJECT_VERSION_MAJOR}")
include(GNUInstallDirs)
include(CTest)
if(BUILD_TESTING)
enable_testing()
Expand Down Expand Up @@ -96,7 +97,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 d2bae80

Please sign in to comment.