From 1f99030cfa5d7782859d903e09eda3f518aa31a2 Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Tue, 11 Sep 2007 14:43:17 -0400 Subject: [PATCH] ENH: for build and test default the config type to the one that ctest was built with, it is good for the current ctest setup, and other projects can always specify a value on the command line --- Source/CTest/cmCTestBuildAndTestHandler.cxx | 26 +++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/Source/CTest/cmCTestBuildAndTestHandler.cxx b/Source/CTest/cmCTestBuildAndTestHandler.cxx index 2855cae26..579a4cba4 100644 --- a/Source/CTest/cmCTestBuildAndTestHandler.cxx +++ b/Source/CTest/cmCTestBuildAndTestHandler.cxx @@ -72,10 +72,20 @@ int cmCTestBuildAndTestHandler::RunCMake(std::string* outstring, generator += this->BuildGenerator; args.push_back(generator); } + + const char* config = 0; if ( this->CTest->GetConfigType().size() > 0 ) + { + config = this->CTest->GetConfigType().c_str(); + } +#ifdef CMAKE_INTDIR + config = CMAKE_INTDIR; +#endif + + if ( config ) { std::string btype - = "-DCMAKE_BUILD_TYPE:STRING=" + this->CTest->GetConfigType(); + = "-DCMAKE_BUILD_TYPE:STRING=" + std::string(config); args.push_back(btype); } @@ -235,11 +245,23 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring) } } std::string output; + const char* config = 0; + if ( this->CTest->GetConfigType().size() > 0 ) + { + config = this->CTest->GetConfigType().c_str(); + } +#ifdef CMAKE_INTDIR + config = CMAKE_INTDIR; +#endif + if(!config) + { + config = "Debug"; + } int retVal = cm.GetGlobalGenerator()->Build( this->SourceDir.c_str(), this->BinaryDir.c_str(), this->BuildProject.c_str(), tarIt->c_str(), &output, this->BuildMakeProgram.c_str(), - this->CTest->GetConfigType().c_str(), + config, !this->BuildNoClean, false, remainingTime);