summaryrefslogtreecommitdiffstats
path: root/Modules/FetchContent.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-11-15 13:38:35 (GMT)
committerKitware Robot <kwrobot@kitware.com>2023-11-15 13:38:54 (GMT)
commit105ac2670b06a61f55d3af81636039f284b44d94 (patch)
tree23b74a7b6c7ad0744724ccdafc1f71fb48ec7261 /Modules/FetchContent.cmake
parent403374a81c9bd7499b57b5bbe6d593ff462484d8 (diff)
parentd007d304ff4dd63db3c527077967bed0bc6d3158 (diff)
downloadCMake-105ac2670b06a61f55d3af81636039f284b44d94.zip
CMake-105ac2670b06a61f55d3af81636039f284b44d94.tar.gz
CMake-105ac2670b06a61f55d3af81636039f284b44d94.tar.bz2
Merge topic 'doc-find_package-advice'
d007d304ff Help: FetchContent FIND_PACKAGE_ARGS REQUIRED usually inappropriate 6341267780 Help: Note ways CMAKE_..._FIND_PACKAGE_... vars can break projects Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !8951
Diffstat (limited to 'Modules/FetchContent.cmake')
-rw-r--r--Modules/FetchContent.cmake6
1 files changed, 6 insertions, 0 deletions
diff --git a/Modules/FetchContent.cmake b/Modules/FetchContent.cmake
index aa7f20a..b6c8bad 100644
--- a/Modules/FetchContent.cmake
+++ b/Modules/FetchContent.cmake
@@ -195,6 +195,12 @@ Commands
still be called if :variable:`FETCHCONTENT_TRY_FIND_PACKAGE_MODE` is
set to ``OPT_IN`` or is not set.
+ It would not normally be appropriate to specify ``REQUIRED`` as one of
+ the additional arguments after ``FIND_PACKAGE_ARGS``. Doing so would
+ mean the :command:`find_package` call must succeed, so none of the other
+ details specified in the ``FetchContent_Declare()`` call would get a
+ chance to be used as a fall-back.
+
Everything after the ``FIND_PACKAGE_ARGS`` keyword is appended to the
:command:`find_package` call, so all other ``<contentOptions>`` must
come before the ``FIND_PACKAGE_ARGS`` keyword. If the