diff options
author | Friedrich W. H. Kossebau <kossebau@kde.org> | 2021-04-17 11:02:00 +0200 |
---|---|---|
committer | Friedrich W. H. Kossebau <kossebau@kde.org> | 2021-04-23 17:49:14 +0000 |
commit | 5512e03562694ebfe571a3b6068a7d35d9ddfd7a (patch) | |
tree | 3caca041d3526c8427ec3065642b41a52ad8578c /modules/ECMUseFindModules.cmake | |
parent | 38b5d046c4d42232d45bf4464167b2e6feea4cf7 (diff) | |
download | extra-cmake-modules-5512e03562694ebfe571a3b6068a7d35d9ddfd7a.tar.gz extra-cmake-modules-5512e03562694ebfe571a3b6068a7d35d9ddfd7a.tar.bz2 |
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
Diffstat (limited to 'modules/ECMUseFindModules.cmake')
-rw-r--r-- | modules/ECMUseFindModules.cmake | 100 |
1 files changed, 50 insertions, 50 deletions
diff --git a/modules/ECMUseFindModules.cmake b/modules/ECMUseFindModules.cmake index 34c358d1..d8bcf7b4 100644 --- a/modules/ECMUseFindModules.cmake +++ b/modules/ECMUseFindModules.cmake @@ -1,57 +1,57 @@ -#.rst: -# ECMUseFindModules -# ----------------- -# -# Selectively use some of the find modules provided by extra-cmake-modules. -# -# This module is automatically available once extra-cmake-modules has been -# found, so it is not necessary to ``include(ECMUseFindModules)`` explicitly. -# -# :: -# -# ecm_use_find_modules(DIR <dir> -# MODULES module1.cmake [module2.cmake [...]] -# [NO_OVERRIDE]) -# -# This allows selective use of the find modules provided by ECM, including -# deferring to CMake's versions of those modules if it has them. Rather than -# adding ``${ECM_FIND_MODULE_DIR}`` to ``CMAKE_MODULE_PATH``, you use -# ecm_use_find_modules() to copy the modules you want to a local (build) -# directory, and add that to ``CMAKE_MODULE_PATH``. -# -# The find modules given to MODULES will be copied to the directory given by DIR -# (which should be located in ``${CMAKE_BINARY_DIR}`` and added to -# ``CMAKE_MODULE_PATH``). If NO_OVERRIDE is given, only modules not also -# provided by CMake will be copied. -# -# Example: -# -# .. code-block:: cmake -# -# find_package(ECM REQUIRED) -# ecm_use_find_modules( -# DIR ${CMAKE_BINARY_DIR}/cmake -# MODULES FindEGL.cmake -# NO_OVERRIDE -# ) -# set(CMAKE_MODULE_PATH ${CMAKE_BINARY_DIR}/cmake) -# -# This example will make ``FindEGL.cmake`` available in your project, but only -# as long as it is not yet part of CMake. Calls to ``find_package(EGL)`` will -# then make use of this copied module (or the CMake module if it exists). -# -# Another possible use for this macro is to take copies of find modules that can -# be installed along with config files if they are required as a dependency (for -# example, if targets provided by the find module are in the link interface of a -# library). -# -# Since pre-1.0.0. - -#============================================================================= # SPDX-FileCopyrightText: 2011 Alexander Neundorf <neundorf@kde.org> # # SPDX-License-Identifier: BSD-3-Clause +#[=======================================================================[.rst: +ECMUseFindModules +----------------- + +Selectively use some of the find modules provided by extra-cmake-modules. + +This module is automatically available once extra-cmake-modules has been +found, so it is not necessary to ``include(ECMUseFindModules)`` explicitly. + +:: + + ecm_use_find_modules(DIR <dir> + MODULES module1.cmake [module2.cmake [...]] + [NO_OVERRIDE]) + +This allows selective use of the find modules provided by ECM, including +deferring to CMake's versions of those modules if it has them. Rather than +adding ``${ECM_FIND_MODULE_DIR}`` to ``CMAKE_MODULE_PATH``, you use +ecm_use_find_modules() to copy the modules you want to a local (build) +directory, and add that to ``CMAKE_MODULE_PATH``. + +The find modules given to MODULES will be copied to the directory given by DIR +(which should be located in ``${CMAKE_BINARY_DIR}`` and added to +``CMAKE_MODULE_PATH``). If NO_OVERRIDE is given, only modules not also +provided by CMake will be copied. + +Example: + +.. code-block:: cmake + + find_package(ECM REQUIRED) + ecm_use_find_modules( + DIR ${CMAKE_BINARY_DIR}/cmake + MODULES FindEGL.cmake + NO_OVERRIDE + ) + set(CMAKE_MODULE_PATH ${CMAKE_BINARY_DIR}/cmake) + +This example will make ``FindEGL.cmake`` available in your project, but only +as long as it is not yet part of CMake. Calls to ``find_package(EGL)`` will +then make use of this copied module (or the CMake module if it exists). + +Another possible use for this macro is to take copies of find modules that can +be installed along with config files if they are required as a dependency (for +example, if targets provided by the find module are in the link interface of a +library). + +Since pre-1.0.0. +#]=======================================================================] + include(CMakeParseArguments) function(ecm_use_find_modules) |