aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Merry <alex.merry@kde.org>2015-01-11 18:40:54 +0000
committerAlex Merry <alex.merry@kde.org>2015-01-24 14:50:07 +0000
commitcc30b9b9b16f0999dfb97b2e78488abd2c41de43 (patch)
treef71ea91543216d37fceffa53f56d71626c1c4088
parentd609e598170064b4ee65392177a9d07f4302698d (diff)
downloadextra-cmake-modules-cc30b9b9b16f0999dfb97b2e78488abd2c41de43.tar.gz
extra-cmake-modules-cc30b9b9b16f0999dfb97b2e78488abd2c41de43.tar.bz2
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
-rw-r--r--kde-modules/KDEInstallDirs.cmake20
1 files changed, 20 insertions, 0 deletions
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 <alex.merry@kde.org>
@@ -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.