diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2006-02-08 10:58:36 -0500 |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2006-02-08 10:58:36 -0500 |
commit | 347c5f4b46396e974ff164b44f23b37eef779138 (patch) | |
tree | e6457f6b3ce5ec7e54f3991e4e7912d2531f98b3 /Source/cmAddCustomCommandCommand.cxx | |
parent | 6fe45fe9c3348645a0fe145e1f32c487829cea64 (diff) | |
download | cmake-347c5f4b46396e974ff164b44f23b37eef779138.tar.gz |
ENH: add working directory support
Diffstat (limited to 'Source/cmAddCustomCommandCommand.cxx')
-rw-r--r-- | Source/cmAddCustomCommandCommand.cxx | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/Source/cmAddCustomCommandCommand.cxx b/Source/cmAddCustomCommandCommand.cxx index c0750a5940..15df8ededd 100644 --- a/Source/cmAddCustomCommandCommand.cxx +++ b/Source/cmAddCustomCommandCommand.cxx @@ -31,7 +31,8 @@ bool cmAddCustomCommandCommand::InitialPass(std::vector<std::string> const& args return false; } - std::string source, target, comment, output, main_dependency; + std::string source, target, comment, output, main_dependency, + working; std::vector<std::string> depends, outputs; // Accumulate one command line at a time. @@ -51,6 +52,7 @@ bool cmAddCustomCommandCommand::InitialPass(std::vector<std::string> const& args doing_output, doing_outputs, doing_comment, + doing_working_directory, doing_nothing }; @@ -107,6 +109,10 @@ bool cmAddCustomCommandCommand::InitialPass(std::vector<std::string> const& args { doing = doing_output; } + else if (copy == "WORKING_DIRECTORY") + { + doing = doing_working_directory; + } else if (copy == "MAIN_DEPENDENCY") { doing = doing_main_dependency; @@ -141,6 +147,9 @@ bool cmAddCustomCommandCommand::InitialPass(std::vector<std::string> const& args switch (doing) { + case doing_working_directory: + working = copy; + break; case doing_source: source = copy; break; @@ -210,14 +219,15 @@ bool cmAddCustomCommandCommand::InitialPass(std::vector<std::string> const& args std::vector<std::string> no_depends; m_Makefile->AddCustomCommandToTarget(target.c_str(), no_depends, commandLines, cctype, - comment.c_str()); + comment.c_str(), working.c_str()); } else if(target.empty()) { // Target is empty, use the output. m_Makefile->AddCustomCommandToOutput(output.c_str(), depends, main_dependency.c_str(), - commandLines, comment.c_str()); + commandLines, comment.c_str(), + working.c_str()); } else { |