From 5512e03562694ebfe571a3b6068a7d35d9ddfd7a Mon Sep 17 00:00:00 2001 From: "Friedrich W. H. Kossebau" Date: Sat, 17 Apr 2021 11:02:00 +0200 Subject: Modules docs: move rst docs into bracket comments CMake >= 3.0 supports bracket comments, and the reStructuredText integration code in sphinx/ext/ecm.py already supports extracting the docs from a bracket comment instead. Editing documentation without leading line comment markers is more simple, e,g. when reflowing text over lines. With ECM meanwhile requiring CMake 3.5 now it is possible to switch (and thus follow also the approach used by cmake itself). NO_CHANGELOG --- kde-modules/KDEInstallDirs.cmake | 425 +++++++++++++++++++-------------------- 1 file changed, 212 insertions(+), 213 deletions(-) (limited to 'kde-modules/KDEInstallDirs.cmake') diff --git a/kde-modules/KDEInstallDirs.cmake b/kde-modules/KDEInstallDirs.cmake index 8b332ff9..628baa06 100644 --- a/kde-modules/KDEInstallDirs.cmake +++ b/kde-modules/KDEInstallDirs.cmake @@ -1,216 +1,3 @@ -#.rst: -# KDEInstallDirs -# -------------- -# -# Define KDE standard installation directories. -# -# Note that none of the variables defined by this module provide any -# information about the location of already-installed KDE software. -# -# Also sets ``CMAKE_INSTALL_PREFIX`` to the installation prefix of ECM, -# unless that variable has been already explicitly set by something else -# (since 5.61 and with CMake >= 3.7). -# -# Inclusion of this module defines the following variables: -# -# ``KDE_INSTALL_`` -# destination for files of a given type -# ``KDE_INSTALL_FULL_`` -# corresponding absolute path -# -# where ```` is one of (default values in parentheses and alternative, -# deprecated variable name in square brackets): -# -# ``BUNDLEDIR`` -# application bundles (``/Applications/KDE``) [``BUNDLE_INSTALL_DIR``] -# ``EXECROOTDIR`` -# executables and libraries (````) [``EXEC_INSTALL_PREFIX``] -# ``BINDIR`` -# user executables (``EXECROOTDIR/bin``) [``BIN_INSTALL_DIR``] -# ``SBINDIR`` -# system admin executables (``EXECROOTDIR/sbin``) [``SBIN_INSTALL_DIR``] -# ``LIBDIR`` -# object code libraries (``EXECROOTDIR/lib``, ``EXECROOTDIR/lib64`` or -# ``EXECROOTDIR/lib/`` variables (or their ``CMAKE_INSTALL_`` or -# deprecated counterparts) may be passed to the DESTINATION options of -# ``install()`` commands for the corresponding file type. They are set in the -# CMake cache, and so the defaults above can be overridden by users. -# -# Note that the ``KDE_INSTALL_``, ``CMAKE_INSTALL_`` or deprecated -# form of the variable can be changed using CMake command line variable -# definitions; in either case, all forms of the variable will be affected. The -# effect of passing multiple forms of the same variable on the command line -# (such as ``KDE_INSTALL_BINDIR`` and ``CMAKE_INSTALL_BINDIR`` is undefined. -# -# The variable ``KDE_INSTALL_TARGETS_DEFAULT_ARGS`` is also defined (along with -# the deprecated form ``INSTALL_TARGETS_DEFAULT_ARGS``). This should be used -# when libraries or user-executable applications are installed, in the -# following manner: -# -# .. code-block:: cmake -# -# install(TARGETS mylib myapp ${KDE_INSTALL_TARGETS_DEFAULT_ARGS}) -# -# It MUST NOT be used for installing plugins, system admin executables or -# executables only intended for use internally by other code. Those should use -# ``KDE_INSTALL_PLUGINDIR``, ``KDE_INSTALL_SBINDIR`` or -# ``KDE_INSTALL_LIBEXECDIR`` respectively. -# -# 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 available since 1.6.0, -# unless otherwise noted with the variable. -# -# The ``KDE_INSTALL_PREFIX_SCRIPT`` option will install a ${CMAKE_INSTALL_PREFIX}/prefix.sh -# file that allows to easily incorporate the necessary environment variables -# for the prefix into a process. -# - -#============================================================================= # SPDX-FileCopyrightText: 2014-2015 Alex Merry # SPDX-FileCopyrightText: 2013 Stephen Kelly # SPDX-FileCopyrightText: 2012 David Faure @@ -220,6 +7,218 @@ # # SPDX-License-Identifier: BSD-3-Clause +#[=======================================================================[.rst: +KDEInstallDirs +-------------- + +Define KDE standard installation directories. + +Note that none of the variables defined by this module provide any +information about the location of already-installed KDE software. + +Also sets ``CMAKE_INSTALL_PREFIX`` to the installation prefix of ECM, +unless that variable has been already explicitly set by something else +(since 5.61 and with CMake >= 3.7). + +Inclusion of this module defines the following variables: + +``KDE_INSTALL_`` + destination for files of a given type +``KDE_INSTALL_FULL_`` + corresponding absolute path + +where ```` is one of (default values in parentheses and alternative, +deprecated variable name in square brackets): + +``BUNDLEDIR`` + application bundles (``/Applications/KDE``) [``BUNDLE_INSTALL_DIR``] +``EXECROOTDIR`` + executables and libraries (````) [``EXEC_INSTALL_PREFIX``] +``BINDIR`` + user executables (``EXECROOTDIR/bin``) [``BIN_INSTALL_DIR``] +``SBINDIR`` + system admin executables (``EXECROOTDIR/sbin``) [``SBIN_INSTALL_DIR``] +``LIBDIR`` + object code libraries (``EXECROOTDIR/lib``, ``EXECROOTDIR/lib64`` or + ``EXECROOTDIR/lib/`` variables (or their ``CMAKE_INSTALL_`` or +deprecated counterparts) may be passed to the DESTINATION options of +``install()`` commands for the corresponding file type. They are set in the +CMake cache, and so the defaults above can be overridden by users. + +Note that the ``KDE_INSTALL_``, ``CMAKE_INSTALL_`` or deprecated +form of the variable can be changed using CMake command line variable +definitions; in either case, all forms of the variable will be affected. The +effect of passing multiple forms of the same variable on the command line +(such as ``KDE_INSTALL_BINDIR`` and ``CMAKE_INSTALL_BINDIR`` is undefined. + +The variable ``KDE_INSTALL_TARGETS_DEFAULT_ARGS`` is also defined (along with +the deprecated form ``INSTALL_TARGETS_DEFAULT_ARGS``). This should be used +when libraries or user-executable applications are installed, in the +following manner: + +.. code-block:: cmake + + install(TARGETS mylib myapp ${KDE_INSTALL_TARGETS_DEFAULT_ARGS}) + +It MUST NOT be used for installing plugins, system admin executables or +executables only intended for use internally by other code. Those should use +``KDE_INSTALL_PLUGINDIR``, ``KDE_INSTALL_SBINDIR`` or +``KDE_INSTALL_LIBEXECDIR`` respectively. + +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 available since 1.6.0, +unless otherwise noted with the variable. + +The ``KDE_INSTALL_PREFIX_SCRIPT`` option will install a ${CMAKE_INSTALL_PREFIX}/prefix.sh +file that allows to easily incorporate the necessary environment variables +for the prefix into a process. +#]=======================================================================] + # Figure out what the default install directory for libraries should be. # This is based on the logic in GNUInstallDirs, but simplified (the # GNUInstallDirs code deals with re-configuring, but that is dealt with -- cgit v1.2.1