diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 47 |
1 files changed, 8 insertions, 39 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 3c2ea8b..fb7b9b7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -264,7 +264,6 @@ macro(CMAKE_SETUP_TESTING) ${CMake_BINARY_DIR}/Testing/HTML/TestingResults/Icons/Logo.gif COPYONLY) endif() mark_as_advanced(DART_ROOT) - mark_as_advanced(CURL_TESTING) endmacro() @@ -368,7 +367,7 @@ macro (CMAKE_BUILD_UTILITIES) # Setup third-party libraries. # Everything in the tree should be able to include files from the # Utilities directory. - if (CMAKE_SYSTEM_NAME STREQUAL "AIX" AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + if ((CMAKE_SYSTEM_NAME STREQUAL "AIX" OR CMAKE_SYSTEM_NAME STREQUAL "OS400") AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU") # using -isystem option generate error "template with C linkage" include_directories("${CMake_SOURCE_DIR}/Utilities/std") else() @@ -671,10 +670,6 @@ if(NOT CMake_TEST_EXTERNAL_CMAKE) set(LIBRARY_OUTPUT_PATH "" CACHE INTERNAL "Where to put the libraries for CMake") - # The CMake executables usually do not need any rpath to run in the build or - # install tree. - set(CMAKE_SKIP_RPATH ON CACHE INTERNAL "CMake does not need RPATHs.") - # Load install destinations. include(Source/CMakeInstallDestinations.cmake) @@ -714,19 +709,6 @@ if(NOT CMake_TEST_EXTERNAL_CMAKE) # build the utilities (a macro defined in this file) CMAKE_BUILD_UTILITIES() - # On NetBSD ncurses is required, since curses doesn't have the wsyncup() - # function. ncurses is installed via pkgsrc, so the library is in /usr/pkg/lib, - # which isn't in the default linker search path. So without RPATH ccmake - # doesn't run and the build doesn't succeed since ccmake is executed for - # generating the documentation. - if(BUILD_CursesDialog) - get_filename_component(_CURSES_DIR "${CURSES_LIBRARY}" PATH) - set(CURSES_NEED_RPATH FALSE) - if(NOT "${_CURSES_DIR}" STREQUAL "/lib" AND NOT "${_CURSES_DIR}" STREQUAL "/usr/lib" AND NOT "${_CURSES_DIR}" STREQUAL "/lib64" AND NOT "${_CURSES_DIR}" STREQUAL "/usr/lib64") - set(CURSES_NEED_RPATH TRUE) - endif() - endif() - if(BUILD_QtDialog) if(APPLE) set(CMAKE_BUNDLE_VERSION @@ -739,28 +721,15 @@ if(NOT CMake_TEST_EXTERNAL_CMAKE) set(CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}CMake.app/Contents") endif() - - set(QT_NEED_RPATH FALSE) - if(NOT "${QT_LIBRARY_DIR}" STREQUAL "/lib" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/usr/lib" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/lib64" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/usr/lib64") - set(QT_NEED_RPATH TRUE) - endif() endif() - - # The same might be true on other systems for other libraries. - # Then only enable RPATH if we have are building at least with cmake 2.4, - # since this one has much better RPATH features than cmake 2.2. - # The executables are then built with the RPATH for the libraries outside - # the build tree, which is both the build and the install RPATH. - if (UNIX) - if( CMAKE_USE_SYSTEM_CURL OR CMAKE_USE_SYSTEM_ZLIB - OR CMAKE_USE_SYSTEM_EXPAT OR CURSES_NEED_RPATH OR QT_NEED_RPATH) - set(CMAKE_SKIP_RPATH OFF CACHE INTERNAL "CMake built with RPATH.") - set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) - set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) - endif() - endif () - + if(UNIX) + # Install executables with the RPATH set for libraries outside the build tree. + # This is also suitable for binaries in the build tree. Avoid re-link on install. + set(CMAKE_INSTALL_RPATH_USE_LINK_PATH ON CACHE BOOL "Install with RPATH set to find custom-built libraries.") + set(CMAKE_BUILD_WITH_INSTALL_RPATH ON CACHE BOOL "Build with RPATH set to match install-tree RPATH.") + mark_as_advanced(CMAKE_INSTALL_RPATH_USE_LINK_PATH CMAKE_BUILD_WITH_INSTALL_RPATH) + endif() # add the uninstall support configure_file( |