summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-03-06 16:30:45 (GMT)
committerBrad King <brad.king@kitware.com>2017-03-06 16:31:19 (GMT)
commit485685fdd9dc4de8db8184c9f57f644575f1c129 (patch)
treed6bf512ed534fb02b7d5c0ebf905f02170cde2dd /Source/cmLocalGenerator.cxx
parente1adec32b8325fb731da084e99acd6070f5e39bf (diff)
downloadCMake-485685fdd9dc4de8db8184c9f57f644575f1c129.zip
CMake-485685fdd9dc4de8db8184c9f57f644575f1c129.tar.gz
CMake-485685fdd9dc4de8db8184c9f57f644575f1c129.tar.bz2
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.
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r--Source/cmLocalGenerator.cxx11
1 files changed, 4 insertions, 7 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 44c390c..7077bbb 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -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);