[Cmake-commits] CMake branch, master, updated. v3.13.0-rc2-231-gd697f4e

Kitware Robot kwrobot at kitware.com
Mon Oct 29 10:05: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  d697f4eb489ee42a08f2a15efffe55e1c29860b7 (commit)
       via  d6b7c037b2e360c7b3f3e6952ddc108746274b05 (commit)
       via  bcd61da3503be85d247657827e5fb08db3ecf07d (commit)
       via  213433858f6962be8709b4e3b9332ce1a103b54b (commit)
       via  a4e9391953b9906b085cbc1c6d6909d049e540dd (commit)
       via  50c4dec07267c8678302b0c4cf0c89a5a02b1d6b (commit)
      from  f0a9094d809a80ef754642b13d7b66a90b61cee7 (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=d697f4eb489ee42a08f2a15efffe55e1c29860b7
commit d697f4eb489ee42a08f2a15efffe55e1c29860b7
Merge: d6b7c03 2134338
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Oct 29 13:57:52 2018 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Mon Oct 29 09:58:00 2018 -0400

    Merge topic 'target_property-clarification'
    
    213433858f Help: Clarify usage of TARGET_PROPERTY generator expression
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !2535


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d6b7c037b2e360c7b3f3e6952ddc108746274b05
commit d6b7c037b2e360c7b3f3e6952ddc108746274b05
Merge: bcd61da a4e9391
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Oct 29 13:57:10 2018 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Mon Oct 29 09:57:17 2018 -0400

    Merge topic 'ExternalProject-log-patch'
    
    a4e9391953 ExternalProject: add LOG_PATCH option to log the patch command
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !2534


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bcd61da3503be85d247657827e5fb08db3ecf07d
commit bcd61da3503be85d247657827e5fb08db3ecf07d
Merge: f0a9094 50c4dec
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Oct 29 13:56:18 2018 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Mon Oct 29 09:56:25 2018 -0400

    Merge topic 'graphviz-fix-alias'
    
    50c4dec072 graphviz: dereference ALIAS targets
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !2521


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=213433858f6962be8709b4e3b9332ce1a103b54b
commit 213433858f6962be8709b4e3b9332ce1a103b54b
Author:     Kyle Edwards <kyle.edwards at kitware.com>
AuthorDate: Fri Oct 26 11:55:34 2018 -0400
Commit:     Kyle Edwards <kyle.edwards at kitware.com>
CommitDate: Fri Oct 26 14:43:17 2018 -0400

    Help: Clarify usage of TARGET_PROPERTY generator expression
    
    When using $<TARGET_PROPERTY:prop>, the value of prop comes from
    the consuming target rather than the current target. Add a note to
    clarify this.

diff --git a/Help/manual/cmake-generator-expressions.7.rst b/Help/manual/cmake-generator-expressions.7.rst
index 0826ce0..bddf827 100644
--- a/Help/manual/cmake-generator-expressions.7.rst
+++ b/Help/manual/cmake-generator-expressions.7.rst
@@ -238,7 +238,10 @@ Available informational expressions are:
   expression is evaluated on.
 ``$<TARGET_PROPERTY:prop>``
   Value of the property ``prop`` on the target on which the generator
-  expression is evaluated.
+  expression is evaluated. Note that for generator expressions in
+  :ref:`Target Usage Requirements` this is the value of the property
+  on the consuming target rather than the target specifying the
+  requirement.
 ``$<INSTALL_PREFIX>``
   Content of the install prefix when the target is exported via
   :command:`install(EXPORT)` and empty otherwise.

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a4e9391953b9906b085cbc1c6d6909d049e540dd
commit a4e9391953b9906b085cbc1c6d6909d049e540dd
Author:     Wouter Klouwen <wouter.klouwen at youview.com>
AuthorDate: Fri Oct 26 12:44:14 2018 +0100
Commit:     Wouter Klouwen <wouter.klouwen at youview.com>
CommitDate: Fri Oct 26 16:50:23 2018 +0100

    ExternalProject: add LOG_PATCH option to log the patch command
    
    Most steps support the logging into a file but the patch command is a
    notable exception. This commit adds the LOG_PATCH options that acts as
    the other LOG_* options.

diff --git a/Auxiliary/vim/syntax/cmake.vim b/Auxiliary/vim/syntax/cmake.vim
index 25384e4..d4d0edf 100644
--- a/Auxiliary/vim/syntax/cmake.vim
+++ b/Auxiliary/vim/syntax/cmake.vim
@@ -877,6 +877,7 @@ syn keyword cmakeKWExternalProject contained
             \ LOG_DOWNLOAD
             \ LOG_INSTALL
             \ LOG_MERGED_STDOUTERR
+            \ LOG_PATCH
             \ LOG_TEST
             \ LOG_UPDATE
             \ MAKE_EXE
diff --git a/Help/release/dev/ExternalProject-log-options.rst b/Help/release/dev/ExternalProject-log-options.rst
index 2fc4c4f..88bc799 100644
--- a/Help/release/dev/ExternalProject-log-options.rst
+++ b/Help/release/dev/ExternalProject-log-options.rst
@@ -3,3 +3,6 @@ ExternalProject-log-options
 
 * The :module:`ExternalProject` module :command:`ExternalProject_Add` command
   gained ``LOG_DIR`` and ``LOG_MERGED_STDOUTERR`` options to control logging.
+
+* The :module:`ExternalProject` module :command:`ExternalProject_Add` command
+  gained ``LOG_PATCH`` to optionally log the patch step.
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index a8c31ed..93cd74a 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -532,6 +532,9 @@ External Project Definition
     ``LOG_UPDATE <bool>``
       When enabled, the output of the update step is logged to files.
 
+    ``LOG_PATCH <bool>``
+      When enabled, the output of the patch step is logged to files.
+
     ``LOG_CONFIGURE <bool>``
       When enabled, the output of the configure step is logged to files.
 
@@ -2760,10 +2763,18 @@ function(_ep_add_patch_command name)
     set(work_dir ${source_dir})
   endif()
 
+  get_property(log TARGET ${name} PROPERTY _EP_LOG_PATCH)
+  if(log)
+    set(log LOG 1)
+  else()
+    set(log "")
+  endif()
+
   ExternalProject_Add_Step(${name} patch
     COMMAND ${cmd}
     WORKING_DIRECTORY ${work_dir}
     DEPENDEES download
+    ${log}
     )
 endfunction()
 
diff --git a/Tests/ExternalProjectLocal/CMakeLists.txt b/Tests/ExternalProjectLocal/CMakeLists.txt
index 5b94163..55fd713 100644
--- a/Tests/ExternalProjectLocal/CMakeLists.txt
+++ b/Tests/ExternalProjectLocal/CMakeLists.txt
@@ -100,6 +100,7 @@ ExternalProject_Add(${proj}
              -DTEST_LIST:STRING=A::B::C
   INSTALL_COMMAND ""
   LOG_CONFIGURE 1
+  LOG_PATCH 1
 )
 set_property(TARGET ${proj} PROPERTY FOLDER "Local/TAR")
 

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=50c4dec07267c8678302b0c4cf0c89a5a02b1d6b
commit 50c4dec07267c8678302b0c4cf0c89a5a02b1d6b
Author:     Nick Schultz <nickker22 at gmail.com>
AuthorDate: Wed Oct 24 18:49:12 2018 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Fri Oct 26 11:17:49 2018 -0400

    graphviz: dereference ALIAS targets
    
    Previous behavior treats ALIAS targets as external targets.
    This fix de-aliases these targets to their pointed target.
    
    Fixes: #15636

diff --git a/Source/cmGraphVizWriter.cxx b/Source/cmGraphVizWriter.cxx
index fcdf03f..754fa7d 100644
--- a/Source/cmGraphVizWriter.cxx
+++ b/Source/cmGraphVizWriter.cxx
@@ -68,7 +68,7 @@ const char* getShapeForTarget(const cmGeneratorTarget* target)
 }
 
 std::map<std::string, LinkLibraryScopeType> getScopedLinkLibrariesFromTarget(
-  cmTarget* Target)
+  cmTarget* Target, const cmGlobalGenerator* globalGenerator)
 {
   char sep = ';';
   std::map<std::string, LinkLibraryScopeType> tokens;
@@ -95,6 +95,13 @@ std::map<std::string, LinkLibraryScopeType> getScopedLinkLibrariesFromTarget(
     }
 
     std::string element = interfaceLinkLibraries.substr(start, end - start);
+    if (globalGenerator->IsAlias(element)) {
+      const auto tgt = globalGenerator->FindTarget(element);
+      if (tgt) {
+        element = tgt->GetName();
+      }
+    }
+
     if (std::string::npos == element.find("$<LINK_ONLY:", 0)) {
       // we assume first, that this library is an interface library.
       // if we find it again in the linklibraries property, we promote it to an
@@ -116,6 +123,12 @@ std::map<std::string, LinkLibraryScopeType> getScopedLinkLibrariesFromTarget(
     }
 
     std::string element = linkLibraries.substr(start, end - start);
+    if (globalGenerator->IsAlias(element)) {
+      const auto tgt = globalGenerator->FindTarget(element);
+      if (tgt) {
+        element = tgt->GetName();
+      }
+    }
 
     if (tokens.find(element) == tokens.end()) {
       // this library is not found in interfaceLinkLibraries but in
@@ -137,13 +150,13 @@ std::map<std::string, LinkLibraryScopeType> getScopedLinkLibrariesFromTarget(
 }
 }
 
-cmGraphVizWriter::cmGraphVizWriter(
-  const std::vector<cmLocalGenerator*>& localGenerators)
+cmGraphVizWriter::cmGraphVizWriter(const cmGlobalGenerator* globalGenerator)
   : GraphType("digraph")
   , GraphName("GG")
   , GraphHeader("node [\n  fontsize = \"12\"\n];")
   , GraphNodePrefix("node")
-  , LocalGenerators(localGenerators)
+  , GlobalGenerator(globalGenerator)
+  , LocalGenerators(globalGenerator->GetLocalGenerators())
   , GenerateForExecutables(true)
   , GenerateForStaticLibs(true)
   , GenerateForSharedLibs(true)
@@ -374,7 +387,8 @@ void cmGraphVizWriter::WriteConnections(
 
   std::string myNodeName = this->TargetNamesNodes.find(targetName)->second;
   std::map<std::string, LinkLibraryScopeType> ll =
-    getScopedLinkLibrariesFromTarget(targetPtrIt->second->Target);
+    getScopedLinkLibrariesFromTarget(targetPtrIt->second->Target,
+                                     GlobalGenerator);
 
   for (auto const& llit : ll) {
     const char* libName = llit.first.c_str();
@@ -439,7 +453,7 @@ void cmGraphVizWriter::WriteDependerConnections(
     // Now we have a target, check whether it links against targetName.
     // If so, draw a connection, and then continue with dependers on that one.
     std::map<std::string, LinkLibraryScopeType> ll =
-      getScopedLinkLibrariesFromTarget(tptr.second->Target);
+      getScopedLinkLibrariesFromTarget(tptr.second->Target, GlobalGenerator);
 
     for (auto const& llit : ll) {
       if (llit.first == targetName) {
@@ -540,6 +554,13 @@ int cmGraphVizWriter::CollectAllExternalLibs(int cnt)
           continue;
         }
 
+        if (GlobalGenerator->IsAlias(libName)) {
+          const auto tgt = GlobalGenerator->FindTarget(libName);
+          if (tgt) {
+            libName = tgt->GetName().c_str();
+          }
+        }
+
         std::map<std::string, const cmGeneratorTarget*>::const_iterator tarIt =
           this->TargetPtrs.find(libName);
         if (tarIt == this->TargetPtrs.end()) {
diff --git a/Source/cmGraphVizWriter.h b/Source/cmGraphVizWriter.h
index ac20da9..ed242f0 100644
--- a/Source/cmGraphVizWriter.h
+++ b/Source/cmGraphVizWriter.h
@@ -16,13 +16,14 @@
 class cmGeneratedFileStream;
 class cmGeneratorTarget;
 class cmLocalGenerator;
+class cmGlobalGenerator;
 
 /** This class implements writing files for graphviz (dot) for graphs
  * representing the dependencies between the targets in the project. */
 class cmGraphVizWriter
 {
 public:
-  cmGraphVizWriter(const std::vector<cmLocalGenerator*>& localGenerators);
+  cmGraphVizWriter(const cmGlobalGenerator* globalGenerator);
 
   void ReadSettings(const char* settingsFileName,
                     const char* fallbackSettingsFileName);
@@ -69,6 +70,7 @@ protected:
 
   std::vector<cmsys::RegularExpression> TargetsToIgnoreRegex;
 
+  const cmGlobalGenerator* GlobalGenerator;
   const std::vector<cmLocalGenerator*>& LocalGenerators;
 
   std::map<std::string, const cmGeneratorTarget*> TargetPtrs;
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 889a5fb..ab0b5cf 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -2128,7 +2128,7 @@ void cmake::MarkCliAsUsed(const std::string& variable)
 void cmake::GenerateGraphViz(const char* fileName) const
 {
 #ifdef CMAKE_BUILD_WITH_CMAKE
-  cmGraphVizWriter gvWriter(this->GetGlobalGenerator()->GetLocalGenerators());
+  cmGraphVizWriter gvWriter(this->GetGlobalGenerator());
 
   std::string settingsFile = this->GetHomeOutputDirectory();
   settingsFile += "/CMakeGraphVizOptions.cmake";

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

Summary of changes:
 Auxiliary/vim/syntax/cmake.vim                   |  1 +
 Help/manual/cmake-generator-expressions.7.rst    |  5 +++-
 Help/release/dev/ExternalProject-log-options.rst |  3 +++
 Modules/ExternalProject.cmake                    | 11 ++++++++
 Source/cmGraphVizWriter.cxx                      | 33 +++++++++++++++++++-----
 Source/cmGraphVizWriter.h                        |  4 ++-
 Source/cmake.cxx                                 |  2 +-
 Tests/ExternalProjectLocal/CMakeLists.txt        |  1 +
 8 files changed, 51 insertions(+), 9 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list