summaryrefslogtreecommitdiffstats
path: root/Source/cmQtAutoGenInitializer.cxx
diff options
context:
space:
mode:
authorSebastian Holtermann <sebholt@xwmw.org>2019-05-15 08:52:49 (GMT)
committerSebastian Holtermann <sebholt@xwmw.org>2019-05-15 13:28:17 (GMT)
commit4b4fd99f41e4178d914c41883ee12b63e9cb145a (patch)
treec39737a063cef85f673aa8a93046039b12f86b08 /Source/cmQtAutoGenInitializer.cxx
parent66efdbd21a46b63572f5de677ed126a68e524e7a (diff)
downloadCMake-4b4fd99f41e4178d914c41883ee12b63e9cb145a.zip
CMake-4b4fd99f41e4178d914c41883ee12b63e9cb145a.tar.gz
CMake-4b4fd99f41e4178d914c41883ee12b63e9cb145a.tar.bz2
Autogen: Use ADDITIONAL_CLEAN_FILES target property for file cleaning
The `ADDITIONAL_CLEAN_FILES` target property works on multiple generators to remove addition files at the clean target. In `AUTOGEN` use it instead of the deprecated and limited `ADDITIONAL_MAKE_CLEAN_FILES` directory property to remove `AUTOGEN` generated files. Fixes: #17074 "Autogen: clean target with ninja generator doesn’t clean autogen files"
Diffstat (limited to 'Source/cmQtAutoGenInitializer.cxx')
-rw-r--r--Source/cmQtAutoGenInitializer.cxx20
1 files changed, 10 insertions, 10 deletions
diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx
index 38f39fb..a5e0f32 100644
--- a/Source/cmQtAutoGenInitializer.cxx
+++ b/Source/cmQtAutoGenInitializer.cxx
@@ -52,12 +52,6 @@ static std::size_t GetParallelCPUCount()
return count;
}
-static void AddCleanFile(cmMakefile* makefile, std::string const& fileName)
-{
- makefile->AppendProperty("ADDITIONAL_MAKE_CLEAN_FILES", fileName.c_str(),
- false);
-}
-
static std::string FileProjectRelativePath(cmMakefile* makefile,
std::string const& fileName)
{
@@ -320,7 +314,7 @@ bool cmQtAutoGenInitializer::InitCustomTargets()
}
cmSystemTools::ConvertToUnixSlashes(this->Dir.Build);
// Cleanup build directory
- AddCleanFile(makefile, this->Dir.Build);
+ this->AddCleanFile(this->Dir.Build);
// Working directory
this->Dir.Work = cbd;
@@ -381,15 +375,15 @@ bool cmQtAutoGenInitializer::InitCustomTargets()
std::string& filename = this->AutogenTarget.ConfigSettingsFile[cfg];
filename =
AppendFilenameSuffix(this->AutogenTarget.SettingsFile, "_" + cfg);
- AddCleanFile(makefile, filename);
+ this->AddCleanFile(filename);
}
} else {
- AddCleanFile(makefile, this->AutogenTarget.SettingsFile);
+ this->AddCleanFile(this->AutogenTarget.SettingsFile);
}
this->AutogenTarget.ParseCacheFile = this->Dir.Info;
this->AutogenTarget.ParseCacheFile += "/ParseCache.txt";
- AddCleanFile(makefile, this->AutogenTarget.ParseCacheFile);
+ this->AddCleanFile(this->AutogenTarget.ParseCacheFile);
}
// Autogen target: Compute user defined dependencies
@@ -1528,6 +1522,12 @@ bool cmQtAutoGenInitializer::AddToSourceGroup(std::string const& fileName,
return true;
}
+void cmQtAutoGenInitializer::AddCleanFile(std::string const& fileName)
+{
+ Target->Target->AppendProperty("ADDITIONAL_CLEAN_FILES", fileName.c_str(),
+ false);
+}
+
static unsigned int CharPtrToUInt(const char* const input)
{
unsigned long tmp = 0;