diff options
author | Ed Branch <brance@mail.utexas.edu> | 2017-01-14 02:01:17 (GMT) |
---|---|---|
committer | Ed Branch <brance@mail.utexas.edu> | 2017-01-14 02:02:16 (GMT) |
commit | 7c8ab7ddc8944152a1344c43acbb8c57fa2d398a (patch) | |
tree | e74c16ab04cd0961e5ca032ba99c45087dbd0dec /Source/cmMakefile.cxx | |
parent | eee51e24d2290771ad3dded566ef897243f21331 (diff) | |
download | CMake-7c8ab7ddc8944152a1344c43acbb8c57fa2d398a.zip CMake-7c8ab7ddc8944152a1344c43acbb8c57fa2d398a.tar.gz CMake-7c8ab7ddc8944152a1344c43acbb8c57fa2d398a.tar.bz2 |
add_custom_{command,target}: Add COMMAND_EXPAND_LISTS option
This option allows lists generated by generator expressions to be expanded.
Closes: #15935
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r-- | Source/cmMakefile.cxx | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index cfc0495..bfe46ae 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -692,7 +692,7 @@ void cmMakefile::AddCustomCommandToTarget( const std::vector<std::string>& depends, const cmCustomCommandLines& commandLines, cmTarget::CustomCommandType type, const char* comment, const char* workingDir, bool escapeOldStyle, - bool uses_terminal, const std::string& depfile) + bool uses_terminal, const std::string& depfile, bool command_expand_lists) { // Find the target to which to add the custom command. cmTargets::iterator ti = this->Targets.find(target); @@ -764,6 +764,7 @@ void cmMakefile::AddCustomCommandToTarget( cc.SetEscapeOldStyle(escapeOldStyle); cc.SetEscapeAllowMakeVars(true); cc.SetUsesTerminal(uses_terminal); + cc.SetCommandExpandLists(command_expand_lists); cc.SetDepfile(depfile); switch (type) { case cmTarget::PRE_BUILD: @@ -784,7 +785,7 @@ cmSourceFile* cmMakefile::AddCustomCommandToOutput( const std::vector<std::string>& depends, const std::string& main_dependency, const cmCustomCommandLines& commandLines, const char* comment, const char* workingDir, bool replace, bool escapeOldStyle, - bool uses_terminal, const std::string& depfile) + bool uses_terminal, bool command_expand_lists, const std::string& depfile) { // Make sure there is at least one output. if (outputs.empty()) { @@ -878,6 +879,7 @@ cmSourceFile* cmMakefile::AddCustomCommandToOutput( cc->SetEscapeOldStyle(escapeOldStyle); cc->SetEscapeAllowMakeVars(true); cc->SetUsesTerminal(uses_terminal); + cc->SetCommandExpandLists(command_expand_lists); cc->SetDepfile(depfile); file->SetCustomCommand(cc); this->UpdateOutputToSourceMap(outputs, file); @@ -916,14 +918,16 @@ cmSourceFile* cmMakefile::AddCustomCommandToOutput( const std::string& output, const std::vector<std::string>& depends, const std::string& main_dependency, const cmCustomCommandLines& commandLines, const char* comment, const char* workingDir, bool replace, - bool escapeOldStyle, bool uses_terminal, const std::string& depfile) + bool escapeOldStyle, bool uses_terminal, bool command_expand_lists, + const std::string& depfile) { std::vector<std::string> outputs; outputs.push_back(output); std::vector<std::string> no_byproducts; return this->AddCustomCommandToOutput( outputs, no_byproducts, depends, main_dependency, commandLines, comment, - workingDir, replace, escapeOldStyle, uses_terminal, depfile); + workingDir, replace, escapeOldStyle, uses_terminal, command_expand_lists, + depfile); } void cmMakefile::AddCustomCommandOldStyle( @@ -1018,12 +1022,13 @@ cmTarget* cmMakefile::AddUtilityCommand( const std::string& utilityName, bool excludeFromAll, const char* workingDirectory, const std::vector<std::string>& depends, const cmCustomCommandLines& commandLines, bool escapeOldStyle, - const char* comment, bool uses_terminal) + const char* comment, bool uses_terminal, bool command_expand_lists) { std::vector<std::string> no_byproducts; return this->AddUtilityCommand(utilityName, excludeFromAll, workingDirectory, no_byproducts, depends, commandLines, - escapeOldStyle, comment, uses_terminal); + escapeOldStyle, comment, uses_terminal, + command_expand_lists); } cmTarget* cmMakefile::AddUtilityCommand( @@ -1031,7 +1036,7 @@ cmTarget* cmMakefile::AddUtilityCommand( const char* workingDirectory, const std::vector<std::string>& byproducts, const std::vector<std::string>& depends, const cmCustomCommandLines& commandLines, bool escapeOldStyle, - const char* comment, bool uses_terminal) + const char* comment, bool uses_terminal, bool command_expand_lists) { // Create a target instance for this utility. cmTarget* target = this->AddNewTarget(cmStateEnums::UTILITY, utilityName); @@ -1055,7 +1060,8 @@ cmTarget* cmMakefile::AddUtilityCommand( bool no_replace = false; this->AddCustomCommandToOutput( forced, byproducts, depends, no_main_dependency, commandLines, comment, - workingDirectory, no_replace, escapeOldStyle, uses_terminal); + workingDirectory, no_replace, escapeOldStyle, uses_terminal, + command_expand_lists); cmSourceFile* sf = target->AddSourceCMP0049(force); // The output is not actually created so mark it symbolic. |