[Cmake-commits] CMake branch, master, updated. v3.15.3-1053-g7c47894

Kitware Robot kwrobot at kitware.com
Mon Sep 16 10:20:22 EDT 2019


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  7c47894b459c0f71ebe32b64a619f290df6bcf44 (commit)
       via  1df2f8803b79c2e27d123de4f3f351bae824feef (commit)
       via  33588714832de46915542094c93a96096755fb55 (commit)
       via  7bf8eb78777e70d2d9c4dc7a3dd6875d82766592 (commit)
       via  5d28e361b709a781a131cb9d9da73f04484eff54 (commit)
       via  c16641607fcf85206b3faf67ae1e1bab173bf44d (commit)
       via  4fb29850ad325b70fb412d4fd596c0a0d627ae8b (commit)
      from  bfa2eaa617de778ecfb2a0678c9898605822260d (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=7c47894b459c0f71ebe32b64a619f290df6bcf44
commit 7c47894b459c0f71ebe32b64a619f290df6bcf44
Merge: 1df2f88 5d28e36
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Sep 16 14:16:57 2019 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Mon Sep 16 10:18:51 2019 -0400

    Merge topic 'prepare-deferred-custom-command-creation'
    
    5d28e361b7 add_custom_command: Move append functionality into class cmMakefile
    4fb29850ad add_custom_command: Refactor setting implicit depends
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !3810


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1df2f8803b79c2e27d123de4f3f351bae824feef
commit 1df2f8803b79c2e27d123de4f3f351bae824feef
Merge: 3358871 c166416
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Sep 16 14:16:40 2019 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Mon Sep 16 10:17:22 2019 -0400

    Merge topic 'add_custom_command-genex-slash'
    
    c16641607f add_custom_command: Delay slash conversion until after genex evaluation
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !3791


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=33588714832de46915542094c93a96096755fb55
commit 33588714832de46915542094c93a96096755fb55
Merge: bfa2eaa 7bf8eb7
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Sep 16 14:15:23 2019 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Mon Sep 16 10:15:37 2019 -0400

    Merge topic 'remove-unused-class'
    
    7bf8eb7877 Remove unused cmInstallExportAndroidMKGenerator
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !3812


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7bf8eb78777e70d2d9c4dc7a3dd6875d82766592
commit 7bf8eb78777e70d2d9c4dc7a3dd6875d82766592
Author:     Tushar Maheshwari <tushar27192 at gmail.com>
AuthorDate: Fri Sep 13 13:23:33 2019 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Fri Sep 13 13:24:45 2019 -0400

    Remove unused cmInstallExportAndroidMKGenerator
    
    This class was added by commit 42ce9f1e71 (Add support for creating
    prebuilt Android.mk files, 2016-07-12, v3.7.0-rc1~126^2) but not used.

diff --git a/Source/cmInstallExportAndroidMKGenerator.cxx b/Source/cmInstallExportAndroidMKGenerator.cxx
deleted file mode 100644
index e8de029..0000000
--- a/Source/cmInstallExportAndroidMKGenerator.cxx
+++ /dev/null
@@ -1,134 +0,0 @@
-
-/* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
-   file Copyright.txt or https://cmake.org/licensing for details.  */
-#include "cmInstallExportAndroidMKGenerator.h"
-
-#include <stdio.h>
-
-#include "cmExportInstallFileGenerator.h"
-#include "cmExportSet.h"
-#include "cmGeneratedFileStream.h"
-#include "cmGlobalGenerator.h"
-#include "cmInstallFilesGenerator.h"
-#include "cmInstallTargetGenerator.h"
-#include "cmLocalGenerator.h"
-#include "cmMakefile.h"
-#include "cmMessageType.h"
-
-cmInstallExportAndroidMKGenerator::cmInstallExportAndroidMKGenerator(
-  cmExportSet* exportSet, const char* destination,
-  const char* file_permissions, std::vector<std::string> const& configurations,
-  const char* component, MessageLevel message, bool exclude_from_all,
-  const char* filename, const char* name_space, bool exportOld)
-  : cmInstallExportGenerator(exportSet, destination, file_permissions,
-                             configurations, component, message,
-                             exclude_from_all, filename, name_space, exportOld)
-{
-}
-
-cmInstallExportAndroidMKGenerator::~cmInstallExportAndroidMKGenerator()
-{
-}
-
-bool cmInstallExportAndroidMKGenerator::Compute(cmLocalGenerator* lg)
-{
-  this->LocalGenerator = lg;
-  this->ExportSet->Compute(lg);
-  return true;
-}
-
-void cmInstallExportAndroidMKGenerator::GenerateScript(std::ostream& os)
-{
-  // Skip empty sets.
-  if (ExportSet->GetTargetExports()->empty()) {
-    std::ostringstream e;
-    e << "INSTALL(EXPORT) given unknown export \"" << ExportSet->GetName()
-      << "\"";
-    cmSystemTools::Error(e.str());
-    return;
-  }
-
-  // Create the temporary directory in which to store the files.
-  this->ComputeTempDir();
-  cmSystemTools::MakeDirectory(this->TempDir.c_str());
-
-  // Construct a temporary location for the file.
-  this->MainImportFile = cmStrCat(this->TempDir, '/', this->FileName);
-
-  // Generate the import file for this export set.
-  this->EFGen->SetExportFile(this->MainImportFile.c_str());
-  this->EFGen->SetNamespace(this->Namespace);
-  this->EFGen->SetExportOld(this->ExportOld);
-  if (this->ConfigurationTypes->empty()) {
-    if (!this->ConfigurationName.empty()) {
-      this->EFGen->AddConfiguration(this->ConfigurationName);
-    } else {
-      this->EFGen->AddConfiguration("");
-    }
-  } else {
-    for (std::string const& config : this->ConfigurationTypes) {
-      this->EFGen->AddConfiguration(config);
-    }
-  }
-  this->EFGen->GenerateImportFile();
-
-  // Perform the main install script generation.
-  this->cmInstallGenerator::GenerateScript(os);
-}
-
-void cmInstallExportAndroidMKGenerator::GenerateScriptConfigs(
-  std::ostream& os, Indent const& indent)
-{
-  // Create the main install rules first.
-  this->cmInstallGenerator::GenerateScriptConfigs(os, indent);
-
-  // Now create a configuration-specific install rule for the import
-  // file of each configuration.
-  std::vector<std::string> files;
-  for (auto const& pair : this->EFGen->GetConfigImportFiles()) {
-    files.push_back(pair.second);
-    std::string config_test = this->CreateConfigTest(pair.first);
-    os << indent << "if(" << config_test << ")\n";
-    this->AddInstallRule(os, this->Destination, cmInstallType_FILES, files,
-                         false, this->FilePermissions.c_str(), nullptr,
-                         nullptr, nullptr, indent.Next());
-    os << indent << "endif()\n";
-    files.clear();
-  }
-}
-
-void cmInstallExportAndroidMKGenerator::GenerateScriptActions(
-  std::ostream& os, Indent const& indent)
-{
-  // Remove old per-configuration export files if the main changes.
-  std::string installedDir =
-    cmStrCat("$ENV{DESTDIR}",
-             this->ConvertToAbsoluteDestination(this->Destination), '/');
-  std::string installedFile = cmStrCat(installedDir, this->FileName);
-  os << indent << "if(EXISTS \"" << installedFile << "\")\n";
-  Indent indentN = indent.Next();
-  Indent indentNN = indentN.Next();
-  Indent indentNNN = indentNN.Next();
-  /* clang-format off */
-  os << indentN << "file(DIFFERENT EXPORT_FILE_CHANGED FILES\n"
-     << indentN << "     \"" << installedFile << "\"\n"
-     << indentN << "     \"" << this->MainImportFile << "\")\n";
-  os << indentN << "if(EXPORT_FILE_CHANGED)\n";
-  os << indentNN << "file(GLOB OLD_CONFIG_FILES \"" << installedDir
-     << this->EFGen->GetConfigImportFileGlob() << "\")\n";
-  os << indentNN << "if(OLD_CONFIG_FILES)\n";
-  os << indentNNN << "message(STATUS \"Old export file \\\"" << installedFile
-     << "\\\" will be replaced.  Removing files [${OLD_CONFIG_FILES}].\")\n";
-  os << indentNNN << "file(REMOVE ${OLD_CONFIG_FILES})\n";
-  os << indentNN << "endif()\n";
-  os << indentN << "endif()\n";
-  os << indent << "endif()\n";
-  /* clang-format on */
-
-  // Install the main export file.
-  std::vector<std::string> files;
-  files.push_back(this->MainImportFile);
-  this->AddInstallRule(os, this->Destination, cmInstallType_FILES, files,
-                       false, this->FilePermissions.c_str(), nullptr, nullptr,
-                       nullptr, indent);
-}
diff --git a/Source/cmInstallExportAndroidMKGenerator.h b/Source/cmInstallExportAndroidMKGenerator.h
deleted file mode 100644
index a92ff27..0000000
--- a/Source/cmInstallExportAndroidMKGenerator.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
-   file Copyright.txt or https://cmake.org/licensing for details.  */
-#ifndef cmInstallExportAndroidMKGenerator_h
-#define cmInstallExportAndroidMKGenerator_h
-
-#include "cmInstallExportGenerator.h"
-
-class cmExportInstallFileGenerator;
-class cmInstallFilesGenerator;
-class cmInstallTargetGenerator;
-class cmExportSet;
-class cmMakefile;
-
-/** \class cmInstallExportAndroidMKGenerator
- * \brief Generate rules for creating an export files.
- */
-class cmInstallExportAndroidMKGenerator : public cmInstallExportGenerator
-{
-public:
-  cmInstallExportAndroidMKGenerator(
-    cmExportSet* exportSet, const char* dest, const char* file_permissions,
-    const std::vector<std::string>& configurations, const char* component,
-    MessageLevel message, bool exclude_from_all, const char* filename,
-    const char* name_space, bool exportOld);
-  ~cmInstallExportAndroidMKGenerator();
-
-  bool Compute(cmLocalGenerator* lg) override;
-
-protected:
-  virtual void GenerateScript(std::ostream& os);
-  virtual void GenerateScriptConfigs(std::ostream& os, Indent const& indent);
-  virtual void GenerateScriptActions(std::ostream& os, Indent const& indent);
-  void GenerateImportFile(cmExportSet const* exportSet);
-  void GenerateImportFile(const char* config, cmExportSet const* exportSet);
-};
-
-#endif

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5d28e361b709a781a131cb9d9da73f04484eff54
commit 5d28e361b709a781a131cb9d9da73f04484eff54
Author:     Daniel Eiband <daniel.eiband at brainlab.com>
AuthorDate: Thu Sep 12 23:20:13 2019 +0200
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Fri Sep 13 11:00:21 2019 -0400

    add_custom_command: Move append functionality into class cmMakefile

diff --git a/Source/cmAddCustomCommandCommand.cxx b/Source/cmAddCustomCommandCommand.cxx
index 2a0db45..90317bd 100644
--- a/Source/cmAddCustomCommandCommand.cxx
+++ b/Source/cmAddCustomCommandCommand.cxx
@@ -13,7 +13,6 @@
 #include "cmMakefile.h"
 #include "cmMessageType.h"
 #include "cmPolicies.h"
-#include "cmSourceFile.h"
 #include "cmStringAlgorithms.h"
 #include "cmSystemTools.h"
 #include "cmTarget.h"
@@ -317,14 +316,9 @@ bool cmAddCustomCommandCommand(std::vector<std::string> const& args,
 
   // Check for an append request.
   if (append) {
-    // Lookup an existing command.
-    if (cmSourceFile* sf = mf.GetSourceFileWithOutput(output[0])) {
-      if (cmCustomCommand* cc = sf->GetCustomCommand()) {
-        cc->AppendCommands(commandLines);
-        cc->AppendDepends(depends);
-        cc->AppendImplicitDepends(implicit_depends);
-        return true;
-      }
+    if (mf.AppendCustomCommandToOutput(output[0], depends, implicit_depends,
+                                       commandLines)) {
+      return true;
     }
 
     // No command for this output exists.
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index ec2e646..000d84b 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -1111,6 +1111,23 @@ void cmMakefile::AddCustomCommandOldStyle(
   }
 }
 
+bool cmMakefile::AppendCustomCommandToOutput(
+  const std::string& output, const std::vector<std::string>& depends,
+  const cmImplicitDependsList& implicit_depends,
+  const cmCustomCommandLines& commandLines)
+{
+  // Lookup an existing command.
+  if (cmSourceFile* sf = this->GetSourceFileWithOutput(output)) {
+    if (cmCustomCommand* cc = sf->GetCustomCommand()) {
+      cc->AppendCommands(commandLines);
+      cc->AppendDepends(depends);
+      cc->AppendImplicitDepends(implicit_depends);
+      return true;
+    }
+  }
+  return false;
+}
+
 cmTarget* cmMakefile::AddUtilityCommand(
   const std::string& utilityName, TargetOrigin origin, bool excludeFromAll,
   const std::vector<std::string>& depends, const char* workingDirectory,
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index f9031c1..8671bd7 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -185,6 +185,10 @@ public:
                                 const std::string& source,
                                 const cmCustomCommandLines& commandLines,
                                 const char* comment);
+  bool AppendCustomCommandToOutput(
+    const std::string& output, const std::vector<std::string>& depends,
+    const cmImplicitDependsList& implicit_depends,
+    const cmCustomCommandLines& commandLines);
 
   /**
    * Add a define flag to the build.

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c16641607fcf85206b3faf67ae1e1bab173bf44d
commit c16641607fcf85206b3faf67ae1e1bab173bf44d
Author:     Sebastian Lipponer <mail at sebastianlipponer.de>
AuthorDate: Fri Sep 6 22:33:47 2019 +0200
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Fri Sep 13 10:56:26 2019 -0400

    add_custom_command: Delay slash conversion until after genex evaluation
    
    Generator expressions may contain or produce backslashes.
    
    Fixes: #19553

diff --git a/Source/cmAddCustomCommandCommand.cxx b/Source/cmAddCustomCommandCommand.cxx
index d2330e1..d7afb57 100644
--- a/Source/cmAddCustomCommandCommand.cxx
+++ b/Source/cmAddCustomCommandCommand.cxx
@@ -4,7 +4,6 @@
 
 #include <sstream>
 #include <unordered_set>
-#include <utility>
 
 #include "cmCustomCommand.h"
 #include "cmCustomCommandLines.h"
@@ -248,6 +247,8 @@ bool cmAddCustomCommandCommand(std::vector<std::string> const& args,
           // An implicit dependency starting point is also an
           // explicit dependency.
           std::string dep = copy;
+          // Upfront path conversion is correct because Genex
+          // are not supported.
           cmSystemTools::ConvertToUnixSlashes(dep);
           depends.push_back(dep);
 
@@ -264,9 +265,7 @@ bool cmAddCustomCommandCommand(std::vector<std::string> const& args,
           target = copy;
           break;
         case doing_depends: {
-          std::string dep = copy;
-          cmSystemTools::ConvertToUnixSlashes(dep);
-          depends.push_back(std::move(dep));
+          depends.push_back(copy);
         } break;
         case doing_outputs:
           outputs.push_back(filename);
diff --git a/Source/cmCustomCommandGenerator.cxx b/Source/cmCustomCommandGenerator.cxx
index 82cc037..6a4125b 100644
--- a/Source/cmCustomCommandGenerator.cxx
+++ b/Source/cmCustomCommandGenerator.cxx
@@ -58,6 +58,7 @@ cmCustomCommandGenerator::cmCustomCommandGenerator(cmCustomCommand const& cc,
     std::vector<std::string> result =
       cmExpandedList(cge->Evaluate(this->LG, this->Config));
     for (std::string& it : result) {
+      cmSystemTools::ConvertToUnixSlashes(it);
       if (cmSystemTools::FileIsFullPath(it)) {
         it = cmSystemTools::CollapseFullPath(it);
       }
diff --git a/Tests/GeneratorExpression/CMakeLists.txt b/Tests/GeneratorExpression/CMakeLists.txt
index 3ff2b85..9d51342 100644
--- a/Tests/GeneratorExpression/CMakeLists.txt
+++ b/Tests/GeneratorExpression/CMakeLists.txt
@@ -86,7 +86,7 @@ add_custom_target(check-part1 ALL
     -Dtest_colons_4=$<1:C:\\CMake>
     -Dtest_colons_5=$<1:C:/CMake>
     -P ${CMAKE_CURRENT_SOURCE_DIR}/check-part1.cmake
-  COMMAND ${CMAKE_COMMAND} -E echo "check done (part 1 of 4)"
+  COMMAND ${CMAKE_COMMAND} -E echo "check done (part 1 of 5)"
   VERBATIM
   )
 
@@ -157,7 +157,7 @@ add_custom_target(check-part2 ALL
     -Dtest_arbitrary_content_comma_9=$<1:a,,b,,>
     -Dtest_arbitrary_content_comma_10=$<1:,,a,,b,,>
     -P ${CMAKE_CURRENT_SOURCE_DIR}/check-part2.cmake
-  COMMAND ${CMAKE_COMMAND} -E echo "check done (part 2 of 4)"
+  COMMAND ${CMAKE_COMMAND} -E echo "check done (part 2 of 5)"
   VERBATIM
 )
 
@@ -251,7 +251,7 @@ add_custom_target(check-part3 ALL
     -Dequal22=$<EQUAL:10,-012>
     -Dequal23=$<EQUAL:-10,-012>
     -P ${CMAKE_CURRENT_SOURCE_DIR}/check-part3.cmake
-  COMMAND ${CMAKE_COMMAND} -E echo "check done (part 3 of 4)"
+  COMMAND ${CMAKE_COMMAND} -E echo "check done (part 3 of 5)"
   VERBATIM
   )
 
@@ -277,7 +277,27 @@ add_custom_target(check-part4 ALL
     -DWIN32=${WIN32}
     -DCMAKE_GENERATOR=${CMAKE_GENERATOR}
     -P ${CMAKE_CURRENT_SOURCE_DIR}/check-part4.cmake
-  COMMAND ${CMAKE_COMMAND} -E echo "check done (part 4 of 4)"
+  COMMAND ${CMAKE_COMMAND} -E echo "check done (part 4 of 5)"
+  VERBATIM
+  )
+
+add_custom_target(check-part5 ALL
+  COMMAND ${CMAKE_COMMAND} -E echo "check done (part 5 of 5)"
+  DEPENDS check-part5.stamp
+  VERBATIM
+  )
+
+add_custom_command(
+  OUTPUT check-part5.stamp
+  DEPENDS $<FILTER:file.foo.bar,EXCLUDE,\\.foo\\.bar$>
+  COMMAND ${CMAKE_COMMAND} -E sleep 0
+  VERBATIM
+  )
+set_property(SOURCE check-part5.stamp PROPERTY SYMBOLIC 1)
+
+add_custom_command(
+  OUTPUT file.foo.bar
+  COMMAND ${CMAKE_COMMAND} -P check-part5.cmake
   VERBATIM
   )
 
diff --git a/Tests/GeneratorExpression/check-part5.cmake b/Tests/GeneratorExpression/check-part5.cmake
new file mode 100644
index 0000000..77d1387
--- /dev/null
+++ b/Tests/GeneratorExpression/check-part5.cmake
@@ -0,0 +1 @@
+message(SEND_ERROR "$<FILTER:file.foo.bar,EXCLUDE,\\.foo\\.bar$> genex in DEPENDS argument of 'add_custom_command()' is not empty")

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4fb29850ad325b70fb412d4fd596c0a0d627ae8b
commit 4fb29850ad325b70fb412d4fd596c0a0d627ae8b
Author:     Daniel Eiband <daniel.eiband at brainlab.com>
AuthorDate: Thu Sep 12 23:00:36 2019 +0200
Commit:     Daniel Eiband <daniel.eiband at brainlab.com>
CommitDate: Thu Sep 12 23:00:36 2019 +0200

    add_custom_command: Refactor setting implicit depends
    
    Implicit dependencies are now passed as argument to AddCustomCommandToOutput.
    This is necessary to be able to delay custom command creation.

diff --git a/Source/cmAddCustomCommandCommand.cxx b/Source/cmAddCustomCommandCommand.cxx
index d2330e1..2a0db45 100644
--- a/Source/cmAddCustomCommandCommand.cxx
+++ b/Source/cmAddCustomCommandCommand.cxx
@@ -51,7 +51,7 @@ bool cmAddCustomCommandCommand(std::vector<std::string> const& args,
   bool uses_terminal = false;
   bool command_expand_lists = false;
   std::string implicit_depends_lang;
-  cmCustomCommand::ImplicitDependsList implicit_depends;
+  cmImplicitDependsList implicit_depends;
 
   // Accumulate one command line at a time.
   cmCustomCommandLine currentLine;
@@ -351,28 +351,10 @@ bool cmAddCustomCommandCommand(std::vector<std::string> const& args,
                                 job_pool, command_expand_lists);
   } else if (target.empty()) {
     // Target is empty, use the output.
-    mf.AddCustomCommandToOutput(output, byproducts, depends, main_dependency,
-                                commandLines, comment, working.c_str(), false,
-                                escapeOldStyle, uses_terminal,
-                                command_expand_lists, depfile, job_pool);
-
-    // Add implicit dependency scanning requests if any were given.
-    if (!implicit_depends.empty()) {
-      bool okay = false;
-      if (cmSourceFile* sf = mf.GetSourceFileWithOutput(output[0])) {
-        if (cmCustomCommand* cc = sf->GetCustomCommand()) {
-          okay = true;
-          cc->SetImplicitDepends(implicit_depends);
-        }
-      }
-      if (!okay) {
-        std::ostringstream e;
-        e << "could not locate source file with a custom command producing \""
-          << output[0] << "\" even though this command tried to create it!";
-        status.SetError(e.str());
-        return false;
-      }
-    }
+    mf.AddCustomCommandToOutput(
+      output, byproducts, depends, main_dependency, implicit_depends,
+      commandLines, comment, working.c_str(), false, escapeOldStyle,
+      uses_terminal, command_expand_lists, depfile, job_pool);
   } else if (!byproducts.empty()) {
     status.SetError("BYPRODUCTS may not be specified with SOURCE signatures");
     return false;
diff --git a/Source/cmCustomCommand.cxx b/Source/cmCustomCommand.cxx
index 7402eeb..fc6718d 100644
--- a/Source/cmCustomCommand.cxx
+++ b/Source/cmCustomCommand.cxx
@@ -88,18 +88,17 @@ cmListFileBacktrace const& cmCustomCommand::GetBacktrace() const
   return this->Backtrace;
 }
 
-cmCustomCommand::ImplicitDependsList const&
-cmCustomCommand::GetImplicitDepends() const
+cmImplicitDependsList const& cmCustomCommand::GetImplicitDepends() const
 {
   return this->ImplicitDepends;
 }
 
-void cmCustomCommand::SetImplicitDepends(ImplicitDependsList const& l)
+void cmCustomCommand::SetImplicitDepends(cmImplicitDependsList const& l)
 {
   this->ImplicitDepends = l;
 }
 
-void cmCustomCommand::AppendImplicitDepends(ImplicitDependsList const& l)
+void cmCustomCommand::AppendImplicitDepends(cmImplicitDependsList const& l)
 {
   cmAppend(this->ImplicitDepends, l);
 }
diff --git a/Source/cmCustomCommand.h b/Source/cmCustomCommand.h
index 102b178..bb5a0ed 100644
--- a/Source/cmCustomCommand.h
+++ b/Source/cmCustomCommand.h
@@ -14,6 +14,11 @@
 
 class cmMakefile;
 
+class cmImplicitDependsList
+  : public std::vector<std::pair<std::string, std::string>>
+{
+};
+
 /** \class cmCustomCommand
  * \brief A class to encapsulate a custom command
  *
@@ -68,13 +73,9 @@ public:
   /** Backtrace of the command that created this custom command.  */
   cmListFileBacktrace const& GetBacktrace() const;
 
-  using ImplicitDependsPair = std::pair<std::string, std::string>;
-  class ImplicitDependsList : public std::vector<ImplicitDependsPair>
-  {
-  };
-  void SetImplicitDepends(ImplicitDependsList const&);
-  void AppendImplicitDepends(ImplicitDependsList const&);
-  ImplicitDependsList const& GetImplicitDepends() const;
+  void SetImplicitDepends(cmImplicitDependsList const&);
+  void AppendImplicitDepends(cmImplicitDependsList const&);
+  cmImplicitDependsList const& GetImplicitDepends() const;
 
   /** Set/Get whether this custom command should be given access to the
       real console (if possible).  */
@@ -99,7 +100,7 @@ private:
   std::vector<std::string> Depends;
   cmCustomCommandLines CommandLines;
   cmListFileBacktrace Backtrace;
-  ImplicitDependsList ImplicitDepends;
+  cmImplicitDependsList ImplicitDepends;
   std::string Comment;
   std::string WorkingDirectory;
   std::string Depfile;
diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx
index 5e60108..18ff9ac 100644
--- a/Source/cmGlobalVisualStudio8Generator.cxx
+++ b/Source/cmGlobalVisualStudio8Generator.cxx
@@ -2,6 +2,7 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmGlobalVisualStudio8Generator.h"
 
+#include "cmCustomCommand.h"
 #include "cmDocumentationEntry.h"
 #include "cmGeneratedFileStream.h"
 #include "cmGeneratorExpression.h"
@@ -191,11 +192,13 @@ bool cmGlobalVisualStudio8Generator::AddCheckTarget()
     // file as the main dependency because it would get
     // overwritten by the CreateVCProjBuildRule.
     // (this could be avoided with per-target source files)
-    std::string no_main_dependency;
     std::vector<std::string> no_byproducts;
+    std::string no_main_dependency;
+    cmImplicitDependsList no_implicit_depends;
     if (cmSourceFile* file = mf->AddCustomCommandToOutput(
-          stamps, no_byproducts, listFiles, no_main_dependency, commandLines,
-          "Checking Build System", no_working_directory, true, false)) {
+          stamps, no_byproducts, listFiles, no_main_dependency,
+          no_implicit_depends, commandLines, "Checking Build System",
+          no_working_directory, true, false)) {
       gt->AddSource(file->ResolveFullPath());
     } else {
       cmSystemTools::Error("Error adding rule for " + stamps[0]);
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 16cc453..ec2e646 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -914,6 +914,7 @@ cmSourceFile* cmMakefile::AddCustomCommandToOutput(
   const std::vector<std::string>& outputs,
   const std::vector<std::string>& byproducts,
   const std::vector<std::string>& depends, const std::string& main_dependency,
+  const cmImplicitDependsList& implicit_depends,
   const cmCustomCommandLines& commandLines, const char* comment,
   const char* workingDir, bool replace, bool escapeOldStyle,
   bool uses_terminal, bool command_expand_lists, const std::string& depfile,
@@ -998,6 +999,7 @@ cmSourceFile* cmMakefile::AddCustomCommandToOutput(
       this, outputs, byproducts, depends2, commandLines, comment, workingDir);
     cc->SetEscapeOldStyle(escapeOldStyle);
     cc->SetEscapeAllowMakeVars(true);
+    cc->SetImplicitDepends(implicit_depends);
     cc->SetUsesTerminal(uses_terminal);
     cc->SetCommandExpandLists(command_expand_lists);
     cc->SetDepfile(depfile);
@@ -1044,10 +1046,11 @@ cmSourceFile* cmMakefile::AddCustomCommandToOutput(
   std::vector<std::string> outputs;
   outputs.push_back(output);
   std::vector<std::string> no_byproducts;
+  cmImplicitDependsList no_implicit_depends;
   return this->AddCustomCommandToOutput(
-    outputs, no_byproducts, depends, main_dependency, commandLines, comment,
-    workingDir, replace, escapeOldStyle, uses_terminal, command_expand_lists,
-    depfile, job_pool);
+    outputs, no_byproducts, depends, main_dependency, no_implicit_depends,
+    commandLines, comment, workingDir, replace, escapeOldStyle, uses_terminal,
+    command_expand_lists, depfile, job_pool);
 }
 
 void cmMakefile::AddCustomCommandOldStyle(
@@ -1181,11 +1184,12 @@ cmTarget* cmMakefile::AddUtilityCommand(
     std::vector<std::string> forced;
     forced.push_back(force);
     std::string no_main_dependency;
+    cmImplicitDependsList no_implicit_depends;
     bool no_replace = false;
     this->AddCustomCommandToOutput(
-      forced, byproducts, depends, no_main_dependency, commandLines, comment,
-      workingDirectory, no_replace, escapeOldStyle, uses_terminal,
-      command_expand_lists, /*depfile=*/"", job_pool);
+      forced, byproducts, depends, no_main_dependency, no_implicit_depends,
+      commandLines, comment, workingDirectory, no_replace, escapeOldStyle,
+      uses_terminal, command_expand_lists, /*depfile=*/"", job_pool);
     cmSourceFile* sf = target->AddSourceCMP0049(force);
 
     // The output is not actually created so mark it symbolic.
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 52464d6..f9031c1 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -42,6 +42,7 @@ class cmExportBuildFileGenerator;
 class cmFunctionBlocker;
 class cmGeneratorExpressionEvaluationFile;
 class cmGlobalGenerator;
+class cmImplicitDependsList;
 class cmInstallGenerator;
 class cmMessenger;
 class cmSourceFile;
@@ -166,6 +167,7 @@ public:
     const std::vector<std::string>& byproducts,
     const std::vector<std::string>& depends,
     const std::string& main_dependency,
+    const cmImplicitDependsList& implicit_depends,
     const cmCustomCommandLines& commandLines, const char* comment,
     const char* workingDir, bool replace = false, bool escapeOldStyle = true,
     bool uses_terminal = false, bool command_expand_lists = false,
diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx
index d6916b0..54304c3 100644
--- a/Source/cmQtAutoGenInitializer.cxx
+++ b/Source/cmQtAutoGenInitializer.cxx
@@ -1166,10 +1166,12 @@ bool cmQtAutoGenInitializer::InitRccTargets()
         if (!this->Rcc.ExecutableTargetName.empty()) {
           ccDepends.push_back(this->Rcc.ExecutableTargetName);
         }
-        makefile->AddCustomCommandToOutput(ccOutput, ccByproducts, ccDepends,
-                                           /*main_dependency*/ std::string(),
-                                           commandLines, ccComment.c_str(),
-                                           this->Dir.Work.c_str());
+        std::string no_main_dependency;
+        cmImplicitDependsList no_implicit_depends;
+        makefile->AddCustomCommandToOutput(
+          ccOutput, ccByproducts, ccDepends, no_main_dependency,
+          no_implicit_depends, commandLines, ccComment.c_str(),
+          this->Dir.Work.c_str());
       }
       // Reconfigure when .qrc file changes
       makefile->AddCMakeDependFile(qrc.QrcFile);

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

Summary of changes:
 Source/cmAddCustomCommandCommand.cxx         |  47 +++-------
 Source/cmCustomCommand.cxx                   |   7 +-
 Source/cmCustomCommand.h                     |  17 ++--
 Source/cmCustomCommandGenerator.cxx          |   1 +
 Source/cmGlobalVisualStudio8Generator.cxx    |   9 +-
 Source/cmInstallExportAndroidMKGenerator.cxx | 134 ---------------------------
 Source/cmInstallExportAndroidMKGenerator.h   |  37 --------
 Source/cmMakefile.cxx                        |  33 +++++--
 Source/cmMakefile.h                          |   6 ++
 Source/cmQtAutoGenInitializer.cxx            |  10 +-
 Tests/GeneratorExpression/CMakeLists.txt     |  28 +++++-
 Tests/GeneratorExpression/check-part5.cmake  |   1 +
 12 files changed, 94 insertions(+), 236 deletions(-)
 delete mode 100644 Source/cmInstallExportAndroidMKGenerator.cxx
 delete mode 100644 Source/cmInstallExportAndroidMKGenerator.h
 create mode 100644 Tests/GeneratorExpression/check-part5.cmake


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list