mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-02 11:49:55 -06:00
Revert "Remove CTestTestfile.cmake when BUILD_TESTING is OFF"
This reverts commit v3.8.0-rc1~305^2 (Remove CTestTestfile.cmake when BUILD_TESTING is OFF, 2016-11-14). It breaks projects that never enable testing but create their own `CTestTestfile.cmake` manually instead.
This commit is contained in:
@@ -214,14 +214,7 @@ void cmLocalGenerator::TraceDependencies()
|
||||
|
||||
void cmLocalGenerator::GenerateTestFiles()
|
||||
{
|
||||
std::string file = this->StateSnapshot.GetDirectory().GetCurrentBinary();
|
||||
file += "/";
|
||||
file += "CTestTestfile.cmake";
|
||||
|
||||
if (!this->Makefile->IsOn("CMAKE_TESTING_ENABLED")) {
|
||||
if (cmSystemTools::FileExists(file)) {
|
||||
cmSystemTools::RemoveFile(file);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -230,6 +223,10 @@ void cmLocalGenerator::GenerateTestFiles()
|
||||
const std::string& config =
|
||||
this->Makefile->GetConfigurations(configurationTypes, false);
|
||||
|
||||
std::string file = this->StateSnapshot.GetDirectory().GetCurrentBinary();
|
||||
file += "/";
|
||||
file += "CTestTestfile.cmake";
|
||||
|
||||
cmGeneratedFileStream fout(file.c_str());
|
||||
fout.SetCopyIfDifferent(true);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user