diff options
author | l10n daemon script <scripty@kde.org> | 2015-11-08 21:01:33 +0000 |
---|---|---|
committer | l10n daemon script <scripty@kde.org> | 2015-11-08 21:01:33 +0000 |
commit | 7feccae76e01a65b406995b5ba9526fe9ade4299 (patch) | |
tree | 99011137f4dedcf4bf242e167ac7dc70d9136b8e /kde-modules/KDECMakeSettings.cmake | |
parent | a1bb0b0488843165e606771b75a3a67ba8a131a6 (diff) | |
parent | c88bc78e0ca3834c46b89ca9d14b404751da5d4a (diff) | |
download | extra-cmake-modules-5.16.0-rc2.tar.gz extra-cmake-modules-5.16.0-rc2.tar.bz2 |
Merge remote-tracking branch 'origin/master' into local_releasev5.16.0-rc2v5.16.0
Diffstat (limited to 'kde-modules/KDECMakeSettings.cmake')
-rw-r--r-- | kde-modules/KDECMakeSettings.cmake | 63 |
1 files changed, 51 insertions, 12 deletions
diff --git a/kde-modules/KDECMakeSettings.cmake b/kde-modules/KDECMakeSettings.cmake index 4ccbf82e..8e7ff359 100644 --- a/kde-modules/KDECMakeSettings.cmake +++ b/kde-modules/KDECMakeSettings.cmake @@ -41,6 +41,23 @@ # # This section can be disabled by setting ``KDE_SKIP_BUILD_SETTINGS`` to TRUE # before including this module. +# +# This section also provides an "uninstall" target that can be individually +# disabled by setting ``KDE_SKIP_UNINSTALL_TARGET`` to TRUE before including +# this module. +# +# By default on OS X, X11 and XCB related detections are disabled. However if +# the need would arise to use these technologies, the detection can be enabled +# by setting ``APPLE_FORCE_X11`` to ``ON``. +# +# A warning is printed for the developer to know that the detection is disabled on OS X. +# This message can be turned off by setting ``APPLE_SUPPRESS_X11_WARNING`` to ``ON``. +# +# Since pre-1.0.0. +# +# - Uninstall target functionality since 1.7.0. +# - ``APPLE_FORCE_X11`` option since 5.14.0 (detecting X11 was previously the default behavior) +# - ``APPLE_SUPPRESS_X11_WARNING`` option since 5.14.0 #============================================================================= # Copyright 2014 Alex Merry <alex.merry@kde.org> @@ -78,21 +95,23 @@ if(NOT KDE_SKIP_RPATH_SETTINGS) endif() if (UNIX) + # for mac os: add install name dir in addition + # check: is the rpath stuff below really required on mac os? at least it seems so to use a stock qt from qt.io if (APPLE) set(CMAKE_INSTALL_NAME_DIR ${_abs_LIB_INSTALL_DIR}) - else () - # add our LIB_INSTALL_DIR to the RPATH (but only when it is not one of - # the standard system link directories - such as /usr/lib on UNIX) - list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${_abs_LIB_INSTALL_DIR}" _isSystemLibDir) - list(FIND CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "${_abs_LIB_INSTALL_DIR}" _isSystemCxxLibDir) - list(FIND CMAKE_C_IMPLICIT_LINK_DIRECTORIES "${_abs_LIB_INSTALL_DIR}" _isSystemCLibDir) - if("${_isSystemLibDir}" STREQUAL "-1" AND "${_isSystemCxxLibDir}" STREQUAL "-1" AND "${_isSystemCLibDir}" STREQUAL "-1") - set(CMAKE_INSTALL_RPATH "${_abs_LIB_INSTALL_DIR}") - endif() - - # Append directories in the linker search path (but outside the project) - set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) endif () + + # add our LIB_INSTALL_DIR to the RPATH (but only when it is not one of + # the standard system link directories - such as /usr/lib on UNIX) + list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${_abs_LIB_INSTALL_DIR}" _isSystemLibDir) + list(FIND CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "${_abs_LIB_INSTALL_DIR}" _isSystemCxxLibDir) + list(FIND CMAKE_C_IMPLICIT_LINK_DIRECTORIES "${_abs_LIB_INSTALL_DIR}" _isSystemCLibDir) + if("${_isSystemLibDir}" STREQUAL "-1" AND "${_isSystemCxxLibDir}" STREQUAL "-1" AND "${_isSystemCLibDir}" STREQUAL "-1") + set(CMAKE_INSTALL_RPATH "${_abs_LIB_INSTALL_DIR}") + endif() + + # Append directories in the linker search path (but outside the project) + set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) endif (UNIX) endif() @@ -177,5 +196,25 @@ if(NOT KDE_SKIP_BUILD_SETTINGS) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin") endif() + # Disable detection of X11 and related package on OS X because when using + # brew or macports, X11 can be installed and thus is detected. + option(APPLE_FORCE_X11 "Force enable X11 related detection on OS X" OFF) + option(APPLE_SUPPRESS_X11_WARNING "Suppress X11 and related technologies search disabling warning on OS X" OFF) + + if(APPLE AND NOT APPLE_FORCE_X11) + if (NOT APPLE_SUPPRESS_X11_WARNING) + message(WARNING "Searching for X11 and related technologies is disabled on Apple systems. Set APPLE_FORCE_X11 to ON to change this behaviour. Set APPLE_SUPPRESS_X11_WARNING to ON to hide this warning.") + endif() + + set(CMAKE_DISABLE_FIND_PACKAGE_X11 true) + set(CMAKE_DISABLE_FIND_PACKAGE_XCB true) + set(CMAKE_DISABLE_FIND_PACKAGE_Qt5X11Extras true) + endif() + + option(KDE_SKIP_UNINSTALL_TARGET "Prevent an \"uninstall\" target from being generated." OFF) + if(NOT KDE_SKIP_UNINSTALL_TARGET) + include("${ECM_MODULE_DIR}/ECMUninstallTarget.cmake") + endif() + endif() ################################################################### |