diff options
Diffstat (limited to 'kde-modules/KDEInstallDirs.cmake')
-rw-r--r-- | kde-modules/KDEInstallDirs.cmake | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/kde-modules/KDEInstallDirs.cmake b/kde-modules/KDEInstallDirs.cmake index 72a67641..b7cd34d8 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_<dir>`` variables (or their ``CMAKE_INSTALL_<dir>`` or # deprecated counterparts) may be passed to the DESTINATION options of @@ -161,6 +162,18 @@ # # 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). +# +# 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 <alex.merry@kde.org> @@ -564,6 +577,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. |