2023-05-25 16:25:06 +03:00
|
|
|
# RPATH configuration
|
2024-03-11 21:45:11 +03:00
|
|
|
option(CMAKE_SKIP_BUILD_RPATH "skip build RPATH" OFF)
|
|
|
|
option(CMAKE_BUILD_WITH_INSTALL_RPATH "build with install RPATH" OFF)
|
|
|
|
option(CMAKE_INSTALL_RPATH_USE_LINK_PATH "build with link RPATH" OFF)
|
|
|
|
|
2023-05-25 16:25:06 +03:00
|
|
|
if (APPLE)
|
2024-03-19 14:19:07 +03:00
|
|
|
if (BUILD_SHARED_LIBS)
|
|
|
|
option(CMAKE_MACOSX_RPATH "MacOSX RPATH" ON)
|
|
|
|
endif()
|
|
|
|
|
2023-12-01 12:51:28 +03:00
|
|
|
file(RELATIVE_PATH FRAMEWORK_PATH ${CMAKE_INSTALL_FULL_BINDIR} ${CMAKE_INSTALL_FULL_LIBDIR})
|
2024-03-11 21:45:11 +03:00
|
|
|
set(CFG_INSTALL_RPATH "@loader_path/${FRAMEWORK_PATH}")
|
2024-03-19 14:19:07 +03:00
|
|
|
elseif(NOT WIN32)
|
2023-05-25 16:25:06 +03:00
|
|
|
if (NOT FREEBSD)
|
|
|
|
option(WITH_ADD_PLUGIN_TO_RPATH "Add extension and plugin path to RPATH" OFF)
|
|
|
|
if (WITH_ADD_PLUGIN_TO_RPATH)
|
2024-03-11 21:45:11 +03:00
|
|
|
set(CFG_INSTALL_RPATH "\$ORIGIN/../${FREERDP_EXTENSION_REL_PATH}:\$ORIGIN/../${FREERDP_PLUGIN_PATH}:\$ORIGIN/../${CMAKE_INSTALL_LIBDIR}:\$ORIGIN/..")
|
|
|
|
else()
|
|
|
|
set(CFG_INSTALL_RPATH "\$ORIGIN/../${CMAKE_INSTALL_LIBDIR}:\$ORIGIN/..")
|
2023-05-25 16:25:06 +03:00
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
endif(APPLE)
|
|
|
|
|
2024-03-11 21:45:11 +03:00
|
|
|
set(CMAKE_INSTALL_RPATH ${CFG_INSTALL_RPATH} CACHE INTERNAL "ConfigureRPATH")
|
|
|
|
message("Configured RPATH=${CMAKE_INSTALL_RPATH}")
|