summaryrefslogtreecommitdiffstats
path: root/Source/CTest/cmCTestBuildCommand.cxx
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2006-03-29 17:01:24 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2006-03-29 17:01:24 (GMT)
commit386900bfdd5836ccabeb0c050a6292c50aec79d6 (patch)
tree8316484c17eb5201a18f11ee8ff6245ae29ce365 /Source/CTest/cmCTestBuildCommand.cxx
parentb75166ea45173f8bc2cb9076f511a51b8112f61b (diff)
downloadCMake-386900bfdd5836ccabeb0c050a6292c50aec79d6.zip
CMake-386900bfdd5836ccabeb0c050a6292c50aec79d6.tar.gz
CMake-386900bfdd5836ccabeb0c050a6292c50aec79d6.tar.bz2
ENH: Several cleanups and make sure things get propagated where they should. Also, allow to load CTest custom files to the actual ctest -S script
Diffstat (limited to 'Source/CTest/cmCTestBuildCommand.cxx')
-rw-r--r--Source/CTest/cmCTestBuildCommand.cxx64
1 files changed, 2 insertions, 62 deletions
diff --git a/Source/CTest/cmCTestBuildCommand.cxx b/Source/CTest/cmCTestBuildCommand.cxx
index b323881..5d19e0e 100644
--- a/Source/CTest/cmCTestBuildCommand.cxx
+++ b/Source/CTest/cmCTestBuildCommand.cxx
@@ -39,61 +39,8 @@ cmCTestBuildCommand::~cmCTestBuildCommand()
}
//----------------------------------------------------------------------------
-bool cmCTestBuildCommand::InitialPass(
- std::vector<std::string> const& args)
+cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler()
{
- const char* build_dir = 0;
- const char* res_var = 0;
-
- bool havereturn_variable = false;
- bool havesource = false;
- for(size_t i=0; i < args.size(); ++i)
- {
- if ( havereturn_variable )
- {
- res_var = args[i].c_str();
- havereturn_variable = false;
- }
- else if ( havesource )
- {
- build_dir = args[i].c_str();
- havesource = false;
- }
- else if(args[i] == "RETURN_VALUE")
- {
- if ( res_var )
- {
- this->SetError("called with incorrect number of arguments. "
- "RETURN_VALUE specified twice.");
- return false;
- }
- havereturn_variable = true;
- }
- else if(args[i] == "BUILD")
- {
- if ( build_dir )
- {
- this->SetError("called with incorrect number of arguments. "
- "BUILD specified twice.");
- return false;
- }
- havesource = true;
- }
- else
- {
- cmOStringStream str;
- str << "called with incorrect number of arguments. Extra argument is: "
- << args[i].c_str() << ".";
- this->SetError(str.str().c_str());
- return false;
- }
- }
-
- if ( build_dir )
- {
- this->CTest->SetCTestConfiguration("BuildDirectory", build_dir);
- }
-
cmCTestGenericHandler* handler
= this->CTest->GetInitializedHandler("build");
if ( !handler )
@@ -161,14 +108,7 @@ bool cmCTestBuildCommand::InitialPass(
}
}
- int res = handler->ProcessHandler();
- if ( res_var )
- {
- cmOStringStream str;
- str << res;
- this->Makefile->AddDefinition(res_var, str.str().c_str());
- }
- return true;
+ return handler;
}