浏览代码

Merge topic 'autogen_ninja_clean'

93ee7dd044 Autogen: Update documentation for ADDITIONAL_CLEAN_FILES
4b4fd99f41 Autogen: Use ADDITIONAL_CLEAN_FILES target property for file cleaning

Acked-by: Kitware Robot <[email protected]>
Merge-request: !3327
Brad King 6 年之前
父节点
当前提交
e1c95bc278
共有 3 个文件被更改,包括 12 次插入11 次删除
  1. 1 1
      Help/prop_tgt/AUTOGEN_BUILD_DIR.rst
  2. 10 10
      Source/cmQtAutoGenInitializer.cxx
  3. 1 0
      Source/cmQtAutoGenInitializer.h

+ 1 - 1
Help/prop_tgt/AUTOGEN_BUILD_DIR.rst

@@ -5,7 +5,7 @@ Directory where :prop_tgt:`AUTOMOC`, :prop_tgt:`AUTOUIC` and :prop_tgt:`AUTORCC`
 generate files for the target.
 generate files for the target.
 
 
 The directory is created on demand and automatically added to the
 The directory is created on demand and automatically added to the
-:prop_dir:`ADDITIONAL_MAKE_CLEAN_FILES`.
+:prop_tgt:`ADDITIONAL_CLEAN_FILES` target property.
 
 
 When unset or empty the directory ``<dir>/<target-name>_autogen`` is used where
 When unset or empty the directory ``<dir>/<target-name>_autogen`` is used where
 ``<dir>`` is :variable:`CMAKE_CURRENT_BINARY_DIR` and ``<target-name>``
 ``<dir>`` is :variable:`CMAKE_CURRENT_BINARY_DIR` and ``<target-name>``

+ 10 - 10
Source/cmQtAutoGenInitializer.cxx

@@ -52,12 +52,6 @@ static std::size_t GetParallelCPUCount()
   return count;
   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,
 static std::string FileProjectRelativePath(cmMakefile* makefile,
                                            std::string const& fileName)
                                            std::string const& fileName)
 {
 {
@@ -320,7 +314,7 @@ bool cmQtAutoGenInitializer::InitCustomTargets()
     }
     }
     cmSystemTools::ConvertToUnixSlashes(this->Dir.Build);
     cmSystemTools::ConvertToUnixSlashes(this->Dir.Build);
     // Cleanup build directory
     // Cleanup build directory
-    AddCleanFile(makefile, this->Dir.Build);
+    this->AddCleanFile(this->Dir.Build);
 
 
     // Working directory
     // Working directory
     this->Dir.Work = cbd;
     this->Dir.Work = cbd;
@@ -381,15 +375,15 @@ bool cmQtAutoGenInitializer::InitCustomTargets()
           std::string& filename = this->AutogenTarget.ConfigSettingsFile[cfg];
           std::string& filename = this->AutogenTarget.ConfigSettingsFile[cfg];
           filename =
           filename =
             AppendFilenameSuffix(this->AutogenTarget.SettingsFile, "_" + cfg);
             AppendFilenameSuffix(this->AutogenTarget.SettingsFile, "_" + cfg);
-          AddCleanFile(makefile, filename);
+          this->AddCleanFile(filename);
         }
         }
       } else {
       } else {
-        AddCleanFile(makefile, this->AutogenTarget.SettingsFile);
+        this->AddCleanFile(this->AutogenTarget.SettingsFile);
       }
       }
 
 
       this->AutogenTarget.ParseCacheFile = this->Dir.Info;
       this->AutogenTarget.ParseCacheFile = this->Dir.Info;
       this->AutogenTarget.ParseCacheFile += "/ParseCache.txt";
       this->AutogenTarget.ParseCacheFile += "/ParseCache.txt";
-      AddCleanFile(makefile, this->AutogenTarget.ParseCacheFile);
+      this->AddCleanFile(this->AutogenTarget.ParseCacheFile);
     }
     }
 
 
     // Autogen target: Compute user defined dependencies
     // Autogen target: Compute user defined dependencies
@@ -1528,6 +1522,12 @@ bool cmQtAutoGenInitializer::AddToSourceGroup(std::string const& fileName,
   return true;
   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)
 static unsigned int CharPtrToUInt(const char* const input)
 {
 {
   unsigned long tmp = 0;
   unsigned long tmp = 0;

+ 1 - 0
Source/cmQtAutoGenInitializer.h

@@ -145,6 +145,7 @@ private:
                           bool prepend = false);
                           bool prepend = false);
   bool AddToSourceGroup(std::string const& fileName,
   bool AddToSourceGroup(std::string const& fileName,
                         std::string const& genNameUpper);
                         std::string const& genNameUpper);
+  void AddCleanFile(std::string const& fileName);
 
 
   bool GetQtExecutable(GenVarsT& genVars, const std::string& executable,
   bool GetQtExecutable(GenVarsT& genVars, const std::string& executable,
                        bool ignoreMissingTarget, std::string* output) const;
                        bool ignoreMissingTarget, std::string* output) const;