diff options
author | Gregor Jasny <gjasny@googlemail.com> | 2016-03-06 16:46:53 (GMT) |
---|---|---|
committer | Gregor Jasny <gjasny@googlemail.com> | 2016-03-09 19:33:01 (GMT) |
commit | 111cd679191c8aa4e081765ac4f7bc2e08657c7f (patch) | |
tree | 1fb8ff0a6e5787ae243f3ba69feea4425a0e11f6 /Source/cmGlobalXCodeGenerator.cxx | |
parent | b19bc31277bb2e3dd75e78f64924be3955ea8c6d (diff) | |
download | CMake-111cd679191c8aa4e081765ac4f7bc2e08657c7f.zip CMake-111cd679191c8aa4e081765ac4f7bc2e08657c7f.tar.gz CMake-111cd679191c8aa4e081765ac4f7bc2e08657c7f.tar.bz2 |
Xcode: ReRunCMake even if files disappeared (#15992)
Diffstat (limited to 'Source/cmGlobalXCodeGenerator.cxx')
-rw-r--r-- | Source/cmGlobalXCodeGenerator.cxx | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index ef18729..7c85281 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -593,19 +593,28 @@ void cmGlobalXCodeGenerator::CreateReRunCMakeFile( cmGeneratedFileStream makefileStream (this->CurrentReRunCMakeMakefile.c_str()); makefileStream.SetCopyIfDifferent(true); - makefileStream << "# Generated by CMake, DO NOT EDIT\n"; - std::string checkCache = root->GetBinaryDirectory(); - checkCache += "/"; - checkCache += cmake::GetCMakeFilesDirectoryPostSlash(); - checkCache += "cmake.check_cache"; - makefileStream << this->ConvertToRelativeForMake(checkCache.c_str()) - << ": "; + makefileStream << "# Generated by CMake, DO NOT EDIT\n\n"; + + makefileStream << "empty:= \n"; + makefileStream << "space:= $(empty) $(empty)\n"; + makefileStream << "spaceplus:= $(empty)\\ $(empty)\n\n"; + for(std::vector<std::string>::const_iterator i = lfiles.begin(); i != lfiles.end(); ++i) { - makefileStream << "\\\n" << this->ConvertToRelativeForMake(i->c_str()); + makefileStream << "TARGETS += $(subst $(space),$(spaceplus),$(wildcard " + << this->ConvertToRelativeForMake(i->c_str()) + << "))\n"; } - makefileStream << "\n\t" << + + std::string checkCache = root->GetBinaryDirectory(); + checkCache += "/"; + checkCache += cmake::GetCMakeFilesDirectoryPostSlash(); + checkCache += "cmake.check_cache"; + + makefileStream << "\n" << this->ConvertToRelativeForMake(checkCache.c_str()) + << ": $(TARGETS)\n"; + makefileStream << "\t" << this->ConvertToRelativeForMake(cmSystemTools::GetCMakeCommand().c_str()) << " -H" << this->ConvertToRelativeForMake( root->GetSourceDirectory()) |