summaryrefslogtreecommitdiffstats
path: root/Source/cmAddCustomTargetCommand.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2006-02-08 15:58:36 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2006-02-08 15:58:36 (GMT)
commit347c5f4b46396e974ff164b44f23b37eef779138 (patch)
treee6457f6b3ce5ec7e54f3991e4e7912d2531f98b3 /Source/cmAddCustomTargetCommand.cxx
parent6fe45fe9c3348645a0fe145e1f32c487829cea64 (diff)
downloadCMake-347c5f4b46396e974ff164b44f23b37eef779138.zip
CMake-347c5f4b46396e974ff164b44f23b37eef779138.tar.gz
CMake-347c5f4b46396e974ff164b44f23b37eef779138.tar.bz2
ENH: add working directory support
Diffstat (limited to 'Source/cmAddCustomTargetCommand.cxx')
-rw-r--r--Source/cmAddCustomTargetCommand.cxx14
1 files changed, 12 insertions, 2 deletions
diff --git a/Source/cmAddCustomTargetCommand.cxx b/Source/cmAddCustomTargetCommand.cxx
index 02ae161..f1f1a77 100644
--- a/Source/cmAddCustomTargetCommand.cxx
+++ b/Source/cmAddCustomTargetCommand.cxx
@@ -33,11 +33,13 @@ bool cmAddCustomTargetCommand::InitialPass(std::vector<std::string> const& args)
// Accumulate dependencies.
std::vector<std::string> depends;
+ std::string working_directory;
// Keep track of parser state.
enum tdoing {
doing_command,
- doing_depends
+ doing_depends,
+ doing_working_directory
};
tdoing doing = doing_command;
@@ -62,6 +64,10 @@ bool cmAddCustomTargetCommand::InitialPass(std::vector<std::string> const& args)
{
doing = doing_depends;
}
+ if(copy == "WORKING_DIRECTORY")
+ {
+ doing = doing_working_directory;
+ }
else if(copy == "COMMAND")
{
doing = doing_command;
@@ -77,6 +83,9 @@ bool cmAddCustomTargetCommand::InitialPass(std::vector<std::string> const& args)
{
switch (doing)
{
+ case doing_working_directory:
+ working_directory = copy;
+ break;
case doing_command:
currentLine.push_back(copy);
break;
@@ -109,7 +118,8 @@ bool cmAddCustomTargetCommand::InitialPass(std::vector<std::string> const& args)
// Add the utility target to the makefile.
const char* no_output = 0;
- m_Makefile->AddUtilityCommand(args[0].c_str(), all, no_output, depends,
+ m_Makefile->AddUtilityCommand(args[0].c_str(), all, no_output,
+ working_directory.c_str(), depends,
commandLines);
return true;