summaryrefslogtreecommitdiffstats
path: root/Modules/ExternalProject.cmake
diff options
context:
space:
mode:
authorCraig Scott <craig.scott@crascit.com>2024-08-25 04:21:16 (GMT)
committerCraig Scott <craig.scott@crascit.com>2024-08-30 05:19:58 (GMT)
commitf5f80305ef69dd33fbedd31ef1d2cfd3d2bc15b4 (patch)
tree2d4751bc7bb441835051b02e8e97df83365d8a78 /Modules/ExternalProject.cmake
parent1accfd94b59c5e717156552e1a065622f1655903 (diff)
downloadCMake-f5f80305ef69dd33fbedd31ef1d2cfd3d2bc15b4.zip
CMake-f5f80305ef69dd33fbedd31ef1d2cfd3d2bc15b4.tar.gz
CMake-f5f80305ef69dd33fbedd31ef1d2cfd3d2bc15b4.tar.bz2
ExternalProject: Ensure keywords requiring an argument have one
Issue: #21089
Diffstat (limited to 'Modules/ExternalProject.cmake')
-rw-r--r--Modules/ExternalProject.cmake20
1 files changed, 13 insertions, 7 deletions
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index 86d83f5..bef918d 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -2157,6 +2157,12 @@ function(ExternalProject_Add_Step name step)
byproducts
)
+ if(NOT "x${work_dir}" STREQUAL "x")
+ set(maybe_WORKING_DIRECTORY "WORKING_DIRECTORY [==[${work_dir}]==]")
+ else()
+ set(maybe_WORKING_DIRECTORY "")
+ endif()
+
# Custom comment?
get_property(comment_set
TARGET ${name}
@@ -2176,9 +2182,9 @@ function(ExternalProject_Add_Step name step)
PROPERTY _EP_${step}_USES_TERMINAL
)
if(uses_terminal)
- set(uses_terminal USES_TERMINAL)
+ set(maybe_USES_TERMINAL USES_TERMINAL)
else()
- set(uses_terminal "")
+ set(maybe_USES_TERMINAL "")
endif()
# Run every time?
@@ -2245,14 +2251,14 @@ function(ExternalProject_Add_Step name step)
add_custom_command(
OUTPUT \${stamp_file}
BYPRODUCTS \${byproducts}
- COMMENT \${comment}
+ COMMENT [===[${comment}]===]
COMMAND ${__cmdQuoted}
- ${maybe_COMMAND_touch}
- ${maybe_JOB_SERVER_AWARE}
DEPENDS \${depends}
- WORKING_DIRECTORY \${work_dir}
VERBATIM
- ${uses_terminal}
+ ${maybe_COMMAND_touch}
+ ${maybe_JOB_SERVER_AWARE}
+ ${maybe_WORKING_DIRECTORY}
+ ${maybe_USES_TERMINAL}
)"
)
set_property(TARGET ${name} APPEND PROPERTY _EP_STEPS ${step})