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
This commit is contained in:
Marc Chevrier authored and Brad King committed 2018-04-24 10:42:00 -04:00
1 parent fbe6cd1596
commit 60cb75e4a1
1 file changed
+2 -1
+2 -1
View File
@@ -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