summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalUnixMakefileGenerator3.cxx
diff options
context:
space:
mode:
authorHugh Sorby <h.sorby@auckland.ac.nz>2020-02-13 02:38:52 (GMT)
committerBrad King <brad.king@kitware.com>2020-02-14 13:50:15 (GMT)
commite46e3442fdea8297d27d765a77d48176cf50a83b (patch)
tree22388c8267de7e1a43044a6dbd6e308682f62e88 /Source/cmGlobalUnixMakefileGenerator3.cxx
parentcb967317e4f4f91dd7840035ae1a2b2f800d3ea7 (diff)
downloadCMake-e46e3442fdea8297d27d765a77d48176cf50a83b.zip
CMake-e46e3442fdea8297d27d765a77d48176cf50a83b.tar.gz
CMake-e46e3442fdea8297d27d765a77d48176cf50a83b.tar.bz2
Makefiles: Re-run CMake if file configured in subdirectory is missing
Add files configured by all subdirectories to `CMAKE_MAKEFILE_PRODUCTS` rather than just those from the top level. Fixes: #19719
Diffstat (limited to 'Source/cmGlobalUnixMakefileGenerator3.cxx')
-rw-r--r--Source/cmGlobalUnixMakefileGenerator3.cxx17
1 files changed, 8 insertions, 9 deletions
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx
index 90c9ef0..d123830 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.cxx
+++ b/Source/cmGlobalUnixMakefileGenerator3.cxx
@@ -343,19 +343,18 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefile()
const std::string& binDir = lg.GetBinaryDirectory();
// CMake must rerun if a byproduct is missing.
- {
- cmakefileStream << "# Byproducts of CMake generate step:\n"
- << "set(CMAKE_MAKEFILE_PRODUCTS\n";
- for (std::string const& outfile : lg.GetMakefile()->GetOutputFiles()) {
+ cmakefileStream << "# Byproducts of CMake generate step:\n"
+ << "set(CMAKE_MAKEFILE_PRODUCTS\n";
+
+ // add in any byproducts and all the directory information files
+ std::string tmpStr;
+ for (const auto& localGen : this->LocalGenerators) {
+ for (std::string const& outfile :
+ localGen->GetMakefile()->GetOutputFiles()) {
cmakefileStream << " \""
<< lg.MaybeConvertToRelativePath(binDir, outfile)
<< "\"\n";
}
- }
-
- // add in all the directory information files
- std::string tmpStr;
- for (const auto& localGen : this->LocalGenerators) {
tmpStr = cmStrCat(localGen->GetCurrentBinaryDirectory(),
"/CMakeFiles/CMakeDirectoryInformation.cmake");
cmakefileStream << " \""