summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorCraig Scott <craig.scott@crascit.com>2017-08-23 14:40:49 (GMT)
committerCraig Scott <craig.scott@crascit.com>2017-09-02 07:53:16 (GMT)
commit1561748496b10bc74adc731fd1d5e7c733034cba (patch)
tree1711de0d41fa4e7f92435b305ea0a476ca8790d4 /Modules
parentf4aa346538433f4c89a9963d74ea5d3f9bd60390 (diff)
downloadCMake-1561748496b10bc74adc731fd1d5e7c733034cba.zip
CMake-1561748496b10bc74adc731fd1d5e7c733034cba.tar.gz
CMake-1561748496b10bc74adc731fd1d5e7c733034cba.tar.bz2
ExternalProject: Prevent COMMAND from being treated as a true keyword
The known keywords for each function are obtained by scraping the documentation for lines matching a particular regular expression. In commit 8842a027 (ExternalProject: Improve documentation, 2017-07-09), the docs were overhauled and the COMMAND docs subsequently matched the regular expression when they shouldn't have. This made COMMAND appear as a true keyword, which thwarted the special handling logic elsewhere for the intended use of COMMAND arguments. This commit contains a workaround for issue #17229 to force a dependency of the patch step on the update step to ensure a predictable step order. Fixes: #17198
Diffstat (limited to 'Modules')
-rw-r--r--Modules/ExternalProject.cmake8
1 files changed, 8 insertions, 0 deletions
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index d92eb5f..912c5ac 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -870,6 +870,14 @@ foreach(line IN LISTS lines)
set(_ep_keyword_sep)
elseif("${line}" MATCHES "^ +``([A-Z0-9_]+) [^`]*``$")
set(_ep_key "${CMAKE_MATCH_1}")
+ # COMMAND should never be included as a keyword,
+ # for ExternalProject_Add(), as it is treated as a
+ # special case by argument parsing as an extension
+ # of a previous ..._COMMAND
+ if("x${_ep_key}x" STREQUAL "xCOMMANDx" AND
+ "x${_ep_func}x" STREQUAL "xExternalProject_Addx")
+ continue()
+ endif()
#message(" keyword [${_ep_key}]")
string(APPEND _ep_keywords_${_ep_func}
"${_ep_keyword_sep}${_ep_key}")