summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-09-11 11:55:37 (GMT)
committerKitware Robot <kwrobot@kitware.com>2017-09-11 11:56:02 (GMT)
commit1c9d3c0d32aebeac2f4e402df9a1e22c284d7f54 (patch)
tree3f6226006c384896a7377d3f09c8c38300c1745c /Modules
parent28adf3833c23411dfce12b5be754ad53bc2b9b05 (diff)
parente48acfc501cec71337a6dbe04e9d61e9224fba6b (diff)
downloadCMake-1c9d3c0d32aebeac2f4e402df9a1e22c284d7f54.zip
CMake-1c9d3c0d32aebeac2f4e402df9a1e22c284d7f54.tar.gz
CMake-1c9d3c0d32aebeac2f4e402df9a1e22c284d7f54.tar.bz2
Merge topic 'doc-find_dependency-return'
e48acfc5 CMakeFindDependencyMacro: Document return() behavior and caveats 07a05079 CMakeFindDependencyMacro: Convert documentation to bracket comment Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1245
Diffstat (limited to 'Modules')
-rw-r--r--Modules/CMakeFindDependencyMacro.cmake45
1 files changed, 28 insertions, 17 deletions
diff --git a/Modules/CMakeFindDependencyMacro.cmake b/Modules/CMakeFindDependencyMacro.cmake
index 81606ce..6a89fff 100644
--- a/Modules/CMakeFindDependencyMacro.cmake
+++ b/Modules/CMakeFindDependencyMacro.cmake
@@ -1,23 +1,34 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# CMakeFindDependencyMacro
-# -------------------------
-#
-# ::
-#
-# find_dependency(<dep> [...])
-#
-#
-# ``find_dependency()`` wraps a :command:`find_package` call for a package
-# dependency. It is designed to be used in a <package>Config.cmake file, and it
-# forwards the correct parameters for QUIET and REQUIRED which were passed to
-# the original :command:`find_package` call. It also sets an informative
-# diagnostic message if the dependency could not be found.
-#
-# Any additional arguments specified are forwarded to :command:`find_package`.
-#
+#[=======================================================================[.rst:
+CMakeFindDependencyMacro
+-------------------------
+
+.. command:: find_dependency
+
+ The ``find_dependency()`` macro wraps a :command:`find_package` call for
+ a package dependency::
+
+ find_dependency(<dep> [...])
+
+ It is designed to be used in a
+ :ref:`Package Configuration File <Config File Packages>`
+ (``<package>Config.cmake``). ``find_dependency`` forwards the correct
+ parameters for ``QUIET`` and ``REQUIRED`` which were passed to
+ the original :command:`find_package` call. Any additional arguments
+ specified are forwarded to :command:`find_package`.
+
+ If the dependency could not be found it sets an informative diagnostic
+ message and calls :command:`return` to end processing of the calling
+ package configuration file and return to the :command:`find_package`
+ command that loaded it.
+
+ .. note::
+
+ The call to :command:`return` makes this macro unsuitable to call
+ from :ref:`Find Modules`.
+#]=======================================================================]
macro(find_dependency dep)
if (NOT ${dep}_FOUND)