From d007d304ff4dd63db3c527077967bed0bc6d3158 Mon Sep 17 00:00:00 2001 From: Craig Scott Date: Mon, 6 Nov 2023 14:41:49 +1100 Subject: Help: FetchContent FIND_PACKAGE_ARGS REQUIRED usually inappropriate --- Modules/FetchContent.cmake | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Modules/FetchContent.cmake b/Modules/FetchContent.cmake index ad5a6f1..1d18141 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 ```` must come before the ``FIND_PACKAGE_ARGS`` keyword. If the -- cgit v0.12