From d47ef4776d349110988477ea1836d98a9e393755 Mon Sep 17 00:00:00 2001 From: Christoph Cullmann Date: Wed, 7 Jan 2015 20:16:23 +0100 Subject: fix typo that lead to nearly empty KDE_INSTALL_TARGETS_DEFAULT_ARGS var on mac --- kde-modules/KDEInstallDirs.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'kde-modules') diff --git a/kde-modules/KDEInstallDirs.cmake b/kde-modules/KDEInstallDirs.cmake index 8bec5402..7d592afc 100644 --- a/kde-modules/KDEInstallDirs.cmake +++ b/kde-modules/KDEInstallDirs.cmake @@ -587,7 +587,7 @@ set(KF5_INSTALL_TARGETS_DEFAULT_ARGS RUNTIME DESTINATION "${CMAKE_INSTALL_BINDI # on the Mac support an extra install directory for application bundles if(APPLE) - set(KDE_INSTALL_TARGETS_DEFAULT_ARGS ${INSTALL_TARGETS_DEFAULT_ARGS} + set(KDE_INSTALL_TARGETS_DEFAULT_ARGS ${KDE_INSTALL_TARGETS_DEFAULT_ARGS} BUNDLE DESTINATION "${BUNDLE_INSTALL_DIR}" ) set(KF5_INSTALL_TARGETS_DEFAULT_ARGS ${KF5_INSTALL_TARGETS_DEFAULT_ARGS} BUNDLE DESTINATION "${BUNDLE_INSTALL_DIR}" ) -- cgit v1.2.1 From 4462e9ddedb78c31a6f1089d073b1bfde6ce60ce Mon Sep 17 00:00:00 2001 From: Alex Merry Date: Sun, 11 Jan 2015 10:57:17 +0000 Subject: Do not unset cache variables in KDEInstallDirs. Cache variables such as CMAKE_INSTALL_BINDIR may be used by other modules included from parallel parts of the tree, so we should not touch them. We still override them in the runtime environment, but this will not interfere with parallel subtrees of the project. As part of this, the order of precedence of variables specified on the command line is changed, so that KDE_INSTALL_* is considered first (although it is still considered "undefined" in the documentation). This means that if you only specify CMAKE_INSTALL_BINDIR, that will be used by both KDEInstallDirs and GNUInstallDirs, but if you specify both that and KDE_INSTALL_BINDIR, KDEInstallDirs will use KDE_INSTALL_BINDIR instead. This is probably not too useful, but seems more useful than any other arrangement. BUG: 342717 REVIEW: 121982 --- kde-modules/KDEInstallDirs.cmake | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) (limited to 'kde-modules') diff --git a/kde-modules/KDEInstallDirs.cmake b/kde-modules/KDEInstallDirs.cmake index 7d592afc..72a67641 100644 --- a/kde-modules/KDEInstallDirs.cmake +++ b/kde-modules/KDEInstallDirs.cmake @@ -163,7 +163,7 @@ # ``${PROJECT_NAME}`` to provide a sensible default for this CMake option. #============================================================================= -# Copyright 2014 Alex Merry +# Copyright 2014-2015 Alex Merry # Copyright 2013 Stephen Kelly # Copyright 2012 David Faure # Copyright 2007 Matthias Kretz @@ -280,7 +280,18 @@ macro(_define_relative varname parent subdir docstring) set(_realpath "${_subdir}") endif() - if(${_oldstylename}) + if(KDE_INSTALL_${varname}) + # make sure the cache documentation is set correctly + get_property(_iscached CACHE KDE_INSTALL_${varname} PROPERTY VALUE SET) + if (_iscached) + # make sure the docs are still set if it was passed on the command line + set_property(CACHE KDE_INSTALL_${varname} + PROPERTY HELPSTRING "${docstring} (${_docpath})") + # make sure the type is correct if it was passed on the command line + set_property(CACHE KDE_INSTALL_${varname} + PROPERTY TYPE PATH) + endif() + elseif(${_oldstylename}) if(NOT CMAKE_VERSION VERSION_LESS 3.0.0) message(DEPRECATION "${_oldstylename} is deprecated, use KDE_INSTALL_${varname} instead.") endif() @@ -290,10 +301,6 @@ macro(_define_relative varname parent subdir docstring) CACHE PATH "${docstring} (${_docpath})" FORCE) - unset(${_oldstylename} CACHE) - if(_cmakename AND ${_cmakename}) - unset(${_cmakename} CACHE) - endif() elseif(${_cmakename}) if(_cmakename_is_deprecated AND NOT CMAKE_VERSION VERSION_LESS 3.0.0) message(DEPRECATION "${_cmakename} is deprecated, use KDE_INSTALL_${varname} instead.") @@ -304,21 +311,12 @@ macro(_define_relative varname parent subdir docstring) CACHE PATH "${docstring} (${_docpath})" FORCE) - unset(${_cmakename} CACHE) - elseif(NOT KDE_INSTALL_${varname}) + else() + # insert an empty value into the cache, indicating the default + # should be used (including compatibility vars above) set(KDE_INSTALL_${varname} "" CACHE PATH "${docstring} (${_docpath})") set(KDE_INSTALL_${varname} "${_realpath}") - else() - get_property(_iscached CACHE KDE_INSTALL_${varname} PROPERTY VALUE SET) - if (_iscached) - # make sure the docs are still set if it was passed on the command line - set_property(CACHE KDE_INSTALL_${varname} - PROPERTY HELPSTRING "${docstring} (${_docpath})") - # make sure the type is correct if it was passed on the command line - set_property(CACHE KDE_INSTALL_${varname} - PROPERTY TYPE PATH) - endif() endif() mark_as_advanced(KDE_INSTALL_${varname}) @@ -330,6 +328,10 @@ macro(_define_relative varname parent subdir docstring) set(KDE_INSTALL_FULL_${varname} "${KDE_INSTALL_${varname}}") endif() + # Override compatibility vars at runtime, even though we don't touch + # them in the cache; this way, we keep the variables in sync where + # KDEInstallDirs is included, but don't interfere with, say, + # GNUInstallDirs in a parallel part of the CMake tree. if(_cmakename) set(${_cmakename} "${KDE_INSTALL_${varname}}") set(CMAKE_INSTALL_FULL_${varname} "${KDE_INSTALL_FULL_${varname}}") -- cgit v1.2.1 From 8b24ae53823a516144d15a10abcee644c4b15354 Mon Sep 17 00:00:00 2001 From: Alex Merry Date: Tue, 13 Jan 2015 19:04:55 +0000 Subject: Stop lying in the KDEInstallDirs documentation. --- kde-modules/KDEInstallDirs.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'kde-modules') diff --git a/kde-modules/KDEInstallDirs.cmake b/kde-modules/KDEInstallDirs.cmake index 72a67641..6e1ef774 100644 --- a/kde-modules/KDEInstallDirs.cmake +++ b/kde-modules/KDEInstallDirs.cmake @@ -132,7 +132,8 @@ # ``KDE_INSTALL_DIRS_NO_DEPRECATED`` is set to TRUE, only those variables # defined by the ``GNUInstallDirs`` module (shipped with CMake) are defined. # If ``KDE_INSTALL_DIRS_NO_CMAKE_VARIABLES`` is set to TRUE, no variables with -# a ``CMAKE_`` prefix will be defined by this module. +# a ``CMAKE_`` prefix will be defined by this module (other than +# CMAKE_INSTALL_DEFAULT_COMPONENT_NAME - see below). # # The ``KDE_INSTALL_`` variables (or their ``CMAKE_INSTALL_`` or # deprecated counterparts) may be passed to the DESTINATION options of -- cgit v1.2.1 From cc30b9b9b16f0999dfb97b2e78488abd2c41de43 Mon Sep 17 00:00:00 2001 From: Alex Merry Date: Sun, 11 Jan 2015 18:40:54 +0000 Subject: Warn when mixing relative and absolute paths in KDEInstallDirs. BUG: 341683 FIXED-IN: 1.7.0 REVIEW: 121999 CHANGELOG: KDEInstallDirs: warn about mixing relative and absolute installation paths on the command line --- kde-modules/KDEInstallDirs.cmake | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'kde-modules') diff --git a/kde-modules/KDEInstallDirs.cmake b/kde-modules/KDEInstallDirs.cmake index 6e1ef774..a690ae9c 100644 --- a/kde-modules/KDEInstallDirs.cmake +++ b/kde-modules/KDEInstallDirs.cmake @@ -162,6 +162,13 @@ # # Additionally, ``CMAKE_INSTALL_DEFAULT_COMPONENT_NAME`` will be set to # ``${PROJECT_NAME}`` to provide a sensible default for this CMake option. +# +# Note that mixing absolute and relative paths, particularly for ``BINDIR``, +# ``LIBDIR`` and ``INCLUDEDIR``, can cause issues with exported targets. Given +# that the default values for these are relative paths, relative paths should +# be used on the command line when possible (eg: use +# ``-DKDE_INSTALL_LIBDIR=lib64`` instead of +# ``-DKDE_INSTALL_LIBDIR=/usr/lib/lib64`` to override the library directory). #============================================================================= # Copyright 2014-2015 Alex Merry @@ -565,6 +572,19 @@ _define_relative(AUTOSTARTDIR CONFDIR "autostart" "autostart files" AUTOSTART_INSTALL_DIR) +set(_mixed_core_path_styles FALSE) +if (IS_ABSOLUTE "${KDE_INSTALL_BINDIR}") + if (NOT IS_ABSOLUTE "${KDE_INSTALL_LIBDIR}" OR NOT IS_ABSOLUTE "${KDE_INSTALL_INCLUDEDIR}") + set(_mixed_core_path_styles ) + endif() +else() + if (IS_ABSOLUTE "${KDE_INSTALL_LIBDIR}" OR IS_ABSOLUTE "${KDE_INSTALL_INCLUDEDIR}") + set(_mixed_core_path_styles TRUE) + endif() +endif() +if (_mixed_core_path_styles) + message(WARNING "KDE_INSTALL_BINDIR, KDE_INSTALL_LIBDIR and KDE_INSTALL_INCLUDEDIR should either all be absolute paths or all be relative paths.") +endif() # For more documentation see above. -- cgit v1.2.1 From b03e287f9abe95372b0bc1b1917a006447280c95 Mon Sep 17 00:00:00 2001 From: Alex Merry Date: Sun, 1 Feb 2015 12:02:39 +0000 Subject: Create an uninstall target by default in KDE projects. REVIEW: 122359 --- kde-modules/KDECMakeSettings.cmake | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'kde-modules') diff --git a/kde-modules/KDECMakeSettings.cmake b/kde-modules/KDECMakeSettings.cmake index 4ccbf82e..000761fb 100644 --- a/kde-modules/KDECMakeSettings.cmake +++ b/kde-modules/KDECMakeSettings.cmake @@ -41,6 +41,10 @@ # # 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. #============================================================================= # Copyright 2014 Alex Merry @@ -177,5 +181,10 @@ if(NOT KDE_SKIP_BUILD_SETTINGS) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin") 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() ################################################################### -- cgit v1.2.1 From a1d6d8f7259ade901a87b33edbef8b31bffb5e26 Mon Sep 17 00:00:00 2001 From: Alex Merry Date: Fri, 6 Feb 2015 11:31:19 +0000 Subject: Document when modules were added to ECM. --- kde-modules/KDECMakeSettings.cmake | 4 ++++ kde-modules/KDECompilerSettings.cmake | 2 ++ kde-modules/KDEFrameworkCompilerSettings.cmake | 2 ++ kde-modules/KDEInstallDirs.cmake | 5 +++++ 4 files changed, 13 insertions(+) (limited to 'kde-modules') diff --git a/kde-modules/KDECMakeSettings.cmake b/kde-modules/KDECMakeSettings.cmake index 000761fb..0c997931 100644 --- a/kde-modules/KDECMakeSettings.cmake +++ b/kde-modules/KDECMakeSettings.cmake @@ -45,6 +45,10 @@ # This section also provides an "uninstall" target that can be individually # disabled by setting ``KDE_SKIP_UNINSTALL_TARGET`` to TRUE before including # this module. +# +# Since pre-1.0.0. +# +# Uninstall target functionality since 1.7.0. #============================================================================= # Copyright 2014 Alex Merry diff --git a/kde-modules/KDECompilerSettings.cmake b/kde-modules/KDECompilerSettings.cmake index aa0249d9..5a585021 100644 --- a/kde-modules/KDECompilerSettings.cmake +++ b/kde-modules/KDECompilerSettings.cmake @@ -29,6 +29,8 @@ # # Enables exceptions for C++ source files compiled for the # CMakeLists.txt file in the current directory and all subdirectories. +# +# Since pre-1.0.0. #============================================================================= # Copyright 2014 Alex Merry diff --git a/kde-modules/KDEFrameworkCompilerSettings.cmake b/kde-modules/KDEFrameworkCompilerSettings.cmake index 3b77fc3c..1bc23ccf 100644 --- a/kde-modules/KDEFrameworkCompilerSettings.cmake +++ b/kde-modules/KDEFrameworkCompilerSettings.cmake @@ -11,6 +11,8 @@ # For example, constructions like QString("foo") are prohibited, instead # forcing the use of QLatin1String or QStringLiteral, and some # Qt-defined keywords like signals and slots will not be defined. +# +# Since pre-1.0.0. #============================================================================= # Copyright 2013 Albert Astals Cid diff --git a/kde-modules/KDEInstallDirs.cmake b/kde-modules/KDEInstallDirs.cmake index a690ae9c..b7cd34d8 100644 --- a/kde-modules/KDEInstallDirs.cmake +++ b/kde-modules/KDEInstallDirs.cmake @@ -169,6 +169,11 @@ # be used on the command line when possible (eg: use # ``-DKDE_INSTALL_LIBDIR=lib64`` instead of # ``-DKDE_INSTALL_LIBDIR=/usr/lib/lib64`` to override the library directory). +# +# Since pre-1.0.0. +# +# NB: The variables starting ``KDE_INSTALL_`` are only available since 1.6.0. +# The ``APPDIR`` install variable is available since 1.1.0. #============================================================================= # Copyright 2014-2015 Alex Merry -- cgit v1.2.1 From 2b0951d3b6b3740b12a2cc3eedf8b3d1f6eba943 Mon Sep 17 00:00:00 2001 From: Volker Krause Date: Sun, 16 Aug 2015 09:43:29 +0200 Subject: Also set the default visibility for C code to hidden. This prevents accidental "leaking" of symbols from internal code, such as flex/bison generated parsers. REVIEW: 124740 --- kde-modules/KDECompilerSettings.cmake | 1 + 1 file changed, 1 insertion(+) (limited to 'kde-modules') diff --git a/kde-modules/KDECompilerSettings.cmake b/kde-modules/KDECompilerSettings.cmake index 5a585021..73d77825 100644 --- a/kde-modules/KDECompilerSettings.cmake +++ b/kde-modules/KDECompilerSettings.cmake @@ -196,6 +196,7 @@ if ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" OR endif() # Default to hidden visibility for symbols +set(CMAKE_C_VISIBILITY_PRESET hidden) set(CMAKE_CXX_VISIBILITY_PRESET hidden) set(CMAKE_VISIBILITY_INLINES_HIDDEN 1) -- cgit v1.2.1 From 00b1f67ef595c6fd2b326738ea7ac03c0e23303b Mon Sep 17 00:00:00 2001 From: David Faure Date: Sun, 16 Aug 2015 01:16:04 +0200 Subject: KDEFrameworkCompilerSettings: only enable strict iterators in debug mode (they are slower). And enable them on MSVC now that we rely on Qt 5.3, as the comment said. REVIEW: 124762 --- kde-modules/KDEFrameworkCompilerSettings.cmake | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'kde-modules') diff --git a/kde-modules/KDEFrameworkCompilerSettings.cmake b/kde-modules/KDEFrameworkCompilerSettings.cmake index 1bc23ccf..d499444f 100644 --- a/kde-modules/KDEFrameworkCompilerSettings.cmake +++ b/kde-modules/KDEFrameworkCompilerSettings.cmake @@ -40,11 +40,7 @@ add_definitions(-DQT_NO_CAST_TO_ASCII -DQT_USE_FAST_OPERATOR_PLUS -DQT_USE_QSTRINGBUILDER ) -if(NOT MSVC) - # QT_STRICT_ITERATORS breaks MSVC: it tries to link to QTypedArrayData symbols - # when using foreach. However these symbols don't actually exist. - # Not having QT_STRICT_ITERATORS defined fixes this issue. - # This is fixed by https://codereview.qt-project.org/#change,76311 - # TODO: set QT_STRICT_ITERATORS on all platforms once we depend on Qt 5.3 - add_definitions(-DQT_STRICT_ITERATORS) + +if (CMAKE_BUILD_TYPE STREQUAL "Debug") + add_definitions(-DQT_STRICT_ITERATORS) endif() -- cgit v1.2.1 From 7af8bdcc7610df1de24c36ceeedd8c9f82529634 Mon Sep 17 00:00:00 2001 From: David Faure Date: Sun, 16 Aug 2015 01:20:04 +0200 Subject: Add -pedantic for KF5 code (when using gcc or clang) REVIEW: 124763 --- kde-modules/KDEFrameworkCompilerSettings.cmake | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'kde-modules') diff --git a/kde-modules/KDEFrameworkCompilerSettings.cmake b/kde-modules/KDEFrameworkCompilerSettings.cmake index d499444f..84de77ab 100644 --- a/kde-modules/KDEFrameworkCompilerSettings.cmake +++ b/kde-modules/KDEFrameworkCompilerSettings.cmake @@ -44,3 +44,7 @@ add_definitions(-DQT_NO_CAST_TO_ASCII if (CMAKE_BUILD_TYPE STREQUAL "Debug") add_definitions(-DQT_STRICT_ITERATORS) endif() + +if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic") +endif() -- cgit v1.2.1 From 456d7772dcc2ae2f6f36bb6358d04cbdd1218d30 Mon Sep 17 00:00:00 2001 From: Alex Richardson Date: Thu, 10 Sep 2015 14:44:33 +0100 Subject: Disable -Wgnu-zero-variadic-macro-arguments when using clang This warning is emitted for every qCDebug() call and is not useful. REVIEW: 125031 --- kde-modules/KDEFrameworkCompilerSettings.cmake | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'kde-modules') diff --git a/kde-modules/KDEFrameworkCompilerSettings.cmake b/kde-modules/KDEFrameworkCompilerSettings.cmake index 84de77ab..e88c10d9 100644 --- a/kde-modules/KDEFrameworkCompilerSettings.cmake +++ b/kde-modules/KDEFrameworkCompilerSettings.cmake @@ -45,6 +45,11 @@ if (CMAKE_BUILD_TYPE STREQUAL "Debug") add_definitions(-DQT_STRICT_ITERATORS) endif() -if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") +if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic") +elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") + # -Wgnu-zero-variadic-macro-arguments is triggered by every qCDebug() call and therefore results + # in a lot of noise. This warning is only notifying us that clang is emulating the GCC behaviour + # instead of the exact standard wording so we can safely ignore it + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wno-gnu-zero-variadic-macro-arguments") endif() -- cgit v1.2.1 From d4bcaf7eb3ff501ad0a5f06ed0724964e0e0f404 Mon Sep 17 00:00:00 2001 From: Samuel Gaist Date: Wed, 16 Sep 2015 00:40:18 +0200 Subject: Disable X11,XCB etc. detection on OS X Reviewed at https://git.reviewboard.kde.org/r/125163/ --- kde-modules/KDECMakeSettings.cmake | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'kde-modules') diff --git a/kde-modules/KDECMakeSettings.cmake b/kde-modules/KDECMakeSettings.cmake index 0c997931..cefd6daa 100644 --- a/kde-modules/KDECMakeSettings.cmake +++ b/kde-modules/KDECMakeSettings.cmake @@ -46,9 +46,18 @@ # 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. +# - 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 @@ -185,6 +194,21 @@ 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") -- cgit v1.2.1 From 20bf1de42b035eb669d0250f4d549c15f9256e58 Mon Sep 17 00:00:00 2001 From: Christoph Cullmann Date: Tue, 13 Oct 2015 13:33:26 +0200 Subject: make it possible to build KDE Frameworks 5 with a plain qt 5.5.x installed from the normal qt.io installer on mac os we can revisit this change, if it leads to problems for mac ports or homebrew REVIEW: 125614 --- kde-modules/KDECMakeSettings.cmake | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'kde-modules') diff --git a/kde-modules/KDECMakeSettings.cmake b/kde-modules/KDECMakeSettings.cmake index cefd6daa..8e7ff359 100644 --- a/kde-modules/KDECMakeSettings.cmake +++ b/kde-modules/KDECMakeSettings.cmake @@ -95,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() -- cgit v1.2.1