[cmake] add installWithRPATH

this new CMake function installs a target to a destination and adds the
correct relative RPATH to some desired locations
This commit is contained in:
akallabeth
2025-07-17 13:24:53 +02:00
parent 1d098015ae
commit 12d0e491f6
22 changed files with 220 additions and 34 deletions

View File

@@ -50,7 +50,21 @@ if(BUILD_TESTING_INTERNAL OR BUILD_TESTING)
endif()
if(NOT RDTK_FORCE_STATIC_BUILD)
install(TARGETS ${MODULE_NAME} COMPONENT libraries EXPORT rdtk ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
installwithrpath(
TARGETS
${MODULE_NAME}
COMPONENT
libraries
EXPORT
rdtk
ARCHIVE
DESTINATION
${CMAKE_INSTALL_LIBDIR}
LIBRARY
DESTINATION
${CMAKE_INSTALL_LIBDIR}
RUNTIME
DESTINATION
${CMAKE_INSTALL_BINDIR}
)
endif()