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  a09274c6ec5a3cbe1d57c48199279946d6c997a7 (commit)
       via  aed259ac414e49933e498639edadfff6290d2a65 (commit)
       via  e653f46677450090b6acb46e9e12543cc307021a (commit)
       via  fc366d25946f7434527658475835d1e587cea4ea (commit)
       via  4b94f3420c78e1bb7aa1324973e3ec76ba765c27 (commit)
       via  b5f8113ca7796df47bcb04bcd77991885c3b1b07 (commit)
       via  a5241cc3a7d5c7173603e637c039f1b8a1852627 (commit)
       via  a3c31effedbaf6c552fc433ac6688cb0453e7bf3 (commit)
       via  3e1c361afa1c58b3c56a3253f8215dfaac2c0cc4 (commit)
       via  c24f29c6647f70e6597dd35a1fe276279e019ad4 (commit)
       via  d3fa2e7400f4c7ce88c8fe762810bc379879444c (commit)
       via  01c7d9ce863d6f8bcae578b500dd2e8ba2d97967 (commit)
      from  d851a8b457251a577f10055d9fb277b75a82da6c (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=a09274c6ec5a3cbe1d57c48199279946d6c997a7
commit a09274c6ec5a3cbe1d57c48199279946d6c997a7
Merge: aed259a a5241cc
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Tue Nov 20 09:30:24 2018 -0500
Commit:     Brad King <brad.k...@kitware.com>
CommitDate: Tue Nov 20 09:30:24 2018 -0500

    Merge branch 'release-3.13'


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=aed259ac414e49933e498639edadfff6290d2a65
commit aed259ac414e49933e498639edadfff6290d2a65
Merge: e653f46 b5f8113
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Tue Nov 20 14:29:38 2018 +0000
Commit:     Kitware Robot <kwro...@kitware.com>
CommitDate: Tue Nov 20 09:29:44 2018 -0500

    Merge topic 'genex-in_list-empty-args'
    
    b5f8113ca7 Genex: Add policy to handle empty list items in $<IN_LIST:...>
    
    Acked-by: Kitware Robot <kwro...@kitware.com>
    Merge-request: !2569


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e653f46677450090b6acb46e9e12543cc307021a
commit e653f46677450090b6acb46e9e12543cc307021a
Merge: fc366d2 a3c31ef
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Tue Nov 20 14:25:39 2018 +0000
Commit:     Kitware Robot <kwro...@kitware.com>
CommitDate: Tue Nov 20 09:26:31 2018 -0500

    Merge topic 'blas-pkgcfg'
    
    a3c31effed FindBLAS: Restore BLAS_FOUND when found using pkgconfig
    
    Acked-by: Kitware Robot <kwro...@kitware.com>
    Merge-request: !2631


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fc366d25946f7434527658475835d1e587cea4ea
commit fc366d25946f7434527658475835d1e587cea4ea
Merge: 4b94f34 c24f29c
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Tue Nov 20 14:25:21 2018 +0000
Commit:     Kitware Robot <kwro...@kitware.com>
CommitDate: Tue Nov 20 09:25:48 2018 -0500

    Merge topic 'FindPython-lib-arch'
    
    c24f29c664 FindPython: Ensure config tool matches library architecture
    
    Acked-by: Kitware Robot <kwro...@kitware.com>
    Acked-by: Eric Noulard <eric.noul...@gmail.com>
    Merge-request: !2624


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4b94f3420c78e1bb7aa1324973e3ec76ba765c27
commit 4b94f3420c78e1bb7aa1324973e3ec76ba765c27
Merge: d851a8b 01c7d9c
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Tue Nov 20 14:24:56 2018 +0000
Commit:     Kitware Robot <kwro...@kitware.com>
CommitDate: Tue Nov 20 09:25:03 2018 -0500

    Merge topic 'irsl-ucrt-version'
    
    01c7d9ce86 IRSL: Detect versioned Windows Universal CRT directories
    
    Acked-by: Kitware Robot <kwro...@kitware.com>
    Merge-request: !2637


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b5f8113ca7796df47bcb04bcd77991885c3b1b07
commit b5f8113ca7796df47bcb04bcd77991885c3b1b07
Author:     Kyle Edwards <kyle.edwa...@kitware.com>
AuthorDate: Tue Nov 6 11:27:03 2018 -0500
Commit:     Kyle Edwards <kyle.edwa...@kitware.com>
CommitDate: Mon Nov 19 17:02:06 2018 -0500

    Genex: Add policy to handle empty list items in $<IN_LIST:...>
    
    The old behavior of $<IN_LIST:...> is inconsistent with that of
    if(IN_LIST), in that it does not find an empty search item even if
    the list contains empty items. This change adds a new policy to
    correctly handle empty items and make the behavior more consistent
    with if(IN_LIST).
    
    Fixes: #18556

diff --git a/Help/manual/cmake-policies.7.rst b/Help/manual/cmake-policies.7.rst
index 7c0fe6d..044a06e 100644
--- a/Help/manual/cmake-policies.7.rst
+++ b/Help/manual/cmake-policies.7.rst
@@ -57,6 +57,7 @@ Policies Introduced by CMake 3.14
 .. toctree::
    :maxdepth: 1
 
+   CMP0085: IN_LIST generator expression handles empty list items. 
</policy/CMP0085>
    CMP0084: The FindQt module does not exist for find_package(). 
</policy/CMP0084>
    CMP0083: Add PIE options when linking executable. </policy/CMP0083>
    CMP0082: Install rules from add_subdirectory() are interleaved with those 
in caller. </policy/CMP0082>
diff --git a/Help/policy/CMP0085.rst b/Help/policy/CMP0085.rst
new file mode 100644
index 0000000..d9ec9a2
--- /dev/null
+++ b/Help/policy/CMP0085.rst
@@ -0,0 +1,21 @@
+CMP0085
+-------
+
+``$<IN_LIST:...>`` handles empty list items.
+
+In CMake 3.13 and lower, the ``$<IN_LIST:...>`` generator expression always
+returned ``0`` if the first argument was empty, even if the list contained an
+empty item. This behavior is inconsistent with the ``IN_LIST`` behavior of
+:command:`if`, which this generator expression is meant to emulate. CMake 3.14
+and later handles this case correctly.
+
+The ``OLD`` behavior of this policy is for ``$<IN_LIST:...>`` to always return
+``0`` if the first argument is empty. The ``NEW`` behavior is to return ``1``
+if the first argument is empty and the list contains an empty item.
+
+This policy was introduced in CMake version 3.14.  CMake version
+|release| warns when the policy is not set and uses ``OLD`` behavior.
+Use the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW``
+explicitly.
+
+.. include:: DEPRECATED.txt
diff --git a/Help/release/dev/genex-in_list-empty-args.rst 
b/Help/release/dev/genex-in_list-empty-args.rst
new file mode 100644
index 0000000..ec1c6c0
--- /dev/null
+++ b/Help/release/dev/genex-in_list-empty-args.rst
@@ -0,0 +1,5 @@
+genex-in_list-empty-args
+------------------------
+
+* The $<IN_LIST:...> generator expression now correctly handles an empty
+  argument. See :policy:`CMP0085` for details.
diff --git a/Source/cmGeneratorExpressionNode.cxx 
b/Source/cmGeneratorExpressionNode.cxx
index 49b97fb..eb3df16 100644
--- a/Source/cmGeneratorExpressionNode.cxx
+++ b/Source/cmGeneratorExpressionNode.cxx
@@ -283,14 +283,39 @@ static const struct InListNode : public 
cmGeneratorExpressionNode
 
   std::string Evaluate(
     const std::vector<std::string>& parameters,
-    cmGeneratorExpressionContext* /*context*/,
+    cmGeneratorExpressionContext* context,
     const GeneratorExpressionContent* /*content*/,
     cmGeneratorExpressionDAGChecker* /*dagChecker*/) const override
   {
-    std::vector<std::string> values;
-    cmSystemTools::ExpandListArgument(parameters[1], values);
-    if (values.empty()) {
-      return "0";
+    std::vector<std::string> values, checkValues;
+    bool check = false;
+    switch (context->LG->GetPolicyStatus(cmPolicies::CMP0085)) {
+      case cmPolicies::WARN:
+        if (parameters.front().empty()) {
+          check = true;
+          cmSystemTools::ExpandListArgument(parameters[1], checkValues, true);
+        }
+        CM_FALLTHROUGH;
+      case cmPolicies::OLD:
+        cmSystemTools::ExpandListArgument(parameters[1], values);
+        if (check && values != checkValues) {
+          std::ostringstream e;
+          e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0085)
+            << "\nSearch Item:\n  \"" << parameters.front()
+            << "\"\nList:\n  \"" << parameters[1] << "\"\n";
+          context->LG->GetCMakeInstance()->IssueMessage(
+            cmake::AUTHOR_WARNING, e.str(), context->Backtrace);
+          return "0";
+        }
+        if (values.empty()) {
+          return "0";
+        }
+        break;
+      case cmPolicies::REQUIRED_IF_USED:
+      case cmPolicies::REQUIRED_ALWAYS:
+      case cmPolicies::NEW:
+        cmSystemTools::ExpandListArgument(parameters[1], values, true);
+        break;
     }
 
     return std::find(values.cbegin(), values.cend(), parameters.front()) ==
diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h
index 6b1314f..9985d63 100644
--- a/Source/cmPolicies.h
+++ b/Source/cmPolicies.h
@@ -249,7 +249,9 @@ class cmMakefile;
          0, cmPolicies::WARN)                                                 \
   SELECT(POLICY, CMP0084,                                                     \
          "The FindQt module does not exist for find_package().", 3, 14, 0,    \
-         cmPolicies::WARN)
+         cmPolicies::WARN)                                                    \
+  SELECT(POLICY, CMP0085, "$<IN_LIST:...> handles empty list items.", 3, 14,  \
+         0, cmPolicies::WARN)
 
 #define CM_SELECT_ID(F, A1, A2, A3, A4, A5, A6) F(A1)
 #define CM_FOR_EACH_POLICY_ID(POLICY)                                         \
