[Cmake-commits] CMake branch, master, updated. v3.14.0-rc4-326-g57d178b

Kitware Robot kwrobot at kitware.com
Tue Mar 12 10:03:06 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  57d178bbca7757792653f1a658423826c52b5730 (commit)
       via  5822a7bed289100b78a502e449b436da2fe67af1 (commit)
       via  05774d4b5845d0b7cbdd1985922b3351a4ebb39d (commit)
       via  463c2fba4eec7f364689a11b7c36afe966b1f151 (commit)
       via  21da25d2a878cfccf9496ef7b227de2c98601ef2 (commit)
      from  7358f317e356dff8ef2c1cdd216b9e6063cd4d9a (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=57d178bbca7757792653f1a658423826c52b5730
commit 57d178bbca7757792653f1a658423826c52b5730
Merge: 5822a7b 05774d4
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Mar 12 13:53:26 2019 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Tue Mar 12 09:54:23 2019 -0400

    Merge topic 'FindBoost-dyn-link'
    
    05774d4b58 FindBoost: always define BOOST_ALL_DYN_LINK for Boost::dynamic_linking
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !3083


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5822a7bed289100b78a502e449b436da2fe67af1
commit 5822a7bed289100b78a502e449b436da2fe67af1
Merge: 7358f31 463c2fb
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Mar 12 13:53:16 2019 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Tue Mar 12 09:53:27 2019 -0400

    Merge topic 'shell_path'
    
    463c2fba4e Genex: Teach SHELL_PATH to support a list of paths
    21da25d2a8 Tests: Generalize GeneratorExpression MSYS path conversion workaround
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !3057


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=05774d4b5845d0b7cbdd1985922b3351a4ebb39d
commit 05774d4b5845d0b7cbdd1985922b3351a4ebb39d
Author:     NeroBurner <pyro4hell at gmail.com>
AuthorDate: Mon Mar 11 03:48:20 2019 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Mar 11 13:24:51 2019 -0400

    FindBoost: always define BOOST_ALL_DYN_LINK for Boost::dynamic_linking
    
    The purpose of the `Boost::dynamic_linking` interface library is to
    cause `BOOST_ALL_DYN_LINK` to be defined.  Do this on all platforms
    instead of just Windows.
    
    In particular, using Boost::log trivial_logger requires to set
    BOOST_ALL_NO_LIB when Boost::Log is compiled as dynamic library.
    
    Fixes: #17813

diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake
index 7882c4b..6e7d3db 100644
--- a/Modules/FindBoost.cmake
+++ b/Modules/FindBoost.cmake
@@ -1201,6 +1201,8 @@ if(NOT TARGET Boost::diagnostic_definitions)
   add_library(Boost::diagnostic_definitions INTERFACE IMPORTED)
   add_library(Boost::disable_autolinking INTERFACE IMPORTED)
   add_library(Boost::dynamic_linking INTERFACE IMPORTED)
+  set_target_properties(Boost::dynamic_linking PROPERTIES
+    INTERFACE_COMPILE_DEFINITIONS "BOOST_ALL_DYN_LINK")
 endif()
 if(WIN32)
   # In windows, automatic linking is performed, so you do not have
@@ -1225,8 +1227,6 @@ if(WIN32)
     INTERFACE_COMPILE_DEFINITIONS "BOOST_LIB_DIAGNOSTIC")
   set_target_properties(Boost::disable_autolinking PROPERTIES
     INTERFACE_COMPILE_DEFINITIONS "BOOST_ALL_NO_LIB")
-  set_target_properties(Boost::dynamic_linking PROPERTIES
-    INTERFACE_COMPILE_DEFINITIONS "BOOST_ALL_DYN_LINK")
 endif()
 
 _Boost_CHECK_SPELLING(Boost_ROOT)

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=463c2fba4eec7f364689a11b7c36afe966b1f151
commit 463c2fba4eec7f364689a11b7c36afe966b1f151
Author:     Henri Manson <hfmanson at gmail.com>
AuthorDate: Mon Mar 4 12:40:24 2019 +0100
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Mar 11 11:39:25 2019 -0400

    Genex: Teach SHELL_PATH to support a list of paths
    
    Extend the genex added by commit ca6ba3fee5 (Genex: Add a SHELL_PATH
    expression, 2015-09-24, v3.4.0-rc1~37^2) to accept a `;`-list of paths,
    convert them all, and generate a list separated by the native shell
    `PATH``` separator.

