summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2006-02-24 15:55:44 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2006-02-24 15:55:44 (GMT)
commit77e5a607f266a2f136417574e08dc5b0727fec3f (patch)
tree70a54405d4f7ec32d3259d10716b59cc9988189d
parent0ba40b59c7dc4c00c11902bae20fb9f03bde4168 (diff)
downloadCMake-77e5a607f266a2f136417574e08dc5b0727fec3f.zip
CMake-77e5a607f266a2f136417574e08dc5b0727fec3f.tar.gz
CMake-77e5a607f266a2f136417574e08dc5b0727fec3f.tar.bz2
BUG: Only add test targets when testing is enabled. Also add CMAKE_CFG_INTDIR when specified
-rw-r--r--Source/cmGlobalGenerator.cxx27
1 files changed, 18 insertions, 9 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 8f1bbe2..525033d 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1231,15 +1231,18 @@ void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets)
"Run CPack packaging tool...", &cpackCommandLines, depends);
// Test
- cpackCommandLines.erase(cpackCommandLines.begin(), cpackCommandLines.end());
- singleLine.erase(singleLine.begin(), singleLine.end());
- depends.erase(depends.begin(), depends.end());
- singleLine.push_back(this->GetCMakeInstance()->GetCTestCommand());
- singleLine.push_back("--force-new-ctest-process");
- cpackCommandLines.push_back(singleLine);
- (*targets)[this->GetTestTargetName()]
- = this->CreateGlobalTarget(this->GetTestTargetName(),
- "Running tests...", &cpackCommandLines, depends);
+ if(mf->IsOn("CMAKE_TESTING_ENABLED"))
+ {
+ cpackCommandLines.erase(cpackCommandLines.begin(), cpackCommandLines.end());
+ singleLine.erase(singleLine.begin(), singleLine.end());
+ depends.erase(depends.begin(), depends.end());
+ singleLine.push_back(this->GetCMakeInstance()->GetCTestCommand());
+ singleLine.push_back("--force-new-ctest-process");
+ cpackCommandLines.push_back(singleLine);
+ (*targets)[this->GetTestTargetName()]
+ = this->CreateGlobalTarget(this->GetTestTargetName(),
+ "Running tests...", &cpackCommandLines, depends);
+ }
//Edit Cache
cpackCommandLines.erase(cpackCommandLines.begin(), cpackCommandLines.end());
@@ -1306,6 +1309,12 @@ void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets)
cmd = "$(CMAKE_COMMAND)";
}
singleLine.push_back(cmd.c_str());
+ const char* cmakeCfgIntDir = mf->GetDefinition("CMAKE_CFG_INTDIR");
+ if ( cmakeCfgIntDir && *cmakeCfgIntDir && cmakeCfgIntDir[1] != '.' )
+ {
+ std::string cfgArg = "-DBUILD_TYPE=";
+ cfgArg += mf->GetDefinition("CMAKE_CFG_INTDIR");
+ }
singleLine.push_back("-P");
singleLine.push_back("cmake_install.cmake");
cpackCommandLines.push_back(singleLine);