rpath_utils.cmake 1.08 KB
Newer Older
Pierre Aubert's avatar
Pierre Aubert committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33

if(APPLE)
	set(CMAKE_MACOSX_RPATH ${CMAKE_INSTALL_PREFIX}/lib)
	
	# use, i.e. don't skip the full RPATH for the build tree
	set(CMAKE_SKIP_BUILD_RPATH  FALSE)

	# when building, don't use the install RPATH already
	# (but later on when installing)
	set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) 

	set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")

	# add the automatically determined parts of the RPATH
	# which point to directories outside the build tree to the install RPATH
	set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
endif()

if(CREATE_RPM)
	set(LIBRARY_DIRECTORY "lib64")
	set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib" "${CMAKE_INSTALL_PREFIX}/lib64")
endif()
message(STATUS "LIBRARY_DIRECTORY = '${LIBRARY_DIRECTORY}'")


if(CREATE_RPM OR CREATE_DEB)
	set(PACKAGE_CREATION_MODE yes CACHE BOOL "Say if we are in the package creation mode or not at the install")
# 	message(STATUS "Now install cmake modules in '${CMAKE_MODULE_PATH}'")
# 	set(PLIBS_INSTALL_CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} CACHE STRING "Install path of the cmake module when creating binary package")
endif()