diff --git a/Tests/RunCMake/GeneratorExpression/CMP0085-NEW-check.cmake 
b/Tests/RunCMake/GeneratorExpression/CMP0085-NEW-check.cmake
new file mode 100644
index 0000000..520bf3d
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/CMP0085-NEW-check.cmake
@@ -0,0 +1,6 @@
+file(READ "${RunCMake_TEST_BINARY_DIR}/CMP0085-NEW-generated.txt" content)
+
+set(expected "101011")
+if(NOT content STREQUAL expected)
+  set(RunCMake_TEST_FAILED "actual content:\n [[${content}]]\nbut expected:\n 
[[${expected}]]")
+endif()
diff --git a/Tests/RunCMake/GeneratorExpression/CMP0085-NEW.cmake 
b/Tests/RunCMake/GeneratorExpression/CMP0085-NEW.cmake
new file mode 100644
index 0000000..ee85c0d
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/CMP0085-NEW.cmake
@@ -0,0 +1,4 @@
+cmake_policy(SET CMP0070 NEW)
+file(GENERATE OUTPUT CMP0085-NEW-generated.txt CONTENT
+  
"$<IN_LIST:,>$<IN_LIST:,a>$<IN_LIST:,;a>$<IN_LIST:a,>$<IN_LIST:a,a>$<IN_LIST:a,;a>"
+  )
diff --git a/Tests/RunCMake/GeneratorExpression/CMP0085-OLD-check.cmake 
b/Tests/RunCMake/GeneratorExpression/CMP0085-OLD-check.cmake
new file mode 100644
index 0000000..c387db7
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/CMP0085-OLD-check.cmake
@@ -0,0 +1,6 @@
+file(READ "${RunCMake_TEST_BINARY_DIR}/CMP0085-OLD-generated.txt" content)
+
+set(expected "000011")
+if(NOT content STREQUAL expected)
+  set(RunCMake_TEST_FAILED "actual content:\n [[${content}]]\nbut expected:\n 
[[${expected}]]")
+endif()
diff --git a/Tests/RunCMake/GeneratorExpression/CMP0085-OLD.cmake 
b/Tests/RunCMake/GeneratorExpression/CMP0085-OLD.cmake
new file mode 100644
index 0000000..31b6a51
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/CMP0085-OLD.cmake
@@ -0,0 +1,4 @@
+cmake_policy(SET CMP0070 NEW)
+file(GENERATE OUTPUT CMP0085-OLD-generated.txt CONTENT
+  
"$<IN_LIST:,>$<IN_LIST:,a>$<IN_LIST:,;a>$<IN_LIST:a,>$<IN_LIST:a,a>$<IN_LIST:a,;a>"
+  )
diff --git a/Tests/RunCMake/GeneratorExpression/CMP0085-WARN-check.cmake 
b/Tests/RunCMake/GeneratorExpression/CMP0085-WARN-check.cmake
new file mode 100644
index 0000000..f7bcf0f
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/CMP0085-WARN-check.cmake
@@ -0,0 +1,6 @@
+file(READ "${RunCMake_TEST_BINARY_DIR}/CMP0085-WARN-generated.txt" content)
+
+set(expected "000011")
+if(NOT content STREQUAL expected)
+  set(RunCMake_TEST_FAILED "actual content:\n [[${content}]]\nbut expected:\n 
[[${expected}]]")
+endif()
diff --git a/Tests/RunCMake/GeneratorExpression/CMP0085-WARN-stderr.txt 
b/Tests/RunCMake/GeneratorExpression/CMP0085-WARN-stderr.txt
new file mode 100644
index 0000000..81bd450
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/CMP0085-WARN-stderr.txt
@@ -0,0 +1,33 @@
+CMake Warning \(dev\) at CMP0085-WARN\.cmake:[0-9]+ \(file\):
+  Policy CMP0085 is not set: \$<IN_LIST:\.\.\.> handles empty list items\.  Run
+  "cmake --help-policy CMP0085" for policy details\.  Use the cmake_policy
+  command to set the policy and suppress this warning\.
+
+  Search Item:
+
+    ""
+
+  List:
+
+    ""
+
+Call Stack \(most recent call first\):
+  CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\.  Use -Wno-dev to suppress it\.
+
+CMake Warning \(dev\) at CMP0085-WARN\.cmake:[0-9]+ \(file\):
+  Policy CMP0085 is not set: \$<IN_LIST:\.\.\.> handles empty list items\.  Run
+  "cmake --help-policy CMP0085" for policy details\.  Use the cmake_policy
+  command to set the policy and suppress this warning\.
+
+  Search Item:
+
+    ""
+
+  List:
+
+    ";a"
+
+Call Stack \(most recent call first\):
+  CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\.  Use -Wno-dev to suppress it\.
diff --git a/Tests/RunCMake/GeneratorExpression/CMP0085-WARN.cmake 
b/Tests/RunCMake/GeneratorExpression/CMP0085-WARN.cmake
new file mode 100644
index 0000000..59c7826
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/CMP0085-WARN.cmake
@@ -0,0 +1,4 @@
+cmake_policy(SET CMP0070 NEW)
+file(GENERATE OUTPUT CMP0085-WARN-generated.txt CONTENT
+  
"$<IN_LIST:,>$<IN_LIST:,a>$<IN_LIST:,;a>$<IN_LIST:a,>$<IN_LIST:a,a>$<IN_LIST:a,;a>"
+  )
diff --git a/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake 
b/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake
index 3905c5f..013117e 100644
--- a/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake
+++ b/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake
@@ -61,3 +61,13 @@ if(LINKER_SUPPORTS_PDB)
 else()
   run_cmake(NonValidCompiler-TARGET_PDB_FILE)
 endif()
+
+set(RunCMake_TEST_OPTIONS -DCMAKE_POLICY_DEFAULT_CMP0085:STRING=OLD)
+run_cmake(CMP0085-OLD)
+unset(RunCMake_TEST_OPTIONS)
+
+run_cmake(CMP0085-WARN)
+
+set(RunCMake_TEST_OPTIONS -DCMAKE_POLICY_DEFAULT_CMP0085:STRING=NEW)
+run_cmake(CMP0085-NEW)
+unset(RunCMake_TEST_OPTIONS)

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

Summary of changes:
 Help/manual/cmake-policies.7.rst                   |  1 +
 Help/policy/CMP0085.rst                            | 21 +++++++++++++
 Help/release/dev/genex-in_list-empty-args.rst      |  5 ++++
 Modules/FindBLAS.cmake                             |  1 +
 Modules/FindPython/Support.cmake                   | 17 +++++++++++
 Modules/InstallRequiredSystemLibraries.cmake       | 22 ++++++++++++--
 Source/cmGeneratorExpressionNode.cxx               | 35 ++++++++++++++++++----
 Source/cmPolicies.h                                |  4 ++-
 ..._EXISTS-check.cmake => CMP0085-NEW-check.cmake} |  4 +--
 .../RunCMake/GeneratorExpression/CMP0085-NEW.cmake |  4 +++
 ..._EXISTS-check.cmake => CMP0085-OLD-check.cmake} |  4 +--
 .../RunCMake/GeneratorExpression/CMP0085-OLD.cmake |  4 +++
 ...EXISTS-check.cmake => CMP0085-WARN-check.cmake} |  4 +--
 .../GeneratorExpression/CMP0085-WARN-stderr.txt    | 33 ++++++++++++++++++++
 .../GeneratorExpression/CMP0085-WARN.cmake         |  4 +++
 .../GeneratorExpression/RunCMakeTest.cmake         | 10 +++++++
 16 files changed, 158 insertions(+), 15 deletions(-)
 create mode 100644 Help/policy/CMP0085.rst
 create mode 100644 Help/release/dev/genex-in_list-empty-args.rst
 copy Tests/RunCMake/GeneratorExpression/{TARGET_EXISTS-check.cmake => 
CMP0085-NEW-check.cmake} (58%)
 create mode 100644 Tests/RunCMake/GeneratorExpression/CMP0085-NEW.cmake
 copy Tests/RunCMake/GeneratorExpression/{TARGET_EXISTS-check.cmake => 
CMP0085-OLD-check.cmake} (58%)
 create mode 100644 Tests/RunCMake/GeneratorExpression/CMP0085-OLD.cmake
 copy Tests/RunCMake/GeneratorExpression/{TARGET_EXISTS-check.cmake => 
CMP0085-WARN-check.cmake} (58%)
 create mode 100644 Tests/RunCMake/GeneratorExpression/CMP0085-WARN-stderr.txt
 create mode 100644 Tests/RunCMake/GeneratorExpression/CMP0085-WARN.cmake


hooks/post-receive
-- 
CMake
_______________________________________________
Cmake-commits mailing list
Cmake-commits@cmake.org
https://cmake.org/mailman/listinfo/cmake-commits

Reply via email to