summaryrefslogtreecommitdiffstats
path: root/Source/CTest/cmCTestBuildAndTestHandler.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2007-09-11 18:43:17 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2007-09-11 18:43:17 (GMT)
commit1f99030cfa5d7782859d903e09eda3f518aa31a2 (patch)
tree56b89580e4e9b68fbd77b5337e5706a885d5c706 /Source/CTest/cmCTestBuildAndTestHandler.cxx
parent66a094a9eb14d43cb21fdea76479d2e8f8c94648 (diff)
downloadCMake-1f99030cfa5d7782859d903e09eda3f518aa31a2.zip
CMake-1f99030cfa5d7782859d903e09eda3f518aa31a2.tar.gz
CMake-1f99030cfa5d7782859d903e09eda3f518aa31a2.tar.bz2
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
Diffstat (limited to 'Source/CTest/cmCTestBuildAndTestHandler.cxx')
-rw-r--r--Source/CTest/cmCTestBuildAndTestHandler.cxx26
1 files changed, 24 insertions, 2 deletions
diff --git a/Source/CTest/cmCTestBuildAndTestHandler.cxx b/Source/CTest/cmCTestBuildAndTestHandler.cxx
index 2855cae..579a4cb 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);