Merge topic 'FetchContent-unparsed-arguments'

9ede4cab2b FetchContent: Protect ExternalProject keywords from unknown arguments

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Acked-by: Craig Scott <craig.scott@crascit.com>
Merge-request: !8598
This commit is contained in:
Brad King
2023-06-30 13:29:20 +00:00
committed by Kitware Robot
6 changed files with 11 additions and 5 deletions

View File

@@ -4266,6 +4266,10 @@ function(ExternalProject_Add name)
# Miscellaneous options
#
LIST_SEPARATOR
#
# Internal options (undocumented)
#
EXTERNALPROJECT_INTERNAL_ARGUMENT_SEPARATOR
)
_ep_parse_arguments(
ExternalProject_Add

View File

@@ -1336,9 +1336,11 @@ function(FetchContent_Declare contentName)
endif()
# Add back in the keyword args we pulled out and potentially tweaked/added
set(sep EXTERNALPROJECT_INTERNAL_ARGUMENT_SEPARATOR)
foreach(key IN LISTS oneValueArgs)
if(DEFINED ARG_${key})
list(PREPEND ARG_UNPARSED_ARGUMENTS ${key} "${ARG_${key}}")
list(PREPEND ARG_UNPARSED_ARGUMENTS ${key} "${ARG_${key}}" ${sep})
set(sep "")
endif()
endforeach()