diff --git a/Help/manual/cmake-generator-expressions.7.rst b/Help/manual/cmake-generator-expressions.7.rst
index 7f484a4..614358a 100644
--- a/Help/manual/cmake-generator-expressions.7.rst
+++ b/Help/manual/cmake-generator-expressions.7.rst
@@ -455,6 +455,11 @@ Output-Related Expressions
   Content of ``...`` converted to shell path style. For example, slashes are
   converted to backslashes in Windows shells and drive letters are converted
   to posix paths in MSYS shells. The ``...`` must be an absolute path.
+  The ``...`` may be a :ref:`semicolon-separated list <CMake Language Lists>`
+  of paths, in which case each path is converted individually and a result
+  list is generated using the shell path separator (``:`` on POSIX and
+  ``;`` on Windows).  Be sure to enclose the argument containing this genex
+  in double quotes in CMake source code so that ``;`` does not split arguments.
 
 Debugging
 =========
diff --git a/Help/release/dev/shell_path.rst b/Help/release/dev/shell_path.rst
new file mode 100644
index 0000000..e8ebfb5
--- /dev/null
+++ b/Help/release/dev/shell_path.rst
@@ -0,0 +1,5 @@
+shell_path
+----------
+
+* The ``$<SHELL_PATH:...>`` :manual:`generator expression
+  <cmake-generator-expressions(7)>` gained support for a list of paths.
diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx
index ce308cc..50fd16e 100644
--- a/Source/cmGeneratorExpressionNode.cxx
+++ b/Source/cmGeneratorExpressionNode.cxx
@@ -15,6 +15,8 @@
 #include "cmMessageType.h"
 #include "cmOutputConverter.h"
 #include "cmPolicies.h"
+#include "cmState.h"
+#include "cmStateSnapshot.h"
 #include "cmStateTypes.h"
 #include "cmSystemTools.h"
 #include "cmTarget.h"
@@ -2045,13 +2047,27 @@ static const struct ShellPathNode : public cmGeneratorExpressionNode
     const GeneratorExpressionContent* content,
     cmGeneratorExpressionDAGChecker* /*dagChecker*/) const override
   {
-    if (!cmSystemTools::FileIsFullPath(parameters.front())) {
+    std::vector<std::string> listIn;
+    cmSystemTools::ExpandListArgument(parameters.front(), listIn);
+    if (listIn.empty()) {
       reportError(context, content->GetOriginalExpression(),
-                  "\"" + parameters.front() + "\" is not an absolute path.");
+                  "\"\" is not an absolute path.");
       return std::string();
     }
-    cmOutputConverter converter(context->LG->GetStateSnapshot());
-    return converter.ConvertDirectorySeparatorsForShell(parameters.front());
+    cmStateSnapshot snapshot = context->LG->GetStateSnapshot();
+    cmOutputConverter converter(snapshot);
+    const char* separator = snapshot.GetState()->UseWindowsShell() ? ";" : ":";
+    std::vector<std::string> listOut;
+    listOut.reserve(listIn.size());
+    for (auto const& in : listIn) {
+      if (!cmSystemTools::FileIsFullPath(in)) {
+        reportError(context, content->GetOriginalExpression(),
+                    "\"" + in + "\" is not an absolute path.");
+        return std::string();
+      }
+      listOut.emplace_back(converter.ConvertDirectorySeparatorsForShell(in));
+    }
+    return cmJoin(listOut, separator);
   }
 } shellPathNode;
 
