From 770dd9d58075159e4091ef8cea0b85cc8bbdab27 Mon Sep 17 00:00:00 2001 From: "Addisu Z. Taddese" Date: Wed, 3 Apr 2024 02:13:29 -0500 Subject: [PATCH 1/2] Use relative install paths for plugin shared libraries Signed-off-by: Addisu Z. Taddese --- CMakeLists.txt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 32c31fbc8..e2ad9a7bf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -97,9 +97,7 @@ message(STATUS "-------------------------------------------\n") set(GZ_PHYSICS_ENGINE_RELATIVE_INSTALL_DIR ${GZ_LIB_INSTALL_DIR}/gz-${GZ_DESIGNATION}-${PROJECT_VERSION_MAJOR}/engine-plugins ) -set(GZ_PHYSICS_ENGINE_INSTALL_DIR - ${CMAKE_INSTALL_PREFIX}/${GZ_PHYSICS_ENGINE_RELATIVE_INSTALL_DIR} -) +set(GZ_PHYSICS_ENGINE_INSTALL_DIR ${GZ_PHYSICS_ENGINE_RELATIVE_INSTALL_DIR}) #============================================================================ # Configure the build From a141a083f5eac6b2b9d575d2bfd4e780ddf2c75a Mon Sep 17 00:00:00 2001 From: "Addisu Z. Taddese" Date: Tue, 9 Apr 2024 14:05:56 -0500 Subject: [PATCH 2/2] Use GZ_PHYSICS_ENGINE_RELATIVE_INSTALL_DIR Signed-off-by: Addisu Z. Taddese --- CMakeLists.txt | 4 +++- bullet-featherstone/CMakeLists.txt | 4 ++-- bullet/CMakeLists.txt | 4 ++-- dartsim/CMakeLists.txt | 4 ++-- tpe/plugin/CMakeLists.txt | 4 ++-- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e2ad9a7bf..32c31fbc8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -97,7 +97,9 @@ message(STATUS "-------------------------------------------\n") set(GZ_PHYSICS_ENGINE_RELATIVE_INSTALL_DIR ${GZ_LIB_INSTALL_DIR}/gz-${GZ_DESIGNATION}-${PROJECT_VERSION_MAJOR}/engine-plugins ) -set(GZ_PHYSICS_ENGINE_INSTALL_DIR ${GZ_PHYSICS_ENGINE_RELATIVE_INSTALL_DIR}) +set(GZ_PHYSICS_ENGINE_INSTALL_DIR + ${CMAKE_INSTALL_PREFIX}/${GZ_PHYSICS_ENGINE_RELATIVE_INSTALL_DIR} +) #============================================================================ # Configure the build diff --git a/bullet-featherstone/CMakeLists.txt b/bullet-featherstone/CMakeLists.txt index c8ee36f41..fbae005e4 100644 --- a/bullet-featherstone/CMakeLists.txt +++ b/bullet-featherstone/CMakeLists.txt @@ -25,7 +25,7 @@ target_link_libraries(${bullet_plugin} gz-math${GZ_MATH_VER}::eigen3) # Note that plugins are currently being installed in 2 places: /lib and the engine-plugins dir -install(TARGETS ${bullet_plugin} DESTINATION ${GZ_PHYSICS_ENGINE_INSTALL_DIR}) +install(TARGETS ${bullet_plugin} DESTINATION ${GZ_PHYSICS_ENGINE_RELATIVE_INSTALL_DIR}) # The library created by `gz_add_component` includes the ign-physics version # (i.e. libgz-physics1-name-plugin.so), but for portability, @@ -40,5 +40,5 @@ if (WIN32) ${GZ_PHYSICS_ENGINE_INSTALL_DIR}\/${unversioned})") else() EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E create_symlink ${versioned} ${unversioned}) - INSTALL(FILES ${PROJECT_BINARY_DIR}/${unversioned} DESTINATION ${GZ_PHYSICS_ENGINE_INSTALL_DIR}) + INSTALL(FILES ${PROJECT_BINARY_DIR}/${unversioned} DESTINATION ${GZ_PHYSICS_ENGINE_RELATIVE_INSTALL_DIR}) endif() diff --git a/bullet/CMakeLists.txt b/bullet/CMakeLists.txt index 134284448..f5553822c 100644 --- a/bullet/CMakeLists.txt +++ b/bullet/CMakeLists.txt @@ -25,7 +25,7 @@ target_link_libraries(${bullet_plugin} gz-math${GZ_MATH_VER}::eigen3) # Note that plugins are currently being installed in 2 places: /lib and the engine-plugins dir -install(TARGETS ${bullet_plugin} DESTINATION ${GZ_PHYSICS_ENGINE_INSTALL_DIR}) +install(TARGETS ${bullet_plugin} DESTINATION ${GZ_PHYSICS_ENGINE_RELATIVE_INSTALL_DIR}) # The library created by `gz_add_component` includes the gz-physics version # (i.e. libgz-physics1-name-plugin.so), but for portability, @@ -40,5 +40,5 @@ if (WIN32) ${GZ_PHYSICS_ENGINE_INSTALL_DIR}\/${unversioned})") else() EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E create_symlink ${versioned} ${unversioned}) - INSTALL(FILES ${PROJECT_BINARY_DIR}/${unversioned} DESTINATION ${GZ_PHYSICS_ENGINE_INSTALL_DIR}) + INSTALL(FILES ${PROJECT_BINARY_DIR}/${unversioned} DESTINATION ${GZ_PHYSICS_ENGINE_RELATIVE_INSTALL_DIR}) endif() diff --git a/dartsim/CMakeLists.txt b/dartsim/CMakeLists.txt index fbf06aab7..1a39a989c 100644 --- a/dartsim/CMakeLists.txt +++ b/dartsim/CMakeLists.txt @@ -55,7 +55,7 @@ else() endif() # Note that plugins are currently being installed in 2 places: /lib and the engine-plugins dir -install(TARGETS ${dartsim_plugin} DESTINATION ${GZ_PHYSICS_ENGINE_INSTALL_DIR}) +install(TARGETS ${dartsim_plugin} DESTINATION ${GZ_PHYSICS_ENGINE_RELATIVE_INSTALL_DIR}) # The library created by `gz_add_component` includes the gz-physics version # (i.e. libgz-physics1-name-plugin.so), but for portability, @@ -70,7 +70,7 @@ if (WIN32) ${GZ_PHYSICS_ENGINE_INSTALL_DIR}\/${unversioned})") else() EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E create_symlink ${versioned} ${unversioned}) - INSTALL(FILES ${PROJECT_BINARY_DIR}/${unversioned} DESTINATION ${GZ_PHYSICS_ENGINE_INSTALL_DIR}) + INSTALL(FILES ${PROJECT_BINARY_DIR}/${unversioned} DESTINATION ${GZ_PHYSICS_ENGINE_RELATIVE_INSTALL_DIR}) endif() # Testing diff --git a/tpe/plugin/CMakeLists.txt b/tpe/plugin/CMakeLists.txt index 573fe8adb..636a2b2c7 100644 --- a/tpe/plugin/CMakeLists.txt +++ b/tpe/plugin/CMakeLists.txt @@ -32,7 +32,7 @@ target_link_libraries(${tpe_plugin} ) # Note that plugins are currently being installed in 2 places: /lib and the engine-plugins dir -install(TARGETS ${tpe_plugin} DESTINATION ${GZ_PHYSICS_ENGINE_INSTALL_DIR}) +install(TARGETS ${tpe_plugin} DESTINATION ${GZ_PHYSICS_ENGINE_RELATIVE_INSTALL_DIR}) # The library created by `gz_add_component` includes the gz-physics version # (i.e. libgz-physics1-name-plugin.so), but for portability, @@ -47,7 +47,7 @@ if (WIN32) ${GZ_PHYSICS_ENGINE_INSTALL_DIR}\/${unversioned})") else() EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E create_symlink ${versioned} ${unversioned}) - INSTALL(FILES ${PROJECT_BINARY_DIR}/${unversioned} DESTINATION ${GZ_PHYSICS_ENGINE_INSTALL_DIR}) + INSTALL(FILES ${PROJECT_BINARY_DIR}/${unversioned} DESTINATION ${GZ_PHYSICS_ENGINE_RELATIVE_INSTALL_DIR}) endif() gz_build_tests(