summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Help/dev/documentation.rst84
-rw-r--r--Help/manual/cmake-developer.7.rst93
-rw-r--r--Help/manual/cmake-policies.7.rst1
-rw-r--r--Help/policy/CMP0085.rst21
-rw-r--r--Help/release/dev/genex-in_list-empty-args.rst5
-rw-r--r--Modules/FindBLAS.cmake1
-rw-r--r--Modules/FindPython/Support.cmake17
-rw-r--r--Modules/InstallRequiredSystemLibraries.cmake22
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/LexerParser/cmFortranLexer.cxx226
-rw-r--r--Source/LexerParser/cmFortranLexer.in.l2
-rw-r--r--Source/cmGeneratorExpressionNode.cxx35
-rw-r--r--Source/cmPolicies.h4
-rw-r--r--Tests/FortranModules/Submodules/child.f906
-rw-r--r--Tests/RunCMake/GeneratorExpression/CMP0085-NEW-check.cmake6
-rw-r--r--Tests/RunCMake/GeneratorExpression/CMP0085-NEW.cmake4
-rw-r--r--Tests/RunCMake/GeneratorExpression/CMP0085-OLD-check.cmake6
-rw-r--r--Tests/RunCMake/GeneratorExpression/CMP0085-OLD.cmake4
-rw-r--r--Tests/RunCMake/GeneratorExpression/CMP0085-WARN-check.cmake6
-rw-r--r--Tests/RunCMake/GeneratorExpression/CMP0085-WARN-stderr.txt33
-rw-r--r--Tests/RunCMake/GeneratorExpression/CMP0085-WARN.cmake4
-rw-r--r--Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake10
22 files changed, 387 insertions, 205 deletions
diff --git a/Help/dev/documentation.rst b/Help/dev/documentation.rst
index 1b2c942..c302790 100644
--- a/Help/dev/documentation.rst
+++ b/Help/dev/documentation.rst
@@ -458,32 +458,22 @@ reStructuredText markup from comment blocks that start in ``.rst:``.
At the top of ``Modules/<module-name>.cmake``, begin with the following
license notice:
-.. code-block:: cmake
+::
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
After this notice, add a *BLANK* line. Then, add documentation using
-a `Line Comment`_ block of the form:
-
-.. code-block:: cmake
-
- #.rst:
- # <module-name>
- # -------------
- #
- # <reStructuredText documentation of module>
-
-or a `Bracket Comment`_ of the form:
+a `Bracket Comment`_ of the form:
::
- #[[.rst:
- <module-name>
- -------------
+ #[=======================================================================[.rst:
+ <module-name>
+ -------------
- <reStructuredText documentation of module>
- #]]
+ <reStructuredText documentation of module>
+ #]=======================================================================]
Any number of ``=`` may be used in the opening and closing brackets
as long as they match. Content on the line containing the closing
@@ -496,35 +486,38 @@ For example, a ``Findxxx.cmake`` module may contain:
::
- # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
- # file Copyright.txt or https://cmake.org/licensing for details.
+ # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+ # file Copyright.txt or https://cmake.org/licensing for details.
+
+ #[=======================================================================[.rst:
+ FindXxx
+ -------
+
+ This is a cool module.
+ This module does really cool stuff.
+ It can do even more than you think.
+
+ It even needs two paragraphs to tell you about it.
+ And it defines the following variables:
+
+ ``VAR_COOL``
+ this is great isn't it?
+ ``VAR_REALLY_COOL``
+ cool right?
+ #]=======================================================================]
+
+ <code>
+
+ #[=======================================================================[.rst:
+ .. command:: xxx_do_something
+
+ This command does something for Xxx::
- #.rst:
- # FindXxx
- # -------
- #
- # This is a cool module.
- # This module does really cool stuff.
- # It can do even more than you think.
- #
- # It even needs two paragraphs to tell you about it.
- # And it defines the following variables:
- #
- # * VAR_COOL: this is great isn't it?
- # * VAR_REALLY_COOL: cool right?
-
- <code>
-
- #[========================================[.rst:
- .. command:: xxx_do_something
-
- This command does something for Xxx::
-
- xxx_do_something(some arguments)
- #]========================================]
- macro(xxx_do_something)
- <code>
- endmacro()
+ xxx_do_something(some arguments)
+ #]=======================================================================]
+ macro(xxx_do_something)
+ <code>
+ endmacro()
Test the documentation formatting by running
``cmake --help-module <module-name>``, and also by enabling the
@@ -534,5 +527,4 @@ have a .cmake file in this directory NOT show up in the modules
documentation, simply leave out the ``Help/module/<module-name>.rst``
file and the ``Help/manual/cmake-modules.7.rst`` toctree entry.
-.. _`Line Comment`: https://cmake.org/cmake/help/latest/manual/cmake-language.7.html#line-comment
.. _`Bracket Comment`: https://cmake.org/cmake/help/latest/manual/cmake-language.7.html#bracket-comment
diff --git a/Help/manual/cmake-developer.7.rst b/Help/manual/cmake-developer.7.rst
index b949464..85ed935 100644
--- a/Help/manual/cmake-developer.7.rst
+++ b/Help/manual/cmake-developer.7.rst
@@ -196,49 +196,78 @@ them.
A Sample Find Module
--------------------
-We will describe how to create a simple find module for a library
-``Foo``.
+We will describe how to create a simple find module for a library ``Foo``.
-The first thing that is needed is a license notice.
+The top of the module should begin with a license notice, followed by
+a blank line, and then followed by a :ref:`Bracket Comment`. The comment
+should begin with ``.rst:`` to indicate that the rest of its content is
+reStructuredText-format documentation. For example:
-.. code-block:: cmake
+::
- # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
- # file Copyright.txt or https://cmake.org/licensing for details.
+ # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+ # file Copyright.txt or https://cmake.org/licensing for details.
-Next we need module documentation. CMake's documentation system requires you
-to follow the license notice with a blank line and then with a documentation
-marker and the name of the module. You should follow this with a simple
-statement of what the module does.
+ #[=======================================================================[.rst:
+ FindFoo
+ -------
-.. code-block:: cmake
+ Finds the Foo library.
- #.rst:
- # FindFoo
- # -------
- #
- # Finds the Foo library
- #
+ Imported Targets
+ ^^^^^^^^^^^^^^^^
-More description may be required for some packages. If there are
-caveats or other details users of the module should be aware of, you can
-add further paragraphs below this. Then you need to document what
-variables and imported targets are set by the module, such as
+ This module provides the following imported targets, if found:
-.. code-block:: cmake
+ ``Foo::Foo``
+ The Foo library
+
+ Result Variables
+ ^^^^^^^^^^^^^^^^
+
+ This will define the following variables:
+
+ ``Foo_FOUND``
+ True if the system has the Foo library.
+ ``Foo_VERSION``
+ The version of the Foo library which was found.
+ ``Foo_INCLUDE_DIRS``
+ Include directories needed to use Foo.
+ ``Foo_LIBRARIES``
+ Libraries needed to link to Foo.
+
+ Cache Variables
+ ^^^^^^^^^^^^^^^
+
+ The following cache variables may also be set:
+
+ ``Foo_INCLUDE_DIR``
+ The directory containing ``foo.h``.
+ ``Foo_LIBRARY``
+ The path to the Foo library.
+
+ #]=======================================================================]
+
+The module documentation consists of:
+
+* An underlined heading specifying the module name.
+
+* A simple description of what the module finds.
+ More description may be required for some packages. If there are
+ caveats or other details users of the module should be aware of,
+ specify them here.
+
+* A section listing imported targets provided by the module, if any.
+
+* A section listing result variables provided by the module.
- # This will define the following variables::
- #
- # Foo_FOUND - True if the system has the Foo library
- # Foo_VERSION - The version of the Foo library which was found
- #
- # and the following imported targets::
- #
- # Foo::Foo - The Foo library
+* Optionally a section listing cache variables used by the module, if any.
-If the package provides any macros, they should be listed here, but can
-be documented where they are defined.
+If the package provides any macros or functions, they should be listed in
+an additional section, but can be documented by additional ``.rst:``
+comment blocks immediately above where those macros or functions are defined.
+The find module implementation may begin below the documentation block.
Now the actual libraries and so on have to be found. The code here will
obviously vary from module to module (dealing with that, after all, is the
point of find modules), but there tends to be a common pattern for libraries.
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/Modules/FindBLAS.cmake b/Modules/FindBLAS.cmake
index d150826..14cc68a 100644
--- a/Modules/FindBLAS.cmake
+++ b/Modules/FindBLAS.cmake
@@ -94,6 +94,7 @@ if(BLA_PREFER_PKGCONFIG)
find_package(PkgConfig)
pkg_check_modules(PKGC_BLAS blas)
if(PKGC_BLAS_FOUND)
+ set(BLAS_FOUND ${PKGC_BLAS_FOUND})
set(BLAS_LIBRARIES "${PKGC_BLAS_LINK_LIBRARIES}")
return()
endif()
diff --git a/Modules/FindPython/Support.cmake b/Modules/FindPython/Support.cmake
index 5b1ed4b..e0ebb90 100644
--- a/Modules/FindPython/Support.cmake
+++ b/Modules/FindPython/Support.cmake
@@ -711,6 +711,23 @@ if ("Development" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS
if (NOT _${_PYTHON_PREFIX}_CONFIG)
continue()
endif()
+ if (DEFINED CMAKE_LIBRARY_ARCHITECTURE)
+ # check that config tool match library architecture
+ execute_process (COMMAND "${_${_PYTHON_PREFIX}_CONFIG}" --configdir
+ RESULT_VARIABLE _${_PYTHON_PREFIX}_RESULT
+ OUTPUT_VARIABLE _${_PYTHON_PREFIX}_CONFIGDIR
+ ERROR_QUIET
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+ if (_${_PYTHON_PREFIX}_RESULT)
+ unset (_${_PYTHON_PREFIX}_CONFIG CACHE)
+ continue()
+ endif()
+ string(FIND "${_${_PYTHON_PREFIX}_CONFIGDIR}" "${CMAKE_LIBRARY_ARCHITECTURE}" _${_PYTHON_PREFIX}_RESULT)
+ if (_${_PYTHON_PREFIX}_RESULT EQUAL -1)
+ unset (_${_PYTHON_PREFIX}_CONFIG CACHE)
+ continue()
+ endif()
+ endif()
# retrieve root install directory
execute_process (COMMAND "${_${_PYTHON_PREFIX}_CONFIG}" --prefix
diff --git a/Modules/InstallRequiredSystemLibraries.cmake b/Modules/InstallRequiredSystemLibraries.cmake
index 9a5e64d..5ba8687 100644
--- a/Modules/InstallRequiredSystemLibraries.cmake
+++ b/Modules/InstallRequiredSystemLibraries.cmake
@@ -303,7 +303,15 @@ if(MSVC)
get_filename_component(windows_kits_dir
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots;KitsRoot10]" ABSOLUTE)
set(programfilesx86 "ProgramFiles(x86)")
- find_path(WINDOWS_KITS_DIR NAMES Redist/ucrt/DLLs/${CMAKE_MSVC_ARCH}/ucrtbase.dll
+ if(";${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION};$ENV{UCRTVersion};$ENV{WindowsSDKVersion};" MATCHES [=[;(10\.[0-9.]+)[;\]]=])
+ set(__ucrt_version "${CMAKE_MATCH_1}/")
+ else()
+ set(__ucrt_version "")
+ endif()
+ find_path(WINDOWS_KITS_DIR
+ NAMES
+ Redist/${__ucrt_version}ucrt/DLLs/${CMAKE_MSVC_ARCH}/ucrtbase.dll
+ Redist/ucrt/DLLs/${CMAKE_MSVC_ARCH}/ucrtbase.dll
PATHS
$ENV{CMAKE_WINDOWS_KITS_10_DIR}
"${windows_kits_dir}"
@@ -314,11 +322,19 @@ if(MSVC)
# Glob the list of UCRT DLLs.
if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
- file(GLOB __ucrt_dlls "${WINDOWS_KITS_DIR}/Redist/ucrt/DLLs/${CMAKE_MSVC_ARCH}/*.dll")
+ if(EXISTS "${WINDOWS_KITS_DIR}/Redist/${__ucrt_version}ucrt/DLLs/${CMAKE_MSVC_ARCH}/ucrtbase.dll")
+ file(GLOB __ucrt_dlls "${WINDOWS_KITS_DIR}/Redist/${__ucrt_version}ucrt/DLLs/${CMAKE_MSVC_ARCH}/*.dll")
+ else()
+ file(GLOB __ucrt_dlls "${WINDOWS_KITS_DIR}/Redist/ucrt/DLLs/${CMAKE_MSVC_ARCH}/*.dll")
+ endif()
list(APPEND __install__libs ${__ucrt_dlls})
endif()
if(CMAKE_INSTALL_DEBUG_LIBRARIES)
- file(GLOB __ucrt_dlls "${WINDOWS_KITS_DIR}/bin/${CMAKE_MSVC_ARCH}/ucrt/*.dll")
+ if(EXISTS "${WINDOWS_KITS_DIR}/bin/${__ucrt_version}${CMAKE_MSVC_ARCH}/ucrt/ucrtbased.dll")
+ file(GLOB __ucrt_dlls "${WINDOWS_KITS_DIR}/bin/${__ucrt_version}${CMAKE_MSVC_ARCH}/ucrt/*.dll")
+ else()
+ file(GLOB __ucrt_dlls "${WINDOWS_KITS_DIR}/bin/${CMAKE_MSVC_ARCH}/ucrt/*.dll")
+ endif()
list(APPEND __install__libs ${__ucrt_dlls})
endif()
endif()
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index eec8d1a..869c6dd 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -1,5 +1,5 @@
# CMake version number components.
set(CMake_VERSION_MAJOR 3)
set(CMake_VERSION_MINOR 13)
-set(CMake_VERSION_PATCH 20181119)
+set(CMake_VERSION_PATCH 20181121)
#set(CMake_VERSION_RC 1)
diff --git a/Source/LexerParser/cmFortranLexer.cxx b/Source/LexerParser/cmFortranLexer.cxx
index dec0f5e..82048df 100644
--- a/Source/LexerParser/cmFortranLexer.cxx
+++ b/Source/LexerParser/cmFortranLexer.cxx
@@ -593,13 +593,13 @@ static const YY_CHAR yy_ec[256] =
13, 14, 1, 15, 1, 1, 1, 16, 16, 16,
16, 16, 16, 16, 16, 16, 16, 17, 18, 19,
20, 21, 22, 1, 23, 24, 25, 26, 27, 28,
- 24, 24, 29, 24, 24, 30, 31, 32, 33, 24,
- 24, 34, 35, 36, 37, 24, 24, 24, 24, 24,
- 1, 38, 1, 1, 39, 1, 23, 40, 41, 42,
+ 29, 29, 30, 29, 29, 31, 32, 33, 34, 29,
+ 29, 35, 36, 37, 38, 29, 29, 29, 29, 29,
+ 1, 39, 1, 1, 40, 1, 23, 24, 41, 42,
- 43, 44, 24, 24, 45, 24, 24, 46, 31, 47,
- 33, 24, 24, 34, 48, 36, 49, 24, 24, 24,
- 24, 24, 1, 1, 1, 1, 1, 1, 1, 1,
+ 43, 44, 29, 29, 45, 29, 29, 46, 32, 47,
+ 34, 29, 29, 35, 48, 37, 49, 29, 29, 29,
+ 29, 29, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@@ -621,7 +621,7 @@ static const YY_CHAR yy_meta[50] =
1, 2, 2, 3, 4, 3, 3, 1, 1, 3,
3, 3, 3, 1, 3, 5, 3, 3, 1, 3,
6, 1, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 1, 5, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 1, 5,
7, 7, 7, 7, 7, 7, 7, 7, 7
} ;
@@ -629,28 +629,28 @@ static const flex_int16_t yy_base[219] =
{ 0,
0, 48, 0, 49, 464, 56, 52, 57, 62, 68,
466, 0, 468, 468, 462, 468, 74, 81, 468, 468,
- 468, 468, 447, 468, 442, 440, 0, 41, 42, 428,
- 43, 42, 91, 119, 97, 157, 455, 206, 245, 468,
- 454, 101, 468, 468, 0, 455, 468, 105, 430, 424,
- 62, 68, 119, 141, 468, 468, 468, 111, 0, 59,
- 98, 88, 415, 109, 158, 468, 0, 162, 293, 0,
- 163, 411, 107, 122, 408, 405, 446, 342, 447, 468,
- 0, 444, 169, 173, 420, 421, 132, 404, 90, 404,
- 179, 185, 191, 227, 295, 397, 0, 146, 178, 149,
-
- 412, 0, 208, 206, 398, 171, 399, 170, 399, 391,
- 387, 422, 417, 221, 468, 374, 365, 347, 347, 334,
- 335, 335, 330, 334, 259, 340, 188, 340, 327, 327,
- 327, 324, 325, 325, 320, 322, 319, 355, 354, 325,
- 327, 468, 468, 310, 309, 309, 300, 301, 273, 273,
- 275, 277, 297, 468, 468, 293, 289, 283, 275, 305,
- 261, 238, 237, 214, 468, 468, 468, 196, 197, 189,
- 277, 181, 0, 274, 112, 468, 468, 105, 103, 311,
- 468, 233, 0, 468, 468, 83, 76, 0, 281, 282,
- 468, 468, 52, 468, 468, 468, 468, 23, 287, 298,
-
- 327, 468, 0, 0, 329, 0, 31, 468, 468, 381,
- 388, 394, 397, 404, 411, 418, 425, 432
+ 468, 468, 447, 468, 442, 440, 0, 19, 41, 427,
+ 47, 41, 90, 119, 97, 158, 455, 207, 247, 468,
+ 454, 101, 468, 468, 0, 455, 468, 105, 430, 423,
+ 62, 67, 119, 151, 468, 468, 468, 121, 0, 90,
+ 93, 110, 431, 112, 142, 468, 0, 160, 295, 0,
+ 162, 411, 123, 102, 408, 405, 446, 344, 447, 468,
+ 0, 444, 170, 174, 420, 421, 132, 404, 95, 404,
+ 180, 186, 192, 228, 297, 397, 0, 168, 144, 52,
+
+ 411, 0, 204, 217, 397, 179, 390, 170, 389, 378,
+ 364, 390, 389, 230, 468, 363, 355, 337, 337, 334,
+ 335, 335, 330, 334, 187, 339, 267, 339, 327, 327,
+ 327, 324, 325, 325, 318, 319, 318, 354, 352, 323,
+ 327, 468, 468, 310, 307, 305, 297, 297, 275, 275,
+ 277, 279, 287, 468, 468, 286, 283, 273, 196, 307,
+ 200, 238, 234, 210, 468, 468, 468, 174, 171, 162,
+ 279, 182, 0, 269, 150, 468, 468, 137, 109, 323,
+ 468, 239, 0, 468, 468, 72, 71, 0, 283, 283,
+ 468, 468, 51, 468, 468, 468, 468, 37, 283, 288,
+
+ 330, 468, 0, 0, 331, 0, 52, 468, 468, 384,
+ 391, 397, 400, 407, 414, 421, 428, 435
} ;
static const flex_int16_t yy_def[219] =
@@ -685,53 +685,53 @@ static const flex_int16_t yy_nxt[518] =
{ 0,
12, 13, 14, 13, 13, 15, 16, 12, 17, 18,
19, 20, 21, 12, 22, 12, 23, 24, 12, 25,
- 12, 26, 27, 27, 27, 27, 28, 27, 29, 27,
- 30, 27, 27, 27, 31, 27, 32, 33, 34, 27,
+ 12, 26, 27, 27, 27, 27, 28, 27, 27, 29,
+ 27, 30, 27, 27, 27, 31, 27, 32, 33, 34,
27, 27, 28, 27, 29, 27, 27, 31, 32, 35,
- 35, 208, 35, 35, 41, 36, 36, 35, 37, 41,
- 35, 42, 43, 36, 41, 202, 42, 43, 44, 38,
- 41, 42, 60, 61, 44, 48, 64, 42, 48, 63,
- 39, 39, 53, 53, 97, 53, 54, 60, 61, 64,
- 55, 63, 65, 66, 201, 65, 39, 39, 68, 49,
-
- 97, 68, 83, 84, 69, 83, 48, 87, 88, 48,
- 50, 89, 95, 100, 90, 95, 51, 198, 52, 45,
- 53, 53, 98, 53, 54, 197, 45, 45, 55, 100,
- 49, 121, 45, 99, 67, 102, 122, 45, 98, 45,
- 45, 50, 92, 53, 193, 92, 93, 51, 192, 52,
- 94, 102, 106, 107, 191, 96, 45, 67, 70, 65,
- 66, 70, 65, 68, 104, 108, 68, 104, 109, 69,
- 83, 84, 71, 83, 114, 125, 118, 114, 71, 119,
- 92, 53, 115, 92, 93, 127, 92, 53, 94, 92,
- 93, 125, 92, 53, 94, 92, 93, 127, 72, 73,
-
- 94, 74, 75, 189, 126, 76, 78, 104, 80, 104,
- 104, 133, 104, 78, 78, 130, 134, 151, 131, 78,
- 126, 78, 114, 103, 78, 114, 78, 78, 92, 53,
- 115, 92, 93, 151, 195, 195, 94, 187, 186, 185,
- 184, 183, 182, 78, 78, 79, 79, 80, 79, 79,
+ 35, 60, 35, 35, 41, 36, 36, 35, 37, 41,
+ 35, 42, 43, 36, 41, 60, 42, 43, 44, 38,
+ 41, 42, 208, 61, 44, 48, 64, 42, 48, 202,
+ 39, 39, 53, 53, 63, 53, 54, 61, 64, 127,
+ 55, 65, 66, 201, 65, 63, 39, 39, 68, 49,
+
+ 127, 68, 83, 84, 69, 83, 48, 87, 88, 48,
+ 89, 50, 198, 90, 197, 97, 51, 98, 52, 45,
+ 53, 53, 95, 53, 54, 95, 45, 45, 55, 99,
+ 49, 97, 45, 98, 67, 100, 121, 45, 102, 45,
+ 45, 122, 50, 65, 66, 108, 65, 51, 109, 52,
+ 193, 100, 92, 53, 102, 92, 93, 45, 67, 70,
+ 94, 68, 70, 104, 68, 96, 104, 69, 106, 107,
+ 126, 83, 84, 71, 83, 114, 118, 71, 114, 119,
+ 192, 92, 53, 115, 92, 93, 126, 92, 53, 94,
+ 92, 93, 191, 92, 53, 94, 92, 93, 125, 72,
+
+ 73, 94, 74, 75, 189, 104, 76, 78, 104, 80,
+ 187, 133, 186, 125, 78, 78, 134, 185, 104, 103,
+ 78, 104, 78, 130, 149, 78, 131, 78, 78, 92,
+ 53, 114, 92, 93, 114, 149, 184, 94, 183, 115,
+ 195, 195, 182, 181, 179, 78, 78, 79, 79, 80,
79, 79, 79, 79, 79, 79, 79, 79, 79, 79,
- 81, 79, 79, 79, 79, 79, 79, 81, 81, 81,
+ 79, 79, 81, 79, 79, 79, 79, 79, 79, 81,
81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
- 81, 81, 79, 81, 81, 81, 81, 81, 81, 81,
- 81, 81, 81, 81, 70, 149, 95, 70, 171, 95,
-
- 172, 173, 174, 188, 181, 199, 180, 149, 103, 180,
- 190, 200, 180, 203, 171, 180, 172, 173, 174, 188,
- 103, 199, 190, 179, 204, 178, 103, 200, 205, 203,
- 205, 205, 177, 205, 72, 73, 176, 74, 75, 96,
- 204, 76, 78, 175, 80, 206, 170, 206, 169, 78,
- 78, 168, 167, 166, 165, 78, 164, 78, 163, 162,
- 78, 161, 78, 78, 160, 159, 158, 157, 156, 155,
- 154, 153, 152, 150, 148, 147, 146, 145, 144, 78,
- 78, 40, 40, 40, 40, 40, 40, 40, 45, 143,
- 142, 141, 45, 45, 46, 46, 46, 46, 46, 46,
-
- 46, 59, 140, 59, 79, 79, 79, 79, 79, 79,
- 79, 91, 91, 91, 91, 91, 91, 91, 194, 194,
- 194, 139, 194, 194, 194, 196, 138, 196, 137, 196,
- 196, 196, 207, 207, 207, 207, 207, 136, 207, 135,
- 132, 129, 128, 124, 123, 120, 117, 116, 113, 80,
+ 81, 81, 81, 81, 81, 79, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 70, 151, 95, 70,
+
+ 171, 95, 172, 173, 174, 188, 190, 199, 180, 203,
+ 103, 180, 151, 200, 204, 178, 171, 190, 172, 173,
+ 174, 188, 103, 199, 180, 203, 177, 180, 200, 176,
+ 204, 205, 205, 175, 205, 205, 72, 73, 103, 74,
+ 75, 96, 170, 76, 78, 169, 80, 168, 206, 206,
+ 167, 78, 78, 166, 165, 164, 163, 78, 162, 78,
+ 161, 160, 78, 159, 78, 78, 158, 157, 156, 155,
+ 154, 153, 152, 150, 148, 147, 146, 145, 144, 143,
+ 142, 141, 78, 78, 40, 40, 40, 40, 40, 40,
+ 40, 45, 140, 139, 138, 45, 45, 46, 46, 46,
+
+ 46, 46, 46, 46, 59, 137, 59, 79, 79, 79,
+ 79, 79, 79, 79, 91, 91, 91, 91, 91, 91,
+ 91, 194, 194, 194, 136, 194, 194, 194, 196, 135,
+ 196, 132, 196, 196, 196, 207, 207, 207, 207, 207,
+ 129, 207, 128, 124, 123, 120, 117, 116, 113, 80,
112, 111, 110, 105, 101, 86, 85, 47, 82, 77,
62, 58, 57, 56, 47, 209, 37, 11, 209, 209,
209, 209, 209, 209, 209, 209, 209, 209, 209, 209,
@@ -749,50 +749,50 @@ static const flex_int16_t yy_chk[518] =
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 2,
- 4, 207, 2, 4, 7, 2, 4, 6, 6, 8,
- 6, 7, 7, 6, 9, 198, 8, 8, 9, 6,
- 10, 9, 28, 29, 10, 17, 32, 10, 17, 31,
- 6, 6, 18, 18, 60, 18, 18, 28, 29, 32,
- 18, 31, 33, 33, 193, 33, 6, 6, 35, 17,
-
- 60, 35, 42, 42, 35, 42, 48, 51, 51, 48,
- 17, 52, 58, 62, 52, 58, 17, 187, 17, 34,
- 53, 53, 61, 53, 53, 186, 34, 34, 53, 62,
- 48, 89, 34, 61, 34, 64, 89, 34, 61, 34,
- 34, 48, 54, 54, 179, 54, 54, 48, 178, 48,
- 54, 64, 73, 73, 175, 58, 34, 34, 36, 65,
- 65, 36, 65, 68, 71, 74, 68, 71, 74, 68,
- 83, 83, 36, 83, 84, 98, 87, 84, 71, 87,
- 91, 91, 84, 91, 91, 100, 92, 92, 91, 92,
- 92, 98, 93, 93, 92, 93, 93, 100, 36, 36,
-
- 93, 36, 36, 172, 99, 36, 38, 104, 38, 103,
- 104, 108, 103, 38, 38, 106, 108, 127, 106, 38,
- 99, 38, 114, 103, 38, 114, 38, 38, 94, 94,
- 114, 94, 94, 127, 182, 182, 94, 170, 169, 168,
- 164, 163, 162, 38, 38, 39, 39, 39, 39, 39,
+ 4, 28, 2, 4, 7, 2, 4, 6, 6, 8,
+ 6, 7, 7, 6, 9, 28, 8, 8, 9, 6,
+ 10, 9, 207, 29, 10, 17, 32, 10, 17, 198,
+ 6, 6, 18, 18, 31, 18, 18, 29, 32, 100,
+ 18, 33, 33, 193, 33, 31, 6, 6, 35, 17,
+
+ 100, 35, 42, 42, 35, 42, 48, 51, 51, 48,
+ 52, 17, 187, 52, 186, 60, 17, 61, 17, 34,
+ 53, 53, 58, 53, 53, 58, 34, 34, 53, 61,
+ 48, 60, 34, 61, 34, 62, 89, 34, 64, 34,
+ 34, 89, 48, 65, 65, 74, 65, 48, 74, 48,
+ 179, 62, 54, 54, 64, 54, 54, 34, 34, 36,
+ 54, 68, 36, 71, 68, 58, 71, 68, 73, 73,
+ 99, 83, 83, 36, 83, 84, 87, 71, 84, 87,
+ 178, 91, 91, 84, 91, 91, 99, 92, 92, 91,
+ 92, 92, 175, 93, 93, 92, 93, 93, 98, 36,
+
+ 36, 93, 36, 36, 172, 103, 36, 38, 103, 38,
+ 170, 108, 169, 98, 38, 38, 108, 168, 104, 103,
+ 38, 104, 38, 106, 125, 38, 106, 38, 38, 94,
+ 94, 114, 94, 94, 114, 125, 164, 94, 163, 114,
+ 182, 182, 162, 161, 159, 38, 38, 39, 39, 39,
39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
- 39, 39, 39, 39, 69, 125, 95, 69, 149, 95,
-
- 150, 151, 152, 171, 161, 189, 160, 125, 69, 160,
- 174, 190, 180, 199, 149, 180, 150, 151, 152, 171,
- 160, 189, 174, 159, 200, 158, 180, 190, 201, 199,
- 205, 201, 157, 205, 69, 69, 156, 69, 69, 95,
- 200, 69, 78, 153, 78, 201, 148, 205, 147, 78,
- 78, 146, 145, 144, 141, 78, 140, 78, 139, 138,
- 78, 137, 78, 78, 136, 135, 134, 133, 132, 131,
- 130, 129, 128, 126, 124, 123, 122, 121, 120, 78,
- 78, 210, 210, 210, 210, 210, 210, 210, 211, 119,
- 118, 117, 211, 211, 212, 212, 212, 212, 212, 212,
-
- 212, 213, 116, 213, 214, 214, 214, 214, 214, 214,
- 214, 215, 215, 215, 215, 215, 215, 215, 216, 216,
- 216, 113, 216, 216, 216, 217, 112, 217, 111, 217,
- 217, 217, 218, 218, 218, 218, 218, 110, 218, 109,
- 107, 105, 101, 96, 90, 88, 86, 85, 82, 79,
+ 39, 39, 39, 39, 39, 39, 69, 127, 95, 69,
+
+ 149, 95, 150, 151, 152, 171, 174, 189, 160, 199,
+ 69, 160, 127, 190, 200, 158, 149, 174, 150, 151,
+ 152, 171, 160, 189, 180, 199, 157, 180, 190, 156,
+ 200, 201, 205, 153, 201, 205, 69, 69, 180, 69,
+ 69, 95, 148, 69, 78, 147, 78, 146, 201, 205,
+ 145, 78, 78, 144, 141, 140, 139, 78, 138, 78,
+ 137, 136, 78, 135, 78, 78, 134, 133, 132, 131,
+ 130, 129, 128, 126, 124, 123, 122, 121, 120, 119,
+ 118, 117, 78, 78, 210, 210, 210, 210, 210, 210,
+ 210, 211, 116, 113, 112, 211, 211, 212, 212, 212,
+
+ 212, 212, 212, 212, 213, 111, 213, 214, 214, 214,
+ 214, 214, 214, 214, 215, 215, 215, 215, 215, 215,
+ 215, 216, 216, 216, 110, 216, 216, 216, 217, 109,
+ 217, 107, 217, 217, 217, 218, 218, 218, 218, 218,
+ 105, 218, 101, 96, 90, 88, 86, 85, 82, 79,
77, 76, 75, 72, 63, 50, 49, 46, 41, 37,
30, 26, 25, 23, 15, 11, 5, 209, 209, 209,
209, 209, 209, 209, 209, 209, 209, 209, 209, 209,
diff --git a/Source/LexerParser/cmFortranLexer.in.l b/Source/LexerParser/cmFortranLexer.in.l
index 9acba4c..b7e837b 100644
--- a/Source/LexerParser/cmFortranLexer.in.l
+++ b/Source/LexerParser/cmFortranLexer.in.l
@@ -146,7 +146,7 @@ $[ \t]*endif { return F90PPR_ENDIF; }
[Ii][Nn][Cc][Ll][Uu][Dd][Ee] { return INCLUDE; }
[Ii][Nn][Tt][Ee][Rr][Ff][Aa][Cc][Ee] { return INTERFACE; }
[Mm][Oo][Dd][Uu][Ll][Ee] { return MODULE; }
-[Ss][Uu][bb][Mm][Oo][Dd][Uu][Ll][Ee] { return SUBMODULE; }
+[Ss][Uu][Bb][Mm][Oo][Dd][Uu][Ll][Ee] { return SUBMODULE; }
[Uu][Ss][Ee] { return USE; }
[a-zA-Z_][a-zA-Z_0-9]* {
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/FortranModules/Submodules/child.f90 b/Tests/FortranModules/Submodules/child.f90
index 838ab61..c314835 100644
--- a/Tests/FortranModules/Submodules/child.f90
+++ b/Tests/FortranModules/Submodules/child.f90
@@ -1,10 +1,10 @@
! Test the notation for a 1st-generation direct
! descendant of a parent module
-submodule ( parent ) child
+SUBMODULE ( parent ) child
implicit none
-contains
+CONTAINS
module function child_function() result(child_stuff)
logical :: child_stuff
child_stuff=.true.
end function
-end submodule child
+END SUBMODULE child
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)