Skip to content

Commit 3a55402

Browse files
shashank1300azeey
andauthored
Remove build RUNPATH from installed libGrid3D.so (#676)
Installs libGrid3D.so (a legacy alias for libGridConfig.so) by copying the already installed libGridConfig.so using install(CODE ...) instead of install(FILES ...). This ensures the build directory RUNPATH is correctly stripped, matching other installed plugins. Fixes #627 Signed-off-by: shashank1300 <shashankrao1307@gmail.com> Co-authored-by: Addisu Z. Taddese <addisu@openrobotics.org>
1 parent 30234c5 commit 3a55402

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

src/plugins/grid_config/CMakeLists.txt

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,14 @@ gz_gui_add_plugin(GridConfig
77
gz-rendering${GZ_RENDERING_VER}::gz-rendering${GZ_RENDERING_VER}
88
)
99

10-
# Also install as Grid3D, which was a legacy plugin with a subset of features
11-
install (
12-
FILES $<TARGET_FILE:GridConfig>
13-
RENAME ${CMAKE_SHARED_LIBRARY_PREFIX}Grid3D${CMAKE_SHARED_LIBRARY_SUFFIX}
14-
DESTINATION ${GZ_GUI_PLUGIN_RELATIVE_INSTALL_DIR})
10+
# Also install Grid3D (a legacy plugin with a subset of features) by copying the installed GridConfig library. This ensures the correct RUNPATH is used.
11+
12+
install(CODE "
13+
if(EXISTS \"\${CMAKE_INSTALL_PREFIX}/${GZ_GUI_PLUGIN_RELATIVE_INSTALL_DIR}/libGridConfig.so\")
14+
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different
15+
\"\${CMAKE_INSTALL_PREFIX}/${GZ_GUI_PLUGIN_RELATIVE_INSTALL_DIR}/libGridConfig.so\"
16+
\"\${CMAKE_INSTALL_PREFIX}/${GZ_GUI_PLUGIN_RELATIVE_INSTALL_DIR}/libGrid3D.so\")
17+
else()
18+
message(WARNING \"Source file for Grid3D (legacy plugin) copy not found, skipping copy: \${CMAKE_INSTALL_PREFIX}/${GZ_GUI_PLUGIN_RELATIVE_INSTALL_DIR}/libGridConfig.so\")
19+
endif()
20+
")

0 commit comments

Comments
 (0)