diff options
author | Brad King <brad.king@kitware.com> | 2023-06-28 13:19:22 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-06-29 13:49:51 (GMT) |
commit | 9ede4cab2ba8a405749c09922a7fe54c70ecc190 (patch) | |
tree | 283d7965429baf61d5360189c6a7512aa6ed9501 /Modules/FetchContent.cmake | |
parent | f9fe9099ab1b02239f5904c8c4ca477f63de1f2c (diff) | |
download | CMake-9ede4cab2ba8a405749c09922a7fe54c70ecc190.zip CMake-9ede4cab2ba8a405749c09922a7fe54c70ecc190.tar.gz CMake-9ede4cab2ba8a405749c09922a7fe54c70ecc190.tar.bz2 |
FetchContent: Protect ExternalProject keywords from unknown arguments
`ExternalProject_Add` treats all keyword arguments as multi-valued.
FetchContent re-orders some keyword arguments w.r.t. unparsed arguments.
Add an internal keyword argument to separate the keyword values from
following unparsed arguments.
This was exposed by commit 550f63447d (ExternalProject/FetchContent:
Support relative remote URLs, 2023-04-21, v3.27.0-rc1~156^2) by adding
`GIT_REPOSITORY` to the set of re-ordered keyword arguments. This
caused its value to absorb following unparsed arguments.
Fixes: #25029
Diffstat (limited to 'Modules/FetchContent.cmake')
-rw-r--r-- | Modules/FetchContent.cmake | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Modules/FetchContent.cmake b/Modules/FetchContent.cmake index 56fc0ed..4ff43ed 100644 --- a/Modules/FetchContent.cmake +++ b/Modules/FetchContent.cmake @@ -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() |