Support RESINSIGHT_INSTALL_RPATH as CMake build parameter

This commit is contained in:
Magne Sjaastad
2024-01-26 08:37:41 +01:00
parent 6922ba22b0
commit de58f3dd54

View File

@@ -442,8 +442,14 @@ endif(RESINSIGHT_ENABLE_GRPC)
# bundle libraries together with private installation
if(RESINSIGHT_PRIVATE_INSTALL)
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
# tell binary to first attempt to load libraries from its own directory
set(RESINSIGHT_INSTALL_RPATH "\$ORIGIN")
set(RESINSIGHT_INSTALL_RPATH "" CACHE STRING "RPATH to be injected into binary")
mark_as_advanced(FORCE RESINSIGHT_INSTALL_RPATH)
# Add ORIGIN to represent the directory where the binary is located
set(RESINSIGHT_INSTALL_RPATH ${RESINSIGHT_INSTALL_RPATH}
"\$ORIGIN"
)
if(${RESINSIGHT_USE_ODB_API})
# This is a "hack" to make ResInsight runtime find the ODB so files used