aboutsummaryrefslogtreecommitdiff
path: root/kde-modules
diff options
context:
space:
mode:
authorAleix Pol <aleixpol@kde.org>2016-04-07 00:53:50 +0200
committerAleix Pol <aleixpol@kde.org>2016-04-07 00:53:50 +0200
commita2d184bb89eaee3dc5e5b12ff6dfd4297bfcd5fb (patch)
treeafe6878c54c17fec9cbede73e62475a5a775b3aa /kde-modules
parentf7c1e8d57f84d0883a2a7683fd59ecc990a03de1 (diff)
downloadextra-cmake-modules-a2d184bb89eaee3dc5e5b12ff6dfd4297bfcd5fb.tar.gz
extra-cmake-modules-a2d184bb89eaee3dc5e5b12ff6dfd4297bfcd5fb.tar.bz2
Enables KDE_INSTALL_USE_QT_SYS_PATHS if CMAKE_INSTALL_PREFIX Qt5 prefix
Make Qt and ECM-based projects use the same directory sctructure (i.e. where plugins are, libs, etc.) by default. Otherwise it creates a tiny mess that might be controlled but usually won't. In the end, otherwise, people need to keep adapting their systems with environment variables anyway. All distros end up setting always this setting as ON, as well as brave developers who don't have separate prefixes for Qt and KDE. REVIEW: 127169
Diffstat (limited to 'kde-modules')
-rw-r--r--kde-modules/KDEInstallDirs.cmake17
1 files changed, 13 insertions, 4 deletions
diff --git a/kde-modules/KDEInstallDirs.cmake b/kde-modules/KDEInstallDirs.cmake
index ebd48fa8..d9c3b781 100644
--- a/kde-modules/KDEInstallDirs.cmake
+++ b/kde-modules/KDEInstallDirs.cmake
@@ -424,11 +424,20 @@ _define_relative(CMAKEPACKAGEDIR LIBDIR "cmake"
"CMake packages, including config files"
CMAKECONFIG_INSTALL_PREFIX)
-option (KDE_INSTALL_USE_QT_SYS_PATHS "Install mkspecs files, Plugins and Imports to the Qt 5 install dir")
-if(KDE_INSTALL_USE_QT_SYS_PATHS)
-# Qt-specific vars
- include("${ECM_MODULE_DIR}/ECMQueryQmake.cmake")
+include("${ECM_MODULE_DIR}/ECMQueryQmake.cmake")
+
+set(_default_KDE_INSTALL_USE_QT_SYS_PATHS OFF)
+if(NOT DEFINED KDE_INSTALL_USE_QT_SYS_PATHS)
+ query_qmake(qt_install_prefix_dir QT_INSTALL_PREFIX)
+ if(qt_install_prefix_dir STREQUAL "${CMAKE_INSTALL_PREFIX}")
+ message(STATUS "Installing in the same prefix as Qt, adopting their path scheme.")
+ set(_default_KDE_INSTALL_USE_QT_SYS_PATHS ON)
+ endif()
+endif()
+option (KDE_INSTALL_USE_QT_SYS_PATHS "Install mkspecs files, Plugins and Imports to the Qt 5 install dir" "${_default_KDE_INSTALL_USE_QT_SYS_PATHS}")
+if(KDE_INSTALL_USE_QT_SYS_PATHS)
+ # Qt-specific vars
query_qmake(qt_plugins_dir QT_INSTALL_PLUGINS)
_define_absolute(QTPLUGINDIR ${qt_plugins_dir}