BUG: Only add test targets when testing is enabled. Also add CMAKE_CFG_INTDIR when specified
This commit is contained in:
parent
0ba40b59c7
commit
77e5a607f2
@ -1231,15 +1231,18 @@ void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets)
|
|||||||
"Run CPack packaging tool...", &cpackCommandLines, depends);
|
"Run CPack packaging tool...", &cpackCommandLines, depends);
|
||||||
|
|
||||||
// Test
|
// Test
|
||||||
cpackCommandLines.erase(cpackCommandLines.begin(), cpackCommandLines.end());
|
if(mf->IsOn("CMAKE_TESTING_ENABLED"))
|
||||||
singleLine.erase(singleLine.begin(), singleLine.end());
|
{
|
||||||
depends.erase(depends.begin(), depends.end());
|
cpackCommandLines.erase(cpackCommandLines.begin(), cpackCommandLines.end());
|
||||||
singleLine.push_back(this->GetCMakeInstance()->GetCTestCommand());
|
singleLine.erase(singleLine.begin(), singleLine.end());
|
||||||
singleLine.push_back("--force-new-ctest-process");
|
depends.erase(depends.begin(), depends.end());
|
||||||
cpackCommandLines.push_back(singleLine);
|
singleLine.push_back(this->GetCMakeInstance()->GetCTestCommand());
|
||||||
(*targets)[this->GetTestTargetName()]
|
singleLine.push_back("--force-new-ctest-process");
|
||||||
= this->CreateGlobalTarget(this->GetTestTargetName(),
|
cpackCommandLines.push_back(singleLine);
|
||||||
"Running tests...", &cpackCommandLines, depends);
|
(*targets)[this->GetTestTargetName()]
|
||||||
|
= this->CreateGlobalTarget(this->GetTestTargetName(),
|
||||||
|
"Running tests...", &cpackCommandLines, depends);
|
||||||
|
}
|
||||||
|
|
||||||
//Edit Cache
|
//Edit Cache
|
||||||
cpackCommandLines.erase(cpackCommandLines.begin(), cpackCommandLines.end());
|
cpackCommandLines.erase(cpackCommandLines.begin(), cpackCommandLines.end());
|
||||||
@ -1306,6 +1309,12 @@ void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets)
|
|||||||
cmd = "$(CMAKE_COMMAND)";
|
cmd = "$(CMAKE_COMMAND)";
|
||||||
}
|
}
|
||||||
singleLine.push_back(cmd.c_str());
|
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("-P");
|
||||||
singleLine.push_back("cmake_install.cmake");
|
singleLine.push_back("cmake_install.cmake");
|
||||||
cpackCommandLines.push_back(singleLine);
|
cpackCommandLines.push_back(singleLine);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user