summaryrefslogtreecommitdiffstats
path: root/Source/cmAddCustomCommandCommand.cxx
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2014-11-05 20:37:52 (GMT)
committerBrad King <brad.king@kitware.com>2014-11-14 16:55:09 (GMT)
commitfe5d6e8c0f2e37bac0621a3b976d95c471891f38 (patch)
tree56d2a66bbf625ed8f3274baf3632aab2337dd6f1 /Source/cmAddCustomCommandCommand.cxx
parentad6ee426278ebaa9518af4573362a96b0544f4f7 (diff)
downloadCMake-fe5d6e8c0f2e37bac0621a3b976d95c471891f38.zip
CMake-fe5d6e8c0f2e37bac0621a3b976d95c471891f38.tar.gz
CMake-fe5d6e8c0f2e37bac0621a3b976d95c471891f38.tar.bz2
Add USES_TERMINAL option for custom commands
Teach the add_custom_command and add_custom_target commands a new USES_TERMINAL option. Use it to tell the generator to give the command direct access to the terminal if possible.
Diffstat (limited to 'Source/cmAddCustomCommandCommand.cxx')
-rw-r--r--Source/cmAddCustomCommandCommand.cxx14
1 files changed, 12 insertions, 2 deletions
diff --git a/Source/cmAddCustomCommandCommand.cxx b/Source/cmAddCustomCommandCommand.cxx
index 2d19610..410f978 100644
--- a/Source/cmAddCustomCommandCommand.cxx
+++ b/Source/cmAddCustomCommandCommand.cxx
@@ -35,6 +35,7 @@ bool cmAddCustomCommandCommand
std::vector<std::string> depends, outputs, output;
bool verbatim = false;
bool append = false;
+ bool uses_terminal = false;
std::string implicit_depends_lang;
cmCustomCommand::ImplicitDependsList implicit_depends;
@@ -102,6 +103,10 @@ bool cmAddCustomCommandCommand
{
append = true;
}
+ else if(copy == "USES_TERMINAL")
+ {
+ uses_terminal = true;
+ }
else if(copy == "TARGET")
{
doing = doing_target;
@@ -312,7 +317,7 @@ bool cmAddCustomCommandCommand
this->Makefile->AddCustomCommandToTarget(target, no_depends,
commandLines, cctype,
comment, working.c_str(),
- escapeOldStyle);
+ escapeOldStyle, uses_terminal);
}
else if(target.empty())
{
@@ -321,7 +326,7 @@ bool cmAddCustomCommandCommand
main_dependency,
commandLines, comment,
working.c_str(), false,
- escapeOldStyle);
+ escapeOldStyle, uses_terminal);
// Add implicit dependency scanning requests if any were given.
if(!implicit_depends.empty())
@@ -346,6 +351,11 @@ bool cmAddCustomCommandCommand
}
}
}
+ else if (uses_terminal)
+ {
+ this->SetError("USES_TERMINAL may not be used with SOURCE signatures");
+ return false;
+ }
else
{
bool issueMessage = true;