summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@sap.com>2018-04-24 12:16:20 +0200
committerBrad King <brad.king@kitware.com>2018-04-24 10:42:00 -0400
commit60cb75e4a196c97e55d535486e2d28630afb3f6e (patch)
treeb48df5c463a1c8f7662faf39e8c67ee5eee51e95 /Source
parentfbe6cd1596bf280edd49aeb8f981f99d7cd8beb3 (diff)
downloadcmake-60cb75e4a196c97e55d535486e2d28630afb3f6e.tar.gz
Fix CMAKE_DISABLE_SOURCE_CHANGES recognition of top of build tree
The change in commit v3.11.0-rc1~480^2 (UseJava: add_jar OUTPUT_DIR option used only for jar generation, 2017-10-12) added code of the form `file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR})`. This exposed an existing bug in `CMAKE_DISABLE_SOURCE_CHANGES` in which it does not recognize that the top of the build tree itself is in the build tree. Fix that now. Fixes: #17933
Diffstat (limited to 'Source')
-rw-r--r--Source/cmMakefile.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 71359a2710..604ca2ca5f 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -2304,7 +2304,8 @@ bool cmMakefile::CanIWriteThisFile(std::string const& fileName) const
}
return !cmSystemTools::IsSubDirectory(fileName, this->GetHomeDirectory()) ||
- cmSystemTools::IsSubDirectory(fileName, this->GetHomeOutputDirectory());
+ cmSystemTools::IsSubDirectory(fileName, this->GetHomeOutputDirectory()) ||
+ cmSystemTools::SameFile(fileName, this->GetHomeOutputDirectory());
}
const char* cmMakefile::GetRequiredDefinition(const std::string& name) const