[cmake] fix RPATH configuration
* ConfigureRPATH must use option or cache variables (visibility scope) * include CommonConfigOptions (and with it ConfigureRPATH) only after all required variables have been defined
This commit is contained in:
parent
47354c4519
commit
44c86c8049
@ -58,7 +58,6 @@ endif()
|
||||
|
||||
# Include our extra modules
|
||||
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/)
|
||||
include(CommonConfigOptions)
|
||||
|
||||
if((CMAKE_SYSTEM_NAME MATCHES "WindowsStore") AND (CMAKE_SYSTEM_VERSION MATCHES "10.0"))
|
||||
set(UWP 1)
|
||||
@ -727,10 +726,6 @@ else()
|
||||
set(FREERDP_PROXY_PLUGINDIR "${PROXY_PLUGINDIR}")
|
||||
endif()
|
||||
|
||||
if (BUILD_SHARED_LIBS)
|
||||
set(CMAKE_MACOSX_RPATH ON)
|
||||
endif()
|
||||
|
||||
# Android profiling
|
||||
if(ANDROID)
|
||||
if(WITH_GPROF)
|
||||
@ -755,6 +750,8 @@ if(BUILD_TESTING)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
include(CommonConfigOptions)
|
||||
|
||||
# WinPR
|
||||
# We want to control the winpr assert for the whole project
|
||||
option(WITH_VERBOSE_WINPR_ASSERT "Compile with verbose WINPR_ASSERT." ON)
|
||||
|
@ -1,18 +1,25 @@
|
||||
# RPATH configuration
|
||||
set(CMAKE_SKIP_BUILD_RPATH FALSE)
|
||||
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
|
||||
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE)
|
||||
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)
|
||||
|
||||
if (BUILD_SHARED_LIBS)
|
||||
option(CMAKE_MACOSX_RPATH "MacOSX RPATH" ON)
|
||||
endif()
|
||||
|
||||
if (APPLE)
|
||||
file(RELATIVE_PATH FRAMEWORK_PATH ${CMAKE_INSTALL_FULL_BINDIR} ${CMAKE_INSTALL_FULL_LIBDIR})
|
||||
set(CMAKE_INSTALL_RPATH "@loader_path/${FRAMEWORK_PATH}")
|
||||
set(CFG_INSTALL_RPATH "@loader_path/${FRAMEWORK_PATH}")
|
||||
else (APPLE)
|
||||
if (NOT FREEBSD)
|
||||
set(CMAKE_INSTALL_RPATH "\$ORIGIN/../${CMAKE_INSTALL_LIBDIR}:\$ORIGIN/..")
|
||||
option(WITH_ADD_PLUGIN_TO_RPATH "Add extension and plugin path to RPATH" OFF)
|
||||
if (WITH_ADD_PLUGIN_TO_RPATH)
|
||||
set(CMAKE_INSTALL_RPATH "\$ORIGIN/../${FREERDP_EXTENSION_REL_PATH}:\$ORIGIN/../${FREERDP_PLUGIN_PATH}:${CMAKE_INSTALL_RPATH}")
|
||||
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/..")
|
||||
endif()
|
||||
endif()
|
||||
endif(APPLE)
|
||||
|
||||
|
||||
set(CMAKE_INSTALL_RPATH ${CFG_INSTALL_RPATH} CACHE INTERNAL "ConfigureRPATH")
|
||||
message("Configured RPATH=${CMAKE_INSTALL_RPATH}")
|
||||
|
Loading…
Reference in New Issue
Block a user