Merge topic 'CheckSourceRuns-compatibility' into release-3.19
a524bf3aa7 CheckSourceRuns: do not fail on unrecognized arguments
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5426
diff --git a/.gitlab/ci/cmake.ps1 b/.gitlab/ci/cmake.ps1
index 3b42cae..e73aab7 100755
--- a/.gitlab/ci/cmake.ps1
+++ b/.gitlab/ci/cmake.ps1
@@ -1,7 +1,7 @@
$erroractionpreference = "stop"
-$version = "3.17.2"
-$sha256sum = "CF82B1EB20B6FBE583487656FCD496490FFCCDFBCBBA0F26E19F1C9C63B0B041"
+$version = "3.18.4"
+$sha256sum = "A932BC0C8EE79F1003204466C525B38A840424D4AE29F9E5FB88959116F2407D"
$filename = "cmake-$version-win64-x64"
$tarball = "$filename.zip"
diff --git a/.gitlab/ci/cmake.sh b/.gitlab/ci/cmake.sh
index 658a62a..b4c6ddf 100755
--- a/.gitlab/ci/cmake.sh
+++ b/.gitlab/ci/cmake.sh
@@ -2,17 +2,17 @@
set -e
-readonly version="3.17.2"
+readonly version="3.18.4"
case "$( uname -s )" in
Linux)
shatool="sha256sum"
- sha256sum="dc57f3cc448ca67fc8776b4ad4c22b087b9c6a8e459938b9622b8c7f4ef6b21e"
+ sha256sum="149e0cee002e59e0bb84543cf3cb099f108c08390392605e944daeb6594cbc29"
platform="Linux"
;;
Darwin)
shatool="shasum -a 256"
- sha256sum="139500e20b080444fcafe57f24f57248c691c5187cce6695bee2b9aad6792c7d"
+ sha256sum="9d27049660474cf134ab46fa0e0db771b263313fcb8ba82ee8b2d1a1a62f8f20"
platform="Darwin"
;;
*)
diff --git a/.gitlab/ci/download_qt.cmake b/.gitlab/ci/download_qt.cmake
index 31ce6c3..c7e3717 100644
--- a/.gitlab/ci/download_qt.cmake
+++ b/.gitlab/ci/download_qt.cmake
@@ -3,7 +3,7 @@
# Input variables.
set(qt_version_major "5")
set(qt_version_minor "15")
-set(qt_version_patch "0")
+set(qt_version_patch "1")
# This URL is only visible inside of Kitware's network. Please use your own Qt
# Account to obtain these files.
if ("$ENV{CMAKE_CONFIGURATION}" MATCHES "package")
@@ -20,7 +20,7 @@
elseif ("$ENV{CMAKE_CONFIGURATION}" MATCHES "vs2017" OR
"$ENV{CMAKE_CONFIGURATION}" MATCHES "vs2019")
set(qt_platform "windows_x86")
- set(msvc_year "2017")
+ set(msvc_year "2019")
set(qt_abi "win64_msvc${msvc_year}_64")
elseif ("$ENV{CMAKE_CONFIGURATION}" MATCHES "macos")
set(qt_platform "mac_x64")
@@ -37,14 +37,7 @@
# Files needed to download.
set(qt_files)
if (qt_platform STREQUAL "windows_x86")
- if (msvc_year STREQUAL "2017")
- set(qt_build_stamp "202002260536")
- elseif (msvc_year STREQUAL "2015")
- set(qt_build_stamp "202005150700")
- else ()
- message(FATAL_ERROR
- "Build stamp for MSVC ${msvc_year} is unknown")
- endif ()
+ set(qt_build_stamp "202009071110")
set(qt_file_name_prefix "${qt_version}-0-${qt_build_stamp}")
@@ -60,7 +53,7 @@
"qt-5.6.2-macosx10.7-x86_64.tar.xz")
set(qt_subdir "qt-5.6.2-macosx10.7-x86_64")
else ()
- set(qt_build_stamp "202005140805")
+ set(qt_build_stamp "202009071110")
set(qt_file_name_prefix "${qt_version}-0-${qt_build_stamp}")
foreach (qt_component IN ITEMS qtbase)
diff --git a/.gitlab/ci/download_qt_hashes.cmake b/.gitlab/ci/download_qt_hashes.cmake
index 28837dc..02a6fdd 100644
--- a/.gitlab/ci/download_qt_hashes.cmake
+++ b/.gitlab/ci/download_qt_hashes.cmake
@@ -2,12 +2,12 @@
#
# sha256sum $files | awk '{ print "set(\"" $2 "_hash\" " $1 ")" }' >> $thisfile
-set("5.15.0-0-202002260536qtbase-Windows-Windows_10-MSVC2017-Windows-Windows_10-X86_64.7z_hash" c041596be8f7a16c7be9ea6757c14766ff3200ab6d56f7db8f865dbfe039fe20)
-set("5.15.0-0-202002260536qtwinextras-Windows-Windows_10-MSVC2017-Windows-Windows_10-X86_64.7z_hash" 10796128fac54f146767e33f6872975ba238858547de7a9650ec4cd9581fe71a)
+set("5.15.1-0-202009071110qtbase-Windows-Windows_10-MSVC2019-Windows-Windows_10-X86_64.7z_hash" a5635124a135f383d9fb92bf628b018cff9f781addfd388926a367cda5b7cd38)
+set("5.15.1-0-202009071110qtwinextras-Windows-Windows_10-MSVC2019-Windows-Windows_10-X86_64.7z_hash" 908947855b5d7a854886746365ac29e9296b5d64d4e18089641a6988167807d3)
-set("5.15.0-0-202005150700qtbase-Windows-Windows_10-MSVC2015-Windows-Windows_10-X86_64.7z_hash" 0c2653c5eca256f59c0b48b537cd633b05560e4241c0226856d2ae22ab066df4)
-set("5.15.0-0-202005150700qtwinextras-Windows-Windows_10-MSVC2015-Windows-Windows_10-X86_64.7z_hash" 4bca3a8d8c7611e211a82d86b3396f8a622abe7859d5052452414642ec191844)
+set("5.15.1-0-202009071110qtbase-Windows-Windows_10-MSVC2015-Windows-Windows_10-X86_64.7z_hash" 5d0d2e71e3b00cf88ac4c616b4b314a7e73871f325512821f53c464cdfee961f)
+set("5.15.1-0-202009071110qtwinextras-Windows-Windows_10-MSVC2015-Windows-Windows_10-X86_64.7z_hash" 803e0234169464babb5305dedc21382e90c3266c6f9414ff0cff04be578681e1)
-set("5.15.0-0-202005140805qtbase-MacOS-MacOS_10_13-Clang-MacOS-MacOS_10_13-X86_64.7z_hash" 04d867c81d2431f288c42c9752642759460b9468477de349368dcc8de0c8ddc4)
+set("5.15.1-0-202009071110qtbase-MacOS-MacOS_10_13-Clang-MacOS-MacOS_10_13-X86_64.7z_hash" df2813ce7c6cb4287abd7956cd1cb9d08312e4ac1208b6cb57af4df11b8ebba1)
set("qt-5.6.2-macosx10.7-x86_64.tar.xz_hash" 2b60373ea60037ce356d4c9f5a8c1df9854127a2c55118252e1a2f5a5f4e0010)
diff --git a/Help/command/cmake_path.rst b/Help/command/cmake_path.rst
index 555926b..cb84dd1 100644
--- a/Help/command/cmake_path.rst
+++ b/Help/command/cmake_path.rst
@@ -65,15 +65,15 @@
the target system. So this is not generally applicable to the target system
in cross-compiling environment.
-For all commands, ``<path>`` placeholder expect a variable name. An error will
-be raised if the variable does not exist, except for `APPEND`_ and
+For all commands, ``<path-var>`` placeholder expect a variable name. An error
+will be raised if the variable does not exist, except for `APPEND`_ and
`CMAKE_PATH`_ sub-commands. ``<input>`` placeholder expect a string literal.
-``[<input>...]`` placeholder expect zero or more arguments. ``<output>``
+``[<input>...]`` placeholder expect zero or more arguments. ``<out-var>``
placeholder expect a variable name.
.. note::
- ``cmake_path`` command does not support list of paths. The ``<path>``
+ ``cmake_path`` command does not support list of paths. The ``<path-var>``
placeholder must store only one path name.
To initialize a path variable, three possibilities can be used:
@@ -96,7 +96,7 @@
`Modification`_ and `Generation`_ sub-commands store the result in-place or in
the variable specified by ``OUTPUT_VARIABLE`` option. All other sub-commands,
-except `CMAKE_PATH`_, store the result in the required ``<output>`` variable.
+except `CMAKE_PATH`_, store the result in the required ``<out-var>`` variable.
Sub-commands supporting ``NORMALIZE`` option will :ref:`normalize <NORMAL_PATH>`
the path.
@@ -107,58 +107,58 @@
.. parsed-literal::
`Decomposition`_
- cmake_path(`GET`_ <path> :ref:`ROOT_NAME <GET_ROOT_NAME>` <output>)
- cmake_path(`GET`_ <path> :ref:`ROOT_DIRECTORY <GET_ROOT_DIRECTORY>` <output>)
- cmake_path(`GET`_ <path> :ref:`ROOT_PATH <GET_ROOT_PATH>` <output>)
- cmake_path(`GET`_ <path> :ref:`FILENAME <GET_FILENAME>` <output>)
- cmake_path(`GET`_ <path> :ref:`EXTENSION <GET_EXTENSION>` [LAST_ONLY] <output>)
- cmake_path(`GET`_ <path> :ref:`STEM <GET_STEM>` [LAST_ONLY] <output>)
- cmake_path(`GET`_ <path> :ref:`RELATIVE_PATH <GET_RELATIVE_PATH>` <output>)
- cmake_path(`GET`_ <path> :ref:`PARENT_PATH <GET_PARENT_PATH>` <output>)
+ cmake_path(`GET`_ <path-var> :ref:`ROOT_NAME <GET_ROOT_NAME>` <out-var>)
+ cmake_path(`GET`_ <path-var> :ref:`ROOT_DIRECTORY <GET_ROOT_DIRECTORY>` <out-var>)
+ cmake_path(`GET`_ <path-var> :ref:`ROOT_PATH <GET_ROOT_PATH>` <out-var>)
+ cmake_path(`GET`_ <path-var> :ref:`FILENAME <GET_FILENAME>` <out-var>)
+ cmake_path(`GET`_ <path-var> :ref:`EXTENSION <GET_EXTENSION>` [LAST_ONLY] <out-var>)
+ cmake_path(`GET`_ <path-var> :ref:`STEM <GET_STEM>` [LAST_ONLY] <out-var>)
+ cmake_path(`GET`_ <path-var> :ref:`RELATIVE_PATH <GET_RELATIVE_PATH>` <out-var>)
+ cmake_path(`GET`_ <path-var> :ref:`PARENT_PATH <GET_PARENT_PATH>` <out-var>)
`Modification`_
- cmake_path(`APPEND`_ <path> [<input>...] [OUTPUT_VARIABLE <output>])
- cmake_path(`CONCAT`_ <path> [<input>...] [OUTPUT_VARIABLE <output>])
- cmake_path(`REMOVE_FILENAME`_ <path> [OUTPUT_VARIABLE <output>])
- cmake_path(`REPLACE_FILENAME`_ <path> <input> [OUTPUT_VARIABLE <output>])
- cmake_path(`REMOVE_EXTENSION`_ <path> [LAST_ONLY]
- [OUTPUT_VARIABLE <output>])
- cmake_path(`REPLACE_EXTENSION`_ <path> [LAST_ONLY] <input>
- [OUTPUT_VARIABLE <output>])
+ cmake_path(`APPEND`_ <path-var> [<input>...] [OUTPUT_VARIABLE <out-var>])
+ cmake_path(`CONCAT`_ <path-var> [<input>...] [OUTPUT_VARIABLE <out-var>])
+ cmake_path(`REMOVE_FILENAME`_ <path-var> [OUTPUT_VARIABLE <out-var>])
+ cmake_path(`REPLACE_FILENAME`_ <path-var> <input> [OUTPUT_VARIABLE <out-var>])
+ cmake_path(`REMOVE_EXTENSION`_ <path-var> [LAST_ONLY]
+ [OUTPUT_VARIABLE <out-var>])
+ cmake_path(`REPLACE_EXTENSION`_ <path-var> [LAST_ONLY] <input>
+ [OUTPUT_VARIABLE <out-var>])
`Generation`_
- cmake_path(`NORMAL_PATH`_ <path> [OUTPUT_VARIABLE <output>])
- cmake_path(`RELATIVE_PATH`_ <path> [BASE_DIRECTORY <path>]
- [OUTPUT_VARIABLE <output>])
- cmake_path(`PROXIMATE_PATH`_ <path> [BASE_DIRECTORY <path>]
- [OUTPUT_VARIABLE <output>])
- cmake_path(`ABSOLUTE_PATH`_ <path> [BASE_DIRECTORY <path>] [NORMALIZE]
- [OUTPUT_VARIABLE <output>])
+ cmake_path(`NORMAL_PATH`_ <path-var> [OUTPUT_VARIABLE <out-var>])
+ cmake_path(`RELATIVE_PATH`_ <path-var> [BASE_DIRECTORY <input>]
+ [OUTPUT_VARIABLE <out-var>])
+ cmake_path(`PROXIMATE_PATH`_ <path-var> [BASE_DIRECTORY <input>]
+ [OUTPUT_VARIABLE <out-var>])
+ cmake_path(`ABSOLUTE_PATH`_ <path-var> [BASE_DIRECTORY <input>] [NORMALIZE]
+ [OUTPUT_VARIABLE <out-var>])
`Conversion`_
- cmake_path(`CMAKE_PATH`_ <path> [NORMALIZE] <input>)
- cmake_path(`NATIVE_PATH`_ <path> [NORMALIZE] <output>)
- cmake_path(`CONVERT`_ <input> `TO_CMAKE_PATH_LIST`_ <output>)
- cmake_path(`CONVERT`_ <input> `TO_NATIVE_PATH_LIST`_ <output>)
+ cmake_path(`CMAKE_PATH`_ <path-var> [NORMALIZE] <input>)
+ cmake_path(`NATIVE_PATH`_ <path-var> [NORMALIZE] <out-var>)
+ cmake_path(`CONVERT`_ <input> `TO_CMAKE_PATH_LIST`_ <out-var>)
+ cmake_path(`CONVERT`_ <input> `TO_NATIVE_PATH_LIST`_ <out-var>)
`Comparison`_
- cmake_path(`COMPARE`_ <path> <OP> <input> <output>)
+ cmake_path(`COMPARE`_ <path-var> <OP> <input> <out-var>)
`Query`_
- cmake_path(`HAS_ROOT_NAME`_ <path> <output>)
- cmake_path(`HAS_ROOT_DIRECTORY`_ <path> <output>)
- cmake_path(`HAS_ROOT_PATH`_ <path> <output>)
- cmake_path(`HAS_FILENAME`_ <path> <output>)
- cmake_path(`HAS_EXTENSION`_ <path> <output>)
- cmake_path(`HAS_STEM`_ <path> <output>)
- cmake_path(`HAS_RELATIVE_PATH`_ <path> <output>)
- cmake_path(`HAS_PARENT_PATH`_ <path> <output>)
- cmake_path(`IS_ABSOLUTE`_ <path> <output>)
- cmake_path(`IS_RELATIVE`_ <path> <output>)
- cmake_path(`IS_PREFIX`_ <path> <input> [NORMALIZE] <output>)
+ cmake_path(`HAS_ROOT_NAME`_ <path-var> <out-var>)
+ cmake_path(`HAS_ROOT_DIRECTORY`_ <path-var> <out-var>)
+ cmake_path(`HAS_ROOT_PATH`_ <path-var> <out-var>)
+ cmake_path(`HAS_FILENAME`_ <path-var> <out-var>)
+ cmake_path(`HAS_EXTENSION`_ <path-var> <out-var>)
+ cmake_path(`HAS_STEM`_ <path-var> <out-var>)
+ cmake_path(`HAS_RELATIVE_PATH`_ <path-var> <out-var>)
+ cmake_path(`HAS_PARENT_PATH`_ <path-var> <out-var>)
+ cmake_path(`IS_ABSOLUTE`_ <path-var> <out-var>)
+ cmake_path(`IS_RELATIVE`_ <path-var> <out-var>)
+ cmake_path(`IS_PREFIX`_ <path-var> <input> [NORMALIZE] <out-var>)
`Hashing`_
- cmake_path(`HASH`_ <path> [NORMALIZE] <output>)
+ cmake_path(`HASH`_ <path-var> [NORMALIZE] <out-var>)
Decomposition
^^^^^^^^^^^^^
@@ -168,7 +168,7 @@
.. code-block:: cmake
- cmake_path(GET <path> ROOT_NAME <output>)
+ cmake_path(GET <path-var> ROOT_NAME <out-var>)
Returns the root name of the path. If the path does not include a root name,
returns an empty path.
@@ -194,7 +194,7 @@
.. code-block:: cmake
- cmake_path(GET <path> ROOT_DIRECTORY <output>)
+ cmake_path(GET <path-var> ROOT_DIRECTORY <out-var>)
Returns the root directory of the path. If the path does not include a root
directory, returns an empty path.
@@ -215,7 +215,7 @@
.. code-block:: cmake
- cmake_path(GET <path> ROOT_PATH <output>)
+ cmake_path(GET <path-var> ROOT_PATH <out-var>)
Returns the root path of the path. If the path does not include a root path,
returns an empty path.
@@ -238,7 +238,7 @@
.. code-block:: cmake
- cmake_path(GET <path> FILENAME <output>)
+ cmake_path(GET <path-var> FILENAME <out-var>)
Returns the :ref:`filename <FILENAME_DEF>` component of the path. If the path
ends with a ``directory-separator``, there is no filename, so returns an empty
@@ -265,7 +265,7 @@
.. code-block:: cmake
- cmake_path(GET <path> EXTENSION [LAST_ONLY] <output>)
+ cmake_path(GET <path-var> EXTENSION [LAST_ONLY] <out-var>)
Returns the :ref:`extension <EXTENSION_DEF>` of the filename component.
@@ -301,7 +301,7 @@
.. code-block:: cmake
- cmake_path(GET <path> STEM [LAST_ONLY] <output>)
+ cmake_path(GET <path-var> STEM [LAST_ONLY] <out-var>)
Returns the :ref:`filename <FILENAME_DEF>` component of the path stripped of
its :ref:`extension <EXTENSION_DEF>`.
@@ -334,11 +334,11 @@
.. code-block:: cmake
- cmake_path(GET <path> RELATIVE_PATH <output>)
+ cmake_path(GET <path-var> RELATIVE_PATH <out-var>)
Returns path relative to ``root-path``, that is, a pathname composed of
-every component of ``<path>`` after ``root-path``. If ``<path>`` is an empty
-path, returns an empty path.
+every component of ``<path-var>`` after ``root-path``. If ``<path-var>`` is
+an empty path, returns an empty path.
For Example:
@@ -361,12 +361,12 @@
.. code-block:: cmake
- cmake_path(GET <path> PARENT_PATH <output>)
+ cmake_path(GET <path-var> PARENT_PATH <out-var>)
Returns the path to the parent directory.
If `HAS_RELATIVE_PATH`_ sub-command returns false, the result is a copy of
-``<path>``. Otherwise, the result is ``<path>`` with one fewer element.
+``<path-var>``. Otherwise, the result is ``<path-var>`` with one fewer element.
For Example:
@@ -392,15 +392,17 @@
.. code-block:: cmake
- cmake_path(APPEND <path> [<input>...] [OUTPUT_VARIABLE <output>])
+ cmake_path(APPEND <path-var> [<input>...] [OUTPUT_VARIABLE <out-var>])
-Append all the ``<input>`` arguments to the ``<path>`` using ``/`` as
+Append all the ``<input>`` arguments to the ``<path-var>`` using ``/`` as
``directory-separator``.
For each ``<input>`` argument, the following algorithm (pseudo-code) applies:
.. code-block:: cmake
+ # <path> is the contents of <path-var>
+
IF (<input>.is_absolute() OR
(<input>.has_root_name() AND
NOT <input>.root_name() STREQUAL <path>.root_name()))
@@ -411,7 +413,7 @@
IF (<input>.has_root_directory())
remove any root-directory and the entire relative path from <path>
ELSEIF (<path>.has_filename() OR
- (NOT <path>.has_root_directory() OR <path>.is_absolute()))
+ (NOT <path-var>.has_root_directory() OR <path>.is_absolute()))
appends directory-separator to <path>
ENDIF()
@@ -421,22 +423,22 @@
.. code-block:: cmake
- cmake_path(CONCAT <path> [<input>...] [OUTPUT_VARIABLE <output>])
+ cmake_path(CONCAT <path-var> [<input>...] [OUTPUT_VARIABLE <out-var>])
-Concatenates all the ``<input>`` arguments to the ``<path>`` without
+Concatenates all the ``<input>`` arguments to the ``<path-var>`` without
``directory-separator``.
.. _REMOVE_FILENAME:
.. code-block:: cmake
- cmake_path(REMOVE_FILENAME <path> [OUTPUT_VARIABLE <output>])
+ cmake_path(REMOVE_FILENAME <path-var> [OUTPUT_VARIABLE <out-var>])
Removes the :ref:`filename <FILENAME_DEF>` component (as returned by
-:ref:`GET ... FILENAME <GET_FILENAME>`) from ``<path>``.
+:ref:`GET ... FILENAME <GET_FILENAME>`) from ``<path-var>``.
After this function returns, if change is done in-place, `HAS_FILENAME`_
-returns false for ``<path>``.
+returns false for ``<path-var>``.
For Example:
@@ -458,13 +460,13 @@
.. code-block:: cmake
- cmake_path(REPLACE_FILENAME <path> <input> [OUTPUT_VARIABLE <output>])
+ cmake_path(REPLACE_FILENAME <path-var> <input> [OUTPUT_VARIABLE <out-var>])
-Replaces the :ref:`filename <FILENAME_DEF>` component from ``<path>`` with
+Replaces the :ref:`filename <FILENAME_DEF>` component from ``<path-var>`` with
``<input>``.
-If ``<path>`` has no filename component (`HAS_FILENAME`_ returns false), the
-path is unchanged.
+If ``<path-var>`` has no filename component (`HAS_FILENAME`_ returns false),
+the path is unchanged.
Equivalent to the following:
@@ -480,23 +482,24 @@
.. code-block:: cmake
- cmake_path(REMOVE_EXTENSION <path> [LAST_ONLY] [OUTPUT_VARIABLE <output>])
+ cmake_path(REMOVE_EXTENSION <path-var> [LAST_ONLY]
+ [OUTPUT_VARIABLE <out-var>])
-Removes the :ref:`extension <EXTENSION_DEF>`, if any, from ``<path>``.
+Removes the :ref:`extension <EXTENSION_DEF>`, if any, from ``<path-var>``.
.. _REPLACE_EXTENSION:
.. code-block:: cmake
- cmake_path(REPLACE_EXTENSION <path> [LAST_ONLY] <input>
- [OUTPUT_VARIABLE <output>])
+ cmake_path(REPLACE_EXTENSION <path-var> [LAST_ONLY] <input>
+ [OUTPUT_VARIABLE <out-var>])
Replaces the :ref:`extension <EXTENSION_DEF>` with ``<input>``.
- 1. If ``<path>`` has an :ref:`extension <EXTENSION_DEF>`
+ 1. If ``<path-var>`` has an :ref:`extension <EXTENSION_DEF>`
(`HAS_EXTENSION`_ is true), it is removed.
- 2. A ``dot`` character is appended to ``<path>``, if ``<input>`` is not empty
- or does not begin with a ``dot`` character.
+ 2. A ``dot`` character is appended to ``<path-var>``, if ``<input>`` is not
+ empty or does not begin with a ``dot`` character.
3. ``<input>`` is appended as if `CONCAT`_ was used.
@@ -517,9 +520,9 @@
.. code-block:: cmake
- cmake_path(NORMAL_PATH <path> [OUTPUT_VARIABLE <output>])
+ cmake_path(NORMAL_PATH <path-var> [OUTPUT_VARIABLE <out-var>])
-Normalize ``<path>``.
+Normalize ``<path-var>``.
A path can be normalized by following this algorithm:
@@ -544,10 +547,10 @@
.. code-block:: cmake
- cmake_path(RELATIVE_PATH <path> [BASE_DIRECTORY <path>]
- [OUTPUT_VARIABLE <output>])
+ cmake_path(RELATIVE_PATH <path-var> [BASE_DIRECTORY <input>]
+ [OUTPUT_VARIABLE <out-var>])
-Returns ``<path>`` made relative to ``BASE_DIRECTORY`` argument. If
+Returns ``<path-var>`` made relative to ``BASE_DIRECTORY`` argument. If
``BASE_DIRECTORY`` is not specified, the default base directory will be
:variable:`CMAKE_CURRENT_SOURCE_DIR`.
@@ -558,11 +561,11 @@
.. code-block:: cmake
- cmake_path(PROXIMATE_PATH <path> [BASE_DIRECTORY <path>]
- [OUTPUT_VARIABLE <output>])
+ cmake_path(PROXIMATE_PATH <path-var> [BASE_DIRECTORY <input>]
+ [OUTPUT_VARIABLE <out-var>])
If the value of `RELATIVE_PATH`_ is not an empty path, return
-it. Otherwise return ``<path>``.
+it. Otherwise return ``<path-var>``.
If ``BASE_DIRECTORY`` is not specified, the default base directory will be
:variable:`CMAKE_CURRENT_SOURCE_DIR`.
@@ -571,10 +574,10 @@
.. code-block:: cmake
- cmake_path(ABSOLUTE_PATH <path> [BASE_DIRECTORY <path>] [NORMALIZE]
- [OUTPUT_VARIABLE <output>])
+ cmake_path(ABSOLUTE_PATH <path-var> [BASE_DIRECTORY <input>] [NORMALIZE]
+ [OUTPUT_VARIABLE <out-var>])
-If ``<path>`` is a relative path (`IS_RELATIVE`_ is true), it is evaluated
+If ``<path-var>`` is a relative path (`IS_RELATIVE`_ is true), it is evaluated
relative to the given base directory specified by ``BASE_DIRECTORY`` option.
If ``BASE_DIRECTORY`` is not specifired, the default base directory will be
@@ -595,7 +598,7 @@
.. code-block:: cmake
- cmake_path(CMAKE_PATH <path> [NORMALIZE] <input>)
+ cmake_path(CMAKE_PATH <path-var> [NORMALIZE] <input>)
Converts a native ``<input>`` path into cmake-style path with forward-slashes
(``/``). On Windows, the long filename marker is taken into account.
@@ -624,9 +627,9 @@
.. code-block:: cmake
- cmake_path(NATIVE_PATH <path> [NORMALIZE] <output>)
+ cmake_path(NATIVE_PATH <path-var> [NORMALIZE] <out-var>)
-Converts a cmake-style ``<path>`` into a native
+Converts a cmake-style ``<path-var>`` into a native
path with platform-specific slashes (``\`` on Windows and ``/`` elsewhere).
When ``NORMALIZE`` option is specified, the path is :ref:`normalized
@@ -638,13 +641,13 @@
.. code-block:: cmake
- cmake_path(CONVERT <input> TO_CMAKE_PATH_LIST <output> [NORMALIZE])
+ cmake_path(CONVERT <input> TO_CMAKE_PATH_LIST <out-var> [NORMALIZE])
Converts a native ``<input>`` path into cmake-style path with forward-slashes
(``/``). On Windows, the long filename marker is taken into account. The input can
be a single path or a system search path like ``$ENV{PATH}``. A search path
will be converted to a cmake-style list separated by ``;`` characters. The
-result of the conversion is stored in the ``<output>`` variable.
+result of the conversion is stored in the ``<out-var>`` variable.
When ``NORMALIZE`` option is specified, the path is :ref:`normalized
<NORMAL_PATH>` before the conversion.
@@ -654,12 +657,12 @@
.. code-block:: cmake
- cmake_path(CONVERT <input> TO_NATIVE_PATH_LIST <output> [NORMALIZE])
+ cmake_path(CONVERT <input> TO_NATIVE_PATH_LIST <out-var> [NORMALIZE])
Converts a cmake-style ``<input>`` path into a native path with
platform-specific slashes (``\`` on Windows and ``/`` elsewhere). The input can
be a single path or a cmake-style list. A list will be converted into a native
-search path. The result of the conversion is stored in the ``<output>``
+search path. The result of the conversion is stored in the ``<out-var>``
variable.
When ``NORMALIZE`` option is specified, the path is :ref:`normalized
@@ -688,8 +691,8 @@
.. code-block:: cmake
- cmake_path(COMPARE <path> EQUAL <input> <output>)
- cmake_path(COMPARE <path> NOT_EQUAL <input> <output>)
+ cmake_path(COMPARE <path-var> EQUAL <input> <out-var>)
+ cmake_path(COMPARE <path-var> NOT_EQUAL <input> <out-var>)
Compares the lexical representations of the path and another path.
@@ -697,6 +700,8 @@
.. code-block:: cmake
+ # <path> is the contents of <path-var>
+
IF (NOT <path>.root_name() STREQUAL <input>.root_name())
returns FALSE
ELSEIF (<path>.has_root_directory() XOR <input>.has_root_directory())
@@ -714,43 +719,43 @@
.. code-block:: cmake
- cmake_path(HAS_ROOT_NAME <path> <output>)
+ cmake_path(HAS_ROOT_NAME <path-var> <out-var>)
-Checks if ``<path>`` has ``root-name``.
+Checks if ``<path-var>`` has ``root-name``.
.. _HAS_ROOT_DIRECTORY:
.. code-block:: cmake
- cmake_path(HAS_ROOT_DIRECTORY <path> <output>)
+ cmake_path(HAS_ROOT_DIRECTORY <path-var> <out-var>)
-Checks if ``<path>`` has ``root-directory``.
+Checks if ``<path-var>`` has ``root-directory``.
.. _HAS_ROOT_PATH:
.. code-block:: cmake
- cmake_path(HAS_ROOT_PATH <path> <output>)
+ cmake_path(HAS_ROOT_PATH <path-var> <out-var>)
-Checks if ``<path>`` has root path.
+Checks if ``<path-var>`` has root path.
-Effectively, checks if ``<path>`` has ``root-name`` and ``root-directory``.
+Effectively, checks if ``<path-var>`` has ``root-name`` and ``root-directory``.
.. _HAS_FILENAME:
.. code-block:: cmake
- cmake_path(HAS_FILENAME <path> <output>)
+ cmake_path(HAS_FILENAME <path-var> <out-var>)
-Checks if ``<path>`` has a :ref:`filename <FILENAME_DEF>`.
+Checks if ``<path-var>`` has a :ref:`filename <FILENAME_DEF>`.
.. _HAS_EXTENSION:
.. code-block:: cmake
- cmake_path(HAS_EXTENSION <path> <output>)
+ cmake_path(HAS_EXTENSION <path-var> <out-var>)
-Checks if ``<path>`` has an :ref:`extension <EXTENSION_DEF>`. If the first
+Checks if ``<path-var>`` has an :ref:`extension <EXTENSION_DEF>`. If the first
character in the filename is a period, it is not treated as an extension (for
example ".profile").
@@ -758,36 +763,36 @@
.. code-block:: cmake
- cmake_path(HAS_STEM <path> <output>)
+ cmake_path(HAS_STEM <path-var> <out-var>)
-Checks if ``<path>`` has stem (:ref:`GET ... STEM <GET_STEM>` returns a non
+Checks if ``<path-var>`` has stem (:ref:`GET ... STEM <GET_STEM>` returns a non
empty path).
.. _HAS_RELATIVE_PATH:
.. code-block:: cmake
- cmake_path(HAS_RELATIVE_PATH <path> <output>)
+ cmake_path(HAS_RELATIVE_PATH <path-var> <out-var>)
-Checks if ``<path>`` has relative path (`GET_RELATIVE_PATH`_ returns a
+Checks if ``<path-var>`` has relative path (`GET_RELATIVE_PATH`_ returns a
non-empty path).
.. _HAS_PARENT_PATH:
.. code-block:: cmake
- cmake_path(HAS_PARENT_PATH <path> <output>)
+ cmake_path(HAS_PARENT_PATH <path-var> <out-var>)
-Checks if ``<path>`` has parent path. The result is true except if the path is
-only composed of a :ref:`filename <FILENAME_DEF>`.
+Checks if ``<path-var>`` has parent path. The result is true except if the path
+is only composed of a :ref:`filename <FILENAME_DEF>`.
.. _IS_ABSOLUTE:
.. code-block:: cmake
- cmake_path(IS_ABSOLUTE <path> <output>)
+ cmake_path(IS_ABSOLUTE <path-var> <out-var>)
-Checks if ``<path>`` is absolute.
+Checks if ``<path-var>`` is absolute.
An absolute path is a path that unambiguously identifies the location of a file
without reference to an additional starting location.
@@ -796,7 +801,7 @@
.. code-block:: cmake
- cmake_path(IS_RELATIVE <path> <output>)
+ cmake_path(IS_RELATIVE <path-var> <out-var>)
Checks if path is relative (i.e. not :ref:`absolute <IS_ABSOLUTE>`).
@@ -804,9 +809,9 @@
.. code-block:: cmake
- cmake_path(IS_PREFIX <path> <input> [NORMALIZE] <output>)
+ cmake_path(IS_PREFIX <path-var> <input> [NORMALIZE] <out-var>)
-Checks if ``<path>`` is the prefix of ``<input>``.
+Checks if ``<path-var>`` is the prefix of ``<input>``.
When ``NORMALIZE`` option is specified, the paths are :ref:`normalized
<NORMAL_PATH>` before the check.
@@ -818,11 +823,11 @@
.. code-block:: cmake
- cmake_path(HASH <path> [NORMALIZE] <output>)
+ cmake_path(HASH <path-var> [NORMALIZE] <out-var>)
-Compute hash value of ``<path>`` such that if for two paths (``p1`` and ``p2``)
-are equal (:ref:`COMPARE ... EQUAL <COMPARE>`) then hash value of p1 is equal
-to hash value of p2.
+Compute hash value of ``<path-var>`` such that if for two paths (``p1`` and
+``p2``) are equal (:ref:`COMPARE ... EQUAL <COMPARE>`) then hash value of p1 is
+equal to hash value of p2.
When ``NORMALIZE`` option is specified, the paths are :ref:`normalized
<NORMAL_PATH>` before the check.
diff --git a/Help/command/string.rst b/Help/command/string.rst
index 0c2f57e..51f8d82 100644
--- a/Help/command/string.rst
+++ b/Help/command/string.rst
@@ -491,6 +491,16 @@
Functionality for querying a JSON string.
+.. note::
+ In each of the following JSON-related subcommands, if the optional
+ ``ERROR_VARIABLE`` argument is given, errors will be reported in
+ ``<error-variable>`` and the ``<out-var>`` will be set to
+ ``<member|index>-[<member|index>...]-NOTFOUND`` with the path elements
+ up to the point where the error occurred, or just ``NOTFOUND`` if there
+ is no relevant path. If an error occurs but the ``ERROR_VARIABLE``
+ option is not present, a fatal error message is generated. If no error
+ occurs, the ``<error-variable>`` will be set to ``NOTFOUND``.
+
.. _GET:
.. code-block:: cmake
@@ -563,13 +573,6 @@
EQUAL <json-string1> <json-string2>)
Compare the two JSON objects given by ``<json-string1>`` and ``<json-string2>``
-for equality
-
-
-If the optional ``ERROR_VARIABLE`` argument is given, errors will be
-reported in ``<error-variable>``. If no error occurs, the ``<error-variable>``
-will be set to ``NOTFOUND``. If ``ERROR_VARIABLE`` is not set a CMake error
-will be issued.
-When an error occurs the ``<out-var>`` will be set to
-``<member|index>-[<member|index>...]-NOTFOUND`` with the path elements up to
-the point where the error occurred.
+for equality. The contents of ``<json-string1>`` and ``<json-string2>``
+should be valid JSON. The ``<out-var>`` will be set to a true value if the
+JSON objects are considered equal, or a false value otherwise.
diff --git a/Help/manual/cmake-gui.1.rst b/Help/manual/cmake-gui.1.rst
index d9c8ed7..281986f 100644
--- a/Help/manual/cmake-gui.1.rst
+++ b/Help/manual/cmake-gui.1.rst
@@ -11,7 +11,7 @@
cmake-gui [<options>]
cmake-gui [<options>] {<path-to-source> | <path-to-existing-build>}
cmake-gui [<options>] -S <path-to-source> -B <path-to-build>
- cmake-gui [<options>] -S <path-to-source> --preset=<preset-name>
+ cmake-gui [<options>] --browse-manual
Description
===========
@@ -38,8 +38,11 @@
If the directory doesn't already exist CMake will make it.
``--preset=<preset-name>``
- Name of the preset to use from the project's ``CMakePresets.json`` file, if it
- has one.
+ Name of the preset to use from the project's
+ :manual:`presets <cmake-presets(7)>` files, if it has them.
+
+``--browse-manual``
+ Open the CMake reference manual in a browser and immediately exit.
.. include:: OPTIONS_HELP.txt
diff --git a/Help/manual/cmake.1.rst b/Help/manual/cmake.1.rst
index 5452c79..921f5c4 100644
--- a/Help/manual/cmake.1.rst
+++ b/Help/manual/cmake.1.rst
@@ -12,7 +12,6 @@
cmake [<options>] <path-to-source>
cmake [<options>] <path-to-existing-build>
cmake [<options>] -S <path-to-source> -B <path-to-build>
- cmake [<options>] -S <path-to-source> --preset=<preset-name>
`Build a Project`_
cmake --build <dir> [<options>] [-- <build-tool-options>]
@@ -149,22 +148,6 @@
$ cmake -S src -B build
-``cmake [<options>] -S <path-to-source> --preset=<preset-name>``
- Uses ``<path-to-source>`` as the source tree and reads a
- :manual:`preset <cmake-presets(7)>` from
- ``<path-to-source>/CMakePresets.json`` and
- ``<path-to-source>/CMakeUserPresets.json``. The preset specifies the
- generator and the build directory, and optionally a list of variables and
- other arguments to pass to CMake. The :manual:`CMake GUI <cmake-gui(1)>` can
- also recognize ``CMakePresets.json`` and ``CMakeUserPresets.json`` files. For
- full details on these files, see :manual:`cmake-presets(7)`.
-
- The presets are read before all other command line options. The options
- specified by the preset (variables, generator, etc.) can all be overridden by
- manually specifying them on the command line. For example, if the preset sets
- a variable called ``MYVAR`` to ``1``, but the user sets it to ``2`` with a
- ``-D`` argument, the value ``2`` is preferred.
-
In all cases the ``<options>`` may be zero or more of the `Options`_ below.
After generating a buildsystem one may use the corresponding native
@@ -394,6 +377,21 @@
about:tracing tab of Google Chrome or using a plugin for a tool like Trace
Compass.
+``--preset=<preset>``
+ Reads a :manual:`preset <cmake-presets(7)>` from
+ ``<path-to-source>/CMakePresets.json`` and
+ ``<path-to-source>/CMakeUserPresets.json``. The preset specifies the
+ generator and the build directory, and optionally a list of variables and
+ other arguments to pass to CMake. The :manual:`CMake GUI <cmake-gui(1)>` can
+ also recognize ``CMakePresets.json`` and ``CMakeUserPresets.json`` files. For
+ full details on these files, see :manual:`cmake-presets(7)`.
+
+ The presets are read before all other command line options. The options
+ specified by the preset (variables, generator, etc.) can all be overridden by
+ manually specifying them on the command line. For example, if the preset sets
+ a variable called ``MYVAR`` to ``1``, but the user sets it to ``2`` with a
+ ``-D`` argument, the value ``2`` is preferred.
+
.. _`Build Tool Mode`:
Build a Project
diff --git a/Modules/FindRuby.cmake b/Modules/FindRuby.cmake
index 0559a69..a0cdf3b 100644
--- a/Modules/FindRuby.cmake
+++ b/Modules/FindRuby.cmake
@@ -515,6 +515,7 @@
Ruby_SITELIB_DIR
Ruby_HAS_VENDOR_RUBY
Ruby_VENDORARCH_DIR
+ Ruby_VENDORLIB_DIR
)
string(TOUPPER ${Camel} UPPER)
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 30b9512..41f47dd 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -2,7 +2,7 @@
set(CMake_VERSION_MAJOR 3)
set(CMake_VERSION_MINOR 19)
set(CMake_VERSION_PATCH 0)
-set(CMake_VERSION_RC 1)
+set(CMake_VERSION_RC 2)
set(CMake_VERSION_IS_DIRTY 0)
# Start with the full version number used in tags. It has no dev info.
diff --git a/Source/QtDialog/CMakeSetup.cxx b/Source/QtDialog/CMakeSetup.cxx
index a5b2f34..c1555a2 100644
--- a/Source/QtDialog/CMakeSetup.cxx
+++ b/Source/QtDialog/CMakeSetup.cxx
@@ -33,11 +33,16 @@
" cmake-gui [options] <path-to-source>\n"
" cmake-gui [options] <path-to-existing-build>\n"
" cmake-gui [options] -S <path-to-source> -B <path-to-build>\n"
- " cmake-gui [options] -S <path-to-source> --preset=<preset-name>\n" },
+ " cmake-gui [options] --browse-manual\n" },
{ nullptr, nullptr }
};
-static const char* cmDocumentationOptions[][2] = { { nullptr, nullptr } };
+static const char* cmDocumentationOptions[][2] = {
+ { "-S <path-to-source>", "Explicitly specify a source directory." },
+ { "-B <path-to-build>", "Explicitly specify a build directory." },
+ { "--preset=<preset>", "Specify a configure preset." },
+ { nullptr, nullptr }
+};
#if defined(Q_OS_MAC)
static int cmOSXInstall(std::string dir);
@@ -57,6 +62,7 @@
int CMakeGUIExec(CMakeSetupDialog* window);
void SetupDefaultQSettings();
+void OpenReferenceManual();
int main(int argc, char** argv)
{
@@ -194,6 +200,9 @@
return 1;
}
presetName = preset.toLocal8Bit().data();
+ } else if (arg == "--browse-manual") {
+ OpenReferenceManual();
+ return 0;
}
}
if (!sourceDirectory.empty() &&
diff --git a/Source/QtDialog/CMakeSetupDialog.cxx b/Source/QtDialog/CMakeSetupDialog.cxx
index a15614d..05518a9 100644
--- a/Source/QtDialog/CMakeSetupDialog.cxx
+++ b/Source/QtDialog/CMakeSetupDialog.cxx
@@ -43,6 +43,21 @@
#include "RegexExplorer.h"
#include "WarningMessagesDialog.h"
+void OpenReferenceManual()
+{
+ QString urlFormat("https://cmake.org/cmake/help/v%1.%2/");
+ QUrl url(urlFormat.arg(QString::number(cmVersion::GetMajorVersion()),
+ QString::number(cmVersion::GetMinorVersion())));
+
+ if (!cmSystemTools::GetHTMLDoc().empty()) {
+ url = QUrl::fromLocalFile(
+ QDir(QString::fromLocal8Bit(cmSystemTools::GetHTMLDoc().data()))
+ .filePath("index.html"));
+ }
+
+ QDesktopServices::openUrl(url);
+}
+
namespace {
const QString PRESETS_DISABLED_TOOLTIP =
"This option is disabled because there are no available presets in "
@@ -194,19 +209,7 @@
QObject::connect(a, &QAction::triggered, this, &CMakeSetupDialog::doHelp);
a->setShortcut(QKeySequence::HelpContents);
a = HelpMenu->addAction(tr("CMake Reference Manual"));
- QObject::connect(a, &QAction::triggered, this, []() {
- QString urlFormat("https://cmake.org/cmake/help/v%1.%2/");
- QUrl url(urlFormat.arg(QString::number(cmVersion::GetMajorVersion()),
- QString::number(cmVersion::GetMinorVersion())));
-
- if (!cmSystemTools::GetHTMLDoc().empty()) {
- url = QUrl::fromLocalFile(
- QDir(QString::fromLocal8Bit(cmSystemTools::GetHTMLDoc().data()))
- .filePath("index.html"));
- }
-
- QDesktopServices::openUrl(url);
- });
+ QObject::connect(a, &QAction::triggered, this, OpenReferenceManual);
a = HelpMenu->addAction(tr("About"));
QObject::connect(a, &QAction::triggered, this, &CMakeSetupDialog::doAbout);
diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx
index 95686ea..8d1a5fd 100644
--- a/Source/cmCacheManager.cxx
+++ b/Source/cmCacheManager.cxx
@@ -162,6 +162,7 @@
cmSystemTools::Error(message.str());
}
}
+ this->CacheLoaded = true;
return true;
}
diff --git a/Source/cmCacheManager.h b/Source/cmCacheManager.h
index 20d49a8..9aebffc 100644
--- a/Source/cmCacheManager.h
+++ b/Source/cmCacheManager.h
@@ -66,6 +66,9 @@
//! Print the cache to a stream
void PrintCache(std::ostream&) const;
+ //! Get whether or not cache is loaded
+ bool IsCacheLoaded() const { return this->CacheLoaded; }
+
//! Get a value from the cache given a key
cmProp GetInitializedCacheValue(const std::string& key) const;
@@ -204,6 +207,7 @@
const CacheEntry& e, cmMessenger* messenger) const;
std::map<std::string, CacheEntry> Cache;
+ bool CacheLoaded = false;
// Cache version info
unsigned int CacheMajorVersion = 0;
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 3560739..e735897 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -7240,6 +7240,14 @@
}
}
+bool cmGeneratorTarget::IsLanguageUsed(std::string const& language,
+ std::string const& config) const
+{
+ std::set<std::string> languages;
+ this->GetLanguages(languages, config);
+ return languages.count(language);
+}
+
bool cmGeneratorTarget::IsCSharpOnly() const
{
// Only certain target types may compile CSharp.
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index e5fa892..2517b72 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -417,6 +417,8 @@
// until we have per-target object file properties.
void GetLanguages(std::set<std::string>& languages,
std::string const& config) const;
+ bool IsLanguageUsed(std::string const& language,
+ std::string const& config) const;
bool IsCSharpOnly() const;
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 952a179..e7bbf72 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -1423,7 +1423,7 @@
cmGeneratorTarget::SourceFileFlags tsFlags =
gtgt->GetTargetSourceFileFlags(sourceFile);
- if (filetype && IsLibraryType(filetype->GetString())) {
+ if (filetype && filetype->GetString() == "compiled.mach-o.objfile") {
if (sourceFile->GetObjectLibrary().empty()) {
externalObjFiles.push_back(xsf);
}
@@ -1591,7 +1591,7 @@
}
}
- // always create framework build phase
+ // Always create Link Binary With Libraries build phase
cmXCodeObject* frameworkBuildPhase = nullptr;
frameworkBuildPhase =
this->CreateObject(cmXCodeObject::PBXFrameworksBuildPhase);
@@ -1600,6 +1600,7 @@
this->CreateString("2147483647"));
buildFiles = this->CreateObject(cmXCodeObject::OBJECT_LIST);
frameworkBuildPhase->AddAttribute("files", buildFiles);
+ // Add all collected .o files to this build phase
for (auto& externalObjFile : externalObjFiles) {
buildFiles->AddObject(externalObjFile);
}
diff --git a/Source/cmState.cxx b/Source/cmState.cxx
index d5ac9ae..d268e62 100644
--- a/Source/cmState.cxx
+++ b/Source/cmState.cxx
@@ -135,6 +135,11 @@
return this->CacheManager->DeleteCache(path);
}
+bool cmState::IsCacheLoaded() const
+{
+ return this->CacheManager->IsCacheLoaded();
+}
+
std::vector<std::string> cmState::GetCacheEntryKeys() const
{
return this->CacheManager->GetCacheEntryKeys();
diff --git a/Source/cmState.h b/Source/cmState.h
index 2aa57e0..e4c9eb5 100644
--- a/Source/cmState.h
+++ b/Source/cmState.h
@@ -87,6 +87,8 @@
bool DeleteCache(const std::string& path);
+ bool IsCacheLoaded() const;
+
std::vector<std::string> GetCacheEntryKeys() const;
cmProp GetCacheEntryValue(std::string const& key) const;
std::string GetSafeCacheEntryValue(std::string const& key) const;
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 0becee2..a482ed6 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -3078,7 +3078,8 @@
return true;
}
for (std::string const& c : this->Configurations) {
- if (!this->ComputeCudaOptions(c)) {
+ if (this->GeneratorTarget->IsLanguageUsed("CUDA", c) &&
+ !this->ComputeCudaOptions(c)) {
return false;
}
}
@@ -3218,7 +3219,8 @@
void cmVisualStudio10TargetGenerator::WriteCudaOptions(
Elem& e1, std::string const& configName)
{
- if (!this->MSTools || !this->GlobalGenerator->IsCudaEnabled()) {
+ if (!this->MSTools || !this->GlobalGenerator->IsCudaEnabled() ||
+ !this->GeneratorTarget->IsLanguageUsed("CUDA", configName)) {
return;
}
Elem e2(e1, "CudaCompile");
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 45d6d6c..f4ab1b0 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -727,6 +727,7 @@
{
bool haveToolset = false;
bool havePlatform = false;
+ bool haveBArg = false;
#if !defined(CMAKE_BOOTSTRAP)
std::string profilingFormat;
std::string profilingOutput;
@@ -775,6 +776,7 @@
path = cmSystemTools::CollapseFullPath(path);
cmSystemTools::ConvertToUnixSlashes(path);
this->SetHomeOutputDirectory(path);
+ haveBArg = true;
} else if ((i < args.size() - 2) &&
cmHasLiteralPrefix(arg, "--check-build-system")) {
this->CheckBuildSystemArgument = args[++i];
@@ -1057,7 +1059,7 @@
return;
}
- if (!haveBinaryDir) {
+ if (!this->State->IsCacheLoaded() && !haveBArg) {
this->SetHomeOutputDirectory(expandedPreset->BinaryDir);
}
if (!this->GlobalGenerator) {
diff --git a/Source/cmake.h b/Source/cmake.h
index 262d673..1ecf2c2 100644
--- a/Source/cmake.h
+++ b/Source/cmake.h
@@ -704,8 +704,6 @@
#define CMAKE_STANDARD_OPTIONS_TABLE \
{ "-S <path-to-source>", "Explicitly specify a source directory." }, \
{ "-B <path-to-build>", "Explicitly specify a build directory." }, \
- { "--preset=<preset-name>", "Explicitly specify a preset." }, \
- { "--list-presets", "List available presets." }, \
{ "-C <initial-cache>", "Pre-load a script to populate the cache." }, \
{ "-D <var>[:<type>]=<value>", "Create or update a cmake cache entry." }, \
{ "-U <globbing_expr>", "Remove matching entries from CMake cache." }, \
diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx
index f570337..f7734a6 100644
--- a/Source/cmakemain.cxx
+++ b/Source/cmakemain.cxx
@@ -49,8 +49,7 @@
{ nullptr,
" cmake [options] <path-to-source>\n"
" cmake [options] <path-to-existing-build>\n"
- " cmake [options] -S <path-to-source> -B <path-to-build>\n"
- " cmake [options] -S <path-to-source> --preset=<preset-name>" },
+ " cmake [options] -S <path-to-source> -B <path-to-build>" },
{ nullptr,
"Specify a source directory to (re-)generate a build system for "
"it in the current working directory. Specify an existing build "
@@ -65,6 +64,8 @@
const char* cmDocumentationOptions[][2] = {
CMAKE_STANDARD_OPTIONS_TABLE,
+ { "--preset=<preset>", "Specify a configure preset." },
+ { "--list-presets", "List available presets." },
{ "-E", "CMake command mode." },
{ "-L[A][H]", "List non-advanced cached variables." },
{ "--build <dir>", "Build a CMake-generated project binary tree." },
diff --git a/Tests/RunCMake/CMP0104/CMP0104-Common.cmake b/Tests/RunCMake/CMP0104/CMP0104-Common.cmake
index b3568f1..ca4c1aa2 100644
--- a/Tests/RunCMake/CMP0104/CMP0104-Common.cmake
+++ b/Tests/RunCMake/CMP0104/CMP0104-Common.cmake
@@ -1,2 +1,6 @@
+# Make sure CMP0104 isn't issued for CXX targets created prior to enabling CUDA. See #21341.
+enable_language(CXX)
+add_library(cxx main.cxx)
+
enable_language(CUDA)
add_library(cuda main.cu)
diff --git a/Tests/RunCMake/CMP0104/main.cxx b/Tests/RunCMake/CMP0104/main.cxx
new file mode 100644
index 0000000..5047a34
--- /dev/null
+++ b/Tests/RunCMake/CMP0104/main.cxx
@@ -0,0 +1,3 @@
+int main()
+{
+}
diff --git a/Tests/RunCMake/CMakePresets/CMakePresets.json.in b/Tests/RunCMake/CMakePresets/CMakePresets.json.in
index a8f89ff..a347120 100644
--- a/Tests/RunCMake/CMakePresets/CMakePresets.json.in
+++ b/Tests/RunCMake/CMakePresets/CMakePresets.json.in
@@ -160,6 +160,16 @@
"binaryDir": "${sourceDir}/build"
},
{
+ "name": "GoodNoSCachePrep",
+ "generator": "@RunCMake_GENERATOR@",
+ "binaryDir": "${sourceParentDir}/GoodNoSCachePrep-build"
+ },
+ {
+ "name": "GoodNoSCache",
+ "generator": "@RunCMake_GENERATOR@",
+ "binaryDir": "${sourceDir}/build"
+ },
+ {
"name": "GoodInheritanceParentBase",
"hidden": true,
"generator": "@RunCMake_GENERATOR@",
diff --git a/Tests/RunCMake/CMakePresets/GoodNoS.cmake b/Tests/RunCMake/CMakePresets/GoodNoS.cmake
index 1d3b2ff..49e7a25 100644
--- a/Tests/RunCMake/CMakePresets/GoodNoS.cmake
+++ b/Tests/RunCMake/CMakePresets/GoodNoS.cmake
@@ -1,4 +1,3 @@
include(${CMAKE_CURRENT_LIST_DIR}/TestVariable.cmake)
-get_filename_component(_parent "${CMAKE_SOURCE_DIR}" DIRECTORY)
-test_variable(CMAKE_BINARY_DIR "" "${_parent}/GoodNoS-build")
+test_variable(CMAKE_BINARY_DIR "" "${CMAKE_SOURCE_DIR}/build")
diff --git a/Tests/RunCMake/CMakePresets/GoodNoSCache.cmake b/Tests/RunCMake/CMakePresets/GoodNoSCache.cmake
new file mode 100644
index 0000000..df58e72
--- /dev/null
+++ b/Tests/RunCMake/CMakePresets/GoodNoSCache.cmake
@@ -0,0 +1,4 @@
+include(${CMAKE_CURRENT_LIST_DIR}/TestVariable.cmake)
+
+get_filename_component(_parent "${CMAKE_SOURCE_DIR}" DIRECTORY)
+test_variable(CMAKE_BINARY_DIR "" "${_parent}/GoodNoSCachePrep-build")
diff --git a/Tests/RunCMake/CMakePresets/GoodNoSCachePrep.cmake b/Tests/RunCMake/CMakePresets/GoodNoSCachePrep.cmake
new file mode 100644
index 0000000..df58e72
--- /dev/null
+++ b/Tests/RunCMake/CMakePresets/GoodNoSCachePrep.cmake
@@ -0,0 +1,4 @@
+include(${CMAKE_CURRENT_LIST_DIR}/TestVariable.cmake)
+
+get_filename_component(_parent "${CMAKE_SOURCE_DIR}" DIRECTORY)
+test_variable(CMAKE_BINARY_DIR "" "${_parent}/GoodNoSCachePrep-build")
diff --git a/Tests/RunCMake/CMakePresets/RunCMakeTest.cmake b/Tests/RunCMake/CMakePresets/RunCMakeTest.cmake
index bd84510..2caa66a 100644
--- a/Tests/RunCMake/CMakePresets/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CMakePresets/RunCMakeTest.cmake
@@ -28,8 +28,8 @@
function(run_cmake_presets name)
set(RunCMake_TEST_SOURCE_DIR "${RunCMake_BINARY_DIR}/${name}")
set(_source_arg "${RunCMake_TEST_SOURCE_DIR}")
- if(CMakePresets_RELATIVE_SOURCE)
- set(_source_arg "../${name}")
+ if(CMakePresets_SOURCE_ARG)
+ set(_source_arg "${CMakePresets_SOURCE_ARG}")
endif()
file(REMOVE_RECURSE "${RunCMake_TEST_SOURCE_DIR}")
file(MAKE_DIRECTORY "${RunCMake_TEST_SOURCE_DIR}")
@@ -154,9 +154,9 @@
run_cmake_presets(GoodNoArgs)
file(REMOVE_RECURSE ${RunCMake_BINARY_DIR}/GoodBinaryUp-build)
run_cmake_presets(GoodBinaryUp)
-set(CMakePresets_RELATIVE_SOURCE TRUE)
+set(CMakePresets_SOURCE_ARG "../GoodBinaryRelative")
run_cmake_presets(GoodBinaryRelative)
-unset(CMakePresets_RELATIVE_SOURCE)
+unset(CMakePresets_SOURCE_ARG)
run_cmake_presets(GoodSpaces "--preset=Good Spaces")
if(WIN32)
run_cmake_presets(GoodWindowsBackslash)
@@ -170,6 +170,14 @@
run_cmake_presets(InvalidGeneratorCmdLine -G "Invalid Generator")
set(CMakePresets_NO_S_ARG TRUE)
run_cmake_presets(GoodNoS)
+set(RunCMake_TEST_BINARY_DIR "${RunCMake_BINARY_DIR}/GoodNoSCachePrep-build")
+run_cmake_presets(GoodNoSCachePrep)
+set(CMakePresets_SOURCE_ARG ".")
+set(RunCMake_TEST_NO_CLEAN 1)
+run_cmake_presets(GoodNoSCache)
+unset(RunCMake_TEST_NO_CLEAN)
+unset(CMakePresets_SOURCE_ARG)
+unset(RunCMake_TEST_BINARY_DIR)
unset(CMakePresets_NO_S_ARG)
run_cmake_presets(GoodInheritanceParent)
run_cmake_presets(GoodInheritanceChild)
diff --git a/Tests/RunCMake/CommandLine/NoArgs-stdout.txt b/Tests/RunCMake/CommandLine/NoArgs-stdout.txt
index 50f7d9d..f1dafc8 100644
--- a/Tests/RunCMake/CommandLine/NoArgs-stdout.txt
+++ b/Tests/RunCMake/CommandLine/NoArgs-stdout.txt
@@ -3,7 +3,6 @@
cmake \[options\] <path-to-source>
cmake \[options\] <path-to-existing-build>
cmake \[options\] -S <path-to-source> -B <path-to-build>
- cmake \[options\] -S <path-to-source> --preset=<preset-name>
Specify a source directory to \(re-\)generate a build system for it in the
current working directory. Specify an existing build directory to