summaryrefslogtreecommitdiffstats
path: root/Source/cmAddCustomTargetCommand.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmAddCustomTargetCommand.cxx')
-rw-r--r--Source/cmAddCustomTargetCommand.cxx13
1 files changed, 12 insertions, 1 deletions
diff --git a/Source/cmAddCustomTargetCommand.cxx b/Source/cmAddCustomTargetCommand.cxx
index 56f33b4..0d01493 100644
--- a/Source/cmAddCustomTargetCommand.cxx
+++ b/Source/cmAddCustomTargetCommand.cxx
@@ -47,6 +47,7 @@ bool cmAddCustomTargetCommand::InitialPass(
std::string working_directory;
bool verbatim = false;
bool uses_terminal = false;
+ bool command_expand_lists = false;
std::string comment_buffer;
const char* comment = CM_NULLPTR;
std::vector<std::string> sources;
@@ -90,6 +91,9 @@ bool cmAddCustomTargetCommand::InitialPass(
} else if (copy == "USES_TERMINAL") {
doing = doing_nothing;
uses_terminal = true;
+ } else if (copy == "COMMAND_EXPAND_LISTS") {
+ doing = doing_nothing;
+ command_expand_lists = true;
} else if (copy == "COMMENT") {
doing = doing_comment;
} else if (copy == "COMMAND") {
@@ -221,12 +225,19 @@ bool cmAddCustomTargetCommand::InitialPass(
"USES_TERMINAL may not be specified without any COMMAND");
return true;
}
+ if (commandLines.empty() && command_expand_lists) {
+ this->Makefile->IssueMessage(
+ cmake::FATAL_ERROR,
+ "COMMAND_EXPAND_LISTS may not be specified without any COMMAND");
+ return true;
+ }
// Add the utility target to the makefile.
bool escapeOldStyle = !verbatim;
cmTarget* target = this->Makefile->AddUtilityCommand(
targetName, excludeFromAll, working_directory.c_str(), byproducts, depends,
- commandLines, escapeOldStyle, comment, uses_terminal);
+ commandLines, escapeOldStyle, comment, uses_terminal,
+ command_expand_lists);
// Add additional user-specified source files to the target.
target->AddSources(sources);