diff options
author | Brad King <brad.king@kitware.com> | 2016-11-16 12:47:02 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2016-11-16 12:47:02 (GMT) |
commit | e57ee41370196fbedffe57f878d701d302df9e5d (patch) | |
tree | 27f5475e81449a5c1fc04cfba7fb8d53a30f0d2c /Source | |
parent | 2a663ebce10fb9d393594e28f8ecc870488f6eba (diff) | |
parent | ae4cfa8b12d127d7673c6278eb67acdae6239b4e (diff) | |
download | CMake-e57ee41370196fbedffe57f878d701d302df9e5d.zip CMake-e57ee41370196fbedffe57f878d701d302df9e5d.tar.gz CMake-e57ee41370196fbedffe57f878d701d302df9e5d.tar.bz2 |
Merge topic 'Empty_CTestTestfile_on_BUILD_TESTING_OFF'
ae4cfa8b Remove CTestTestfile.cmake when BUILD_TESTING is OFF
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmLocalGenerator.cxx | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index e7dfed5..1fda4e9 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -211,7 +211,14 @@ 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; } @@ -220,10 +227,6 @@ 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); |