From b6c302b1aac9d903e5904febcec0902605dacee2 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Thu, 20 Jan 2011 13:52:42 -0500 Subject: Default the working dir to the current binary dir Keep backwards compatability with CMake <= 2.8.3. --- Source/cmAddTestCommand.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Source/cmAddTestCommand.cxx b/Source/cmAddTestCommand.cxx index 11ca9e7..72a6e93 100644 --- a/Source/cmAddTestCommand.cxx +++ b/Source/cmAddTestCommand.cxx @@ -74,7 +74,8 @@ bool cmAddTestCommand::HandleNameMode(std::vector const& args) { std::string name; std::vector configurations; - std::string working_directory; + std::string working_directory = this->Makefile->GetCurrentOutputDirectory(); + bool working_directory_set = false; std::vector command; // Read the arguments. @@ -108,12 +109,13 @@ bool cmAddTestCommand::HandleNameMode(std::vector const& args) } else if(args[i] == "WORKING_DIRECTORY") { - if(!working_directory.empty()) + if(working_directory_set) { this->SetError(" may be given at most one WORKING_DIRECTORY."); return false; } doing = DoingWorkingDirectory; + working_directory_set = true; } else if(doing == DoingName) { -- cgit v0.12