diff --git a/Tests/GeneratorExpression/CMakeLists.txt b/Tests/GeneratorExpression/CMakeLists.txt
index ab6016b..df0c78d 100644
--- a/Tests/GeneratorExpression/CMakeLists.txt
+++ b/Tests/GeneratorExpression/CMakeLists.txt
@@ -256,8 +256,10 @@ add_custom_target(check-part3 ALL
 
 if(WIN32)
   set(test_shell_path c:/shell/path)
+  set(test_shell_path2 c:/shell/path d:/another/path)
 else()
   set(test_shell_path /shell/path)
+  set(test_shell_path2 /shell/path /another/path)
 endif()
 
 add_custom_target(check-part4 ALL
@@ -266,6 +268,7 @@ add_custom_target(check-part4 ALL
     # CMake as command-line argument
     -Dmsys1_prefix=${msys1_prefix}
     -Dtest_shell_path=${msys1_prefix}$<SHELL_PATH:${test_shell_path}>
+    "-Dtest_shell_path2=$<SHELL_PATH:${test_shell_path2}>"
     -Dif_1=$<IF:1,a,b>
     -Dif_2=$<IF:0,a,b>
     -Dif_3=$<IF:$<EQUAL:10,30>,a,b>
diff --git a/Tests/GeneratorExpression/check-part4.cmake b/Tests/GeneratorExpression/check-part4.cmake
index b6966de..a7e0944 100644
--- a/Tests/GeneratorExpression/check-part4.cmake
+++ b/Tests/GeneratorExpression/check-part4.cmake
@@ -15,6 +15,17 @@ if(WIN32)
 else()
   check(test_shell_path [[/shell/path]])
 endif()
+if(WIN32)
+  if(CMAKE_GENERATOR STREQUAL "MSYS Makefiles" AND NOT msys1_prefix)
+    check(test_shell_path2 [[/c/shell/path:/d/another/path]])
+  elseif(CMAKE_GENERATOR STREQUAL "Unix Makefiles")
+    check(test_shell_path2 [[c:/shell/path;d:/another/path]])
+  else()
+    check(test_shell_path2 [[c:\shell\path;d:\another\path]])
+  endif()
+else()
+  check(test_shell_path2 [[/shell/path:/another/path]])
+endif()
 
 check(if_1 "a")
 check(if_2 "b")
diff --git a/Tests/RunCMake/GeneratorExpression/BadSHELL_PATH-stderr.txt b/Tests/RunCMake/GeneratorExpression/BadSHELL_PATH-stderr.txt
index 8d3c4cc..a08e7b2 100644
--- a/Tests/RunCMake/GeneratorExpression/BadSHELL_PATH-stderr.txt
+++ b/Tests/RunCMake/GeneratorExpression/BadSHELL_PATH-stderr.txt
@@ -15,3 +15,12 @@ CMake Error at BadSHELL_PATH.cmake:[0-9]+ \(add_custom_target\):
   "Relative/Path" is not an absolute path.
 Call Stack \(most recent call first\):
   CMakeLists.txt:3 \(include\)
++
+CMake Error at BadSHELL_PATH.cmake:[0-9]+ \(add_custom_target\):
+  Error evaluating generator expression:
+
+    \$<SHELL_PATH:;>
+
+  "" is not an absolute path.
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/GeneratorExpression/BadSHELL_PATH.cmake b/Tests/RunCMake/GeneratorExpression/BadSHELL_PATH.cmake
index 5eff7bc..0e7c342 100644
--- a/Tests/RunCMake/GeneratorExpression/BadSHELL_PATH.cmake
+++ b/Tests/RunCMake/GeneratorExpression/BadSHELL_PATH.cmake
@@ -1,4 +1,5 @@
 add_custom_target(check ALL COMMAND check
   $<SHELL_PATH:>
   $<SHELL_PATH:Relative/Path>
+  "$<SHELL_PATH:;>"
   VERBATIM)

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=21da25d2a878cfccf9496ef7b227de2c98601ef2
commit 21da25d2a878cfccf9496ef7b227de2c98601ef2
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Mar 11 10:43:38 2019 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Mar 11 11:37:52 2019 -0400

    Tests: Generalize GeneratorExpression MSYS path conversion workaround
    
    Use MSYS2's `MSYS2_ARG_CONV_EXCL` environment variable to prevent
    path conversion where possible.

diff --git a/Tests/GeneratorExpression/CMakeLists.txt b/Tests/GeneratorExpression/CMakeLists.txt
index 3d08704..ab6016b 100644
--- a/Tests/GeneratorExpression/CMakeLists.txt
+++ b/Tests/GeneratorExpression/CMakeLists.txt
@@ -3,11 +3,26 @@ project(GeneratorExpression)
 
 include(CTest)
 
+# Real projects normally want the MSYS shell path conversion, but for this test
+# we need to verify that the command line is constructed with the proper string.
+set(msys1_prefix "")
+set(msys2_no_conv "")
+if(CMAKE_GENERATOR STREQUAL "MSYS Makefiles")
+  execute_process(COMMAND "uname" OUTPUT_VARIABLE uname)
+  if("${uname}" MATCHES "^MINGW32")
+    # MinGW.org MSYS 1.0 does not support generic path conversion suppression
+    set(msys1_prefix MSYS1_PREFIX)
+  else()
+    # msys2 supports generic path conversion suppression
+    set(msys2_no_conv env MSYS2_ARG_CONV_EXCL=-D)
+  endif()
+endif()
+
 # This test is split into multiple parts as needed to avoid NMake command
 # length limits.
 
 add_custom_target(check-part1 ALL
-  COMMAND ${CMAKE_COMMAND}
+  COMMAND ${msys2_no_conv} ${CMAKE_COMMAND}
     -Dtest_0=$<0:nothing>
     -Dtest_0_with_comma=$<0:-Wl,--no-undefined>
     -Dtest_1=$<1:content>
@@ -97,7 +112,7 @@ add_library(empty5 empty.cpp)
 target_include_directories(empty5 PRIVATE /empty5/private1 /empty5/private2)
 
 add_custom_target(check-part2 ALL
-  COMMAND ${CMAKE_COMMAND}
+  COMMAND ${msys2_no_conv} ${CMAKE_COMMAND}
     -Dtest_incomplete_1=$<
     -Dtest_incomplete_2=$<something
     -Dtest_incomplete_3=$<something:
@@ -188,7 +203,7 @@ set_property(TARGET importedFallback PROPERTY MAP_IMPORTED_CONFIG_DEBUG "" DEBUG
 set_property(TARGET importedFallback PROPERTY MAP_IMPORTED_CONFIG_RELEASE "")
 
 add_custom_target(check-part3 ALL
-  COMMAND ${CMAKE_COMMAND}
+  COMMAND ${msys2_no_conv} ${CMAKE_COMMAND}
     -Dtest_version_greater_1=$<VERSION_GREATER:1.0,1.1.1>
     -Dtest_version_greater_2=$<VERSION_GREATER:1.1.1,1.0>
     -Dtest_version_less_1=$<VERSION_LESS:1.1.1,1.0>
@@ -244,14 +259,13 @@ if(WIN32)
 else()
   set(test_shell_path /shell/path)
 endif()
-set(path_prefix BYPASS_FURTHER_CONVERSION)
 
 add_custom_target(check-part4 ALL
-  COMMAND ${CMAKE_COMMAND}
+  COMMAND ${msys2_no_conv} ${CMAKE_COMMAND}
     # Prefix path to bypass its further conversion when being processed by
     # CMake as command-line argument
-    -Dtest_shell_path=${path_prefix}$<SHELL_PATH:${test_shell_path}>
-    -Dpath_prefix=${path_prefix}
+    -Dmsys1_prefix=${msys1_prefix}
+    -Dtest_shell_path=${msys1_prefix}$<SHELL_PATH:${test_shell_path}>
     -Dif_1=$<IF:1,a,b>
     -Dif_2=$<IF:0,a,b>
     -Dif_3=$<IF:$<EQUAL:10,30>,a,b>
diff --git a/Tests/GeneratorExpression/check-part4.cmake b/Tests/GeneratorExpression/check-part4.cmake
index f5d14dd..b6966de 100644
--- a/Tests/GeneratorExpression/check-part4.cmake
+++ b/Tests/GeneratorExpression/check-part4.cmake
@@ -1,6 +1,8 @@
 include(${CMAKE_CURRENT_LIST_DIR}/check-common.cmake)
 
-string(REPLACE ${path_prefix} "" test_shell_path ${test_shell_path})
+if(msys1_prefix)
+  string(REPLACE "${msys1_prefix}" "" test_shell_path ${test_shell_path})
+endif()
 
 if(WIN32)
   if(CMAKE_GENERATOR STREQUAL "MSYS Makefiles")

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

Summary of changes:
 Help/manual/cmake-generator-expressions.7.rst      |  5 ++++
 Help/release/dev/shell_path.rst                    |  5 ++++
 Modules/FindBoost.cmake                            |  4 +--
 Source/cmGeneratorExpressionNode.cxx               | 24 ++++++++++++++---
 Tests/GeneratorExpression/CMakeLists.txt           | 31 +++++++++++++++++-----
 Tests/GeneratorExpression/check-part4.cmake        | 15 ++++++++++-
 .../GeneratorExpression/BadSHELL_PATH-stderr.txt   |  9 +++++++
 .../GeneratorExpression/BadSHELL_PATH.cmake        |  1 +
 8 files changed, 80 insertions(+), 14 deletions(-)
 create mode 100644 Help/release/dev/shell_path.rst


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list