[Cmake-commits] CMake branch, master, updated. v3.12.0-378-g1d76991

Kitware Robot kwrobot at kitware.com
Mon Aug 6 08:45:06 EDT 2018


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, master has been updated
       via  1d76991a412873aa3a0aed9735a06d658ef367e7 (commit)
       via  87e7904c915976456028fcd834bdea9bf07b47fd (commit)
      from  d7a1bcd2e67e27d8897c100f14744547ef639d64 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1d76991a412873aa3a0aed9735a06d658ef367e7
commit 1d76991a412873aa3a0aed9735a06d658ef367e7
Merge: d7a1bcd 87e7904
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Aug 6 12:43:46 2018 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Mon Aug 6 08:43:54 2018 -0400

    Merge topic 'autogen_single_entry'
    
    87e7904c91 Autogen: Use a single AUTOGEN  setup function in cmGlobalGenerator
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !2260


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=87e7904c915976456028fcd834bdea9bf07b47fd
commit 87e7904c915976456028fcd834bdea9bf07b47fd
Author:     Sebastian Holtermann <sebholt at xwmw.org>
AuthorDate: Fri Aug 3 12:55:50 2018 +0200
Commit:     Sebastian Holtermann <sebholt at xwmw.org>
CommitDate: Fri Aug 3 12:55:50 2018 +0200

    Autogen: Use a single AUTOGEN  setup function in cmGlobalGenerator
    
    By moving all AUTOGEN setup code in ``cmGlobalGenerator``
    into a single ``cmGlobalGenerator::QtAutoGen`` function, the
    ``cmGlobalGenerator::Compute`` function becomes cleaner.

diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 63bbf04..58821c2 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1313,16 +1313,10 @@ bool cmGlobalGenerator::Compute()
   // so create the map from project name to vector of local generators
   this->FillProjectMap();
 
-#ifdef CMAKE_BUILD_WITH_CMAKE
-  // Iterate through all targets and set up automoc for those which have
-  // the AUTOMOC, AUTOUIC or AUTORCC property set
-  auto autogenInits = this->CreateQtAutoGenInitializers();
-  for (auto& autoGen : autogenInits) {
-    if (!autoGen->InitCustomTargets()) {
-      return false;
-    }
+  // Iterate through all targets and set up AUTOMOC, AUTOUIC and AUTORCC
+  if (!this->QtAutoGen()) {
+    return false;
   }
-#endif
 
   // Add generator specific helper commands
   for (cmLocalGenerator* localGen : this->LocalGenerators) {
@@ -1341,16 +1335,6 @@ bool cmGlobalGenerator::Compute()
     }
   }
 
-#ifdef CMAKE_BUILD_WITH_CMAKE
-  for (auto& autoGen : autogenInits) {
-    if (!autoGen->SetupCustomTargets()) {
-      return false;
-    }
-    autoGen.reset(nullptr);
-  }
-  autogenInits.clear();
-#endif
-
   for (cmLocalGenerator* localGen : this->LocalGenerators) {
     cmMakefile* mf = localGen->GetMakefile();
     for (cmInstallGenerator* g : mf->GetInstallGenerators()) {
@@ -1480,12 +1464,11 @@ bool cmGlobalGenerator::ComputeTargetDepends()
   return true;
 }
 
-std::vector<std::unique_ptr<cmQtAutoGenInitializer>>
-cmGlobalGenerator::CreateQtAutoGenInitializers()
+bool cmGlobalGenerator::QtAutoGen()
 {
+#ifdef CMAKE_BUILD_WITH_CMAKE
   std::vector<std::unique_ptr<cmQtAutoGenInitializer>> autogenInits;
 
-#ifdef CMAKE_BUILD_WITH_CMAKE
   for (cmLocalGenerator* localGen : this->LocalGenerators) {
     const std::vector<cmGeneratorTarget*>& targets =
       localGen->GetGeneratorTargets();
@@ -1519,12 +1502,30 @@ cmGlobalGenerator::CreateQtAutoGenInitializers()
         continue;
       }
 
-      autogenInits.emplace_back(new cmQtAutoGenInitializer(
+      autogenInits.emplace_back(cm::make_unique<cmQtAutoGenInitializer>(
         target, mocEnabled, uicEnabled, rccEnabled, qtVersionMajor));
     }
   }
+
+  if (!autogenInits.empty()) {
+    // Initialize custom targets
+    for (auto& autoGen : autogenInits) {
+      if (!autoGen->InitCustomTargets()) {
+        return false;
+      }
+    }
+
+    // Setup custom targets
+    for (auto& autoGen : autogenInits) {
+      if (!autoGen->SetupCustomTargets()) {
+        return false;
+      }
+      autoGen.reset(nullptr);
+    }
+  }
 #endif
-  return autogenInits;
+
+  return true;
 }
 
 cmLinkLineComputer* cmGlobalGenerator::CreateLinkLineComputer(
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index a50cc3b..e0b97d2 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -33,7 +33,6 @@ class cmLinkLineComputer;
 class cmLocalGenerator;
 class cmMakefile;
 class cmOutputConverter;
-class cmQtAutoGenInitializer;
 class cmSourceFile;
 class cmStateDirectory;
 class cmake;
@@ -441,9 +440,9 @@ protected:
 
   virtual bool CheckALLOW_DUPLICATE_CUSTOM_TARGETS() const;
 
-  // Qt auto generators
-  std::vector<std::unique_ptr<cmQtAutoGenInitializer>>
-  CreateQtAutoGenInitializers();
+  /// @brief Qt AUTOMOC/UIC/RCC target generation
+  /// @return true on success
+  bool QtAutoGen();
 
   std::string SelectMakeProgram(const std::string& makeProgram,
                                 const std::string& makeDefault = "") const;

-----------------------------------------------------------------------

Summary of changes:
 Source/cmGlobalGenerator.cxx | 49 ++++++++++++++++++++++----------------------
 Source/cmGlobalGenerator.h   |  7 +++----
 2 files changed, 28 insertions(+), 28 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list