summaryrefslogtreecommitdiffstats
path: root/Source/cmAddTestCommand.cxx
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2011-01-20 18:52:42 (GMT)
committerBen Boeckel <ben.boeckel@kitware.com>2011-01-20 18:52:42 (GMT)
commitb6c302b1aac9d903e5904febcec0902605dacee2 (patch)
tree7f63efabe11703e95d30df111ae179d7880c2ca8 /Source/cmAddTestCommand.cxx
parent0594287606dad64904935901d5625b4f47d61ef6 (diff)
downloadCMake-b6c302b1aac9d903e5904febcec0902605dacee2.zip
CMake-b6c302b1aac9d903e5904febcec0902605dacee2.tar.gz
CMake-b6c302b1aac9d903e5904febcec0902605dacee2.tar.bz2
Default the working dir to the current binary dir
Keep backwards compatability with CMake <= 2.8.3.
Diffstat (limited to 'Source/cmAddTestCommand.cxx')
-rw-r--r--Source/cmAddTestCommand.cxx6
1 files 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<std::string> const& args)
{
std::string name;
std::vector<std::string> configurations;
- std::string working_directory;
+ std::string working_directory = this->Makefile->GetCurrentOutputDirectory();
+ bool working_directory_set = false;
std::vector<std::string> command;
// Read the arguments.
@@ -108,12 +109,13 @@ bool cmAddTestCommand::HandleNameMode(std::vector<std::string> 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)
{