diff options
-rw-r--r-- | Source/CTest/cmCTestConfigureCommand.cxx | 37 | ||||
-rw-r--r-- | Source/CTest/cmCTestConfigureCommand.h | 16 | ||||
-rw-r--r-- | Source/CTest/cmCTestConfigureHandler.cxx | 4 | ||||
-rw-r--r-- | Source/CTest/cmCTestGenericHandler.cxx | 7 |
4 files changed, 50 insertions, 14 deletions
diff --git a/Source/CTest/cmCTestConfigureCommand.cxx b/Source/CTest/cmCTestConfigureCommand.cxx index ce2ff3c..1406044 100644 --- a/Source/CTest/cmCTestConfigureCommand.cxx +++ b/Source/CTest/cmCTestConfigureCommand.cxx @@ -19,8 +19,22 @@ #include "cmCTest.h" #include "cmCTestGenericHandler.h" +cmCTestConfigureCommand::cmCTestConfigureCommand() +{ + this->Arguments[ctc_OPTIONS] = "OPTIONS"; + this->Arguments[ctc_LAST] = 0; + this->Last = ctc_LAST; +} + cmCTestGenericHandler* cmCTestConfigureCommand::InitializeHandler() { + std::vector<std::string> options; + + if (this->Values[ctc_OPTIONS]) + { + cmSystemTools::ExpandListArgument(this->Values[ctc_OPTIONS], options); + } + if ( this->Values[ct_BUILD] ) { this->CTest->SetCTestConfiguration("BuildDirectory", @@ -33,6 +47,7 @@ cmCTestGenericHandler* cmCTestConfigureCommand::InitializeHandler() cmSystemTools::CollapseFullPath( this->Makefile->GetDefinition("CTEST_BINARY_DIRECTORY")).c_str()); } + if ( this->Values[ct_SOURCE] ) { this->CTest->SetCTestConfiguration("SourceDirectory", @@ -45,6 +60,7 @@ cmCTestGenericHandler* cmCTestConfigureCommand::InitializeHandler() cmSystemTools::CollapseFullPath( this->Makefile->GetDefinition("CTEST_SOURCE_DIRECTORY")).c_str()); } + if ( this->CTest->GetCTestConfiguration("BuildDirectory").empty() ) { this->SetError("Build directory not specified. Either use BUILD " @@ -77,11 +93,26 @@ cmCTestGenericHandler* cmCTestConfigureCommand::InitializeHandler() } std::string cmakeConfigureCommand = "\""; cmakeConfigureCommand += this->CTest->GetCMakeExecutable(); - cmakeConfigureCommand += "\" \"-G"; + cmakeConfigureCommand += "\""; + + std::vector<std::string>::const_iterator it; + std::string option; + for (it= options.begin(); it!=options.end(); ++it) + { + option = *it; + cmakeConfigureCommand += " \""; + cmakeConfigureCommand += option; + cmakeConfigureCommand += "\""; + } + + cmakeConfigureCommand += " \"-G"; cmakeConfigureCommand += cmakeGeneratorName; - cmakeConfigureCommand += "\" \""; + cmakeConfigureCommand += "\""; + + cmakeConfigureCommand += " \""; cmakeConfigureCommand += source_dir; cmakeConfigureCommand += "\""; + this->CTest->SetCTestConfiguration("ConfigureCommand", cmakeConfigureCommand.c_str()); } @@ -104,5 +135,3 @@ cmCTestGenericHandler* cmCTestConfigureCommand::InitializeHandler() } return handler; } - - diff --git a/Source/CTest/cmCTestConfigureCommand.h b/Source/CTest/cmCTestConfigureCommand.h index 9688032..7284fd7 100644 --- a/Source/CTest/cmCTestConfigureCommand.h +++ b/Source/CTest/cmCTestConfigureCommand.h @@ -27,8 +27,7 @@ class cmCTestConfigureCommand : public cmCTestHandlerCommand { public: - - cmCTestConfigureCommand() {} + cmCTestConfigureCommand(); /** * This is a virtual constructor for the command. @@ -60,10 +59,12 @@ public: virtual const char* GetFullDocumentation() { return - " ctest_configure(BUILD build_dir RETURN_VALUE res)\n" + " ctest_configure(BUILD build_dir OPTIONS options RETURN_VALUE res)\n" "Configures the given build directory and stores results in " - "Configure.xml. The second argument is a variable that will hold " - "return value."; + "Configure.xml. The OPTIONS arguments are passed as command line " + "arguments to the configure command. " + "The RETURN_VALUE argument is a variable that will hold " + "the return value."; } cmTypeMacro(cmCTestConfigureCommand, cmCTestHandlerCommand); @@ -71,6 +72,11 @@ public: protected: cmCTestGenericHandler* InitializeHandler(); + enum { + ctc_FIRST = ct_LAST, + ctc_OPTIONS, + ctc_LAST + }; }; diff --git a/Source/CTest/cmCTestConfigureHandler.cxx b/Source/CTest/cmCTestConfigureHandler.cxx index b81767b..c744d77 100644 --- a/Source/CTest/cmCTestConfigureHandler.cxx +++ b/Source/CTest/cmCTestConfigureHandler.cxx @@ -98,7 +98,7 @@ int cmCTestConfigureHandler::ProcessHandler() << std::endl << "\t<StartConfigureTime>" << start_time_time << "</StartConfigureTime>\n"; - + if ( res == cmsysProcess_State_Exited && retVal ) { os << retVal; @@ -129,7 +129,7 @@ int cmCTestConfigureHandler::ProcessHandler() if (! res || retVal ) { cmCTestLog(this->CTest, ERROR_MESSAGE, - "Error(s) when updating the project" << std::endl); + "Error(s) when configuring the project" << std::endl); return -1; } return 0; diff --git a/Source/CTest/cmCTestGenericHandler.cxx b/Source/CTest/cmCTestGenericHandler.cxx index 1695bc1..6c06f0b 100644 --- a/Source/CTest/cmCTestGenericHandler.cxx +++ b/Source/CTest/cmCTestGenericHandler.cxx @@ -123,8 +123,10 @@ bool cmCTestGenericHandler::StartResultingXML(const char* name, if(this->CTest->GetCurrentTag().empty()) { cmCTestLog(this->CTest, ERROR_MESSAGE, - "Current Tag empty, this may mean" - " NightlyStartTime was not set correctly." << std::endl); + "Current Tag empty, this may mean NightlyStartTime / " + "CTEST_NIGHTLY_START_TIME was not set correctly. Or " + "maybe you forgot to call ctest_start() before calling " + "ctest_configure()." << std::endl); cmSystemTools::SetFatalErrorOccured(); return false; } @@ -175,4 +177,3 @@ bool cmCTestGenericHandler::StartLogFile(const char* name, } return true; } - |