Merge topic 'document-cps-components-resolution'
dd8bf95271 Help: Document handling of CPS transitive components
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10434
diff --git a/.gitlab/ci/configure_debian12_aarch64_ninja.cmake b/.gitlab/ci/configure_debian12_aarch64_ninja.cmake
index d2a401e..00843d5 100644
--- a/.gitlab/ci/configure_debian12_aarch64_ninja.cmake
+++ b/.gitlab/ci/configure_debian12_aarch64_ninja.cmake
@@ -1,13 +1,22 @@
set(CMake_TEST_C_STANDARDS "90;99;11;17;23" CACHE STRING "")
set(CMake_TEST_CXX_STANDARDS "98;11;14;17;20;23" CACHE STRING "")
+set(blas_lapack_cases
+ All
+ static=1 Generic
+ model=lp64
+ static=0 thread=SEQ NVPL thread=OMP NVPL thread= NVPL
+ model=ilp64
+ static=0 thread=SEQ NVPL thread=OMP NVPL thread= NVPL
+ )
+
set(CMake_TEST_CTestUpdate_BZR "ON" CACHE BOOL "")
set(CMake_TEST_CTestUpdate_CVS "ON" CACHE BOOL "")
set(CMake_TEST_CTestUpdate_GIT "ON" CACHE BOOL "")
set(CMake_TEST_CTestUpdate_HG "ON" CACHE BOOL "")
set(CMake_TEST_CTestUpdate_SVN "ON" CACHE BOOL "")
set(CMake_TEST_FindALSA "ON" CACHE BOOL "")
-set(CMake_TEST_FindBLAS "All;static=1;Generic" CACHE STRING "")
+set(CMake_TEST_FindBLAS "${blas_lapack_cases}" CACHE STRING "")
set(CMake_TEST_FindBoost "ON" CACHE BOOL "")
set(CMake_TEST_FindBoost_Python "ON" CACHE BOOL "")
set(CMake_TEST_FindBZip2 "ON" CACHE BOOL "")
@@ -51,7 +60,7 @@
set(CMake_TEST_FindJNI "ON" CACHE BOOL "")
set(CMake_TEST_FindJPEG "ON" CACHE BOOL "")
set(CMake_TEST_FindJsonCpp "ON" CACHE BOOL "")
-set(CMake_TEST_FindLAPACK "All;static=1;Generic" CACHE STRING "")
+set(CMake_TEST_FindLAPACK "${blas_lapack_cases}" CACHE STRING "")
set(CMake_TEST_FindLibArchive "ON" CACHE BOOL "")
set(CMake_TEST_FindLibinput "ON" CACHE BOOL "")
set(CMake_TEST_FindLibLZMA "ON" CACHE BOOL "")
diff --git a/.gitlab/ci/configure_fedora41_asan.cmake b/.gitlab/ci/configure_fedora41_asan.cmake
index df9f46d..4441792 100644
--- a/.gitlab/ci/configure_fedora41_asan.cmake
+++ b/.gitlab/ci/configure_fedora41_asan.cmake
@@ -1,4 +1,5 @@
set(CMAKE_C_FLAGS "-fsanitize=address" CACHE STRING "")
set(CMAKE_CXX_FLAGS "-fsanitize=address" CACHE STRING "")
+set(CMake_QT_MAJOR_VERSION "5" CACHE STRING "")
include("${CMAKE_CURRENT_LIST_DIR}/configure_fedora41_common.cmake")
diff --git a/.gitlab/ci/configure_fedora41_clang_analyzer.cmake b/.gitlab/ci/configure_fedora41_clang_analyzer.cmake
index cdeaab4..4a518d0 100644
--- a/.gitlab/ci/configure_fedora41_clang_analyzer.cmake
+++ b/.gitlab/ci/configure_fedora41_clang_analyzer.cmake
@@ -1,3 +1,4 @@
set(configure_no_sccache 1)
+set(CMake_QT_MAJOR_VERSION "5" CACHE STRING "")
include("${CMAKE_CURRENT_LIST_DIR}/configure_fedora41_common.cmake")
diff --git a/.gitlab/ci/configure_fedora41_common.cmake b/.gitlab/ci/configure_fedora41_common.cmake
index 4484e26..dee78ab 100644
--- a/.gitlab/ci/configure_fedora41_common.cmake
+++ b/.gitlab/ci/configure_fedora41_common.cmake
@@ -1,6 +1,5 @@
set(BUILD_CursesDialog ON CACHE BOOL "")
set(BUILD_QtDialog ON CACHE BOOL "")
-set(CMake_QT_MAJOR_VERSION "5" CACHE STRING "")
set(CMake_TEST_JQ "/usr/bin/jq" CACHE PATH "")
set(CMake_TEST_JSON_SCHEMA ON CACHE BOOL "")
diff --git a/.gitlab/ci/configure_fedora41_makefiles_symlinked.cmake b/.gitlab/ci/configure_fedora41_makefiles_symlinked.cmake
index e4434c1..317de3a 100644
--- a/.gitlab/ci/configure_fedora41_makefiles_symlinked.cmake
+++ b/.gitlab/ci/configure_fedora41_makefiles_symlinked.cmake
@@ -1,2 +1,5 @@
+set(CMake_QT_MAJOR_VERSION "6" CACHE STRING "")
+set(CMake_TEST_GUI "ON" CACHE BOOL "")
+
include("${CMAKE_CURRENT_LIST_DIR}/configure_symlinked_common.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/configure_fedora41_common.cmake")
diff --git a/.gitlab/ci/configure_fedora41_ninja.cmake b/.gitlab/ci/configure_fedora41_ninja.cmake
index 217d24a..9bef7e8 100644
--- a/.gitlab/ci/configure_fedora41_ninja.cmake
+++ b/.gitlab/ci/configure_fedora41_ninja.cmake
@@ -14,5 +14,7 @@
# Cover compilation with C++11 only and not higher standards.
set(CMAKE_CXX_STANDARD "11" CACHE STRING "")
+# Qt 6 requires C++17, so use Qt 5.
+set(CMake_QT_MAJOR_VERSION "5" CACHE STRING "")
include("${CMAKE_CURRENT_LIST_DIR}/configure_fedora41_common.cmake")
diff --git a/.gitlab/ci/configure_fedora41_tidy.cmake b/.gitlab/ci/configure_fedora41_tidy.cmake
index 40bde10..664b4f1 100644
--- a/.gitlab/ci/configure_fedora41_tidy.cmake
+++ b/.gitlab/ci/configure_fedora41_tidy.cmake
@@ -2,5 +2,6 @@
set(CMake_USE_CLANG_TIDY_MODULE ON CACHE BOOL "")
set(CMake_CLANG_TIDY_MODULE "$ENV{CI_PROJECT_DIR}/Utilities/ClangTidyModule/build/libcmake-clang-tidy-module.so" CACHE FILEPATH "")
set(CMake_CLANG_TIDY_EXPORT_FIXES_DIR "$ENV{CI_PROJECT_DIR}/.gitlab/clang-tidy-fixes" CACHE PATH "")
+set(CMake_QT_MAJOR_VERSION "5" CACHE STRING "")
include("${CMAKE_CURRENT_LIST_DIR}/configure_fedora41_common.cmake")
diff --git a/.gitlab/ci/docker/debian12-aarch64/Dockerfile b/.gitlab/ci/docker/debian12-aarch64/Dockerfile
index 58b5e0e..2344ce5 100644
--- a/.gitlab/ci/docker/debian12-aarch64/Dockerfile
+++ b/.gitlab/ci/docker/debian12-aarch64/Dockerfile
@@ -2,7 +2,15 @@
ARG BASE_IMAGE=arm64v8/debian:12
-FROM ${BASE_IMAGE} AS apt-cache
+FROM ${BASE_IMAGE} AS cuda-keyring
+ADD https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/sbsa/cuda-keyring_1.1-1_all.deb /root/
+RUN --mount=type=tmpfs,target=/var/log \
+ apt-get update \
+ && apt-get -y install ca-certificates \
+ && dpkg -i /root/cuda-keyring_1.1-1_all.deb \
+ && rm /root/cuda-keyring_1.1-1_all.deb
+
+FROM cuda-keyring AS apt-cache
# Populate APT cache w/ the fresh metadata and prefetch packages.
# Use an empty `docker-clean` file to "hide" the image-provided
# file to disallow removing packages after `apt-get` operations.
@@ -12,7 +20,7 @@
apt-get update \
&& apt-get --download-only -y install $(grep -h '^[^#]\+$' /root/*.lst)
-FROM ${BASE_IMAGE}
+FROM cuda-keyring
LABEL maintainer="Brad King <brad.king@kitware.com>"
RUN --mount=type=bind,source=install_deps.sh,target=/root/install_deps.sh \
diff --git a/.gitlab/ci/docker/debian12-aarch64/deps_packages.lst b/.gitlab/ci/docker/debian12-aarch64/deps_packages.lst
index c92c715..f953a74 100644
--- a/.gitlab/ci/docker/debian12-aarch64/deps_packages.lst
+++ b/.gitlab/ci/docker/debian12-aarch64/deps_packages.lst
@@ -69,6 +69,9 @@
liblapack-dev
liblzma-dev
libmagick++-dev
+libnvpl-blas-dev
+libnvpl-common-dev
+libnvpl-lapack-dev
libopenal-dev
libopenmpi-dev openmpi-bin
libosp-dev
diff --git a/.gitlab/os-linux.yml b/.gitlab/os-linux.yml
index 534bdb8..d9164e2 100644
--- a/.gitlab/os-linux.yml
+++ b/.gitlab/os-linux.yml
@@ -74,7 +74,7 @@
CMAKE_CI_NO_INSTALL: 1
.debian12_aarch64:
- image: "kitware/cmake:ci-debian12-aarch64-2023-07-27"
+ image: "kitware/cmake:ci-debian12-aarch64-2025-02-24"
variables:
GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci"
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index fccc0be..8b6d940 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -108,7 +108,7 @@
stages: [commit-msg, pre-commit]
- repo: https://github.com/crate-ci/typos
- rev: v1.29.4
+ rev: v1.30.0
hooks:
- id: typos
# NOTE Override hook's default args to prevent automatic
diff --git a/.typos.toml b/.typos.toml
index 70608b8..c852cec 100644
--- a/.typos.toml
+++ b/.typos.toml
@@ -35,6 +35,7 @@
[type.cmake.extend-identifiers]
COMMANDs = "COMMANDs"
xCOMMANDx = "xCOMMANDx"
+TYPEs = "TYPEs"
[type.cmake.extend-words]
# Some compiler's options trigger false-positives
@@ -53,6 +54,9 @@
Ot = "Ot"
SEH = "SEH"
+[type.py.extend-identifiers]
+typ = "typ"
+
[files]
ignore-hidden = false
ignore-dot = false
diff --git a/CMakeCPack.cmake b/CMakeCPack.cmake
index 97668d3..afece50 100644
--- a/CMakeCPack.cmake
+++ b/CMakeCPack.cmake
@@ -32,7 +32,7 @@
# - Root install directory (displayed to end user at installer-run time)
# - "NSIS package/display name" (text used in the installer GUI)
# - Registry key used to store info about the installation
-if(CMAKE_CL_64)
+if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES64")
set(CPACK_NSIS_PACKAGE_NAME "${CPACK_PACKAGE_NAME} ${CPACK_PACKAGE_VERSION} (Win64)")
else()
@@ -44,18 +44,10 @@
if(NOT DEFINED CPACK_SYSTEM_NAME)
# make sure package is not Cygwin-unknown, for Cygwin just
# cygwin is good for the system name
- if("x${CMAKE_SYSTEM_NAME}" STREQUAL "xCYGWIN")
- set(CPACK_SYSTEM_NAME Cygwin)
+ if(CMAKE_SYSTEM_NAME STREQUAL "CYGWIN")
+ set(CPACK_SYSTEM_NAME cygwin)
else()
- set(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR})
- endif()
-endif()
-if(${CPACK_SYSTEM_NAME} MATCHES Windows)
- if(CMAKE_CL_64)
- set(CPACK_SYSTEM_NAME win64-x64)
- set(CPACK_IFW_TARGET_DIRECTORY "@RootDir@/Program Files/${CMAKE_PROJECT_NAME}")
- else()
- set(CPACK_SYSTEM_NAME win32-x86)
+ string(TOLOWER "${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}" CPACK_SYSTEM_NAME)
endif()
endif()
@@ -170,7 +162,7 @@
_cmifwarg("Package <Licenses> tag (pairs of <display_name> <file_path>)"
STRING LICENSES "${${_cpifwrc}LICENSES_DEFAULT}")
-if(${CMAKE_SYSTEM_NAME} MATCHES Windows)
+if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
set(_CPACK_IFW_PACKAGE_ICON
"set(CPACK_IFW_PACKAGE_ICON \"${CMake_SOURCE_DIR}/Source/QtDialog/CMakeSetup.ico\")")
if(BUILD_QtDialog)
@@ -189,9 +181,11 @@
)
endif()
-if(${CMAKE_SYSTEM_NAME} MATCHES Linux)
+if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(CPACK_IFW_TARGET_DIRECTORY "@HomeDir@/${CMAKE_PROJECT_NAME}")
set(CPACK_IFW_ADMIN_TARGET_DIRECTORY "@ApplicationsDir@/${CMAKE_PROJECT_NAME}")
+elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows")
+ set(CPACK_IFW_TARGET_DIRECTORY "@RootDir@/Program Files/${CMAKE_PROJECT_NAME}")
endif()
# Components scripts configuration
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 907c344..974b2c3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,7 +1,7 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file LICENSE.rst or https://cmake.org/licensing for details.
-cmake_minimum_required(VERSION 3.13...3.30 FATAL_ERROR)
+cmake_minimum_required(VERSION 3.13...3.31 FATAL_ERROR)
set(CMAKE_USER_MAKE_RULES_OVERRIDE_C ${CMAKE_CURRENT_SOURCE_DIR}/Source/Modules/OverrideC.cmake)
set(CMAKE_USER_MAKE_RULES_OVERRIDE_CXX ${CMAKE_CURRENT_SOURCE_DIR}/Source/Modules/OverrideCXX.cmake)
diff --git a/Help/command/FIND_XXX.txt b/Help/command/FIND_XXX.txt
index ab96bd3..299c761 100644
--- a/Help/command/FIND_XXX.txt
+++ b/Help/command/FIND_XXX.txt
@@ -18,7 +18,7 @@
[VALIDATOR function]
[DOC "cache documentation string"]
[NO_CACHE]
- [REQUIRED]
+ [REQUIRED|OPTIONAL]
[NO_DEFAULT_PATH]
[NO_PACKAGE_ROOT_PATH]
[NO_CMAKE_PATH]
@@ -118,6 +118,18 @@
the search will be attempted again the next time |FIND_XXX| is invoked
with the same variable.
+ .. versionadded:: 4.1
+
+ Every |FIND_XXX| command will be treated as ``REQUIRED`` when the
+ :variable:`CMAKE_FIND_REQUIRED` variable is enabled.
+
+``OPTIONAL``
+ .. versionadded:: 4.1
+
+ Ignore the value of :variable:`CMAKE_FIND_REQUIRED` and
+ continue without an error message if nothing is found.
+ Incompatible with ``REQUIRED``.
+
If ``NO_DEFAULT_PATH`` is specified, then no additional paths are
added to the search.
If ``NO_DEFAULT_PATH`` is not specified, the search process is as follows:
diff --git a/Help/command/add_dependencies.rst b/Help/command/add_dependencies.rst
index c619212..b0dd494 100644
--- a/Help/command/add_dependencies.rst
+++ b/Help/command/add_dependencies.rst
@@ -12,7 +12,6 @@
is one created by one of the :command:`add_executable`,
:command:`add_library`, or :command:`add_custom_target` commands
(but not targets generated by CMake like ``install``).
-At least one ``<target-dependency>`` must be given.
Dependencies added to an :ref:`imported target <Imported Targets>`
or an :ref:`interface library <Interface Libraries>` are followed
@@ -32,6 +31,10 @@
finished before sources in ``<target>`` start compiling; this
ensures generated sources are available.
+.. versionchanged:: 4.1
+ The command may be called with no dependencies.
+ Previously, at least one dependency was required.
+
See Also
^^^^^^^^
diff --git a/Help/command/cmake_host_system_information.rst b/Help/command/cmake_host_system_information.rst
index 18f6725..4e72749 100644
--- a/Help/command/cmake_host_system_information.rst
+++ b/Help/command/cmake_host_system_information.rst
@@ -214,7 +214,7 @@
.. variable:: CMAKE_GET_OS_RELEASE_FALLBACK_SCRIPTS
In addition to the scripts shipped with CMake, a user may append full
- paths to his script(s) to the this list. The script filename has the
+ paths of their script(s) to this list. The script filename has the
following format: ``NNN-<name>.cmake``, where ``NNN`` is three digits
used to apply collected scripts in a specific order.
@@ -234,6 +234,8 @@
.. code-block:: cmake
+ # 000-FallbackScript.cmake
+ #
# Try to detect some old distribution
# See also
# - http://linuxmafia.com/faq/Admin/release-files.html
@@ -268,6 +270,18 @@
endif()
unset(CMAKE_GET_OS_RELEASE_FALLBACK_CONTENT)
+Then this script can be applied as a fallback to determine the missing host
+system information:
+
+.. code-block:: cmake
+
+ list(
+ APPEND
+ CMAKE_GET_OS_RELEASE_FALLBACK_SCRIPTS
+ ${CMAKE_CURRENT_SOURCE_DIR}/000-FallbackScript.cmake
+ )
+
+ cmake_host_system_information(RESULT info QUERY DISTRIB_INFO)
.. rubric:: Footnotes
diff --git a/Help/command/export.rst b/Help/command/export.rst
index 349522e..1427d89 100644
--- a/Help/command/export.rst
+++ b/Help/command/export.rst
@@ -89,10 +89,10 @@
.. versionadded:: 3.7
-This signature exports cmake built targets to the android ndk build system
+This signature exports CMake built targets to the android ndk build system
by creating an ``Android.mk`` file that references the prebuilt targets. The
Android NDK supports the use of prebuilt libraries, both static and shared.
-This allows cmake to build the libraries of a project and make them available
+This allows CMake to build the libraries of a project and make them available
to an ndk build system complete with transitive dependencies, include flags
and defines required to use the libraries. The signature takes a list of
targets and puts them in the ``Android.mk`` file specified by the
@@ -127,6 +127,36 @@
Specify that :command:`find_dependency` calls should be exported. See
:command:`install(EXPORT)` for details on how this works.
+Exporting Targets to the |CPS|
+""""""""""""""""""""""""""""""
+
+.. code-block:: cmake
+
+ export(EXPORT <export-name> PACKAGE_INFO <package-name>
+ [APPENDIX <appendix-name>]
+ [LOWER_CASE_FILE]
+ [VERSION <version>
+ [COMPAT_VERSION <version>]
+ [VERSION_SCHEMA <string>]]
+ [DEFAULT_TARGETS <target>...]
+ [DEFAULT_CONFIGURATIONS <config>...])
+
+.. versionadded:: 4.1
+.. note::
+
+ Experimental. Gated by ``CMAKE_EXPERIMENTAL_EXPORT_PACKAGE_INFO``.
+
+Creates a file in the |CPS|_ that may be included by outside projects to import
+targets named by ``<target>...`` from the current project's build tree. See
+the :command:`install(PACKAGE_INFO)` command to export targets from an install
+tree. The imported targets are implicitly in the namespace ``<package-name>``.
+
+The default file name is ``<package-name>[-<appendix-name>].cps``. If the
+``LOWER_CASE_FILE`` option is given, the file name will use the package name
+converted to lower case.
+
+See :command:`install(PACKAGE_INFO)` for a description of the other options.
+
Exporting Packages
^^^^^^^^^^^^^^^^^^
@@ -221,3 +251,6 @@
this target. If specified, the generated code will check to see if the
``.xcframework`` exists, and if it does, it will use the ``.xcframework``
as its imported location instead of the installed library.
+
+.. _CPS: https://cps-org.github.io/cps/
+.. |CPS| replace:: Common Package Specification
diff --git a/Help/command/find_package.rst b/Help/command/find_package.rst
index 72b28d3..089a3d6 100644
--- a/Help/command/find_package.rst
+++ b/Help/command/find_package.rst
@@ -132,7 +132,7 @@
.. code-block:: cmake
find_package(<PackageName> [version] [EXACT] [QUIET] [MODULE]
- [REQUIRED] [[COMPONENTS] [components...]]
+ [REQUIRED|OPTIONAL] [[COMPONENTS] [components...]]
[OPTIONAL_COMPONENTS components...]
[REGISTRY_VIEW (64|32|64_32|32_64|HOST|TARGET|BOTH)]
[GLOBAL]
@@ -159,6 +159,13 @@
``REQUIRED`` option is present, the ``COMPONENTS`` keyword can be omitted
and the required components can be listed directly after ``REQUIRED``.
+The :variable:`CMAKE_FIND_REQUIRED` variable can be enabled to make this call
+``REQUIRED`` by default. This behavior can be overridden by providing the
+``OPTIONAL`` keyword. As with the ``REQUIRED`` option, a list of components
+can be listed directly after ``OPTIONAL``, which is equivalent to listing
+them after the ``COMPONENTS`` keyword. When the ``OPTIONAL`` keyword is given,
+the warning output when a package is not found is suppressed.
+
Additional optional components may be listed after ``OPTIONAL_COMPONENTS``.
If these cannot be satisfied, the package overall can still be considered
found, as long as all required components are satisfied.
@@ -246,7 +253,7 @@
.. code-block:: cmake
find_package(<PackageName> [version] [EXACT] [QUIET]
- [REQUIRED] [[COMPONENTS] [components...]]
+ [REQUIRED|OPTIONAL] [[COMPONENTS] [components...]]
[OPTIONAL_COMPONENTS components...]
[CONFIG|NO_MODULE]
[GLOBAL]
@@ -632,6 +639,9 @@
Setting both variables to ``TRUE`` simultaneously is an error.
+The :variable:`CMAKE_REQUIRE_FIND_PACKAGE_<PackageName>` variable takes priority
+over the ``OPTIONAL`` keyword in determining whether a package is required.
+
.. _`version selection`:
Config Mode Version Selection
diff --git a/Help/command/list.rst b/Help/command/list.rst
index 0110021..abae8d2 100644
--- a/Help/command/list.rst
+++ b/Help/command/list.rst
@@ -246,6 +246,11 @@
<replace_expression> ...)
:target: TRANSFORM_REPLACE
+ .. versionchanged:: 4.1
+ The ``^`` anchor now matches only at the beginning of the input
+ element instead of the beginning of each repeated search.
+ See policy :policy:`CMP0186`.
+
``<SELECTOR>`` determines which elements of the list will be transformed.
Only one type of selector can be specified at a time.
When given, ``<SELECTOR>`` must be one of the following:
diff --git a/Help/command/string.rst b/Help/command/string.rst
index e9de32e..d86efc5 100644
--- a/Help/command/string.rst
+++ b/Help/command/string.rst
@@ -117,6 +117,17 @@
two backslashes (``\\1``) are required in CMake code to get a backslash
through argument parsing.
+.. versionchanged:: 4.1
+ The ``^`` anchor now matches only at the beginning of the input
+ string instead of the beginning of each repeated search.
+ See policy :policy:`CMP0186`.
+
+ Zero-length matches are allowed in ``MATCHALL`` and ``REPLACE``.
+ Previously, they triggered an error.
+
+ The replacement expression may contain references to subexpressions that
+ didn't match anything. Previously, such references triggered an error.
+
.. _`Regex Specification`:
Regex Specification
diff --git a/Help/cpack_gen/rpm.rst b/Help/cpack_gen/rpm.rst
index 0fd6964..3583765 100644
--- a/Help/cpack_gen/rpm.rst
+++ b/Help/cpack_gen/rpm.rst
@@ -439,6 +439,51 @@
variable. Note that you must enclose the entire value between quotes when
setting this variable.
+.. variable:: CPACK_RPM_PACKAGE_RECOMMENDS
+ CPACK_RPM_<component>_PACKAGE_RECOMMENDS
+
+ .. versionadded:: 4.1
+
+ RPM spec recommends field.
+
+ :Mandatory: No
+ :Default:
+
+ May be used to set weak RPM dependencies (recommends). If ``rpmbuild`` doesn't
+ support the ``Recommends`` tag, CPack will emit a warning and ignore this
+ variable. Note that you must enclose the entire value between quotes when
+ setting this variable.
+
+.. variable:: CPACK_RPM_PACKAGE_SUPPLEMENTS
+ CPACK_RPM_<component>_PACKAGE_SUPPLEMENTS
+
+ .. versionadded:: 4.1
+
+ RPM spec supplements field.
+
+ :Mandatory: No
+ :Default:
+
+ May be used to set weak RPM dependencies (supplements). If ``rpmbuild`` doesn't
+ support the ``Supplements`` tag, CPack will emit a warning and ignore this
+ variable. Note that you must enclose the entire value between quotes when
+ setting this variable.
+
+.. variable:: CPACK_RPM_PACKAGE_ENHANCES
+ CPACK_RPM_<component>_PACKAGE_ENHANCES
+
+ .. versionadded:: 4.1
+
+ RPM spec enhances field.
+
+ :Mandatory: No
+ :Default:
+
+ May be used to set weak RPM dependencies (enhances). If ``rpmbuild`` doesn't
+ support the ``Enhances`` tag, CPack will emit a warning and ignore this
+ variable. Note that you must enclose the entire value between quotes when
+ setting this variable.
+
.. variable:: CPACK_RPM_PACKAGE_PROVIDES
CPACK_RPM_<component>_PACKAGE_PROVIDES
diff --git a/Help/dev/experimental.rst b/Help/dev/experimental.rst
index 907b31f..6ad1a3b 100644
--- a/Help/dev/experimental.rst
+++ b/Help/dev/experimental.rst
@@ -105,7 +105,7 @@
In order to activate support for exporting build databases, set
* variable ``CMAKE_EXPERIMENTAL_EXPORT_BUILD_DATABASE`` to
-* value ``4bd552e2-b7fb-429a-ab23-c83ef53f3f13``.
+* value ``73194a1d-c0b5-41b9-9190-a4512925e192``.
This UUID may change in future versions of CMake. Be sure to use the value
documented here by the source tree of the version of CMake with which you are
diff --git a/Help/dev/maint.rst b/Help/dev/maint.rst
index 2f4babc..24ddb9a 100644
--- a/Help/dev/maint.rst
+++ b/Help/dev/maint.rst
@@ -78,7 +78,7 @@
.. code-block:: shell
git fetch origin
- git checkout -b release-$ver origin/release
+ git switch -c release-$ver origin/release
Merge the ``$topic`` branch into the local ``release-$ver`` branch, making
sure to include a ``Merge-request: !xxxx`` footer in the commit message:
@@ -91,7 +91,7 @@
.. code-block:: shell
- git checkout master
+ git switch master
git pull
git merge --no-ff release-$ver
@@ -180,7 +180,7 @@
.. code-block:: shell
- git checkout -b doc-$ver-relnotes
+ git switch -c doc-$ver-relnotes
Run the `consolidate-relnotes.bash`_ script:
@@ -236,7 +236,7 @@
.. code-block:: shell
- git checkout -b release-$ver origin/master
+ git switch -c release-$ver origin/master
Remove the development branch release note infrastructure:
@@ -278,7 +278,7 @@
.. code-block:: shell
- git checkout master
+ git switch master
git pull
git merge --no-ff release-$ver
@@ -287,7 +287,7 @@
.. code-block:: shell
- git checkout origin/master -- \
+ git restore -s origin/master -- \
Source/CMakeVersion.cmake Help/release/dev/0-sample-topic.rst
sed -i $'/^Releases/ i\\\n.. include:: dev.txt\\\n' Help/release/index.rst
diff --git a/Help/manual/cmake-generator-expressions.7.rst b/Help/manual/cmake-generator-expressions.7.rst
index 271d7a9..2e622ff 100644
--- a/Help/manual/cmake-generator-expressions.7.rst
+++ b/Help/manual/cmake-generator-expressions.7.rst
@@ -532,6 +532,11 @@
$<LIST:TRANSFORM,list,REPLACE,regular_expression,replace_expression[,SELECTOR]>
+ .. versionchanged:: 4.1
+ The ``^`` anchor now matches only at the beginning of the input
+ element instead of the beginning of each repeated search.
+ See policy :policy:`CMP0186`.
+
``SELECTOR`` determines which items of the list will be transformed.
Only one type of selector can be specified at a time. When given,
``SELECTOR`` must be one of the following:
@@ -1914,7 +1919,10 @@
:prop_tgt:`INTERFACE_LINK_LIBRARIES` *including* entries guarded by the
:genex:`LINK_ONLY` generator expression. See policy :policy:`CMP0166`.
- Evaluation of :prop_tgt:`LINK_LIBRARIES` itself is not transitive.
+ .. versionchanged:: 4.1
+
+ Evaluation of :prop_tgt:`LINK_LIBRARIES` itself is now transitive.
+ See policy :policy:`CMP0189`.
:ref:`Target Usage Requirement Properties <Target Usage Requirements>`
These evaluate as a :ref:`semicolon-separated list <CMake Language Lists>`
@@ -1931,7 +1939,10 @@
*including* entries guarded by the :genex:`LINK_ONLY` generator expression.
See policy :policy:`CMP0166`.
- Evaluation of :prop_tgt:`INTERFACE_LINK_LIBRARIES` itself is not transitive.
+ .. versionchanged:: 4.1
+
+ Evaluation of :prop_tgt:`INTERFACE_LINK_LIBRARIES` itself is now
+ transitive. See policy :policy:`CMP0189`.
:ref:`Custom Transitive Properties`
.. versionadded:: 3.30
@@ -2033,13 +2044,12 @@
See also the :prop_tgt:`OUTPUT_NAME`, :prop_tgt:`ARCHIVE_OUTPUT_NAME`,
:prop_tgt:`LIBRARY_OUTPUT_NAME` and :prop_tgt:`RUNTIME_OUTPUT_NAME`
- target properties and their configuration specific variants
+ target properties, their configuration-specific variants
:prop_tgt:`OUTPUT_NAME_<CONFIG>`, :prop_tgt:`ARCHIVE_OUTPUT_NAME_<CONFIG>`,
:prop_tgt:`LIBRARY_OUTPUT_NAME_<CONFIG>` and
- :prop_tgt:`RUNTIME_OUTPUT_NAME_<CONFIG>`.
-
- The :prop_tgt:`<CONFIG>_POSTFIX` and :prop_tgt:`DEBUG_POSTFIX` target
- properties can also be considered.
+ :prop_tgt:`RUNTIME_OUTPUT_NAME_<CONFIG>`, and
+ the :prop_tgt:`<CONFIG>_POSTFIX` and :prop_tgt:`DEBUG_POSTFIX` target
+ properties.
Note that ``tgt`` is not added as a dependency of the target this
expression is evaluated on.
@@ -2101,11 +2111,11 @@
name is ``base``.
See also the :prop_tgt:`OUTPUT_NAME` and :prop_tgt:`ARCHIVE_OUTPUT_NAME`
- target properties and their configuration specific variants
- :prop_tgt:`OUTPUT_NAME_<CONFIG>` and :prop_tgt:`ARCHIVE_OUTPUT_NAME_<CONFIG>`.
-
- The :prop_tgt:`<CONFIG>_POSTFIX` and :prop_tgt:`DEBUG_POSTFIX` target
- properties can also be considered.
+ target properties, their configuration-specific variants
+ :prop_tgt:`OUTPUT_NAME_<CONFIG>` and
+ :prop_tgt:`ARCHIVE_OUTPUT_NAME_<CONFIG>`, and
+ the :prop_tgt:`<CONFIG>_POSTFIX` and :prop_tgt:`DEBUG_POSTFIX` target
+ properties.
Note that ``tgt`` is not added as a dependency of the target this
expression is evaluated on.
@@ -2177,13 +2187,12 @@
example, if target file name is ``libbase.a``, the base name is ``base``.
See also the :prop_tgt:`OUTPUT_NAME`, :prop_tgt:`ARCHIVE_OUTPUT_NAME`,
- and :prop_tgt:`LIBRARY_OUTPUT_NAME` target properties and their configuration
- specific variants :prop_tgt:`OUTPUT_NAME_<CONFIG>`,
+ and :prop_tgt:`LIBRARY_OUTPUT_NAME` target properties, their
+ configuration-specific variants :prop_tgt:`OUTPUT_NAME_<CONFIG>`,
:prop_tgt:`ARCHIVE_OUTPUT_NAME_<CONFIG>` and
- :prop_tgt:`LIBRARY_OUTPUT_NAME_<CONFIG>`.
-
- The :prop_tgt:`<CONFIG>_POSTFIX` and :prop_tgt:`DEBUG_POSTFIX` target
- properties can also be considered.
+ :prop_tgt:`LIBRARY_OUTPUT_NAME_<CONFIG>`, and
+ the :prop_tgt:`<CONFIG>_POSTFIX` and :prop_tgt:`DEBUG_POSTFIX` target
+ properties.
Note that ``tgt`` is not added as a dependency of the target this
expression is evaluated on.
@@ -2246,13 +2255,12 @@
For example, if target file name is ``libbase.a``, the base name is ``base``.
See also the :prop_tgt:`OUTPUT_NAME`, :prop_tgt:`ARCHIVE_OUTPUT_NAME`,
- and :prop_tgt:`LIBRARY_OUTPUT_NAME` target properties and their configuration
- specific variants :prop_tgt:`OUTPUT_NAME_<CONFIG>`,
+ and :prop_tgt:`LIBRARY_OUTPUT_NAME` target properties, their
+ configuration-specific variants :prop_tgt:`OUTPUT_NAME_<CONFIG>`,
:prop_tgt:`ARCHIVE_OUTPUT_NAME_<CONFIG>` and
- :prop_tgt:`LIBRARY_OUTPUT_NAME_<CONFIG>`.
-
- The :prop_tgt:`<CONFIG>_POSTFIX` and :prop_tgt:`DEBUG_POSTFIX` target
- properties can also be considered.
+ :prop_tgt:`LIBRARY_OUTPUT_NAME_<CONFIG>`, and
+ the :prop_tgt:`<CONFIG>_POSTFIX` and :prop_tgt:`DEBUG_POSTFIX` target
+ properties.
Note that ``tgt`` is not added as a dependency of the target this
expression is evaluated on.
@@ -2317,12 +2325,11 @@
For example, if target file name is ``libbase.tbd``, the base name is ``base``.
See also the :prop_tgt:`OUTPUT_NAME` and :prop_tgt:`ARCHIVE_OUTPUT_NAME`,
- target properties and their configuration
- specific variants :prop_tgt:`OUTPUT_NAME_<CONFIG>` and
- :prop_tgt:`ARCHIVE_OUTPUT_NAME_<CONFIG>`.
-
- The :prop_tgt:`<CONFIG>_POSTFIX` and :prop_tgt:`DEBUG_POSTFIX` target
- properties can also be considered.
+ target properties, their configuration-specific variants
+ :prop_tgt:`OUTPUT_NAME_<CONFIG>` and
+ :prop_tgt:`ARCHIVE_OUTPUT_NAME_<CONFIG>`, and
+ the :prop_tgt:`<CONFIG>_POSTFIX` and :prop_tgt:`DEBUG_POSTFIX` target
+ properties.
Note that ``tgt`` is not added as a dependency of the target this
expression is evaluated on.
@@ -2433,11 +2440,8 @@
``$<TARGET_PDB_FILE_NAME:tgt>``) without prefix and suffix. For example,
if target file name is ``base.pdb``, the base name is ``base``.
- See also the :prop_tgt:`PDB_NAME` target property and its configuration
- specific variant :prop_tgt:`PDB_NAME_<CONFIG>`.
-
- The :prop_tgt:`<CONFIG>_POSTFIX` and :prop_tgt:`DEBUG_POSTFIX` target
- properties can also be considered.
+ See also the :prop_tgt:`PDB_NAME` target property, and its
+ configuration-specific variant :prop_tgt:`PDB_NAME_<CONFIG>`.
Note that ``tgt`` is not added as a dependency of the target this
expression is evaluated on.
diff --git a/Help/manual/cmake-policies.7.rst b/Help/manual/cmake-policies.7.rst
index 0165d6a..868dcf6 100644
--- a/Help/manual/cmake-policies.7.rst
+++ b/Help/manual/cmake-policies.7.rst
@@ -34,10 +34,10 @@
.. code-block:: cmake
- cmake_minimum_required(VERSION 3.10...3.31)
+ cmake_minimum_required(VERSION 3.10...4.0)
This uses the ``<min>...<max>`` syntax to enable the ``NEW`` behaviors
-of policies introduced in CMake 3.31 and earlier while only requiring a
+of policies introduced in CMake 4.0 and earlier while only requiring a
minimum version of CMake 3.10. The project is expected to work with
both the ``OLD`` and ``NEW`` behaviors of policies introduced between
those versions.
@@ -92,6 +92,18 @@
The following policies are supported.
+Policies Introduced by CMake 4.1
+--------------------------------
+
+.. toctree::
+ :maxdepth: 1
+
+ CMP0190: FindPython enforce consistency in cross-compiling mode. </policy/CMP0190>
+ CMP0189: TARGET_PROPERTY evaluates LINK_LIBRARIES properties transitively. </policy/CMP0189>
+ CMP0188: The FindGCCXML module is removed. </policy/CMP0188>
+ CMP0187: Include source file without an extension after the same name with an extension. </policy/CMP0187>
+ CMP0186: Regular expressions match ^ at most once in repeated searches. </policy/CMP0186>
+
Policies Introduced by CMake 4.0
--------------------------------
diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst
index cbf8a92..0233147 100644
--- a/Help/manual/cmake-variables.7.rst
+++ b/Help/manual/cmake-variables.7.rst
@@ -61,6 +61,7 @@
/variable/CMAKE_FIND_PACKAGE_REDIRECTS_DIR
/variable/CMAKE_FIND_PACKAGE_SORT_DIRECTION
/variable/CMAKE_FIND_PACKAGE_SORT_ORDER
+ /variable/CMAKE_FIND_REQUIRED
/variable/CMAKE_GENERATOR
/variable/CMAKE_GENERATOR_INSTANCE
/variable/CMAKE_GENERATOR_PLATFORM
diff --git a/Help/policy/CMP0186.rst b/Help/policy/CMP0186.rst
new file mode 100644
index 0000000..747bce2
--- /dev/null
+++ b/Help/policy/CMP0186.rst
@@ -0,0 +1,43 @@
+CMP0186
+-------
+
+.. versionadded:: 4.1
+
+Regular expressions match ``^`` at most once in repeated searches.
+
+This policy affects commands that perform multiple regular expression
+searches:
+
+* :command:`string(REGEX MATCHALL)`
+* :command:`string(REGEX REPLACE)`
+* :command:`list(TRANSFORM REPLACE)`
+
+and the generator expression :genex:`$<LIST:TRANSFORM,list,REPLACE>`.
+
+CMake 4.0 and below match the ``^`` anchor at the start of every
+successive search, leading to multiple matches:
+
+.. code-block:: cmake
+
+ string(REGEX REPLACE "^a" "b" result "aaaa") # result="bbbb"
+ string(REGEX MATCHALL "^a" result "aaaa") # result="a;a;a;a"
+
+CMake 4.1 and above prefer to match the ``^`` anchor at most once,
+at the start of the input string:
+
+.. code-block:: cmake
+
+ string(REGEX REPLACE "^a" "b" result "aaaa") # result="abbb"
+ string(REGEX MATCHALL "^a" result "aaaa") # result="a"
+
+This policy provides compatibility for projects that have not been updated.
+
+The ``OLD`` behavior for this policy is to match ``^`` multiple times,
+at the start of each search. The ``NEW`` behavior for this policy is
+to match ``^`` at most once, at the start of the input string.
+
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 4.1
+.. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
+.. include:: STANDARD_ADVICE.txt
+
+.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0187.rst b/Help/policy/CMP0187.rst
new file mode 100644
index 0000000..d833d84
--- /dev/null
+++ b/Help/policy/CMP0187.rst
@@ -0,0 +1,33 @@
+CMP0187
+-------
+
+.. versionadded:: 4.1
+
+Include source file without an extension after the same name with an extension.
+
+In CMake 4.0 and below, if two source files have the same filename and only one
+file has a file extension and the file with the extension is listed first, the
+file without the extension is omitted from the target.
+
+For example, the following library target only include ``hello.c`` in the
+target, but omits the file ``hello``.
+
+.. code-block:: cmake
+
+ add_library(library hello.c hello)
+
+If the file without the extension is listed before the file with the extension,
+both files are included in the target.
+
+Starting in CMake 4.1, CMake includes both files in the library target.
+
+This policy has no effect if :policy:`CMP0115` uses the ``OLD`` behavior.
+
+The ``OLD`` behavior for this policy is to omit the file without the extension.
+The ``NEW`` behavior for this policy is to include it.
+
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 4.1
+.. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
+.. include:: STANDARD_ADVICE.txt
+
+.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0188.rst b/Help/policy/CMP0188.rst
new file mode 100644
index 0000000..6b4cb83
--- /dev/null
+++ b/Help/policy/CMP0188.rst
@@ -0,0 +1,21 @@
+CMP0188
+-------
+
+.. versionadded:: 4.1
+
+The :module:`FindGCCXML` module is removed.
+
+CMake 4.0 and below provide the :module:`FindGCCXML` module, but the GCC-XML
+tool has long been superseded by CastXML. CMake 4.1 and above prefer to not
+provide the :module:`FindGCCXML` module. This policy provides compatibility
+for projects that have not been ported away from it.
+
+The ``OLD`` behavior of this policy is for ``find_package(GCCXML)`` to load
+the deprecated module. The ``NEW`` behavior is for ``find_package(GCCXML)``
+to fail as if the module does not exist.
+
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 4.1
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
+
+.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0189.rst b/Help/policy/CMP0189.rst
new file mode 100644
index 0000000..c15217c
--- /dev/null
+++ b/Help/policy/CMP0189.rst
@@ -0,0 +1,30 @@
+CMP0189
+-------
+
+.. versionadded:: 4.1
+
+:genex:`TARGET_PROPERTY` evaluates ``LINK_LIBRARIES`` properties transitively.
+
+The :prop_tgt:`LINK_LIBRARIES` and :prop_tgt:`INTERFACE_LINK_LIBRARIES`
+target properties record link dependencies through which the
+:genex:`TARGET_PROPERTY` generator expression evaluates transitive properties.
+However, in CMake 4.0 and below, the properties themselves were not evaluated
+transitively. CMake 4.1 and above prefer to evaluate the
+:prop_tgt:`LINK_LIBRARIES` and :prop_tgt:`INTERFACE_LINK_LIBRARIES`
+target properties transitively because they are among the
+:ref:`build specification <Target Build Specification>` and
+:ref:`usage requirement <Target Usage Requirements>` properties, respectively.
+This policy provides compatibility for projects that have not been updated to
+expect the new behavior.
+
+The ``OLD`` behavior of this policy is for :genex:`TARGET_PROPERTY` to not
+evaluate :prop_tgt:`LINK_LIBRARIES` and :prop_tgt:`INTERFACE_LINK_LIBRARIES`
+transitively. The ``NEW`` behavior is for :genex:`TARGET_PROPERTY` to
+evaluate :prop_tgt:`LINK_LIBRARIES` and :prop_tgt:`INTERFACE_LINK_LIBRARIES`
+transitively.
+
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 4.1
+.. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
+.. include:: STANDARD_ADVICE.txt
+
+.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0190.rst b/Help/policy/CMP0190.rst
new file mode 100644
index 0000000..e46306b
--- /dev/null
+++ b/Help/policy/CMP0190.rst
@@ -0,0 +1,31 @@
+CMP0190
+-------
+
+.. versionadded:: 4.1
+
+Modules :module:`FindPython3`, :module:`FindPython2` and :module:`FindPython`
+enforce consistency of artifacts in cross-compiling mode.
+
+Starting with CMake 4.1, Modules :module:`FindPython3`, :module:`FindPython2`
+and :module:`FindPython` apply, in cross-compiling mode (i.e. the
+:variable:`CMAKE_CROSSCOMPILING` variable is set to true), the following
+constraints to the requested components:
+
+* ``Interpreter`` or ``Compiler`` alone: the host artifacts will be searched.
+* ``Interpreter`` or ``Compiler`` with ``Development`` or any sub-component:
+ The target artifacts will be searched. In this case, the
+ :variable:`CMAKE_CROSSCOMPILING_EMULATOR` variable must be defined and will
+ be used to execute the interpreter or the compiler.
+
+This policy provides compatibility with projects that expect the legacy
+behavior.
+
+The ``OLD`` behavior for this policy does not enforce consistency in
+cross-compiling mode and will, potentially, returns a mix of artifacts
+(i.e. host and target artifacts).
+
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 4.1
+.. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
+.. include:: STANDARD_ADVICE.txt
+
+.. include:: DEPRECATED.txt
diff --git a/Help/prop_sf/VS_SETTINGS.rst b/Help/prop_sf/VS_SETTINGS.rst
index 871e36e..da85f12 100644
--- a/Help/prop_sf/VS_SETTINGS.rst
+++ b/Help/prop_sf/VS_SETTINGS.rst
@@ -3,15 +3,11 @@
.. versionadded:: 3.18
-Set any item metadata on a file.
+Add arbitrary MSBuild item metadata to a file.
-.. versionadded:: 3.22
-
- This property is honored for all source file types.
- Previously it worked only for non-built files.
-
-Takes a list of ``Key=Value`` pairs. Tells the Visual Studio generator to set
-``Key`` to ``Value`` as item metadata on the file.
+This property accepts a list of ``Key=Value`` pairs. The Visual Studio
+generator will add these key-value pairs as item metadata to the file.
+:manual:`Generator expressions <cmake-generator-expressions(7)>` are supported.
For example:
@@ -19,7 +15,21 @@
set_property(SOURCE file.hlsl PROPERTY VS_SETTINGS "Key=Value" "Key2=Value2")
-will set ``Key`` to ``Value`` and ``Key2`` to ``Value2`` on the
-``file.hlsl`` item as metadata.
+will set the ``file.hlsl`` item metadata as follows:
-:manual:`Generator expressions <cmake-generator-expressions(7)>` are supported.
+.. code-block:: xml
+
+ <FXCompile Include="source_path\file.hlsl">
+ <Key>Value</Key>
+ <Key2>Value2</Key2>
+ </FXCompile>
+
+Together with :prop_sf:`VS_TOOL_OVERRIDE`, this property can be used to
+configure items for custom MSBuild tasks.
+
+Adding the metadata ``ExcludedFromBuild=true`` will exclude the file from
+the build.
+
+.. versionchanged:: 3.22
+ This property is honored for all source file types.
+ Previously, it only worked for source types unknown to CMake.
diff --git a/Help/prop_sf/VS_TOOL_OVERRIDE.rst b/Help/prop_sf/VS_TOOL_OVERRIDE.rst
index b2f4112..57172b6 100644
--- a/Help/prop_sf/VS_TOOL_OVERRIDE.rst
+++ b/Help/prop_sf/VS_TOOL_OVERRIDE.rst
@@ -3,5 +3,13 @@
.. versionadded:: 3.7
-Override the default Visual Studio tool that will be applied to the source file
-with a new tool not based on the extension of the file.
+Override the MSBuild item type of a source file in a Visual Studio project.
+
+Together with :prop_sf:`VS_SETTINGS`, this property can be used to configure
+items for custom MSBuild tasks.
+
+Setting the item type to ``None`` will exclude the file from the build.
+
+.. versionchanged:: 3.31
+ This property is honored for all source file types.
+ Previously, it only worked for source types unknown to CMake.
diff --git a/Help/prop_tgt/COMPILE_PDB_OUTPUT_DIRECTORY.rst b/Help/prop_tgt/COMPILE_PDB_OUTPUT_DIRECTORY.rst
index 3f3df66..626b5e0 100644
--- a/Help/prop_tgt/COMPILE_PDB_OUTPUT_DIRECTORY.rst
+++ b/Help/prop_tgt/COMPILE_PDB_OUTPUT_DIRECTORY.rst
@@ -7,9 +7,19 @@
generated by the compiler while building source files.
This property specifies the directory into which the MS debug symbols
-will be placed by the compiler. This property is initialized by the
-value of the :variable:`CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY` variable
-if it is set when a target is created.
+will be placed by the compiler.
+
+.. versionadded:: 3.12
+
+ The property value may use
+ :manual:`generator expressions <cmake-generator-expressions(7)>`.
+ Multi-configuration generators append a per-configuration
+ subdirectory to the specified directory unless a generator expression
+ is used.
+
+This property is initialized by the value of the
+:variable:`CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY` variable if it is
+set when a target is created.
.. |PDB_XXX| replace:: :prop_tgt:`PDB_OUTPUT_DIRECTORY`
.. include:: COMPILE_PDB_NOTE.txt
diff --git a/Help/prop_tgt/COMPILE_PDB_OUTPUT_DIRECTORY_CONFIG.rst b/Help/prop_tgt/COMPILE_PDB_OUTPUT_DIRECTORY_CONFIG.rst
index c25c2fc..8a870f8 100644
--- a/Help/prop_tgt/COMPILE_PDB_OUTPUT_DIRECTORY_CONFIG.rst
+++ b/Help/prop_tgt/COMPILE_PDB_OUTPUT_DIRECTORY_CONFIG.rst
@@ -14,5 +14,10 @@
:variable:`CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY_<CONFIG>` variable
if it is set when a target is created.
+.. versionadded:: 3.12
+
+ Contents of ``COMPILE_PDB_OUTPUT_DIRECTORY_<CONFIG>`` may use
+ :manual:`generator expressions <cmake-generator-expressions(7)>`.
+
.. |PDB_XXX| replace:: :prop_tgt:`PDB_OUTPUT_DIRECTORY_<CONFIG>`
.. include:: COMPILE_PDB_NOTE.txt
diff --git a/Help/prop_tgt/EXCLUDE_FROM_ALL.rst b/Help/prop_tgt/EXCLUDE_FROM_ALL.rst
index f0200f3..240fcd1 100644
--- a/Help/prop_tgt/EXCLUDE_FROM_ALL.rst
+++ b/Help/prop_tgt/EXCLUDE_FROM_ALL.rst
@@ -26,3 +26,12 @@
Only the "Ninja Multi-Config" generator supports a property value that varies by
configuration. For all other generators the value of this property must be the
same for all configurations.
+
+See Also
+^^^^^^^^
+
+* To exclude targets from the whole directory subtree, see the
+ :prop_dir:`EXCLUDE_FROM_ALL` directory property.
+
+* To exclude targets from the Visual Studio solution build, use
+ :prop_tgt:`EXCLUDE_FROM_DEFAULT_BUILD`.
diff --git a/Help/prop_tgt/EXCLUDE_FROM_DEFAULT_BUILD.rst b/Help/prop_tgt/EXCLUDE_FROM_DEFAULT_BUILD.rst
index 664704b..71b36e8 100644
--- a/Help/prop_tgt/EXCLUDE_FROM_DEFAULT_BUILD.rst
+++ b/Help/prop_tgt/EXCLUDE_FROM_DEFAULT_BUILD.rst
@@ -1,8 +1,18 @@
EXCLUDE_FROM_DEFAULT_BUILD
--------------------------
-Exclude target from ``Build Solution``.
+Exclude a target from the solution build configuration.
-This property is only used by Visual Studio generators.
-When set to ``TRUE``, the target will not be built when you press
-``Build Solution``.
+This property is only used by Visual Studio generators. When set to ``TRUE``,
+the target will be excluded from the build when the "Build Solution" command
+is run.
+
+This property has a per-configuration version:
+:prop_tgt:`EXCLUDE_FROM_DEFAULT_BUILD_<CONFIG>`.
+
+.. note::
+ Solution build configurations do not take project dependencies into account.
+ If a target is excluded, it will not be built, even if another target
+ included in the configuration depends on it. This behavior differs from the
+ CMake-generated ``ALL_BUILD`` target and the :prop_tgt:`EXCLUDE_FROM_ALL`
+ property.
diff --git a/Help/prop_tgt/PDB_OUTPUT_DIRECTORY.rst b/Help/prop_tgt/PDB_OUTPUT_DIRECTORY.rst
index 2f667f3..e39643c 100644
--- a/Help/prop_tgt/PDB_OUTPUT_DIRECTORY.rst
+++ b/Help/prop_tgt/PDB_OUTPUT_DIRECTORY.rst
@@ -5,11 +5,15 @@
generated by the linker for an executable or shared library target.
This property specifies the directory into which the MS debug symbols
-will be placed by the linker. The property value may use
-:manual:`generator expressions <cmake-generator-expressions(7)>`.
-Multi-configuration generators append a per-configuration
-subdirectory to the specified directory unless a generator expression
-is used.
+will be placed by the linker.
+
+.. versionadded:: 3.12
+
+ The property value may use
+ :manual:`generator expressions <cmake-generator-expressions(7)>`.
+ Multi-configuration generators append a per-configuration
+ subdirectory to the specified directory unless a generator expression
+ is used.
This property is initialized by the value of the
:variable:`CMAKE_PDB_OUTPUT_DIRECTORY` variable if it is
diff --git a/Help/prop_tgt/PDB_OUTPUT_DIRECTORY_CONFIG.rst b/Help/prop_tgt/PDB_OUTPUT_DIRECTORY_CONFIG.rst
index 6c55083..064b91d 100644
--- a/Help/prop_tgt/PDB_OUTPUT_DIRECTORY_CONFIG.rst
+++ b/Help/prop_tgt/PDB_OUTPUT_DIRECTORY_CONFIG.rst
@@ -12,8 +12,10 @@
:variable:`CMAKE_PDB_OUTPUT_DIRECTORY_<CONFIG>` variable if it is
set when a target is created.
-Contents of ``PDB_OUTPUT_DIRECTORY_<CONFIG>`` may use
-:manual:`generator expressions <cmake-generator-expressions(7)>`.
+.. versionadded:: 3.12
+
+ Contents of ``PDB_OUTPUT_DIRECTORY_<CONFIG>`` may use
+ :manual:`generator expressions <cmake-generator-expressions(7)>`.
.. |COMPILE_PDB_XXX| replace:: :prop_tgt:`COMPILE_PDB_OUTPUT_DIRECTORY_<CONFIG>`
.. include:: PDB_NOTE.txt
diff --git a/Help/release/dev/0-sample-topic.rst b/Help/release/dev/0-sample-topic.rst
new file mode 100644
index 0000000..e4cc01e
--- /dev/null
+++ b/Help/release/dev/0-sample-topic.rst
@@ -0,0 +1,7 @@
+0-sample-topic
+--------------
+
+* This is a sample release note for the change in a topic.
+ Developers should add similar notes for each topic branch
+ making a noteworthy change. Each document should be named
+ and titled to match the topic name to avoid merge conflicts.
diff --git a/Help/release/dev/FindPython-crosscompiling-consistency.rst b/Help/release/dev/FindPython-crosscompiling-consistency.rst
new file mode 100644
index 0000000..6ca7fab
--- /dev/null
+++ b/Help/release/dev/FindPython-crosscompiling-consistency.rst
@@ -0,0 +1,6 @@
+FindPython-crosscompiling-consistency
+-------------------------------------
+
+* Modules :module:`FindPython3`, :module:`FindPython2` and :module:`FindPython`
+ enforce consistency of artifacts in cross-compiling mode. This prevent mixing
+ host and target artifacts. See policy :policy:`CMP0190` for more information.
diff --git a/Help/release/dev/add-dependency-one-arg.rst b/Help/release/dev/add-dependency-one-arg.rst
new file mode 100644
index 0000000..e077258
--- /dev/null
+++ b/Help/release/dev/add-dependency-one-arg.rst
@@ -0,0 +1,4 @@
+add-dependency-one-arg
+----------------------
+
+* The :command:`add_dependencies` command may be called with no dependencies.
diff --git a/Help/release/dev/cmake-find-required.rst b/Help/release/dev/cmake-find-required.rst
new file mode 100644
index 0000000..20e50e6
--- /dev/null
+++ b/Help/release/dev/cmake-find-required.rst
@@ -0,0 +1,8 @@
+cmake-find-required
+-------------------
+
+* The :variable:`CMAKE_FIND_REQUIRED` variable was added to tell
+ :command:`find_package`, :command:`find_path`, :command:`find_file`,
+ :command:`find_library`, and :command:`find_program` to be ``REQUIRED``
+ by default. The commands also gained an ``OPTIONAL`` keyword to ignore
+ the variable for a specific call.
diff --git a/Help/release/dev/cpack-rpm-weak-deps-tags.rst b/Help/release/dev/cpack-rpm-weak-deps-tags.rst
new file mode 100644
index 0000000..50f49c0
--- /dev/null
+++ b/Help/release/dev/cpack-rpm-weak-deps-tags.rst
@@ -0,0 +1,8 @@
+cpack-rpm-weak-deps-tags
+------------------------
+
+* The :cpack_gen:`CPack RPM Generator` gained
+ :variable:`CPACK_RPM_PACKAGE_ENHANCES`,
+ :variable:`CPACK_RPM_PACKAGE_RECOMMENDS`, and
+ :variable:`CPACK_RPM_PACKAGE_SUPPLEMENTS`
+ variables to specify the corresponding RPM spec fields.
diff --git a/Help/release/dev/diab-compiler-support.rst b/Help/release/dev/diab-compiler-support.rst
new file mode 100644
index 0000000..2cf0bd6
--- /dev/null
+++ b/Help/release/dev/diab-compiler-support.rst
@@ -0,0 +1,8 @@
+diab-compiler-support
+---------------------
+
+* `Diab compilers from Wind River Systems`_, versions 5.9.x+, are now
+ supported with :variable:`compiler id <CMAKE_<LANG>_COMPILER_ID>` ``Diab``
+ for languages ``ASM``, ``C``, and ``CXX``.
+
+.. _`Diab compilers from Wind River Systems`: https://www.windriver.com/resource/wind-river-diab-compiler-product-overview
diff --git a/Help/release/dev/genex-transitive-link-libraries.rst b/Help/release/dev/genex-transitive-link-libraries.rst
new file mode 100644
index 0000000..d5cbb90
--- /dev/null
+++ b/Help/release/dev/genex-transitive-link-libraries.rst
@@ -0,0 +1,6 @@
+genex-transitive-link-libraries
+-------------------------------
+
+* The :genex:`TARGET_PROPERTY` generator expression now evaluates the
+ :prop_tgt:`LINK_LIBRARIES` and :prop_tgt:`INTERFACE_LINK_LIBRARIES`
+ target properties transitively. See policy :policy:`CMP0189`.
diff --git a/Help/release/dev/nvpl-support.rst b/Help/release/dev/nvpl-support.rst
new file mode 100644
index 0000000..e8e5791
--- /dev/null
+++ b/Help/release/dev/nvpl-support.rst
@@ -0,0 +1,5 @@
+NVPL Support
+------------
+
+* The :module:`FindBLAS` and :module:`FindLAPACK` modules now support the
+ NVIDIA Performance Libraries (NVPL).
diff --git a/Help/release/dev/regex-fixes.rst b/Help/release/dev/regex-fixes.rst
new file mode 100644
index 0000000..82d1fad
--- /dev/null
+++ b/Help/release/dev/regex-fixes.rst
@@ -0,0 +1,10 @@
+regex-fixes
+-----------
+
+* Regular expressions match the ``^`` anchor at most once in repeated
+ searches, at the start of the input. See policy :policy:`CMP0186`.
+
+* References to unmatched groups are allowed, they are replaced with empty
+ strings.
+
+* Zero-length matches are always allowed.
diff --git a/Help/release/dev/remove-FindGCCXML.rst b/Help/release/dev/remove-FindGCCXML.rst
new file mode 100644
index 0000000..7f17b91
--- /dev/null
+++ b/Help/release/dev/remove-FindGCCXML.rst
@@ -0,0 +1,5 @@
+remove-FindGCCXML
+-----------------
+
+* The :module:`FindGCCXML` module has been deprecated via policy
+ :policy:`CMP0188`. Port projects to CastXML instead.
diff --git a/Help/release/index.rst b/Help/release/index.rst
index b083cf5..7c44090 100644
--- a/Help/release/index.rst
+++ b/Help/release/index.rst
@@ -7,6 +7,8 @@
This file should include the adjacent "dev.txt" file
in development versions but not in release versions.
+.. include:: dev.txt
+
Releases
========
diff --git a/Help/variable/CMAKE_FIND_PACKAGE_SORT_DIRECTION.rst b/Help/variable/CMAKE_FIND_PACKAGE_SORT_DIRECTION.rst
index 98c2a8f..92758fd 100644
--- a/Help/variable/CMAKE_FIND_PACKAGE_SORT_DIRECTION.rst
+++ b/Help/variable/CMAKE_FIND_PACKAGE_SORT_DIRECTION.rst
@@ -6,13 +6,13 @@
The sorting direction used by :variable:`CMAKE_FIND_PACKAGE_SORT_ORDER`.
It can assume one of the following values:
-``DEC``
- Default. Ordering is done in descending mode.
- The highest folder found will be tested first.
-
``ASC``
- Ordering is done in ascending mode.
+ Default. Ordering is done in ascending mode.
The lowest folder found will be tested first.
+``DEC``
+ Ordering is done in descending mode.
+ The highest folder found will be tested first.
+
If :variable:`CMAKE_FIND_PACKAGE_SORT_ORDER` is not set or is set to ``NONE``
this variable has no effect.
diff --git a/Help/variable/CMAKE_FIND_REQUIRED.rst b/Help/variable/CMAKE_FIND_REQUIRED.rst
new file mode 100644
index 0000000..0518edb
--- /dev/null
+++ b/Help/variable/CMAKE_FIND_REQUIRED.rst
@@ -0,0 +1,27 @@
+CMAKE_FIND_REQUIRED
+-------------------
+
+.. versionadded:: 4.1
+
+If enabled, the following commands are treated as having the ``REQUIRED``
+keyword unless provided with the ``OPTIONAL`` keyword:
+
+* :command:`find_package`
+* :command:`find_program`
+* :command:`find_library`
+* :command:`find_path`
+* :command:`find_file`
+
+When :command:`find_package` loads a ``Find<PackageName>.cmake``
+or ``<PackageName>Config.cmake`` module, the ``CMAKE_FIND_REQUIRED``
+variable is automatically unset within it to restore the default
+behavior for nested find operations. The module is free to set the
+``CMAKE_FIND_REQUIRED`` variable itself to opt-in to the behavior.
+
+Note that enabling this variable breaks some commonly used patterns.
+Multiple calls to :command:`find_package` are sometimes used to obtain a
+different search order to the default.
+
+See also the :variable:`CMAKE_REQUIRE_FIND_PACKAGE_<PackageName>` for making
+a :command:`find_package` call ``REQUIRED``, and for additional information on
+how enabling these variables can break commonly used patterns.
diff --git a/Help/variable/CMAKE_LANG_COMPILER_ID.rst b/Help/variable/CMAKE_LANG_COMPILER_ID.rst
index a4f899e..f46ac73 100644
--- a/Help/variable/CMAKE_LANG_COMPILER_ID.rst
+++ b/Help/variable/CMAKE_LANG_COMPILER_ID.rst
@@ -19,6 +19,7 @@
``Clang`` `LLVM Clang`_
``Cray`` Cray Compiler
``CrayClang`` Cray Clang-based Compiler
+``Diab`` `Wind River Systems Diab Compiler`_
``Embarcadero``, ``Borland`` `Embarcadero`_
``Flang`` `Classic Flang Fortran Compiler`_
``LLVMFlang`` `LLVM Flang Fortran Compiler`_
@@ -71,3 +72,4 @@
.. _Tiny C Compiler: https://bellard.org/tcc
.. _Tasking Compiler Toolsets: https://www.tasking.com
.. _Texas Instruments Clang-based Compilers: https://www.ti.com/tool/download/ARM-CGT-CLANG
+.. _Wind River Systems Diab Compiler: https://www.windriver.com/resource/wind-river-diab-compiler-product-overview
diff --git a/Help/variable/CMAKE_SYSTEM_NAME.rst b/Help/variable/CMAKE_SYSTEM_NAME.rst
index 681ee03..41c1b78 100644
--- a/Help/variable/CMAKE_SYSTEM_NAME.rst
+++ b/Help/variable/CMAKE_SYSTEM_NAME.rst
@@ -61,7 +61,6 @@
``Haiku`` Unix operating system inspired by BeOS
``HP-UX`` Hewlett Packard Unix
``iOS`` Apple mobile phone operating system
-``kFreeBSD`` FreeBSD kernel with a GNU userland
``Linux`` All Linux-based distributions
``Midipix`` POSIX-compatible layer for Windows
``MirBSD`` MirOS BSD operating system
diff --git a/Modules/CMakeCompilerIdDetection.cmake b/Modules/CMakeCompilerIdDetection.cmake
index dbbb65a..aae3847 100644
--- a/Modules/CMakeCompilerIdDetection.cmake
+++ b/Modules/CMakeCompilerIdDetection.cmake
@@ -89,6 +89,7 @@
MSVC
ADSP
IAR
+ Diab
)
if ("x${lang}" STREQUAL "xC")
list(APPEND ordered_compilers
diff --git a/Modules/CMakeDetermineASMCompiler.cmake b/Modules/CMakeDetermineASMCompiler.cmake
index 9124285..c4b4603 100644
--- a/Modules/CMakeDetermineASMCompiler.cmake
+++ b/Modules/CMakeDetermineASMCompiler.cmake
@@ -110,6 +110,10 @@
set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_IAR )
set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_IAR "IAR Assembler")
+ list(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS Diab)
+ set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_Diab "-V" )
+ set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_Diab "Wind River Systems")
+
list(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS ARMCC)
set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_ARMCC )
set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_ARMCC "(ARM Compiler)|(ARM Assembler)|(Arm Compiler)")
diff --git a/Modules/CMakeDetermineCUDACompiler.cmake b/Modules/CMakeDetermineCUDACompiler.cmake
index 698346f..5198231 100644
--- a/Modules/CMakeDetermineCUDACompiler.cmake
+++ b/Modules/CMakeDetermineCUDACompiler.cmake
@@ -171,24 +171,40 @@
# Find target directory when crosscompiling.
if(CMAKE_CROSSCOMPILING)
- if(CMAKE_SYSTEM_PROCESSOR STREQUAL "armv7-a")
+ if(CMAKE_CUDA_COMPILER_TARGET MATCHES "^([^-]+)(-|$)")
+ set(_CUDA_TARGET_PROCESSOR "${CMAKE_MATCH_1}")
+ elseif(CMAKE_SYSTEM_PROCESSOR)
+ set(_CUDA_TARGET_PROCESSOR "${CMAKE_SYSTEM_PROCESSOR}")
+ else()
+ message(FATAL_ERROR "Cross-compiling CUDA with Clang requires CMAKE_CUDA_COMPILER_TARGET and/or CMAKE_SYSTEM_PROCESSOR to be set.")
+ endif()
+ # Keep in sync with equivalent table in FindCUDAToolkit!
+ if(_CUDA_TARGET_PROCESSOR STREQUAL "armv7-a")
# Support for NVPACK
- set(_CUDA_TARGET_NAME "armv7-linux-androideabi")
- elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "arm")
- set(_CUDA_TARGET_NAME "armv7-linux-gnueabihf")
- elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64")
+ set(_CUDA_TARGET_NAMES "armv7-linux-androideabi")
+ elseif(_CUDA_TARGET_PROCESSOR MATCHES "arm")
+ set(_CUDA_TARGET_NAMES "armv7-linux-gnueabihf")
+ elseif(_CUDA_TARGET_PROCESSOR MATCHES "aarch64")
if(ANDROID_ARCH_NAME STREQUAL "arm64")
- set(_CUDA_TARGET_NAME "aarch64-linux-androideabi")
+ set(_CUDA_TARGET_NAMES "aarch64-linux-androideabi")
+ elseif (CMAKE_SYSTEM_NAME STREQUAL "QNX")
+ set(_CUDA_TARGET_NAMES "aarch64-qnx")
else()
- set(_CUDA_TARGET_NAME "aarch64-linux")
+ set(_CUDA_TARGET_NAMES "aarch64-linux" "sbsa-linux")
endif()
- elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
- set(_CUDA_TARGET_NAME "x86_64-linux")
+ elseif(_CUDA_TARGET_PROCESSOR STREQUAL "x86_64")
+ set(_CUDA_TARGET_NAMES "x86_64-linux")
endif()
- if(EXISTS "${CMAKE_CUDA_COMPILER_TOOLKIT_ROOT}/targets/${_CUDA_TARGET_NAME}")
- set(_CUDA_TARGET_DIR "${CMAKE_CUDA_COMPILER_TOOLKIT_ROOT}/targets/${_CUDA_TARGET_NAME}")
- endif()
+ foreach(_CUDA_TARGET_NAME IN LISTS _CUDA_TARGET_NAMES)
+ if(EXISTS "${CMAKE_CUDA_COMPILER_TOOLKIT_ROOT}/targets/${_CUDA_TARGET_NAME}")
+ set(_CUDA_TARGET_DIR "${CMAKE_CUDA_COMPILER_TOOLKIT_ROOT}/targets/${_CUDA_TARGET_NAME}")
+ break()
+ endif()
+ endforeach()
+ unset(_CUDA_TARGET_NAME)
+ unset(_CUDA_TARGET_NAMES)
+ unset(_CUDA_TARGET_PROCESSOR)
endif()
# If not already set we can simply use the toolkit root or it's a scattered installation.
@@ -227,7 +243,6 @@
unset(_CUDA_INCLUDE_DIR)
unset(_CUDA_LIBRARY_DIR)
unset(_CUDA_TARGET_DIR)
- unset(_CUDA_TARGET_NAME)
elseif(CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA")
include(Internal/CMakeNVCCParseImplicitInfo)
# Parse CMAKE_CUDA_COMPILER_PRODUCED_OUTPUT to get:
diff --git a/Modules/CMakeFindCodeBlocks.cmake b/Modules/CMakeFindCodeBlocks.cmake
index fc769a1..b330fee 100644
--- a/Modules/CMakeFindCodeBlocks.cmake
+++ b/Modules/CMakeFindCodeBlocks.cmake
@@ -18,7 +18,7 @@
set(_CMAKE_CODEBLOCKS_INITIAL_MAKE_ARGS "")
include(ProcessorCount)
-processorcount(_CMAKE_CODEBLOCKS_PROCESSOR_COUNT)
+ProcessorCount(_CMAKE_CODEBLOCKS_PROCESSOR_COUNT)
# Only set -j if we are under UNIX and if the make-tool used actually has "make" in the name
# (we may also get here in the future e.g. for ninja)
diff --git a/Modules/CMakeFindEclipseCDT4.cmake b/Modules/CMakeFindEclipseCDT4.cmake
index b980fa4..398f9e3 100644
--- a/Modules/CMakeFindEclipseCDT4.cmake
+++ b/Modules/CMakeFindEclipseCDT4.cmake
@@ -68,7 +68,7 @@
set(_CMAKE_ECLIPSE_INITIAL_MAKE_ARGS "")
include(ProcessorCount)
-processorcount(_CMAKE_ECLIPSE_PROCESSOR_COUNT)
+ProcessorCount(_CMAKE_ECLIPSE_PROCESSOR_COUNT)
# Only set -j if we are under UNIX and if the make-tool used actually has "make" in the name
# (we may also get here in the future e.g. for ninja)
diff --git a/Modules/CMakeFindKate.cmake b/Modules/CMakeFindKate.cmake
index a4bf2ed..2adb532 100644
--- a/Modules/CMakeFindKate.cmake
+++ b/Modules/CMakeFindKate.cmake
@@ -9,7 +9,7 @@
# Try to find out how many CPUs we have and set the -j argument for make accordingly
include(ProcessorCount)
-processorcount(_CMAKE_KATE_PROCESSOR_COUNT)
+ProcessorCount(_CMAKE_KATE_PROCESSOR_COUNT)
# Only set -j if we are under UNIX and if the make-tool used actually has "make" in the name
# (we may also get here in the future e.g. for ninja)
diff --git a/Modules/CMakeParseImplicitLinkInfo.cmake b/Modules/CMakeParseImplicitLinkInfo.cmake
index d9f6bad..77e999c 100644
--- a/Modules/CMakeParseImplicitLinkInfo.cmake
+++ b/Modules/CMakeParseImplicitLinkInfo.cmake
@@ -47,6 +47,7 @@
set(is_lfortran_less_0_40 0)
set(is_msvc 0)
+ set(is_cray 0)
if(EXTRA_PARSE_LANGUAGE)
if("x${CMAKE_${EXTRA_PARSE_LANGUAGE}_COMPILER_ID}" STREQUAL "xMSVC" OR
"x${CMAKE_${EXTRA_PARSE_LANGUAGE}_SIMULATE_ID}" STREQUAL "xMSVC")
@@ -54,6 +55,8 @@
elseif("x${CMAKE_${EXTRA_PARSE_LANGUAGE}_COMPILER_ID}" STREQUAL "xLFortran"
AND CMAKE_${EXTRA_PARSE_LANGUAGE}_COMPILER_VERSION VERSION_LESS "0.40")
set(is_lfortran_less_0_40 1)
+ elseif("${CMAKE_${EXTRA_PARSE_LANGUAGE}_COMPILER_ID}" MATCHES "^(Cray|CrayClang)$")
+ set(is_cray 1)
endif()
endif()
# Parse implicit linker arguments.
@@ -65,6 +68,9 @@
if(is_msvc)
string(APPEND linker "|link\\.exe|lld-link(\\.exe)?")
endif()
+ if(is_cray)
+ string(APPEND linker "|cce_omp_offload_linker")
+ endif()
if(CMAKE_LINKER)
get_filename_component(default_linker ${CMAKE_LINKER} NAME)
if (NOT default_linker MATCHES "(${linker})")
diff --git a/Modules/CTestCoverageCollectGCOV.cmake b/Modules/CTestCoverageCollectGCOV.cmake
index 0b4f374..a4ca03a 100644
--- a/Modules/CTestCoverageCollectGCOV.cmake
+++ b/Modules/CTestCoverageCollectGCOV.cmake
@@ -7,10 +7,10 @@
.. versionadded:: 3.2
-This module provides the ``ctest_coverage_collect_gcov`` function.
+This module provides the ``ctest_coverage_collect_gcov()`` function.
-This function runs gcov on all .gcda files found in the binary tree
-and packages the resulting .gcov files into a tar file.
+This function runs ``gcov`` on all ``.gcda`` files found in the binary tree
+and packages the resulting ``.gcov`` files into a tar file.
This tarball also contains the following:
* *data.json* defines the source and build directories for use by CDash.
@@ -26,13 +26,19 @@
.. code-block:: cmake
- ctest_coverage_collect_gcov(TARBALL <tarfile>
- [SOURCE <source_dir>][BUILD <build_dir>]
+ ctest_coverage_collect_gcov(
+ TARBALL <tarfile>
+ [TARBALL_COMPRESSION <option>]
+ [SOURCE <source_dir>]
+ [BUILD <build_dir>]
[GCOV_COMMAND <gcov_command>]
[GCOV_OPTIONS <options>...]
- )
+ [GLOB]
+ [DELETE]
+ [QUIET]
+ )
- Run gcov and package a tar file for CDash. The options are:
+ Run ``gcov`` and package a tar file for CDash. The options are:
``TARBALL <tarfile>``
Specify the location of the ``.tar`` file to be created for later
@@ -73,8 +79,9 @@
``GLOB``
.. versionadded:: 3.6
- Recursively search for .gcda files in build_dir rather than
- determining search locations by reading TargetDirectories.txt.
+ Recursively search for ``.gcda`` files in ``<build_dir>`` rather than
+ determining search locations by reading ``CMakeFiles/TargetDirectories.txt``
+ (file generated by CMake at the generation phase).
``DELETE``
.. versionadded:: 3.6
@@ -88,6 +95,20 @@
.. versionadded:: 3.3
Added support for the :variable:`CTEST_CUSTOM_COVERAGE_EXCLUDE` variable.
+Examples
+^^^^^^^^
+
+Generating code coverage data packaged as a ``.tar.gz`` file in a
+:option:`ctest -S` script:
+
+.. code-block:: cmake
+
+ include(CTestCoverageCollectGCOV)
+
+ ctest_coverage_collect_gcov(
+ TARBALL "${CTEST_BINARY_DIRECTORY}/gcov.tar.gz"
+ TARBALL_COMPRESSION "GZIP"
+ )
#]=======================================================================]
function(ctest_coverage_collect_gcov)
diff --git a/Modules/CTestUseLaunchers.cmake b/Modules/CTestUseLaunchers.cmake
index 5578c3d..dc015f8 100644
--- a/Modules/CTestUseLaunchers.cmake
+++ b/Modules/CTestUseLaunchers.cmake
@@ -5,34 +5,48 @@
CTestUseLaunchers
-----------------
-Set the RULE_LAUNCH_* global properties when CTEST_USE_LAUNCHERS is on.
+This module sets the ``RULE_LAUNCH_*`` global properties when the
+:variable:`CTEST_USE_LAUNCHERS` variable is set to a true-like value (e.g.,
+``ON``):
-CTestUseLaunchers is automatically included when you include(CTest).
-However, it is split out into its own module file so projects can use
-the CTEST_USE_LAUNCHERS functionality independently.
+* :prop_gbl:`RULE_LAUNCH_COMPILE`
+* :prop_gbl:`RULE_LAUNCH_CUSTOM`
+* :prop_gbl:`RULE_LAUNCH_LINK`
-To use launchers, set CTEST_USE_LAUNCHERS to ON in a :option:`ctest -S`
-dashboard script, and then also set it in the cache of the configured
-project. Both cmake and ctest need to know the value of it for the
-launchers to work properly. CMake needs to know in order to generate
-proper build rules, and ctest, in order to produce the proper error
-and warning analysis.
+The ``CTestUseLaunchers`` module is automatically included by the
+:module:`CTest` module when ``include(CTest)`` is called. However, it is
+provided as a separate module so that projects can use the
+``CTEST_USE_LAUNCHERS`` functionality independently.
-For convenience, you may set the ENV variable
-CTEST_USE_LAUNCHERS_DEFAULT in your ctest -S script, too. Then, as
-long as your CMakeLists uses include(CTest) or
-include(CTestUseLaunchers), it will use the value of the ENV variable
-to initialize a CTEST_USE_LAUNCHERS cache variable. This cache
-variable initialization only occurs if CTEST_USE_LAUNCHERS is not
-already defined.
+To use launchers, set the ``CTEST_USE_LAUNCHERS`` variable to a true-like value
+in a :option:`ctest -S` dashboard script, and then also set the
+``CTEST_USE_LAUNCHERS`` cache variable in the configured project. Both
+``cmake`` and ``ctest`` must be aware of its value for the launchers to function
+correctly:
+
+* ``cmake`` needs it to generate the appropriate build rules
+* ``ctest`` requires it for accurate error and warning analysis
+
+For convenience, the environment variable :envvar:`CTEST_USE_LAUNCHERS_DEFAULT`
+may be set in the :option:`ctest -S` script. Then, as long as the
+``CMakeLists.txt`` includes the ``CTest`` or ``CTestUseLaunchers`` module, it
+will use the value of the environment variable to initialize a
+``CTEST_USE_LAUNCHERS`` cache variable. This cache variable initialization only
+occurs if ``CTEST_USE_LAUNCHERS`` is not already defined.
.. versionadded:: 3.8
- If CTEST_USE_LAUNCHERS is on in a :option:`ctest -S` script
- the ctest_configure command will add -DCTEST_USE_LAUNCHERS:BOOL=TRUE
- to the cmake command used to configure the project.
+ If ``CTEST_USE_LAUNCHERS`` is set to a true-like value in a
+ :option:`ctest -S` script, the :command:`ctest_configure` command will add
+ ``-DCTEST_USE_LAUNCHERS:BOOL=TRUE`` to the ``cmake`` command when configuring
+ the project.
-.. TODO Use RST markup
+Examples
+^^^^^^^^
+.. code-block:: cmake
+
+ set(CTEST_USE_LAUNCHERS ON)
+ include(CTestUseLaunchers)
#]=======================================================================]
if(NOT DEFINED CTEST_USE_LAUNCHERS AND DEFINED ENV{CTEST_USE_LAUNCHERS_DEFAULT})
diff --git a/Modules/Compiler/Diab-ASM.cmake b/Modules/Compiler/Diab-ASM.cmake
new file mode 100644
index 0000000..ccc8cb6
--- /dev/null
+++ b/Modules/Compiler/Diab-ASM.cmake
@@ -0,0 +1,3 @@
+include(Compiler/Diab)
+
+__compiler_diab(ASM)
diff --git a/Modules/Compiler/Diab-C.cmake b/Modules/Compiler/Diab-C.cmake
new file mode 100644
index 0000000..0fd5345
--- /dev/null
+++ b/Modules/Compiler/Diab-C.cmake
@@ -0,0 +1,9 @@
+include(Compiler/Diab)
+
+__compiler_diab(C)
+
+# c89/90 is both -Xdialect-c89
+set(CMAKE_C89_STANDARD_COMPILE_OPTION "-Xdialect-c89")
+set(CMAKE_C90_STANDARD_COMPILE_OPTION "-Xdialect-c89")
+set(CMAKE_C99_STANDARD_COMPILE_OPTION "-Xdialect-c99")
+set(CMAKE_C11_STANDARD_COMPILE_OPTION "-Xdialect-c11")
diff --git a/Modules/Compiler/Diab-CXX.cmake b/Modules/Compiler/Diab-CXX.cmake
new file mode 100644
index 0000000..a8a17c5
--- /dev/null
+++ b/Modules/Compiler/Diab-CXX.cmake
@@ -0,0 +1,12 @@
+include(Compiler/Diab)
+
+__compiler_diab(CXX)
+
+# Diab C++98 is named as -Xdialect-c++03
+set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "-Xdialect-c++03")
+set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-Xdialect-c++11")
+set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "-Xdialect-c++14")
+set(CMAKE_CXX17_STANDARD_COMPILE_OPTION "-Xdialect-c++17")
+set(CMAKE_CXX20_STANDARD_COMPILE_OPTION "-Xdialect-c++20")
+
+__compiler_check_default_language_standard(CXX 4.0 98 5.0 11)
diff --git a/Modules/Compiler/Diab-DetermineCompiler.cmake b/Modules/Compiler/Diab-DetermineCompiler.cmake
new file mode 100644
index 0000000..86518f5
--- /dev/null
+++ b/Modules/Compiler/Diab-DetermineCompiler.cmake
@@ -0,0 +1,10 @@
+# Diab Toolchain. Works only for versions 5.9.x or higher.
+set(_compiler_id_pp_test "defined(__DCC__) && defined(_DIAB_TOOL)")
+
+set(_compiler_id_version_compute "
+ # define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(__VERSION_MAJOR_NUMBER__)
+ # define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(__VERSION_MINOR_NUMBER__)
+ # define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__VERSION_ARCH_FEATURE_NUMBER__)
+ # define @PREFIX@COMPILER_VERSION_TWEAK @MACRO_DEC@(__VERSION_BUG_FIX_NUMBER__)
+"
+)
diff --git a/Modules/Compiler/Diab-FindBinUtils.cmake b/Modules/Compiler/Diab-FindBinUtils.cmake
new file mode 100644
index 0000000..7ca00cb
--- /dev/null
+++ b/Modules/Compiler/Diab-FindBinUtils.cmake
@@ -0,0 +1,15 @@
+# Find the archiver for the compiler architecture, which is always in the same
+# directory as the compiler.
+if(NOT DEFINED _CMAKE_PROCESSING_LANGUAGE OR _CMAKE_PROCESSING_LANGUAGE STREQUAL "")
+ message(FATAL_ERROR "Internal error: _CMAKE_PROCESSING_LANGUAGE is not set")
+endif()
+
+get_filename_component(__diab_path "${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER}" DIRECTORY)
+
+find_program(CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_AR
+ NAMES dar
+ HINTS ${__diab_path}
+ NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH
+ DOC "Diab Archiver"
+)
+mark_as_advanced(CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_AR)
diff --git a/Modules/Compiler/Diab.cmake b/Modules/Compiler/Diab.cmake
new file mode 100644
index 0000000..a8cfbfd
--- /dev/null
+++ b/Modules/Compiler/Diab.cmake
@@ -0,0 +1,33 @@
+# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+# file LICENSE.rst or https://cmake.org/licensing for details.
+
+# This module is shared by multiple languages; use include blocker.
+if(__COMPILER_Diab)
+ return()
+endif()
+set(__COMPILER_Diab 1)
+
+include(Compiler/CMakeCommonCompilerMacros)
+
+macro(__compiler_diab lang)
+ set(CMAKE_${lang}_VERBOSE_FLAG "-#")
+ set(CMAKE_${lang}_OUTPUT_EXTENSION ".o")
+
+ string(APPEND CMAKE_${lang}_FLAGS_INIT " ")
+ string(APPEND CMAKE_${lang}_FLAGS_DEBUG_INIT " -g")
+ string(APPEND CMAKE_${lang}_FLAGS_MINSIZEREL_INIT " -O -Xsize-opt")
+ string(APPEND CMAKE_${lang}_FLAGS_RELEASE_INIT " -XO")
+ string(APPEND CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT " -XO -g3")
+
+ set(__DIAB_AR "${CMAKE_${lang}_COMPILER_AR}")
+ set(CMAKE_${lang}_CREATE_STATIC_LIBRARY "\"${__DIAB_AR}\" -r <TARGET> <LINK_FLAGS> <OBJECTS>")
+ set(CMAKE_${lang}_ARCHIVE_CREATE "\"${__DIAB_AR}\" -r <TARGET> <LINK_FLAGS> <OBJECTS>")
+
+ set(_CMAKE_${lang}_IPO_SUPPORTED_BY_CMAKE YES)
+ set(_CMAKE_${lang}_IPO_MAY_BE_SUPPORTED_BY_COMPILER YES)
+ set(CMAKE_${lang}_COMPILE_OPTIONS_IPO -XO -Xwhole-program-optim)
+endmacro()
+
+set(CMAKE_EXECUTABLE_SUFFIX "")
+set(CMAKE_LIBRARY_PATH_TERMINATOR "")
+set(CMAKE_LIBRARY_PATH_FLAG "")
diff --git a/Modules/DeployQt4.cmake b/Modules/DeployQt4.cmake
index 39443cf..c94be82 100644
--- a/Modules/DeployQt4.cmake
+++ b/Modules/DeployQt4.cmake
@@ -5,102 +5,125 @@
DeployQt4
---------
-Functions to help assemble a standalone Qt4 executable.
+This module provides a collection of CMake utility functions useful for
+assembling and deploying standalone Qt4 executables.
-A collection of CMake utility functions useful for deploying Qt4
-executables.
+Functions
+^^^^^^^^^
-The following functions are provided by this module:
+This module defines the following functions:
-::
+* :command:`write_qt4_conf`
+* :command:`resolve_qt4_paths`
+* :command:`fixup_qt4_executable`
+* :command:`install_qt4_plugin_path`
+* :command:`install_qt4_plugin`
+* :command:`install_qt4_executable`
- write_qt4_conf
- resolve_qt4_paths
- fixup_qt4_executable
- install_qt4_plugin_path
- install_qt4_plugin
- install_qt4_executable
+.. command:: write_qt4_conf
-Requires CMake 2.6 or greater because it uses function and
-PARENT_SCOPE. Also depends on BundleUtilities.cmake.
+ .. code-block:: cmake
-.. code-block:: cmake
+ write_qt4_conf(<qt_conf_dir> <qt_conf_contents>)
- write_qt4_conf(<qt_conf_dir> <qt_conf_contents>)
+ Writes a ``qt.conf`` file with the ``<qt_conf_contents>`` into the
+ ``<qt_conf_dir>`` directory.
-Writes a qt.conf file with the <qt_conf_contents> into <qt_conf_dir>.
+.. command:: resolve_qt4_paths
-.. code-block:: cmake
+ .. code-block:: cmake
- resolve_qt4_paths(<paths_var> [<executable_path>])
+ resolve_qt4_paths(<paths_var> [<executable_path>])
-Loop through <paths_var> list and if any don't exist resolve them
-relative to the <executable_path> (if supplied) or the
-CMAKE_INSTALL_PREFIX.
+ Loops through the ``<paths_var>`` list and if any path doesn't exist, it
+ resolves them relative to the ``<executable_path>`` (if supplied) or the
+ :variable:`CMAKE_INSTALL_PREFIX`.
-.. code-block:: cmake
+.. command:: fixup_qt4_executable
- fixup_qt4_executable(<executable>
- [<qtplugins> <libs> <dirs> <plugins_dir> <request_qt_conf>])
+ .. code-block:: cmake
-Copies Qt plugins, writes a Qt configuration file (if needed) and
-fixes up a Qt4 executable using BundleUtilities so it is standalone
-and can be drag-and-drop copied to another machine as long as all of
-the system libraries are compatible.
+ fixup_qt4_executable(
+ <executable>
+ [<qtplugins> <libs> <dirs> <plugins_dir> <request_qt_conf>]
+ )
-<executable> should point to the executable to be fixed-up.
+ Copies Qt plugins, writes a Qt configuration file (if needed) and fixes up a
+ Qt4 executable using the :module:`BundleUtilities` module so it is standalone
+ and can be drag-and-drop copied to another machine as long as all of the
+ system libraries are compatible.
-<qtplugins> should contain a list of the names or paths of any Qt
-plugins to be installed.
+ ``<executable>`` should point to the executable to be fixed-up.
-<libs> will be passed to BundleUtilities and should be a list of any
-already installed plugins, libraries or executables to also be
-fixed-up.
+ ``<qtplugins>`` should contain a list of the names or paths of any Qt plugins
+ to be installed.
-<dirs> will be passed to BundleUtilities and should contain and
-directories to be searched to find library dependencies.
+ ``<libs>`` will be passed to the :module:`BundleUtilities` module and should
+ be a list of any already installed plugins, libraries or executables to also
+ be fixed-up.
-<plugins_dir> allows an custom plugins directory to be used.
+ ``<dirs>`` will be passed to the :module:`BundleUtilities` module and should
+ contain directories to be searched to find library dependencies.
-<request_qt_conf> will force a qt.conf file to be written even if not
-needed.
+ ``<plugins_dir>`` allows a custom plugins directory to be used.
-.. code-block:: cmake
+ ``<request_qt_conf>`` will force a ``qt.conf`` file to be written even if not
+ needed.
- install_qt4_plugin_path(plugin executable copy installed_plugin_path_var
- <plugins_dir> <component> <configurations>)
+.. command:: install_qt4_plugin_path
-Install (or copy) a resolved <plugin> to the default plugins directory
-(or <plugins_dir>) relative to <executable> and store the result in
-<installed_plugin_path_var>.
+ .. code-block:: cmake
-If <copy> is set to TRUE then the plugins will be copied rather than
-installed. This is to allow this module to be used at CMake time
-rather than install time.
+ install_qt4_plugin_path(
+ <plugin>
+ <executable>
+ <copy>
+ <installed_plugin_path_var>
+ [<plugins_dir> <component> <configurations>]
+ )
-If <component> is set then anything installed will use this COMPONENT.
+ Installs (or copies) a resolved ``<plugin>`` to the default plugins directory
+ (or ``<plugins_dir>``) relative to ``<executable>`` and stores the result in
+ a variable ``<installed_plugin_path_var>``.
-.. code-block:: cmake
+ If ``<copy>`` is set to ``TRUE`` then the plugins will be copied rather than
+ installed. This is to allow this module to be used at CMake time rather than
+ install time.
- install_qt4_plugin(plugin executable copy installed_plugin_path_var
- <plugins_dir> <component>)
+ If ``<component>`` is set then anything installed will use this COMPONENT.
-Install (or copy) an unresolved <plugin> to the default plugins
-directory (or <plugins_dir>) relative to <executable> and store the
-result in <installed_plugin_path_var>. See documentation of
-INSTALL_QT4_PLUGIN_PATH.
+.. command:: install_qt4_plugin
-.. code-block:: cmake
+ .. code-block:: cmake
- install_qt4_executable(<executable>
- [<qtplugins> <libs> <dirs> <plugins_dir> <request_qt_conf> <component>])
+ install_qt4_plugin(
+ <plugin>
+ <executable>
+ <copy>
+ <installed_plugin_path_var>
+ [<plugins_dir> <component>]
+ )
-Installs Qt plugins, writes a Qt configuration file (if needed) and
-fixes up a Qt4 executable using BundleUtilities so it is standalone
-and can be drag-and-drop copied to another machine as long as all of
-the system libraries are compatible. The executable will be fixed-up
-at install time. <component> is the COMPONENT used for bundle fixup
-and plugin installation. See documentation of FIXUP_QT4_BUNDLE.
+ Installs (or copies) an unresolved ``<plugin>`` to the default plugins
+ directory (or ``<plugins_dir>``) relative to ``<executable>`` and stores the
+ result in a variable ``<installed_plugin_path_var>``. For other arguments,
+ see also :command:`install_qt4_plugin_path`.
+
+.. command:: install_qt4_executable
+
+ .. code-block:: cmake
+
+ install_qt4_executable(
+ <executable>
+ [<qtplugins> <libs> <dirs> <plugins_dir> <request_qt_conf> <component>]
+ )
+
+ Installs Qt plugins, writes a Qt configuration file (if needed) and fixes up a
+ Qt4 executable using the :module:`BundleUtilities` module so it is standalone
+ and can be drag-and-drop copied to another machine as long as all of the
+ system libraries are compatible. The executable will be fixed-up at install
+ time. ``<component>`` is the COMPONENT used for bundle fixup and plugin
+ installation. For other arguments, see also :command:`fixup_qt4_executable`.
#]=======================================================================]
# The functions defined in this file depend on the fixup_bundle function
diff --git a/Modules/FindBLAS.cmake b/Modules/FindBLAS.cmake
index 53d74bc..b45a279 100644
--- a/Modules/FindBLAS.cmake
+++ b/Modules/FindBLAS.cmake
@@ -54,6 +54,21 @@
Search for any BLAS/LAPACK.
Most likely, a BLAS/LAPACK with 32-bit integer interfaces will be found.
+``BLA_THREAD``
+ .. versionadded:: 4.1
+
+ Specify the BLAS/LAPACK threading model:
+
+ ``SEQ``
+ Sequential model
+ ``OMP``
+ OpenMP model
+ ``ANY``
+ Search for any BLAS/LAPACK, if both are available most likely ``OMP`` will
+ be found.
+
+ This is currently only supported by NVIDIA NVPL.
+
Imported Targets
^^^^^^^^^^^^^^^^
@@ -169,6 +184,11 @@
A BLAS/LAPACK demuxing library using PLT trampolines
+``NVPL``
+ .. versionadded:: 4.1
+
+ NVIDIA Performance Libraries
+
``NVHPC``
.. versionadded:: 3.21
@@ -417,6 +437,16 @@
message(FATAL_ERROR "BLA_SIZEOF_INTEGER can have only <no value>, ANY, 4, or 8 values")
endif()
+if(NOT BLA_THREAD)
+ set(_blas_thread "ANY")
+elseif((BLA_THREAD STREQUAL "ANY") OR
+ (BLA_THREAD STREQUAL "SEQ") OR
+ (BLA_THREAD STREQUAL "OMP"))
+ set(_blas_thread ${BLA_THREAD})
+else()
+ message(FATAL_ERROR "BLA_THREAD can have only <no value>, ANY, SEQ, or OMP values")
+endif()
+
# Implicitly linked BLAS libraries?
if(BLA_VENDOR STREQUAL "All")
if(NOT BLAS_LIBRARIES)
@@ -1315,6 +1345,52 @@
unset(_blas_fjlapack_lib)
endif()
+# nVidia NVPL? (https://developer.nvidia.com/nvpl)
+if(BLA_VENDOR STREQUAL "NVPL" OR BLA_VENDOR STREQUAL "All")
+ # Prefer lp64 unless ilp64 is requested.
+ if((_blas_sizeof_integer EQUAL 4) OR (_blas_sizeof_integer STREQUAL "ANY"))
+ list(APPEND _blas_nvpl_ints "_lp64")
+ endif()
+ if((_blas_sizeof_integer EQUAL 8) OR (_blas_sizeof_integer STREQUAL "ANY"))
+ list(APPEND _blas_nvpl_ints "_ilp64")
+ endif()
+
+ # Prefer OMP if available
+ if((_blas_thread STREQUAL "OMP") OR (_blas_thread STREQUAL "ANY"))
+ list(APPEND _blas_nvpl_threads "_omp")
+ endif()
+ if((_blas_thread STREQUAL "SEQ") OR (_blas_thread STREQUAL "ANY"))
+ list(APPEND _blas_nvpl_threads "_seq")
+ endif()
+
+ if(NOT BLAS_LIBRARIES)
+ find_package(nvpl)
+ if(nvpl_FOUND)
+ foreach(_nvpl_thread IN LISTS _blas_nvpl_threads)
+ foreach(_nvpl_int IN LISTS _blas_nvpl_ints)
+
+ set(_blas_lib "nvpl::blas${_nvpl_int}${_nvpl_thread}")
+
+ if(TARGET ${_blas_lib})
+ set(BLAS_LIBRARIES ${_blas_lib})
+ break()
+ endif()
+
+ endforeach()
+
+ if(BLAS_LIBRARIES)
+ break()
+ endif()
+
+ endforeach()
+ endif()
+ endif()
+
+ unset(_blas_lib)
+ unset(_blas_nvpl_ints)
+ unset(_blas_nvpl_threads)
+endif()
+
# BLAS in nVidia HPC SDK? (https://developer.nvidia.com/hpc-sdk)
if(BLA_VENDOR STREQUAL "NVHPC" OR BLA_VENDOR STREQUAL "All")
set(_blas_nvhpc_lib "blas")
diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake
index 4323fda..284726c 100644
--- a/Modules/FindCUDA.cmake
+++ b/Modules/FindCUDA.cmake
@@ -891,21 +891,22 @@
if(CMAKE_CROSSCOMPILING)
set(CUDA_TOOLKIT_ROOT $ENV{CUDA_TOOLKIT_ROOT})
+ # Keep in sync with equivalent table in FindCUDAToolkit!
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "armv7-a")
# Support for NVPACK
- set (CUDA_TOOLKIT_TARGET_NAMES "armv7-linux-androideabi")
+ set(CUDA_TOOLKIT_TARGET_NAMES "armv7-linux-androideabi")
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "arm")
- # Support for arm cross compilation
set(CUDA_TOOLKIT_TARGET_NAMES "armv7-linux-gnueabihf")
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64")
- # Support for aarch64 cross compilation
- if (ANDROID_ARCH_NAME STREQUAL "arm64")
+ if(ANDROID_ARCH_NAME STREQUAL "arm64")
set(CUDA_TOOLKIT_TARGET_NAMES "aarch64-linux-androideabi")
elseif (CMAKE_SYSTEM_NAME STREQUAL "QNX")
set(CUDA_TOOLKIT_TARGET_NAMES "aarch64-qnx")
else()
set(CUDA_TOOLKIT_TARGET_NAMES "aarch64-linux" "sbsa-linux")
endif()
+ elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
+ set(CUDA_TOOLKIT_TARGET_NAMES "x86_64-linux")
endif()
foreach(CUDA_TOOLKIT_TARGET_NAME IN LISTS CUDA_TOOLKIT_TARGET_NAMES)
diff --git a/Modules/FindCUDAToolkit.cmake b/Modules/FindCUDAToolkit.cmake
index b10880d..7df621e 100644
--- a/Modules/FindCUDAToolkit.cmake
+++ b/Modules/FindCUDAToolkit.cmake
@@ -939,6 +939,7 @@
# Find target directory when crosscompiling.
if(CMAKE_CROSSCOMPILING)
+ # Keep in sync with equivalent table in CMakeDetermineCUDACompiler and FindCUDA!
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "armv7-a")
# Support for NVPACK
set(CUDAToolkit_TARGET_NAMES "armv7-linux-androideabi")
diff --git a/Modules/FindGCCXML.cmake b/Modules/FindGCCXML.cmake
index 43ca395..fdab959 100644
--- a/Modules/FindGCCXML.cmake
+++ b/Modules/FindGCCXML.cmake
@@ -5,17 +5,28 @@
FindGCCXML
----------
+.. versionchanged:: 4.1
+ This module is available only if policy :policy:`CMP0188` is not set to ``NEW``.
+ Port projects to search for CastXML by calling ``find_program`` directly.
+
Find the GCC-XML front-end executable.
-
-
This module will define the following variables:
-::
-
- GCCXML - the GCC-XML front-end executable.
+``GCCXML``
+ The GCC-XML front-end executable.
#]=======================================================================]
+cmake_policy(GET CMP0188 _FindGCCXML_CMP0188)
+if(_FindGCCXML_CMP0188 STREQUAL "NEW")
+ message(FATAL_ERROR "The FindGCCXML module has been removed by policy CMP0188.")
+endif()
+
+if(_FindGCCXML_testing)
+ set(_FindGCCXML_included TRUE)
+ return()
+endif()
+
find_program(GCCXML
NAMES gccxml
../GCC_XML/gccxml
diff --git a/Modules/FindGettext.cmake b/Modules/FindGettext.cmake
index 9aae486..181631a 100644
--- a/Modules/FindGettext.cmake
+++ b/Modules/FindGettext.cmake
@@ -35,10 +35,11 @@
.. code-block:: cmake
- gettext_create_translations(<mofile> [ALL] <file>...)
+ gettext_create_translations(<potfile> [ALL] <file>...)
- This will create a target "translations" which will convert the
- given input .po files into the binary output .mo file. Options:
+ This function creates a custom target "translations" which processes the
+ given .pot file to .mo files. The generated binary files will be installed
+ into ``share/locale/`` directory. Options:
``ALL``
The translations will be created when building the default target.
@@ -51,7 +52,7 @@
[INSTALL_DESTINATION <destdir>]
LANGUAGES <lang>...)
- This function creates a custom target "potfile" which processes the given
+ This function creates a custom target "potfiles" which processes the given
.pot file to .mo files. Options:
``ALL``
@@ -77,7 +78,7 @@
``INSTALL_DESTINATION``
Install the results into the given directory (``share/locale/`` by
- default). The language subdirectory will be taken into account .
+ default). The language subdirectory will be taken into account.
.. versionadded:: 3.2
If you wish to use the Gettext runtime library (libintl), use
@@ -95,7 +96,7 @@
OUTPUT_STRIP_TRAILING_WHITESPACE)
get_filename_component(msgmerge_name ${GETTEXT_MSGMERGE_EXECUTABLE} NAME)
get_filename_component(msgmerge_namewe ${GETTEXT_MSGMERGE_EXECUTABLE} NAME_WE)
- if (gettext_version MATCHES "^(${msgmerge_name}|${msgmerge_namewe}) \\([^\\)]*\\) ([0-9\\.]+[^ \n]*)")
+ if(gettext_version MATCHES "^(${msgmerge_name}|${msgmerge_namewe}) \\([^\\)]*\\) ([0-9\\.]+[^ \n]*)")
set(GETTEXT_VERSION_STRING "${CMAKE_MATCH_2}")
endif()
unset(gettext_version)
@@ -116,7 +117,7 @@
endif()
set(${_unique_name} "${_name}_${currentCounter}" PARENT_SCOPE)
math(EXPR currentCounter "${currentCounter} + 1")
- set_property(GLOBAL PROPERTY ${propertyName} ${currentCounter} )
+ set_property(GLOBAL PROPERTY ${propertyName} ${currentCounter})
endfunction()
macro(GETTEXT_CREATE_TRANSLATIONS _potFile _firstPoFileArg)
@@ -134,7 +135,7 @@
set(_firstPoFile)
endif()
- foreach (_currentPoFile ${_firstPoFile} ${ARGN})
+ foreach(_currentPoFile ${_firstPoFile} ${ARGN})
get_filename_component(_absFile ${_currentPoFile} ABSOLUTE)
get_filename_component(_abs_PATH ${_absFile} PATH)
get_filename_component(_lang ${_absFile} NAME_WE)
@@ -142,7 +143,7 @@
add_custom_command(
OUTPUT ${_gmoFile}
- COMMAND ${GETTEXT_MSGMERGE_EXECUTABLE} --quiet --update --backup=none -s ${_absFile} ${_absPotFile}
+ COMMAND ${GETTEXT_MSGMERGE_EXECUTABLE} --quiet --update --backup=none ${_absFile} ${_absPotFile}
COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o ${_gmoFile} ${_absFile}
DEPENDS ${_absPotFile} ${_absFile}
)
@@ -150,7 +151,7 @@
install(FILES ${_gmoFile} DESTINATION share/locale/${_lang}/LC_MESSAGES RENAME ${_potBasename}.mo)
set(_gmoFiles ${_gmoFiles} ${_gmoFile})
- endforeach ()
+ endforeach()
if(NOT TARGET translations)
add_custom_target(translations)
@@ -177,13 +178,13 @@
string(REGEX REPLACE "^(.+)(\\.[^.]+)$" "\\1" _potBasename ${_potName})
get_filename_component(_absPotFile ${_potFile} ABSOLUTE)
- foreach (_lang ${_parsedArguments_LANGUAGES})
+ foreach(_lang ${_parsedArguments_LANGUAGES})
set(_poFile "${CMAKE_CURRENT_BINARY_DIR}/${_lang}.po")
set(_gmoFile "${CMAKE_CURRENT_BINARY_DIR}/${_lang}.gmo")
add_custom_command(
OUTPUT "${_poFile}"
- COMMAND ${GETTEXT_MSGMERGE_EXECUTABLE} --quiet --update --backup=none -s ${_poFile} ${_absPotFile}
+ COMMAND ${GETTEXT_MSGMERGE_EXECUTABLE} --quiet --update --backup=none ${_poFile} ${_absPotFile}
DEPENDS ${_absPotFile}
)
@@ -197,7 +198,7 @@
install(FILES ${_gmoFile} DESTINATION ${_parsedArguments_INSTALL_DESTINATION}/${_lang}/LC_MESSAGES RENAME ${_potBasename}.mo)
endif()
list(APPEND _gmoFiles ${_gmoFile})
- endforeach ()
+ endforeach()
if(NOT TARGET potfiles)
add_custom_target(potfiles)
@@ -245,7 +246,7 @@
add_custom_target(pofiles)
endif()
- _GETTEXT_GET_UNIQUE_TARGET_NAME( pofiles uniqueTargetName)
+ _GETTEXT_GET_UNIQUE_TARGET_NAME(pofiles uniqueTargetName)
if(_parsedArguments_ALL)
add_custom_target(${uniqueTargetName} ALL DEPENDS ${_gmoFiles})
diff --git a/Modules/FindJasper.cmake b/Modules/FindJasper.cmake
index 2c2cbbf..dffb8d7 100644
--- a/Modules/FindJasper.cmake
+++ b/Modules/FindJasper.cmake
@@ -38,7 +38,7 @@
where to find jasper/jasper.h, etc.
``JASPER_LIBRARY_RELEASE``
where to find the Jasper library (optimized).
-``JASPER_LIBARRY_DEBUG``
+``JASPER_LIBRARY_DEBUG``
where to find the Jasper library (debug).
#]=======================================================================]
diff --git a/Modules/FindLAPACK.cmake b/Modules/FindLAPACK.cmake
index 86c438a..af358c3 100644
--- a/Modules/FindLAPACK.cmake
+++ b/Modules/FindLAPACK.cmake
@@ -55,6 +55,21 @@
Search for any BLAS/LAPACK.
Most likely, a BLAS/LAPACK with 32-bit integer interfaces will be found.
+``BLA_THREAD``
+ .. versionadded:: 4.1
+
+ Specify the BLAS/LAPACK threading model:
+
+ ``SEQ``
+ Sequential model
+ ``OMP``
+ OpenMP model
+ ``ANY``
+ Search for any BLAS/LAPACK, if both are available most likely ``OMP`` will
+ be found.
+
+ This is currently only supported by NVIDIA NVPL.
+
Imported Targets
^^^^^^^^^^^^^^^^
@@ -278,6 +293,16 @@
message(FATAL_ERROR "BLA_SIZEOF_INTEGER can have only <no value>, ANY, 4, or 8 values")
endif()
+if(NOT BLA_THREAD)
+ set(_lapack_thread "ANY")
+elseif((BLA_THREAD STREQUAL "ANY") OR
+ (BLA_THREAD STREQUAL "SEQ") OR
+ (BLA_THREAD STREQUAL "OMP"))
+ set(_lapack_thread ${BLA_THREAD})
+else()
+ message(FATAL_ERROR "BLA_THREAD can have only <no value>, ANY, SEQ, or OMP values")
+endif()
+
# Load BLAS
if(NOT LAPACK_NOT_FOUND_MESSAGE)
_lapack_find_dependency(BLAS)
@@ -693,6 +718,51 @@
endif()
endif()
+ # nVidia NVPL? (https://developer.nvidia.com/nvpl)
+ if(NOT LAPACK_LIBRARIES
+ AND (BLA_VENDOR MATCHES "NVPL" OR BLA_VENDOR STREQUAL "All"))
+ # Prefer lp64 unless ilp64 is requested.
+ if((_lapack_sizeof_integer EQUAL 4) OR (_lapack_sizeof_integer STREQUAL "ANY"))
+ list(APPEND _lapack_nvpl_ints "_lp64")
+ endif()
+ if((_lapack_sizeof_integer EQUAL 8) OR (_lapack_sizeof_integer STREQUAL "ANY"))
+ list(APPEND _lapack_nvpl_ints "_ilp64")
+ endif()
+
+ # Prefer OMP if available
+ if((_lapack_thread STREQUAL "OMP") OR (_lapack_thread STREQUAL "ANY"))
+ list(APPEND _lapack_nvpl_threads "_omp")
+ endif()
+ if((_lapack_thread STREQUAL "SEQ") OR (_lapack_thread STREQUAL "ANY"))
+ list(APPEND _lapack_nvpl_threads "_seq")
+ endif()
+
+ find_package(nvpl)
+ if(nvpl_FOUND)
+ foreach(_nvpl_thread IN LISTS _lapack_nvpl_threads)
+ foreach(_nvpl_int IN LISTS _lapack_nvpl_ints)
+
+ set(_lapack_lib "nvpl::lapack${_nvpl_int}${_nvpl_thread}")
+
+ if(TARGET ${_lapack_lib})
+ set(LAPACK_LIBRARIES ${_lapack_lib})
+ break()
+ endif()
+
+ endforeach()
+
+ if(LAPACK_LIBRARIES)
+ break()
+ endif()
+
+ endforeach()
+ endif()
+
+ unset(_lapack_lib)
+ unset(_lapack_nvpl_ints)
+ unset(_lapack_nvpl_threads)
+ endif()
+
# NVHPC Library?
if(NOT LAPACK_LIBRARIES
diff --git a/Modules/FindMPI.cmake b/Modules/FindMPI.cmake
index c6a25a7..78b1c5c 100644
--- a/Modules/FindMPI.cmake
+++ b/Modules/FindMPI.cmake
@@ -536,7 +536,7 @@
# It has to be called as "compchk.sh <arch> <compiler>". Here, <arch> is one out of 32 (i686), 64 (ia64) or 32e (x86_64).
# The compiler is identified by filename, and can be either the MPI compiler or the underlying compiler.
# NOTE: It is vital to run this script while the environment variables are set up, otherwise it can check the wrong compiler.
- if(MPI_COMPILE_CMDLINE MATCHES "^([^\" ]+/compchk.sh|\"[^\"]+/compchk.sh\") +([^ ]+)")
+ if(MPI_COMPILE_CMDLINE MATCHES "^([^\"\n ]+/compchk.sh|\"[^\"]+/compchk.sh\") +([^ ]+)")
# Now CMAKE_MATCH_1 contains the path to the compchk.sh file and CMAKE_MATCH_2 the architecture flag.
unset(COMPILER_CHECKER_OUTPUT)
execute_process(
@@ -551,7 +551,7 @@
endif()
else()
# Since the check passed, we can remove the compchk.sh script.
- string(REGEX REPLACE "^([^\" ]+|\"[^\"]+\")/compchk.sh.*\n" "" MPI_COMPILE_CMDLINE "${MPI_COMPILE_CMDLINE}")
+ string(REGEX REPLACE "^([^\"\n ]+|\"[^\"]+\")/compchk.sh.*\n" "" MPI_COMPILE_CMDLINE "${MPI_COMPILE_CMDLINE}")
endif()
endif()
endif()
@@ -624,10 +624,10 @@
# Especially with M(VA)PICH-1, this appears to happen erroneously, and therefore we should translate
# this output into an additional include directory and then drop it from the output.
# noqa: spellcheck on
- if(MPI_COMPILE_CMDLINE MATCHES "^ln -s ([^\" ]+|\"[^\"]+\") mpif.h")
+ if(MPI_COMPILE_CMDLINE MATCHES "^ln -s ([^\"\n ]+|\"[^\"]+\") mpif.h")
get_filename_component(MPI_INCLUDE_DIRS_WORK "${CMAKE_MATCH_1}" DIRECTORY)
- string(REGEX REPLACE "^ln -s ([^\" ]+|\"[^\"]+\") mpif.h\n" "" MPI_COMPILE_CMDLINE "${MPI_COMPILE_CMDLINE}")
- string(REGEX REPLACE "^ln -s ([^\" ]+|\"[^\"]+\") mpif.h\n" "" MPI_LINK_CMDLINE "${MPI_LINK_CMDLINE}")
+ string(REGEX REPLACE "^ln -s ([^\"\n ]+|\"[^\"]+\") mpif.h\n" "" MPI_COMPILE_CMDLINE "${MPI_COMPILE_CMDLINE}")
+ string(REGEX REPLACE "^ln -s ([^\"\n ]+|\"[^\"]+\") mpif.h\n" "" MPI_LINK_CMDLINE "${MPI_LINK_CMDLINE}")
string(REGEX REPLACE "\nrm -f mpif.h$" "" MPI_COMPILE_CMDLINE "${MPI_COMPILE_CMDLINE}")
string(REGEX REPLACE "\nrm -f mpif.h$" "" MPI_LINK_CMDLINE "${MPI_LINK_CMDLINE}")
endif()
@@ -645,7 +645,7 @@
# on Windows seems to require any specific ones, either.
if(NOT MSVC)
# Extract compile options from the compile command line.
- string(REGEX MATCHALL "(^| )-f([^\" ]+|\"[^\"]+\")" MPI_ALL_COMPILE_OPTIONS "${MPI_COMPILE_CMDLINE}")
+ string(REGEX MATCHALL "(^| )-f([^\"\n ]+|\"[^\"]+\")" MPI_ALL_COMPILE_OPTIONS "${MPI_COMPILE_CMDLINE}")
foreach(_MPI_COMPILE_OPTION IN LISTS MPI_ALL_COMPILE_OPTIONS)
string(REGEX REPLACE "^ " "" _MPI_COMPILE_OPTION "${_MPI_COMPILE_OPTION}")
@@ -673,7 +673,7 @@
endif()
# Same deal as above, for the definitions.
- string(REGEX MATCHALL "(^| )${_MPI_PREPROCESSOR_FLAG_REGEX}-D *([^\" ]+|\"[^\"]+\")" MPI_ALL_COMPILE_DEFINITIONS "${MPI_COMPILE_CMDLINE}")
+ string(REGEX MATCHALL "(^| )${_MPI_PREPROCESSOR_FLAG_REGEX}-D *([^\"\n ]+|\"[^\"]+\")" MPI_ALL_COMPILE_DEFINITIONS "${MPI_COMPILE_CMDLINE}")
foreach(_MPI_COMPILE_DEFINITION IN LISTS MPI_ALL_COMPILE_DEFINITIONS)
string(REGEX REPLACE "^ ?${_MPI_PREPROCESSOR_FLAG_REGEX}-D *" "" _MPI_COMPILE_DEFINITION "${_MPI_COMPILE_DEFINITION}")
@@ -684,7 +684,7 @@
endforeach()
# Extract include paths from compile command line
- string(REGEX MATCHALL "(^|\n| )${_MPI_PREPROCESSOR_FLAG_REGEX}${CMAKE_INCLUDE_FLAG_${LANG}} *([^\" ]+|\"[^\"]+\")"
+ string(REGEX MATCHALL "(^|\n| )${_MPI_PREPROCESSOR_FLAG_REGEX}${CMAKE_INCLUDE_FLAG_${LANG}} *([^\"\n ]+|\"[^\"]+\")"
MPI_ALL_INCLUDE_PATHS "${MPI_COMPILE_CMDLINE}")
# If extracting failed to work, we'll try using -showme:incdirs.
@@ -707,7 +707,7 @@
endforeach()
# The next step are linker flags and library directories. Here, we first take the flags given in raw -L or -LIBPATH: syntax.
- string(REGEX MATCHALL "(^| )${CMAKE_LIBRARY_PATH_FLAG} *([^\" ]+|\"[^\"]+\")" MPI_DIRECT_LINK_PATHS "${MPI_LINK_CMDLINE}")
+ string(REGEX MATCHALL "(^| )${CMAKE_LIBRARY_PATH_FLAG} *([^\"\n ]+|\"[^\"]+\")" MPI_DIRECT_LINK_PATHS "${MPI_LINK_CMDLINE}")
foreach(_MPI_LPATH IN LISTS MPI_DIRECT_LINK_PATHS)
string(REGEX REPLACE "(^| )${CMAKE_LIBRARY_PATH_FLAG} *" "" _MPI_LPATH "${_MPI_LPATH}")
list(APPEND MPI_ALL_LINK_PATHS "${_MPI_LPATH}")
@@ -715,7 +715,7 @@
# If the link commandline hasn't been filtered (e.g. when using MSVC and /link), we need to extract the relevant parts first.
if(NOT _MPI_FILTERED_LINK_INFORMATION)
- string(REGEX MATCHALL "(^| )(-Wl,|-Xlinker +)([^\" ]+|\"[^\"]+\")" MPI_LINK_FLAGS "${MPI_LINK_CMDLINE}")
+ string(REGEX MATCHALL "(^| )(-Wl,|-Xlinker +)([^\"\n ]+|\"[^\"]+\")" MPI_LINK_FLAGS "${MPI_LINK_CMDLINE}")
# In this case, we could also find some indirectly given linker paths, e.g. prefixed by -Xlinker or -Wl,
# Since syntaxes like -Wl,-L -Wl,/my/path/to/lib are also valid, we parse these paths by first removing -Wl, and -Xlinker
@@ -724,7 +724,7 @@
# Now we can parse the leftover output. Note that spaces can now be handled since the above example would reduce to
# -L /my/path/to/lib and can be extracted correctly.
- string(REGEX MATCHALL "^(${CMAKE_LIBRARY_PATH_FLAG},? *|--library-path=)([^\" ]+|\"[^\"]+\")"
+ string(REGEX MATCHALL "^(${CMAKE_LIBRARY_PATH_FLAG},? *|--library-path=)([^\"\n ]+|\"[^\"]+\")"
MPI_INDIRECT_LINK_PATHS "${MPI_LINK_FLAGS_RAW}")
foreach(_MPI_LPATH IN LISTS MPI_INDIRECT_LINK_PATHS)
@@ -733,7 +733,7 @@
endforeach()
# We need to remove the flags we extracted from the linker flag list now.
- string(REGEX REPLACE "(^| )(-Wl,|-Xlinker +)(${CMAKE_LIBRARY_PATH_FLAG},? *(-Wl,|-Xlinker +)?|--library-path=)([^\" ]+|\"[^\"]+\")" ""
+ string(REGEX REPLACE "(^| )(-Wl,|-Xlinker +)(${CMAKE_LIBRARY_PATH_FLAG},? *(-Wl,|-Xlinker +)?|--library-path=)([^\"\n ]+|\"[^\"]+\")" ""
MPI_LINK_CMDLINE_FILTERED "${MPI_LINK_CMDLINE}")
# Some MPI implementations pass on options they themselves were built with. Since -z,noexecstack is a common
@@ -742,7 +742,7 @@
string(REGEX REPLACE "(^| )-Xlinker +-z +-Xlinker +[^ ]+" "" MPI_LINK_CMDLINE_FILTERED "${MPI_LINK_CMDLINE_FILTERED}")
# We only consider options of the form -Wl or -Xlinker:
- string(REGEX MATCHALL "(^| )(-Wl,|-Xlinker +)([^\" ]+|\"[^\"]+\")" MPI_ALL_LINK_FLAGS "${MPI_LINK_CMDLINE_FILTERED}")
+ string(REGEX MATCHALL "(^| )(-Wl,|-Xlinker +)([^\"\n ]+|\"[^\"]+\")" MPI_ALL_LINK_FLAGS "${MPI_LINK_CMDLINE_FILTERED}")
# As a next step, we assemble the linker flags extracted in a preliminary flags string
foreach(_MPI_LINK_FLAG IN LISTS MPI_ALL_LINK_FLAGS)
@@ -755,7 +755,7 @@
endforeach()
else()
# In the filtered case, we obtain the link time flags by just stripping the library paths.
- string(REGEX REPLACE "(^| )${CMAKE_LIBRARY_PATH_FLAG} *([^\" ]+|\"[^\"]+\")" "" MPI_LINK_CMDLINE_FILTERED "${MPI_LINK_CMDLINE}")
+ string(REGEX REPLACE "(^| )${CMAKE_LIBRARY_PATH_FLAG} *([^\"\n ]+|\"[^\"]+\")" "" MPI_LINK_CMDLINE_FILTERED "${MPI_LINK_CMDLINE}")
endif()
# If we failed to extract any linker paths, we'll try using the -showme:libdirs option with the MPI compiler.
@@ -777,7 +777,7 @@
# Extract the set of libraries to link against from the link command line
# This only makes sense if CMAKE_LINK_LIBRARY_FLAG is defined, i.e. a -lxxxx syntax is supported by the compiler.
if(CMAKE_LINK_LIBRARY_FLAG)
- string(REGEX MATCHALL "(^| )${CMAKE_LINK_LIBRARY_FLAG}([^\" ]+|\"[^\"]+\")"
+ string(REGEX MATCHALL "(^| )${CMAKE_LINK_LIBRARY_FLAG}([^\"\n ]+|\"[^\"]+\")"
MPI_LIBNAMES "${MPI_LINK_CMDLINE}")
foreach(_MPI_LIB_NAME IN LISTS MPI_LIBNAMES)
@@ -800,7 +800,7 @@
else()
string(APPEND _MPI_LIB_SUFFIX_REGEX "|${CMAKE_SHARED_LIBRARY_SUFFIX}")
endif()
- set(_MPI_LIB_NAME_REGEX "(([^\" ]+(${_MPI_LIB_SUFFIX_REGEX}))|(\"[^\"]+(${_MPI_LIB_SUFFIX_REGEX})\"))( +|$)")
+ set(_MPI_LIB_NAME_REGEX "(([^\"\n ]+(${_MPI_LIB_SUFFIX_REGEX}))|(\"[^\"]+(${_MPI_LIB_SUFFIX_REGEX})\"))( +|$)")
string(REPLACE "." "\\." _MPI_LIB_NAME_REGEX "${_MPI_LIB_NAME_REGEX}")
string(REGEX MATCHALL "${_MPI_LIB_NAME_REGEX}" MPI_LIBNAMES "${MPI_LINK_CMDLINE}")
diff --git a/Modules/FindOpenCL.cmake b/Modules/FindOpenCL.cmake
index e896e97..480851e 100644
--- a/Modules/FindOpenCL.cmake
+++ b/Modules/FindOpenCL.cmake
@@ -53,12 +53,12 @@
if(EXISTS ${OpenCL_INCLUDE_DIR}/Headers/cl.h)
check_symbol_exists(
CL_VERSION_${VERSION}
- "${OpenCL_INCLUDE_DIR}/Headers/cl.h"
+ "Headers/cl.h"
OPENCL_VERSION_${VERSION})
else()
check_symbol_exists(
CL_VERSION_${VERSION}
- "${OpenCL_INCLUDE_DIR}/CL/cl.h"
+ "CL/cl.h"
OPENCL_VERSION_${VERSION})
endif()
diff --git a/Modules/FindOpenMP.cmake b/Modules/FindOpenMP.cmake
index 99c6765..c1141c7 100644
--- a/Modules/FindOpenMP.cmake
+++ b/Modules/FindOpenMP.cmake
@@ -152,6 +152,7 @@
set(OMP_FLAG_XL "-qsmp=omp")
# Cray compiler activate OpenMP with -h omp, which is enabled by default.
set(OMP_FLAG_Cray " " "-h omp")
+ set(OMP_FLAG_CrayClang "-fopenmp")
set(OMP_FLAG_Fujitsu "-Kopenmp" "-KOMP")
set(OMP_FLAG_FujitsuClang "-fopenmp" "-Kopenmp")
@@ -677,7 +678,8 @@
set_property(TARGET OpenMP::OpenMP_${LANG} PROPERTY
INTERFACE_COMPILE_OPTIONS "$<$<COMPILE_LANGUAGE:${LANG}>:SHELL:${OpenMP_${LANG}_FLAGS}>")
if(CMAKE_${LANG}_COMPILER_ID STREQUAL "Fujitsu"
- OR ${CMAKE_${LANG}_COMPILER_ID} STREQUAL "IntelLLVM")
+ OR ${CMAKE_${LANG}_COMPILER_ID} STREQUAL "IntelLLVM"
+ OR CMAKE_${LANG}_COMPILER_ID MATCHES "^(Cray|CrayClang)$")
set_property(TARGET OpenMP::OpenMP_${LANG} PROPERTY
INTERFACE_LINK_OPTIONS "SHELL:${OpenMP_${LANG}_FLAGS}")
endif()
diff --git a/Modules/FindPkgConfig.cmake b/Modules/FindPkgConfig.cmake
index e2c322a..9200ba3 100644
--- a/Modules/FindPkgConfig.cmake
+++ b/Modules/FindPkgConfig.cmake
@@ -391,7 +391,7 @@
# the system
set(_lib_dirs)
if(NOT DEFINED CMAKE_SYSTEM_NAME
- OR (CMAKE_SYSTEM_NAME MATCHES "^(Linux|kFreeBSD|GNU)$"
+ OR (CMAKE_SYSTEM_NAME MATCHES "^(Linux|GNU)$"
AND NOT CMAKE_CROSSCOMPILING))
if(EXISTS "/etc/debian_version") # is this a debian system ?
if(CMAKE_LIBRARY_ARCHITECTURE)
diff --git a/Modules/FindPython.cmake b/Modules/FindPython.cmake
index 73d41dd..28f47b4 100644
--- a/Modules/FindPython.cmake
+++ b/Modules/FindPython.cmake
@@ -48,6 +48,21 @@
If component ``Development`` is specified, it implies sub-components
``Development.Module`` and ``Development.Embed``.
+.. versionchanged:: 4.1
+ In a cross-compiling mode (i.e. the :variable:`CMAKE_CROSSCOMPILING` variable
+ is defined to true), the following constraints, when the policy
+ :policy:`CMP0190` is set to ``NEW``, now apply to the requested components:
+
+ * ``Interpreter`` or ``Compiler`` alone: the host artifacts will be searched.
+ * ``Interpreter`` or ``Compiler`` with ``Development`` or any sub-component:
+ The target artifacts will be searched. In this case, the
+ :variable:`CMAKE_CROSSCOMPILING_EMULATOR` variable must be defined and will
+ be used to execute the interpreter or the compiler.
+
+ When both host and target artifacts are needed, two different calls to the
+ :command:`find_package` command should be done. The
+ ``Python_ARTIFACTS_PREFIX`` variable can be helpful in this situation.
+
To ensure consistent versions between components ``Interpreter``, ``Compiler``,
``Development`` (or one of its sub-components) and ``NumPy``, specify all
components at the same time:
diff --git a/Modules/FindPython/Support.cmake b/Modules/FindPython/Support.cmake
index f7c1065..231e57e 100644
--- a/Modules/FindPython/Support.cmake
+++ b/Modules/FindPython/Support.cmake
@@ -39,13 +39,17 @@
# helper commands
#
macro (_PYTHON_DISPLAY_FAILURE _PYTHON_MSG)
- if (${_PYTHON_BASE}_FIND_REQUIRED)
+ if (${ARGC} GREATER 1 AND "${ARGV1}" STREQUAL "FATAL")
+ set (_${_PYTHON_PREFIX}_FATAL TRUE)
+ endif()
+ if (${_PYTHON_BASE}_FIND_REQUIRED OR _${_PYTHON_PREFIX}_FATAL)
message (FATAL_ERROR "${_PYTHON_MSG}")
else()
if (NOT ${_PYTHON_BASE}_FIND_QUIETLY)
message(STATUS "${_PYTHON_MSG}")
endif ()
endif()
+ unset(_${_PYTHON_PREFIX}_FATAL)
set (${_PYTHON_BASE}_FOUND FALSE)
set (${_PYTHON_PREFIX}_FOUND FALSE)
@@ -528,7 +532,7 @@
endif()
if ("Interpreter" IN_LIST ${_PYTHON_BASE}_FIND_COMPONENTS AND _${_PYTHON_PREFIX}_EXECUTABLE
- AND NOT CMAKE_CROSSCOMPILING)
+ AND (_${_PYTHON_PREFIX}_CROSSCOMPILING OR NOT CMAKE_CROSSCOMPILING))
if (NAME STREQUAL "PREFIX")
execute_process (COMMAND ${_${_PYTHON_PREFIX}_INTERPRETER_LAUNCHER} "${_${_PYTHON_PREFIX}_EXECUTABLE}" -c "import sys\ntry:\n import sysconfig\n sys.stdout.write(';'.join([sysconfig.get_config_var('base') or '', sysconfig.get_config_var('installed_base') or '']))\nexcept Exception:\n from distutils import sysconfig\n sys.stdout.write(';'.join([sysconfig.PREFIX,sysconfig.EXEC_PREFIX,sysconfig.BASE_EXEC_PREFIX]))"
RESULT_VARIABLE _result
@@ -846,6 +850,11 @@
return()
endif()
+ if (_${_PYTHON_PREFIX}_CROSSCOMPILING)
+ set (${_PYTHON_PGL_NAME} "${CMAKE_CROSSCOMPILING_EMULATOR}" PARENT_SCOPE)
+ return()
+ endif()
+
if ("IronPython" IN_LIST _${_PYTHON_PREFIX}_FIND_IMPLEMENTATIONS
AND NOT SYSTEM_NAME MATCHES "Windows|Linux")
if (_PGL_INTERPRETER)
@@ -1001,7 +1010,7 @@
if (CMAKE_SIZEOF_VOID_P AND ("Development.Module" IN_LIST ${_PYTHON_BASE}_FIND_COMPONENTS
OR "Development.SABIModule" IN_LIST ${_PYTHON_BASE}_FIND_COMPONENTS
OR "Development.Embed" IN_LIST ${_PYTHON_BASE}_FIND_COMPONENTS)
- AND NOT CMAKE_CROSSCOMPILING)
+ AND (_${_PYTHON_PREFIX}_CROSSCOMPILING OR NOT CMAKE_CROSSCOMPILING))
# In this case, interpreter must have same architecture as environment
execute_process (COMMAND ${_${_PYTHON_PREFIX}_INTERPRETER_LAUNCHER} "${_${_PYTHON_PREFIX}_EXECUTABLE}" -c
"import sys, struct; sys.stdout.write(str(struct.calcsize(\"P\")))"
@@ -1085,7 +1094,7 @@
file (WRITE "${working_dir}/version.py" "import sys; sys.stdout.write('.'.join([str(x) for x in sys.version_info[:3]])); sys.stdout.flush()\n")
execute_process (COMMAND ${launcher} "${_${_PYTHON_PREFIX}_COMPILER}"
${_${_PYTHON_PREFIX}_IRON_PYTHON_COMPILER_ARCH_FLAGS}
- /target:exe /embed "${working_dir}/version.py"
+ /target:exe /embed /standalone "${working_dir}/version.py"
WORKING_DIRECTORY "${working_dir}"
OUTPUT_QUIET
ERROR_QUIET
@@ -1440,6 +1449,22 @@
set (${_PYTHON_BASE}_FIND_REQUIRED_Development.Embed TRUE)
endif()
+## handle cross-compiling constraints for components:
+## If Interpreter and/or Compiler are specified with Development components
+## the CMAKE_CROSSCOMPILING_EMULATOR variable should be defined
+cmake_policy (GET CMP0190 _${_PYTHON_PREFIX}_CROSSCOMPILING_POLICY)
+unset (_${_PYTHON_PREFIX}_CROSSCOMPILING)
+if (CMAKE_CROSSCOMPILING AND _${_PYTHON_PREFIX}_CROSSCOMPILING_POLICY STREQUAL "NEW")
+ if (${_PYTHON_BASE}_FIND_COMPONENTS MATCHES "Interpreter|Compiler"
+ AND ${_PYTHON_BASE}_FIND_COMPONENTS MATCHES "Development")
+ if (CMAKE_CROSSCOMPILING_EMULATOR)
+ set (_${_PYTHON_PREFIX}_CROSSCOMPILING TRUE)
+ else()
+ _python_display_failure ("${_PYTHON_PREFIX}: When cross-compiling, Interpreter and/or Compiler components cannot be searched when CMAKE_CROSSCOMPILING_EMULATOR variable is not specified (see policy CMP0190)." FATAL)
+ endif()
+ endif()
+endif()
+
unset (_${_PYTHON_PREFIX}_FIND_DEVELOPMENT_ARTIFACTS)
unset (_${_PYTHON_PREFIX}_FIND_DEVELOPMENT_MODULE_ARTIFACTS)
unset (_${_PYTHON_PREFIX}_FIND_DEVELOPMENT_SABIMODULE_ARTIFACTS)
@@ -2664,7 +2689,7 @@
file (WRITE "${_${_PYTHON_PREFIX}_VERSION_DIR}/version.py" "import sys; sys.stdout.write('.'.join([str(x) for x in sys.version_info[:3]])); sys.stdout.flush()\n")
execute_process (COMMAND ${_${_PYTHON_PREFIX}_COMPILER_LAUNCHER} "${_${_PYTHON_PREFIX}_COMPILER}"
${_${_PYTHON_PREFIX}_IRON_PYTHON_COMPILER_ARCH_FLAGS}
- /target:exe /embed "${_${_PYTHON_PREFIX}_VERSION_DIR}/version.py"
+ /target:exe /embed /standalone "${_${_PYTHON_PREFIX}_VERSION_DIR}/version.py"
WORKING_DIRECTORY "${_${_PYTHON_PREFIX}_VERSION_DIR}"
OUTPUT_QUIET
ERROR_QUIET)
@@ -2827,7 +2852,8 @@
# if python interpreter is found, use it to look-up for artifacts
# to ensure consistency between interpreter and development environments.
# If not, try to locate a compatible config tool
- if ((NOT ${_PYTHON_PREFIX}_Interpreter_FOUND OR CMAKE_CROSSCOMPILING)
+ if ((NOT ${_PYTHON_PREFIX}_Interpreter_FOUND
+ OR (NOT _${_PYTHON_PREFIX}_CROSSCOMPILING AND CMAKE_CROSSCOMPILING))
AND "CPython" IN_LIST _${_PYTHON_PREFIX}_FIND_IMPLEMENTATIONS)
set (_${_PYTHON_PREFIX}_HINTS "${${_PYTHON_PREFIX}_ROOT_DIR}" ENV ${_PYTHON_PREFIX}_ROOT_DIR)
unset (_${_PYTHON_PREFIX}_VIRTUALENV_PATHS)
@@ -3093,7 +3119,9 @@
if ("LIBRARY" IN_LIST _${_PYTHON_PREFIX}_FIND_DEVELOPMENT_ARTIFACTS)
if (NOT _${_PYTHON_PREFIX}_LIBRARY_RELEASE)
- if ((${_PYTHON_PREFIX}_Interpreter_FOUND AND NOT CMAKE_CROSSCOMPILING) OR _${_PYTHON_PREFIX}_CONFIG)
+ if ((${_PYTHON_PREFIX}_Interpreter_FOUND
+ AND (_${_PYTHON_PREFIX}_CROSSCOMPILING OR NOT CMAKE_CROSSCOMPILING))
+ OR _${_PYTHON_PREFIX}_CONFIG)
# retrieve root install directory
_python_get_config_var (_${_PYTHON_PREFIX}_PREFIX PREFIX)
@@ -3361,7 +3389,9 @@
HINTS "${_${_PYTHON_PREFIX}_PATH}" ${_${_PYTHON_PREFIX}_HINTS}
NO_DEFAULT_PATH)
else()
- if ((${_PYTHON_PREFIX}_Interpreter_FOUND AND NOT CMAKE_CROSSCOMPILING) OR _${_PYTHON_PREFIX}_CONFIG)
+ if ((${_PYTHON_PREFIX}_Interpreter_FOUND
+ AND (_${_PYTHON_PREFIX}_CROSSCOMPILING OR NOT CMAKE_CROSSCOMPILING))
+ OR _${_PYTHON_PREFIX}_CONFIG)
# retrieve root install directory
_python_get_config_var (_${_PYTHON_PREFIX}_PREFIX PREFIX)
@@ -3622,7 +3652,9 @@
break()
endif()
- if ((${_PYTHON_PREFIX}_Interpreter_FOUND AND NOT CMAKE_CROSSCOMPILING) OR _${_PYTHON_PREFIX}_CONFIG)
+ if ((${_PYTHON_PREFIX}_Interpreter_FOUND
+ AND (_${_PYTHON_PREFIX}_CROSSCOMPILING OR NOT CMAKE_CROSSCOMPILING))
+ OR _${_PYTHON_PREFIX}_CONFIG)
_python_get_config_var (_${_PYTHON_PREFIX}_INCLUDE_DIRS INCLUDES)
find_path (_${_PYTHON_PREFIX}_INCLUDE_DIR
diff --git a/Modules/FindPython2.cmake b/Modules/FindPython2.cmake
index ce9a7d5..869dc70 100644
--- a/Modules/FindPython2.cmake
+++ b/Modules/FindPython2.cmake
@@ -41,6 +41,21 @@
If component ``Development`` is specified, it implies sub-components
``Development.Module`` and ``Development.Embed``.
+.. versionchanged:: 4.1
+ In a cross-compiling mode (i.e. the :variable:`CMAKE_CROSSCOMPILING` variable
+ is defined to true), the following constraints, when the policy
+ :policy:`CMP0190` is set to ``NEW``, now apply to the requested components:
+
+ * ``Interpreter`` or ``Compiler`` alone: the host artifacts will be searched.
+ * ``Interpreter`` or ``Compiler`` with ``Development`` or any sub-component:
+ The target artifacts will be searched. In this case, the
+ :variable:`CMAKE_CROSSCOMPILING_EMULATOR` variable must be defined and will
+ be used to execute the interpreter or the compiler.
+
+ When both host and target artifacts are needed, two different calls to the
+ :command:`find_package` command should be done. The
+ ``Python_ARTIFACTS_PREFIX`` variable can be helpful in this situation.
+
To ensure consistent versions between components ``Interpreter``, ``Compiler``,
``Development`` (or one of its sub-components) and ``NumPy``, specify all
components at the same time:
diff --git a/Modules/FindPython3.cmake b/Modules/FindPython3.cmake
index 5edc087..66c325a 100644
--- a/Modules/FindPython3.cmake
+++ b/Modules/FindPython3.cmake
@@ -48,6 +48,22 @@
If component ``Development`` is specified, it implies sub-components
``Development.Module`` and ``Development.Embed``.
+.. versionchanged:: 4.1
+
+ In a cross-compiling mode (i.e. the :variable:`CMAKE_CROSSCOMPILING` variable
+ is defined to true), the following constraints, when the policy
+ :policy:`CMP0190` is set to ``NEW``, now apply to the requested components:
+
+ * ``Interpreter`` or ``Compiler`` alone: the host artifacts will be searched.
+ * ``Interpreter`` or ``Compiler`` with ``Development`` or any sub-component:
+ The target artifacts will be searched. In this case, the
+ :variable:`CMAKE_CROSSCOMPILING_EMULATOR` variable must be defined and will
+ be used to execute the interpreter or the compiler.
+
+ When both host and target artifacts are needed, two different calls to the
+ :command:`find_package` command should be done. The
+ ``Python_ARTIFACTS_PREFIX`` variable can be helpful in this situation.
+
To ensure consistent versions between components ``Interpreter``, ``Compiler``,
``Development`` (or one of its sub-components) and ``NumPy``, specify all
components at the same time:
diff --git a/Modules/FindwxWidgets.cmake b/Modules/FindwxWidgets.cmake
index 86f34ee..badd4df 100644
--- a/Modules/FindwxWidgets.cmake
+++ b/Modules/FindwxWidgets.cmake
@@ -963,6 +963,10 @@
foreach(_wx_lib_ ${wxWidgets_LIBRARIES})
if("${_wx_lib_}" MATCHES "^-l(.*)")
set(_wx_lib_name "${CMAKE_MATCH_1}")
+ if(_wx_lib_name STREQUAL "atomic")
+ continue()
+ endif()
+
unset(_wx_lib_found CACHE)
find_library(_wx_lib_found NAMES ${_wx_lib_name} HINTS ${wxWidgets_LIBRARY_DIRS})
if(_wx_lib_found STREQUAL _wx_lib_found-NOTFOUND)
diff --git a/Modules/GNUInstallDirs.cmake b/Modules/GNUInstallDirs.cmake
index 162c829..ff436bc 100644
--- a/Modules/GNUInstallDirs.cmake
+++ b/Modules/GNUInstallDirs.cmake
@@ -252,7 +252,7 @@
"Please enable at least one language before including GNUInstallDirs.")
endif()
- if(CMAKE_SYSTEM_NAME MATCHES "^(Linux|kFreeBSD|GNU)$"
+ if(CMAKE_SYSTEM_NAME MATCHES "^(Linux|GNU)$"
AND NOT CMAKE_CROSSCOMPILING)
unset(__system_type_for_install)
if(DEFINED ENV{CONDA_BUILD} AND DEFINED ENV{PREFIX})
diff --git a/Modules/Internal/CPack/CPackRPM.cmake b/Modules/Internal/CPack/CPackRPM.cmake
index 7776ee2..5f20f92 100644
--- a/Modules/Internal/CPack/CPackRPM.cmake
+++ b/Modules/Internal/CPack/CPackRPM.cmake
@@ -1112,7 +1112,7 @@
# There may be some COMPONENT specific variables as well
# If component specific var is not provided we use the global one
# for each component
- foreach(_RPM_SPEC_HEADER URL REQUIRES SUGGESTS PROVIDES OBSOLETES PREFIX CONFLICTS AUTOPROV AUTOREQ AUTOREQPROV REQUIRES_PRE REQUIRES_POST REQUIRES_PREUN REQUIRES_POSTUN)
+ foreach(_RPM_SPEC_HEADER URL REQUIRES SUGGESTS RECOMMENDS SUPPLEMENTS ENHANCES PROVIDES OBSOLETES PREFIX CONFLICTS AUTOPROV AUTOREQ AUTOREQPROV REQUIRES_PRE REQUIRES_POST REQUIRES_PREUN REQUIRES_POSTUN)
if(CPACK_RPM_PACKAGE_DEBUG)
message("CPackRPM:Debug: processing ${_RPM_SPEC_HEADER}")
@@ -1730,7 +1730,10 @@
\@TMP_RPM_PROVIDES\@
\@TMP_RPM_OBSOLETES\@
\@TMP_RPM_CONFLICTS\@
+\@TMP_RPM_RECOMMENDS\@
\@TMP_RPM_SUGGESTS\@
+\@TMP_RPM_SUPPLEMENTS\@
+\@TMP_RPM_ENHANCES\@
\@TMP_RPM_AUTOPROV\@
\@TMP_RPM_AUTOREQ\@
\@TMP_RPM_AUTOREQPROV\@
@@ -1799,7 +1802,10 @@
\@TMP_RPM_PROVIDES\@
\@TMP_RPM_OBSOLETES\@
\@TMP_RPM_CONFLICTS\@
+\@TMP_RPM_RECOMMENDS\@
\@TMP_RPM_SUGGESTS\@
+\@TMP_RPM_SUPPLEMENTS\@
+\@TMP_RPM_ENHANCES\@
\@TMP_RPM_AUTOPROV\@
\@TMP_RPM_AUTOREQ\@
\@TMP_RPM_AUTOREQPROV\@
diff --git a/Modules/Internal/CPack/NSIS.template.in b/Modules/Internal/CPack/NSIS.template.in
index 6349f9d..c0b61e3 100644
--- a/Modules/Internal/CPack/NSIS.template.in
+++ b/Modules/Internal/CPack/NSIS.template.in
@@ -923,8 +923,9 @@
ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@" "UninstallString"
StrCmp $0 "" inst
+ ReadRegStr $1 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@" "DisplayName"
MessageBox MB_YESNOCANCEL|MB_ICONEXCLAMATION \
- "@CPACK_NSIS_PACKAGE_NAME@ is already installed. $\n$\nDo you want to uninstall the old version before installing the new one?" \
+ "$1 is already installed. $\n$\nDo you want to uninstall the old version before installing the new one?" \
/SD IDYES IDYES uninst IDNO inst
Abort
diff --git a/Modules/Platform/kFreeBSD-Initialize.cmake b/Modules/Platform/kFreeBSD-Initialize.cmake
deleted file mode 100644
index f5d7b0a..0000000
--- a/Modules/Platform/kFreeBSD-Initialize.cmake
+++ /dev/null
@@ -1,5 +0,0 @@
-# kFreeBSD is a Debian GNU distribution with a kernel from FreeBSD,
-# and should be marked as LINUX
-include(Platform/Linux-Initialize)
-
-set(CMAKE_LIBRARY_ARCHITECTURE_REGEX "[a-z0-9_]+(-[a-z0-9_]+)?-kfreebsd-gnu[a-z0-9_]*")
diff --git a/Modules/Platform/kFreeBSD.cmake b/Modules/Platform/kFreeBSD.cmake
deleted file mode 100644
index 171c1ac..0000000
--- a/Modules/Platform/kFreeBSD.cmake
+++ /dev/null
@@ -1,2 +0,0 @@
-# kFreeBSD is a Debian GNU distribution with a kernel from FreeBSD.
-include(Platform/Linux)
diff --git a/Modules/ProcessorCount.cmake b/Modules/ProcessorCount.cmake
index 13d708f..ec959a4 100644
--- a/Modules/ProcessorCount.cmake
+++ b/Modules/ProcessorCount.cmake
@@ -5,49 +5,56 @@
ProcessorCount
--------------
-ProcessorCount(var)
+This module provides the following function to determine the number of
+processors/cores:
-Determine the number of processors/cores and save value in ${var}
+.. command:: ProcessorCount
-Sets the variable named ${var} to the number of physical cores
-available on the machine if the information can be determined.
-Otherwise it is set to 0. Currently this functionality is implemented
-for AIX, cygwin, FreeBSD, HPUX, Linux, macOS, QNX, Sun and
-Windows.
+ .. code-block:: cmake
-.. versionchanged:: 3.15
- On Linux, returns the container CPU count instead of the host CPU count.
+ ProcessorCount(<variable>)
-This function is guaranteed to return a positive integer (>=1) if it
-succeeds. It returns 0 if there's a problem determining the processor
-count.
+ Sets a local variable named ``<variable>`` to the number of logical CPU cores
+ available on the machine, if the information can be determined. If
+ successful, the variable is guaranteed to be set to a positive integer (>=1).
+ If the processor count cannot be determined, it is set to 0.
-More generally accurate physical CPU count can be obtained via
-:command:`cmake_host_system_information`:
+ Currently, this functionality is implemented for AIX, Cygwin, FreeBSD, Haiku,
+ HPUX, Linux, macOS, QNX, Sun and Windows.
+
+ This function provides an approximation of the number of compute cores
+ available on the current machine, making it useful for parallel building and
+ testing. It is meant to help utilize as much of the machine as seems
+ reasonable, though users should consider other workloads running on the
+ machine before using its full capacity for parallel tasks.
+
+ .. versionchanged:: 3.15
+ On Linux, returns the container CPU count instead of the host CPU count.
+
+.. note::
+
+ This module relies on system-dependent commands to determine the number of
+ processors, which may not always provide accurate information in certain
+ environments. A more generally accurate logical CPU count can be also
+ obtained with the :command:`cmake_host_system_information`:
+
+ .. code-block:: cmake
+
+ cmake_host_system_information(RESULT n QUERY NUMBER_OF_LOGICAL_CORES)
+
+Examples
+^^^^^^^^
+
+Using ``ProcessorCount`` module in a :option:`ctest -S` dashboard script:
.. code-block:: cmake
- cmake_host_system_information(RESULT N
- QUERY NUMBER_OF_PHYSICAL_CORES)
-
-Example use, in a ctest -S dashboard script:
-
-.. code-block:: cmake
-
- include(ProcessorCount)
- ProcessorCount(N)
- if(NOT N EQUAL 0)
- set(CTEST_BUILD_FLAGS -j${N})
- set(ctest_test_args ${ctest_test_args} PARALLEL_LEVEL ${N})
- endif()
-
-This function is intended to offer an approximation of the value of
-the number of compute cores available on the current machine, such
-that you may use that value for parallel building and parallel
-testing. It is meant to help utilize as much of the machine as seems
-reasonable. Of course, knowledge of what else might be running on the
-machine simultaneously should be used when deciding whether to request
-a machine's full capacity all for yourself.
+ include(ProcessorCount)
+ ProcessorCount(n)
+ if(NOT n EQUAL 0)
+ set(CTEST_BUILD_FLAGS -j${n})
+ set(ctest_test_args ${ctest_test_args} PARALLEL_LEVEL ${n})
+ endif()
#]=======================================================================]
# A more reliable way might be to compile a small C program that uses the CPUID
@@ -219,6 +226,7 @@
if(NOT count)
# Haiku
find_program(ProcessorCount_cmd_sysinfo sysinfo)
+ mark_as_advanced(ProcessorCount_cmd_sysinfo)
if(ProcessorCount_cmd_sysinfo)
execute_process(COMMAND ${ProcessorCount_cmd_sysinfo}
ERROR_QUIET
diff --git a/Modules/UseEcos.cmake b/Modules/UseEcos.cmake
index c217dcc..31cd52f 100644
--- a/Modules/UseEcos.cmake
+++ b/Modules/UseEcos.cmake
@@ -7,54 +7,137 @@
This module defines variables and macros required to build eCos application.
-This file contains the following macros:
+Macros
+^^^^^^
-``ECOS_ADD_INCLUDE_DIRECTORIES()``
- add the eCos include dirs
-``ECOS_ADD_EXECUTABLE(name source1 ... sourceN )``
- create an eCos executable
-``ECOS_ADJUST_DIRECTORY(VAR source1 ... sourceN )``
- adjusts the path of the source files and puts the result into ``VAR``
+This module defines the following macros:
+
+.. command:: ecos_add_include_directories
+
+ .. code-block:: cmake
+
+ ecos_add_include_directories()
+
+ Adds the eCos include directories for the current `CMakeLists.txt` file.
+
+.. command:: ecos_adjust_directory
+
+ .. code-block:: cmake
+
+ ecos_adjust_directory(<var> <sources>...)
+
+ Adjusts the paths of given source files ``<sources>...`` and stores them into
+ a result variable named ``<var>``.
+
+ ``<var>``
+ Result variable name holding a new list of source files with adjusted paths.
+ ``<sources>...``
+ A list of relative or absolute source files to adjust their paths.
+
+ Use this macro when the actual sources are located one level upwards. A
+ ``../`` has to be prepended in front of every source file that is given as a
+ relative path.
+
+.. command:: ecos_add_executable
+
+ .. code-block:: cmake
+
+ ecos_add_executable(<name> <sources>...)
+
+ Creates an eCos application executable.
+
+ ``<name>``
+ The name of the executable.
+ ``<sources>...``
+ A list of all source files, where the path has been adjusted beforehand by
+ calling the ``ecos_adjust_directory()``.
+
+ This macro also sets the ``ECOS_DEFINITIONS`` local variable, holding some
+ common compile definitions.
Macros for selecting the toolchain:
-``ECOS_USE_ARM_ELF_TOOLS()``
- enable the ARM ELF toolchain for the directory where it is called
-``ECOS_USE_I386_ELF_TOOLS()``
- enable the i386 ELF toolchain for the directory where it is called
-``ECOS_USE_PPC_EABI_TOOLS()``
- enable the PowerPC toolchain for the directory where it is called
+.. command:: ecos_use_arm_elf_tools
-It contains the following variables:
+ .. code-block:: cmake
-``ECOS_DEFINITIONS``
+ ecos_use_arm_elf_tools()
+
+ Enables the ARM ELF toolchain for the directory where it is called. Use this
+ macro, when compiling for the xscale processor.
+
+.. command:: ecos_use_i386_elf_tools
+
+ .. code-block:: cmake
+
+ ecos_use_i386_elf_tools()
+
+ Enables the i386 ELF toolchain for the directory where it is called.
+
+.. command:: ecos_use_ppc_eabi_tools
+
+ .. code-block:: cmake
+
+ ecos_use_ppc_eabi_tools()
+
+ Enables the PowerPC toolchain for the directory where it is called.
+
+Variables
+^^^^^^^^^
+
+Module also defines the following variables:
``ECOSCONFIG_EXECUTABLE``
+ Cache variable that contains a path to the ``ecosconfig`` executable (the eCos
+ configuration program).
``ECOS_CONFIG_FILE``
- defaults to ecos.ecc, if your eCos configuration file has a different name, adjust this variable for internal use only:
+ A local variable that defaults to ``ecos.ecc``. If eCos configuration file
+ has a different name, adjust this variable before calling the
+ ``ecos_add_executable()``.
-::
+Examples
+^^^^^^^^
- ECOS_ADD_TARGET_LIB
+.. code-block:: cmake
+
+ # CMakeLists.txt
+
+ include(UseEcos)
+
+ # Add the eCos include directories.
+ ecos_add_include_directories()
+
+ # Include the file with the eCos sources list. This file, for example, defines
+ # a list of eCos sources:
+ # set(sources file_1.cxx file_2.cxx file_3.cxx)
+ include(../ProjectSources.txt)
+
+ # When using such directory structure, relative source paths must be adjusted:
+ ecos_adjust_directory(adjusted_sources ${sources})
+
+ # Create eCos executable.
+ ecos_add_executable(ecos_app ${adjusted_sources})
#]=======================================================================]
-# first check that ecosconfig is available
+# First check that ecosconfig is available.
find_program(ECOSCONFIG_EXECUTABLE NAMES ecosconfig)
+mark_as_advanced(ECOSCONFIG_EXECUTABLE)
if(NOT ECOSCONFIG_EXECUTABLE)
message(SEND_ERROR "ecosconfig was not found. Either include it in the system path or set it manually using ccmake.")
else()
message(STATUS "Found ecosconfig: ${ECOSCONFIG_EXECUTABLE}")
endif()
-# check that ECOS_REPOSITORY is set correctly
+# Check that ECOS_REPOSITORY is set correctly.
if (NOT EXISTS $ENV{ECOS_REPOSITORY}/ecos.db)
message(SEND_ERROR "The environment variable ECOS_REPOSITORY is not set correctly. Set it to the directory which contains the file ecos.db")
else ()
message(STATUS "ECOS_REPOSITORY is set to $ENV{ECOS_REPOSITORY}")
endif ()
-# check that tclsh (coming with TCL) is available, otherwise ecosconfig doesn't work
+# Check that tclsh (coming with TCL) is available, otherwise ecosconfig doesn't
+# work.
find_package(Tclsh)
if (NOT TCL_TCLSH)
message(SEND_ERROR "The TCL tclsh was not found. Please install TCL, it is required for building eCos applications.")
@@ -62,98 +145,83 @@
message(STATUS "tlcsh found: ${TCL_TCLSH}")
endif ()
-#add the global include-directories
-#usage: ECOS_ADD_INCLUDE_DIRECTORIES()
macro(ECOS_ADD_INCLUDE_DIRECTORIES)
-#check for ProjectSources.txt one level higher
+ # Check for ProjectSources.txt one level higher.
if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../ProjectSources.txt)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../)
else ()
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/)
endif ()
-#the ecos include directory
+ # The ecos include directory.
include_directories(${CMAKE_CURRENT_BINARY_DIR}/ecos/install/include/)
-
endmacro()
-
-#we want to compile for the xscale processor, in this case the following macro has to be called
-#usage: ECOS_USE_ARM_ELF_TOOLS()
macro (ECOS_USE_ARM_ELF_TOOLS)
set(CMAKE_CXX_COMPILER "arm-elf-c++")
set(CMAKE_COMPILER_IS_GNUCXX 1)
set(CMAKE_C_COMPILER "arm-elf-gcc")
set(CMAKE_AR "arm-elf-ar")
set(CMAKE_RANLIB "arm-elf-ranlib")
-#for linking
+ # For linking.
set(ECOS_LD_MCPU "-mcpu=xscale")
-#for compiling
+ # For compiling.
add_definitions(-mcpu=xscale -mapcs-frame)
-#for the obj-tools
+ # For the obj-tools.
set(ECOS_ARCH_PREFIX "arm-elf-")
endmacro ()
-#usage: ECOS_USE_PPC_EABI_TOOLS()
macro (ECOS_USE_PPC_EABI_TOOLS)
set(CMAKE_CXX_COMPILER "powerpc-eabi-c++")
set(CMAKE_COMPILER_IS_GNUCXX 1)
set(CMAKE_C_COMPILER "powerpc-eabi-gcc")
set(CMAKE_AR "powerpc-eabi-ar")
set(CMAKE_RANLIB "powerpc-eabi-ranlib")
-#for linking
+ # For linking.
set(ECOS_LD_MCPU "")
-#for compiling
+ # For compiling.
add_definitions()
-#for the obj-tools
+ # For the obj-tools.
set(ECOS_ARCH_PREFIX "powerpc-eabi-")
endmacro ()
-#usage: ECOS_USE_I386_ELF_TOOLS()
macro (ECOS_USE_I386_ELF_TOOLS)
set(CMAKE_CXX_COMPILER "i386-elf-c++")
set(CMAKE_COMPILER_IS_GNUCXX 1)
set(CMAKE_C_COMPILER "i386-elf-gcc")
set(CMAKE_AR "i386-elf-ar")
set(CMAKE_RANLIB "i386-elf-ranlib")
-#for linking
+ # For linking.
set(ECOS_LD_MCPU "")
-#for compiling
+ # For compiling.
add_definitions()
-#for the obj-tools
+ # For the obj-tools.
set(ECOS_ARCH_PREFIX "i386-elf-")
endmacro ()
-
-#since the actual sources are located one level upwards
-#a "../" has to be prepended in front of every source file
-#call the following macro to achieve this, the first parameter
-#is the name of the new list of source files with adjusted paths,
-#followed by all source files
-#usage: ECOS_ADJUST_DIRECTORY(adjusted_SRCS ${my_srcs})
macro(ECOS_ADJUST_DIRECTORY _target_FILES )
foreach (_current_FILE ${ARGN})
get_filename_component(_abs_FILE ${_current_FILE} ABSOLUTE)
- if (NOT ${_abs_FILE} STREQUAL ${_current_FILE})
- get_filename_component(_abs_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../${_current_FILE} ABSOLUTE)
- endif ()
+ if (NOT ${_abs_FILE} STREQUAL ${_current_FILE})
+ get_filename_component(_abs_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../${_current_FILE} ABSOLUTE)
+ endif ()
list(APPEND ${_target_FILES} ${_abs_FILE})
endforeach ()
endmacro()
-# the default ecos config file name
-# maybe in future also out-of-source builds may be possible
+# The default eCos config file name. Maybe in future also out-of-source builds
+# may be possible.
set(ECOS_CONFIG_FILE ecos.ecc)
-#creates the dependency from all source files on the ecos target.ld,
-#adds the command for compiling ecos
+# Internal macro that creates the dependency from all source files on the eCos
+# target.ld and adds the command for compiling eCos.
macro(ECOS_ADD_TARGET_LIB)
-# when building out-of-source, create the ecos/ subdir
+ # When building out-of-source, create the ecos/ subdir.
if(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/ecos)
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/ecos)
endif()
-#sources depend on target.ld
+ # Sources depend on target.ld.
set_source_files_properties(
${ARGN}
PROPERTIES
@@ -174,40 +242,37 @@
add_custom_target( ecos make -C ${CMAKE_CURRENT_BINARY_DIR}/ecos/ DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/ecos/makefile )
endmacro()
-# get the directory of the current file, used later on in the file
+# Get the directory of the current file, used later on in the file.
get_filename_component( ECOS_CMAKE_MODULE_DIR ${CMAKE_CURRENT_LIST_FILE} PATH)
-#macro for creating an executable ecos application
-#the first parameter is the name of the executable,
-#the second is the list of all source files (where the path
-#has been adjusted beforehand by calling ECOS_ADJUST_DIRECTORY()
-#usage: ECOS_ADD_EXECUTABLE(my_app ${adjusted_SRCS})
macro(ECOS_ADD_EXECUTABLE _exe_NAME )
- #definitions, valid for all ecos projects
- #the optimization and "-g" for debugging has to be enabled
- #in the project-specific CMakeLists.txt
+ # Definitions, valid for all eCos projects.
+ # The optimization and "-g" for debugging has to be enabled in the
+ # project-specific CMakeLists.txt.
add_definitions(-D__ECOS__=1 -D__ECOS=1)
set(ECOS_DEFINITIONS -Wall -Wno-long-long -pipe -fno-builtin)
-#the executable depends on ecos target.ld
- ECOS_ADD_TARGET_LIB(${ARGN})
+ # The executable depends on eCos target.ld.
+ ecos_add_target_lib(${ARGN})
-# when using nmake makefiles, the custom buildtype suppresses the default cl.exe flags
-# and the rules for creating objects are adjusted for gcc
+ # When using nmake makefiles, the custom buildtype suppresses the default
+ # cl.exe flags and the rules for creating objects are adjusted for gcc.
set(CMAKE_BUILD_TYPE CUSTOM_ECOS_BUILD)
set(CMAKE_C_COMPILE_OBJECT "<CMAKE_C_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT> -c <SOURCE>")
set(CMAKE_CXX_COMPILE_OBJECT "<CMAKE_CXX_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT> -c <SOURCE>")
-# special link commands for ecos-executables
+
+ # Special link commands for eCos executables.
set(CMAKE_CXX_LINK_EXECUTABLE "<CMAKE_CXX_COMPILER> <CMAKE_CXX_LINK_FLAGS> <OBJECTS> -o <TARGET> ${_ecos_EXTRA_LIBS} -nostdlib -nostartfiles -L${CMAKE_CURRENT_BINARY_DIR}/ecos/install/lib -Ttarget.ld ${ECOS_LD_MCPU}")
set(CMAKE_C_LINK_EXECUTABLE "<CMAKE_C_COMPILER> <CMAKE_C_LINK_FLAGS> <OBJECTS> -o <TARGET> ${_ecos_EXTRA_LIBS} -nostdlib -nostartfiles -L${CMAKE_CURRENT_BINARY_DIR}/ecos/install/lib -Ttarget.ld ${ECOS_LD_MCPU}")
-# some strict compiler flags
+
+ # Some strict compiler flags.
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wstrict-prototypes")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Woverloaded-virtual -fno-rtti -Wctor-dtor-privacy -fno-strict-aliasing -fno-exceptions")
add_executable(${_exe_NAME} ${ARGN})
set_target_properties(${_exe_NAME} PROPERTIES SUFFIX ".elf")
-#create a binary file
+ # Create a binary file.
add_custom_command(
TARGET ${_exe_NAME}
POST_BUILD
@@ -215,7 +280,7 @@
ARGS -O binary ${CMAKE_CURRENT_BINARY_DIR}/${_exe_NAME}.elf ${CMAKE_CURRENT_BINARY_DIR}/${_exe_NAME}.bin
)
-#and an srec file
+ # And an srec file.
add_custom_command(
TARGET ${_exe_NAME}
POST_BUILD
@@ -223,7 +288,7 @@
ARGS -O srec ${CMAKE_CURRENT_BINARY_DIR}/${_exe_NAME}.elf ${CMAKE_CURRENT_BINARY_DIR}/${_exe_NAME}.srec
)
-#add the created files to the clean-files
+ # Add the created files to the clean-files.
set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_CLEAN_FILES
"${CMAKE_CURRENT_BINARY_DIR}/${_exe_NAME}.bin"
"${CMAKE_CURRENT_BINARY_DIR}/${_exe_NAME}.srec"
@@ -233,7 +298,6 @@
add_custom_target(normalclean ${CMAKE_MAKE_PROGRAM} clean WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
add_dependencies (ecosclean normalclean)
-
add_custom_target( listing
COMMAND echo -e \"\\n--- Symbols sorted by address ---\\n\" > ${CMAKE_CURRENT_BINARY_DIR}/${_exe_NAME}.lst
COMMAND ${ECOS_ARCH_PREFIX}nm -S -C -n ${CMAKE_CURRENT_BINARY_DIR}/${_exe_NAME}.elf >> ${CMAKE_CURRENT_BINARY_DIR}/${_exe_NAME}.lst
@@ -241,5 +305,4 @@
COMMAND ${ECOS_ARCH_PREFIX}nm -S -C -r --size-sort ${CMAKE_CURRENT_BINARY_DIR}/${_exe_NAME}.elf >> ${CMAKE_CURRENT_BINARY_DIR}/${_exe_NAME}.lst
COMMAND echo -e \"\\n--- Full assembly listing ---\\n\" >> ${CMAKE_CURRENT_BINARY_DIR}/${_exe_NAME}.lst
COMMAND ${ECOS_ARCH_PREFIX}objdump -S -x -d -C ${CMAKE_CURRENT_BINARY_DIR}/${_exe_NAME}.elf >> ${CMAKE_CURRENT_BINARY_DIR}/${_exe_NAME}.lst )
-
endmacro()
diff --git a/Modules/UseJava/javaTargets.cmake.in b/Modules/UseJava/javaTargets.cmake.in
index 11f1f06..4aa6560 100644
--- a/Modules/UseJava/javaTargets.cmake.in
+++ b/Modules/UseJava/javaTargets.cmake.in
@@ -1,5 +1,5 @@
cmake_policy(PUSH)
-cmake_policy(VERSION 2.8.12...3.30)
+cmake_policy(VERSION 2.8.12...3.31)
#----------------------------------------------------------------
# Generated CMake Java target import file.
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index 4d1fde9..6795ccb 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -203,6 +203,8 @@
cmExportBuildCMakeConfigGenerator.cxx
cmExportBuildFileGenerator.h
cmExportBuildFileGenerator.cxx
+ cmExportBuildPackageInfoGenerator.h
+ cmExportBuildPackageInfoGenerator.cxx
cmExportCMakeConfigGenerator.h
cmExportCMakeConfigGenerator.cxx
cmExportFileGenerator.h
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 446e8be..0dd428d 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -1,8 +1,8 @@
# CMake version number components.
set(CMake_VERSION_MAJOR 4)
set(CMake_VERSION_MINOR 0)
-set(CMake_VERSION_PATCH 0)
-set(CMake_VERSION_RC 3)
+set(CMake_VERSION_PATCH 20250310)
+#set(CMake_VERSION_RC 0)
set(CMake_VERSION_IS_DIRTY 0)
# Start with the full version number used in tags. It has no dev info.
diff --git a/Source/CPack/cmCPackNSISGenerator.cxx b/Source/CPack/cmCPackNSISGenerator.cxx
index bc18e82..85b240e 100644
--- a/Source/CPack/cmCPackNSISGenerator.cxx
+++ b/Source/CPack/cmCPackNSISGenerator.cxx
@@ -130,11 +130,13 @@
if (this->IsSet("CPACK_NSIS_MUI_ICON") ||
this->IsSet("CPACK_NSIS_MUI_UNIICON")) {
std::string installerIconCode;
- if (cmValue icon = this->GetOptionIfSet("CPACK_NSIS_MUI_ICON")) {
- installerIconCode += cmStrCat("!define MUI_ICON \"", *icon, "\"\n");
+ if (cmValue v = this->GetOptionIfSet("CPACK_NSIS_MUI_ICON")) {
+ std::string iconFile = cmSystemTools::ConvertToWindowsOutputPath(*v);
+ installerIconCode += cmStrCat("!define MUI_ICON ", iconFile, "\n");
}
- if (cmValue icon = this->GetOptionIfSet("CPACK_NSIS_MUI_UNIICON")) {
- installerIconCode += cmStrCat("!define MUI_UNICON \"", *icon, "\"\n");
+ if (cmValue v = this->GetOptionIfSet("CPACK_NSIS_MUI_UNIICON")) {
+ std::string iconFile = cmSystemTools::ConvertToWindowsOutputPath(*v);
+ installerIconCode += cmStrCat("!define MUI_UNICON ", iconFile, "\n");
}
this->SetOptionIfNotSet("CPACK_NSIS_INSTALLER_MUI_ICON_CODE",
installerIconCode.c_str());
@@ -146,24 +148,28 @@
installerHeaderImage = *icon;
}
if (!installerHeaderImage.empty()) {
- std::string installerIconCode = cmStrCat(
- "!define MUI_HEADERIMAGE_BITMAP \"", installerHeaderImage, "\"\n");
+ installerHeaderImage =
+ cmSystemTools::ConvertToWindowsOutputPath(installerHeaderImage);
+ std::string installerIconCode =
+ cmStrCat("!define MUI_HEADERIMAGE_BITMAP ", installerHeaderImage, "\n");
this->SetOptionIfNotSet("CPACK_NSIS_INSTALLER_ICON_CODE",
installerIconCode);
}
if (cmValue v =
this->GetOptionIfSet("CPACK_NSIS_MUI_WELCOMEFINISHPAGE_BITMAP")) {
+ std::string bitmapFile = cmSystemTools::ConvertToWindowsOutputPath(*v);
std::string installerBitmapCode =
- cmStrCat("!define MUI_WELCOMEFINISHPAGE_BITMAP \"", *v, "\"\n");
+ cmStrCat("!define MUI_WELCOMEFINISHPAGE_BITMAP ", bitmapFile, "\n");
this->SetOptionIfNotSet("CPACK_NSIS_INSTALLER_MUI_WELCOMEFINISH_CODE",
installerBitmapCode);
}
if (cmValue v =
this->GetOptionIfSet("CPACK_NSIS_MUI_UNWELCOMEFINISHPAGE_BITMAP")) {
+ std::string bitmapFile = cmSystemTools::ConvertToWindowsOutputPath(*v);
std::string installerBitmapCode =
- cmStrCat("!define MUI_UNWELCOMEFINISHPAGE_BITMAP \"", *v, "\"\n");
+ cmStrCat("!define MUI_UNWELCOMEFINISHPAGE_BITMAP ", bitmapFile, "\n");
this->SetOptionIfNotSet("CPACK_NSIS_INSTALLER_MUI_UNWELCOMEFINISH_CODE",
installerBitmapCode);
}
@@ -231,9 +237,10 @@
}
if (!this->IsSet("CPACK_NSIS_IGNORE_LICENSE_PAGE")) {
+ cmValue v = this->GetOption("CPACK_RESOURCE_FILE_LICENSE");
+ std::string licenseFile = cmSystemTools::ConvertToWindowsOutputPath(*v);
std::string licenseCode =
- cmStrCat("!insertmacro MUI_PAGE_LICENSE \"",
- this->GetOption("CPACK_RESOURCE_FILE_LICENSE"), "\"\n");
+ cmStrCat("!insertmacro MUI_PAGE_LICENSE ", licenseFile, "\n");
this->SetOptionIfNotSet("CPACK_NSIS_LICENSE_PAGE", licenseCode);
}
diff --git a/Source/CTest/cmCTestStartCommand.cxx b/Source/CTest/cmCTestStartCommand.cxx
index 0a4ef09..e2b897e 100644
--- a/Source/CTest/cmCTestStartCommand.cxx
+++ b/Source/CTest/cmCTestStartCommand.cxx
@@ -139,7 +139,6 @@
return false;
}
- this->CTest->SetSuppressUpdatingCTestConfiguration(true);
int model;
if (smodel) {
model = cmCTest::GetTestModelFromString(smodel);
@@ -183,7 +182,6 @@
&mf, "BuildName", "CTEST_BUILD_NAME", quiet);
this->CTest->Initialize(bld_dir);
- this->CTest->UpdateCTestConfiguration();
cmCTestOptionalLog(
this->CTest, OUTPUT,
diff --git a/Source/Checks/Curses/CMakeLists.txt b/Source/Checks/Curses/CMakeLists.txt
index 1f04bd2..255143d 100644
--- a/Source/Checks/Curses/CMakeLists.txt
+++ b/Source/Checks/Curses/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.13...3.30 FATAL_ERROR)
+cmake_minimum_required(VERSION 3.13...3.31 FATAL_ERROR)
project(CheckCurses C)
set(CURSES_NEED_NCURSES TRUE)
diff --git a/Source/QtDialog/CMakeLists.txt b/Source/QtDialog/CMakeLists.txt
index 318849e..7f9e7f0 100644
--- a/Source/QtDialog/CMakeLists.txt
+++ b/Source/QtDialog/CMakeLists.txt
@@ -13,25 +13,26 @@
STRING "Expected Qt major version. Valid values are A (auto-select), 5, 6.")
set(SUPPORTED_QT_VERSIONS "A" 5 6)
set_property(CACHE CMake_QT_MAJOR_VERSION PROPERTY STRINGS ${SUPPORTED_QT_VERSIONS})
+# Select a Qt version and store it in a normal variable of the same name.
if(NOT CMake_QT_MAJOR_VERSION STREQUAL "A")
if(NOT CMake_QT_MAJOR_VERSION IN_LIST SUPPORTED_QT_VERSIONS)
message(FATAL_ERROR "Supported Qt versions are \"${SUPPORTED_QT_VERSIONS}\"."
" But CMake_QT_MAJOR_VERSION is set to ${CMake_QT_MAJOR_VERSION}.")
endif()
- set(INSTALLED_QT_VERSION ${CMake_QT_MAJOR_VERSION})
+ set(CMake_QT_MAJOR_VERSION "${CMake_QT_MAJOR_VERSION}")
else()
find_package(Qt6Widgets QUIET)
- set(INSTALLED_QT_VERSION 6)
+ set(CMake_QT_MAJOR_VERSION 6)
if(NOT Qt6Widgets_FOUND)
find_package(Qt5Widgets QUIET)
if(NOT Qt5Widgets_FOUND)
message(FATAL_ERROR "Could not find a valid Qt installation.")
endif()
- set(INSTALLED_QT_VERSION 5)
+ set(CMake_QT_MAJOR_VERSION 5)
endif()
endif()
-find_package(Qt${INSTALLED_QT_VERSION}
+find_package(Qt${CMake_QT_MAJOR_VERSION}
COMPONENTS ${QT_COMPONENTS}
REQUIRED QUIET
)
@@ -40,10 +41,10 @@
# Try to find the package WinExtras for the task bar progress
if(WIN32)
- find_package(Qt${INSTALLED_QT_VERSION}WinExtras QUIET)
- if(Qt${INSTALLED_QT_VERSION}WinExtras_FOUND)
+ find_package(Qt${CMake_QT_MAJOR_VERSION}WinExtras QUIET)
+ if(Qt${CMake_QT_MAJOR_VERSION}WinExtras_FOUND)
add_compile_definitions(QT_WINEXTRAS)
- list(APPEND CMake_QT_EXTRA_LIBRARIES Qt${INSTALLED_QT_VERSION}::WinExtras)
+ list(APPEND CMake_QT_EXTRA_LIBRARIES Qt${CMake_QT_MAJOR_VERSION}::WinExtras)
list(APPEND QT_COMPONENTS WinExtras)
endif()
endif()
@@ -53,7 +54,7 @@
add_compile_definitions(_SILENCE_STDEXT_ARR_ITERS_DEPRECATION_WARNING)
endif()
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt${INSTALLED_QT_VERSION}Widgets_EXECUTABLE_COMPILE_FLAGS}")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt${CMake_QT_MAJOR_VERSION}Widgets_EXECUTABLE_COMPILE_FLAGS}")
if(CMake_QT_STATIC_QXcbIntegrationPlugin_LIBRARIES)
list(APPEND CMake_QT_EXTRA_LIBRARIES ${CMake_QT_STATIC_QXcbIntegrationPlugin_LIBRARIES})
@@ -70,7 +71,7 @@
# We need to install platform plugin and add qt.conf for Qt5 on Mac and Windows.
if(CMake_INSTALL_DEPENDENCIES AND (APPLE OR WIN32))
function(_qt_get_plugin_name_with_version target out_var)
- string(REGEX REPLACE "^Qt::(.+)" "Qt${INSTALLED_QT_VERSION}::\\1"
+ string(REGEX REPLACE "^Qt::(.+)" "Qt${CMake_QT_MAJOR_VERSION}::\\1"
qt_plugin_with_version "${target}")
if(TARGET "${qt_plugin_with_version}")
set("${out_var}" "${qt_plugin_with_version}" PARENT_SCOPE)
@@ -106,23 +107,23 @@
endmacro()
macro(install_qt_plugins _comps _plugins_var)
foreach(_qt_comp IN LISTS ${_comps})
- if(INSTALLED_QT_VERSION VERSION_LESS 6)
- set(_qt_module_plugins ${Qt${INSTALLED_QT_VERSION}${_qt_comp}_PLUGINS})
+ if(CMake_QT_MAJOR_VERSION VERSION_LESS 6)
+ set(_qt_module_plugins ${Qt${CMake_QT_MAJOR_VERSION}${_qt_comp}_PLUGINS})
else()
- get_target_property(_qt_module_plugins Qt${INSTALLED_QT_VERSION}::${_qt_comp} QT_PLUGINS)
+ get_target_property(_qt_module_plugins Qt${CMake_QT_MAJOR_VERSION}::${_qt_comp} QT_PLUGINS)
endif()
foreach(_qt_plugin IN LISTS _qt_module_plugins)
- if(INSTALLED_QT_VERSION VERSION_GREATER_EQUAL 6)
+ if(CMake_QT_MAJOR_VERSION VERSION_GREATER_EQUAL 6)
# Qt6 provides the plugins as individual packages that need to be found.
- find_package(Qt${INSTALLED_QT_VERSION}${_qt_plugin} QUIET
- PATHS ${Qt${INSTALLED_QT_VERSION}${_qt_comp}_DIR})
+ find_package(Qt${CMake_QT_MAJOR_VERSION}${_qt_plugin} QUIET
+ PATHS ${Qt${CMake_QT_MAJOR_VERSION}${_qt_comp}_DIR})
endif()
install_qt_plugin("${_qt_plugin}" "${_plugins_var}")
endforeach()
endforeach()
endmacro()
if(APPLE)
- if(INSTALLED_QT_VERSION VERSION_EQUAL 5)
+ if(CMake_QT_MAJOR_VERSION VERSION_EQUAL 5)
install_qt_plugin("Qt5::QCocoaIntegrationPlugin" QT_PLUGINS)
if(TARGET Qt5::QMacStylePlugin)
install_qt_plugin("Qt5::QMacStylePlugin" QT_PLUGINS)
@@ -137,7 +138,7 @@
DESTINATION "${CMAKE_INSTALL_PREFIX}/Resources"
${COMPONENT})
elseif(WIN32 AND NOT CMake_QT_STATIC_QWindowsIntegrationPlugin_LIBRARIES)
- if(INSTALLED_QT_VERSION VERSION_EQUAL 5)
+ if(CMake_QT_MAJOR_VERSION VERSION_EQUAL 5)
install_qt_plugin("Qt5::QWindowsIntegrationPlugin" QT_PLUGINS)
else()
# FIXME: Minimize plugins for Qt6.
@@ -151,7 +152,7 @@
endif()
endif()
-get_property(_Qt_Core_LOCATION TARGET Qt${INSTALLED_QT_VERSION}::Core PROPERTY LOCATION)
+get_property(_Qt_Core_LOCATION TARGET Qt${CMake_QT_MAJOR_VERSION}::Core PROPERTY LOCATION)
get_filename_component(Qt_BIN_DIR "${_Qt_Core_LOCATION}" PATH)
if(APPLE)
get_filename_component(Qt_BIN_DIR "${Qt_BIN_DIR}" PATH)
@@ -194,8 +195,8 @@
PUBLIC
CMakeLib
${CMake_QT_EXTRA_LIBRARIES}
- Qt${INSTALLED_QT_VERSION}::Core
- Qt${INSTALLED_QT_VERSION}::Widgets
+ Qt${CMake_QT_MAJOR_VERSION}::Core
+ Qt${CMake_QT_MAJOR_VERSION}::Widgets
)
set(UI_SRCS
@@ -223,7 +224,7 @@
)
set(QRC_SRCS CMakeSetup.qrc)
-if(INSTALLED_QT_VERSION VERSION_LESS 6)
+if(CMake_QT_MAJOR_VERSION VERSION_LESS 6)
qt5_wrap_ui(UI_BUILT_SRCS ${UI_SRCS})
qt5_wrap_cpp(MOC_BUILT_SRCS ${MOC_SRCS})
qt5_add_resources(QRC_BUILT_SRCS ${QRC_SRCS})
@@ -263,13 +264,14 @@
)
add_executable(cmake-gui WIN32 MACOSX_BUNDLE CMakeGUIExec.cxx)
+set_property(TARGET cmake-gui PROPERTY CMake_QT_MAJOR_VERSION "${CMake_QT_MAJOR_VERSION}")
target_link_libraries(cmake-gui
PRIVATE
CMakeGUIMainLib
CMakeGUIQRCLib
$<TARGET_NAME_IF_EXISTS:CMakeVersion>
ManifestLib
- Qt${INSTALLED_QT_VERSION}::Core
+ Qt${CMake_QT_MAJOR_VERSION}::Core
)
if(WIN32)
diff --git a/Source/QtDialog/CMakeSetupDialog.cxx b/Source/QtDialog/CMakeSetupDialog.cxx
index c3aaba0..34e9c9f 100644
--- a/Source/QtDialog/CMakeSetupDialog.cxx
+++ b/Source/QtDialog/CMakeSetupDialog.cxx
@@ -275,6 +275,8 @@
QObject::connect(this->BrowseSourceDirectoryButton,
&QAbstractButton::clicked, this,
&CMakeSetupDialog::doSourceBrowse);
+ QObject::connect(this->ReloadPresetsButton, &QAbstractButton::clicked,
+ this->CMakeThread->cmakeInstance(), &QCMake::loadPresets);
QObject::connect(this->BrowseBinaryDirectoryButton,
&QAbstractButton::clicked, this,
&CMakeSetupDialog::doBinaryBrowse);
diff --git a/Source/QtDialog/CMakeSetupDialog.ui b/Source/QtDialog/CMakeSetupDialog.ui
index c17c414..0289b0a 100644
--- a/Source/QtDialog/CMakeSetupDialog.ui
+++ b/Source/QtDialog/CMakeSetupDialog.ui
@@ -74,6 +74,13 @@
</property>
</widget>
</item>
+ <item row="1" column="2">
+ <widget class="QPushButton" name="ReloadPresetsButton">
+ <property name="text">
+ <string>Reload &presets</string>
+ </property>
+ </widget>
+ </item>
<item row="2" column="0">
<widget class="QLabel" name="BinaryLabel">
<property name="text">
diff --git a/Source/QtDialog/QCMake.cxx b/Source/QtDialog/QCMake.cxx
index 78f6b16..89781ca 100644
--- a/Source/QtDialog/QCMake.cxx
+++ b/Source/QtDialog/QCMake.cxx
@@ -64,17 +64,6 @@
for (cmake::GeneratorInfo const& gen : generators) {
this->AvailableGenerators.push_back(gen);
}
-
- connect(&this->LoadPresetsTimer, &QTimer::timeout, this, [this]() {
- this->loadPresets();
- if (!this->PresetName.isEmpty() &&
- this->CMakePresetsGraph.ConfigurePresets.find(
- std::string(this->PresetName.toStdString())) ==
- this->CMakePresetsGraph.ConfigurePresets.end()) {
- this->setPreset(QString{});
- }
- });
- this->LoadPresetsTimer.start(1000);
}
QCMake::~QCMake() = default;
@@ -93,7 +82,8 @@
emit this->sourceDirChanged(this->SourceDirectory);
this->loadPresets();
this->setPreset(QString{});
- if (!cmSystemTools::FileIsFullPath(
+ if (!this->MaybeRelativeBinaryDirectory.isEmpty() &&
+ !cmSystemTools::FileIsFullPath(
this->MaybeRelativeBinaryDirectory.toStdString())) {
this->setBinaryDirectory(this->MaybeRelativeBinaryDirectory);
}
@@ -572,13 +562,12 @@
{
auto result = this->CMakePresetsGraph.ReadProjectPresets(
this->SourceDirectory.toStdString(), true);
- if (result != this->LastLoadPresetsResult && !result) {
+ if (!result) {
emit this->presetLoadError(
this->SourceDirectory,
QString::fromStdString(
this->CMakePresetsGraph.parseState.GetErrorMessage(false)));
}
- this->LastLoadPresetsResult = result;
QVector<QCMakePreset> presets;
for (auto const& name : this->CMakePresetsGraph.ConfigurePresetOrder) {
diff --git a/Source/QtDialog/QCMake.h b/Source/QtDialog/QCMake.h
index 7eb8bc7..50305f9 100644
--- a/Source/QtDialog/QCMake.h
+++ b/Source/QtDialog/QCMake.h
@@ -124,6 +124,8 @@
void setWarnUninitializedMode(bool value);
/// check if project IDE open is possible and emit openPossible signal
void checkOpenPossible();
+ /// Reload the preset files and tree
+ void loadPresets();
public:
/// get the list of cache properties
@@ -193,8 +195,6 @@
void stderrCallback(std::string const& msg);
void setUpEnvironment() const;
- void loadPresets();
-
bool WarnUninitializedMode;
QString SourceDirectory;
QString BinaryDirectory;
@@ -204,11 +204,9 @@
QString Toolset;
std::vector<cmake::GeneratorInfo> AvailableGenerators;
cmCMakePresetsGraph CMakePresetsGraph;
- bool LastLoadPresetsResult = true;
QString PresetName;
QString CMakeExecutable;
QAtomicInt InterruptFlag;
QProcessEnvironment StartEnvironment;
QProcessEnvironment Environment;
- QTimer LoadPresetsTimer;
};
diff --git a/Source/QtDialog/QCMakeCacheView.cxx b/Source/QtDialog/QCMakeCacheView.cxx
index c9fbc26..8d4e295 100644
--- a/Source/QtDialog/QCMakeCacheView.cxx
+++ b/Source/QtDialog/QCMakeCacheView.cxx
@@ -187,7 +187,7 @@
QCMakeCacheModel::~QCMakeCacheModel() = default;
-static uint qHash(QCMakeProperty const& p)
+static size_t qHash(QCMakeProperty const& p)
{
return qHash(p.Key);
}
@@ -349,7 +349,7 @@
QCMakePropertyList props = this->properties();
QCMakePropertyList oldProps;
- int numNew = this->NewPropertyCount;
+ cm_qsizetype numNew = this->NewPropertyCount;
cm_qsizetype numTotal = props.count();
for (cm_qsizetype i = numNew; i < numTotal; i++) {
oldProps.append(props[i]);
@@ -530,7 +530,7 @@
return this->EditEnabled;
}
-int QCMakeCacheModel::newPropertyCount() const
+cm_qsizetype QCMakeCacheModel::newPropertyCount() const
{
return this->NewPropertyCount;
}
diff --git a/Source/QtDialog/QCMakeCacheView.h b/Source/QtDialog/QCMakeCacheView.h
index 6e28670..8d2c742 100644
--- a/Source/QtDialog/QCMakeCacheView.h
+++ b/Source/QtDialog/QCMakeCacheView.h
@@ -3,6 +3,7 @@
#pragma once
#include "QCMake.h"
+#include "QCMakeSizeType.h"
#include <QItemDelegate>
#include <QSet>
#include <QStandardItemModel>
@@ -99,7 +100,7 @@
bool editEnabled() const;
// returns how many new properties there are
- int newPropertyCount() const;
+ cm_qsizetype newPropertyCount() const;
// return flags (overloaded to modify flag based on EditEnabled flag)
Qt::ItemFlags flags(QModelIndex const& index) const;
@@ -114,7 +115,7 @@
protected:
bool EditEnabled;
- int NewPropertyCount;
+ cm_qsizetype NewPropertyCount;
bool ShowNewProperties;
ViewType View;
diff --git a/Source/QtDialog/QCMakePresetItemModel.cxx b/Source/QtDialog/QCMakePresetItemModel.cxx
index dbc2ee8..cb4e4fe 100644
--- a/Source/QtDialog/QCMakePresetItemModel.cxx
+++ b/Source/QtDialog/QCMakePresetItemModel.cxx
@@ -83,7 +83,8 @@
if (this->m_presets.empty()) {
return 1;
}
- return this->m_presets.size() + 2;
+ // NOLINTNEXTLINE(readability-redundant-casting)
+ return static_cast<int>(this->m_presets.size() + 2);
}
int QCMakePresetItemModel::columnCount(QModelIndex const& parent) const
@@ -144,5 +145,6 @@
index++;
}
- return this->m_presets.size() + 1;
+ // NOLINTNEXTLINE(readability-redundant-casting)
+ return static_cast<int>(this->m_presets.size() + 1);
}
diff --git a/Source/QtDialog/WarningMessagesDialog.cxx b/Source/QtDialog/WarningMessagesDialog.cxx
index 8cf4077..a0c72d4 100644
--- a/Source/QtDialog/WarningMessagesDialog.cxx
+++ b/Source/QtDialog/WarningMessagesDialog.cxx
@@ -26,21 +26,23 @@
void WarningMessagesDialog::setupSignals()
{
+#if (QT_VERSION >= QT_VERSION_CHECK(6, 7, 0))
+ static auto const checkStateChanged = &QCheckBox::checkStateChanged;
+#else
+ static auto const checkStateChanged = &QCheckBox::stateChanged;
+#endif
QObject::connect(this->buttonBox, &QDialogButtonBox::accepted, this,
&WarningMessagesDialog::doAccept);
-
- QObject::connect(this->suppressDeveloperWarnings, &QCheckBox::stateChanged,
- this,
+ QObject::connect(this->suppressDeveloperWarnings, checkStateChanged, this,
&WarningMessagesDialog::doSuppressDeveloperWarningsChanged);
QObject::connect(
- this->suppressDeprecatedWarnings, &QCheckBox::stateChanged, this,
+ this->suppressDeprecatedWarnings, checkStateChanged, this,
&WarningMessagesDialog::doSuppressDeprecatedWarningsChanged);
- QObject::connect(this->developerWarningsAsErrors, &QCheckBox::stateChanged,
- this,
+ QObject::connect(this->developerWarningsAsErrors, checkStateChanged, this,
&WarningMessagesDialog::doDeveloperWarningsAsErrorsChanged);
QObject::connect(
- this->deprecatedWarningsAsErrors, &QCheckBox::stateChanged, this,
+ this->deprecatedWarningsAsErrors, checkStateChanged, this,
&WarningMessagesDialog::doDeprecatedWarningsAsErrorsChanged);
}
diff --git a/Source/bindexplib.cxx b/Source/bindexplib.cxx
index 587e2c7..f5c36b0 100644
--- a/Source/bindexplib.cxx
+++ b/Source/bindexplib.cxx
@@ -469,7 +469,7 @@
// check for /bigobj and llvm LTO format
cmANON_OBJECT_HEADER_BIGOBJ* h =
(cmANON_OBJECT_HEADER_BIGOBJ*)lpFileBase;
- if (h->Sig1 == 0x0 && h->Sig2 == 0xffff) {
+ if (h->Sig1 == 0x0 && h->Sig2 == 0xffff && h->Version >= 2) {
// bigobj
DumpSymbols<cmANON_OBJECT_HEADER_BIGOBJ, cmIMAGE_SYMBOL_EX>
symbolDumper(
diff --git a/Source/cmAddDependenciesCommand.cxx b/Source/cmAddDependenciesCommand.cxx
index cf938f7..ff85ed3 100644
--- a/Source/cmAddDependenciesCommand.cxx
+++ b/Source/cmAddDependenciesCommand.cxx
@@ -12,7 +12,7 @@
bool cmAddDependenciesCommand(std::vector<std::string> const& args,
cmExecutionStatus& status)
{
- if (args.size() < 2) {
+ if (args.empty()) {
status.SetError("called with incorrect number of arguments");
return false;
}
diff --git a/Source/cmBuildDatabase.cxx b/Source/cmBuildDatabase.cxx
index c80e7fb..b25ca27 100644
--- a/Source/cmBuildDatabase.cxx
+++ b/Source/cmBuildDatabase.cxx
@@ -447,7 +447,7 @@
bool isCXXModule = false;
bool isPrivate = true;
- if (sf->GetLanguage() != "CXX"_s) {
+ if (sf->GetLanguage() == "CXX"_s) {
auto const* fs = gt->GetFileSetForSource(config, sf);
if (fs && fs->GetType() == "CXX_MODULES"_s) {
isCXXModule = true;
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index 75ddcc9..8f691bf 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -173,8 +173,6 @@
bool CompressXMLFiles = false;
bool CompressTestOutput = true;
- bool SuppressUpdatingCTestConfiguration = false;
-
bool Debug = false;
bool Quiet = false;
@@ -529,9 +527,6 @@
bool cmCTest::UpdateCTestConfiguration()
{
- if (this->Impl->SuppressUpdatingCTestConfiguration) {
- return true;
- }
std::string fileName = this->Impl->BinaryDir + "/CTestConfiguration.ini";
if (!cmSystemTools::FileExists(fileName)) {
fileName = this->Impl->BinaryDir + "/DartConfiguration.tcl";
@@ -716,20 +711,9 @@
this->Impl->Verbose = true;
this->Impl->ProduceXML = true;
- std::string const currDir = cmSystemTools::GetLogicalWorkingDirectory();
- std::string workDir = currDir;
- if (!this->Impl->TestDir.empty()) {
- workDir = cmSystemTools::ToNormalizedPathOnDisk(this->Impl->TestDir);
- }
+ // Minimal dashboard client script configuration.
+ this->SetCTestConfiguration("BuildDirectory", this->Impl->BinaryDir);
- cmWorkingDirectory changeDir(workDir);
- if (changeDir.Failed()) {
- cmCTestLog(this, ERROR_MESSAGE, changeDir.GetError() << std::endl);
- return 1;
- }
-
- this->Impl->BinaryDir = workDir;
- cmSystemTools::ConvertToUnixSlashes(this->Impl->BinaryDir);
this->UpdateCTestConfiguration();
this->BlockTestErrorDiagnostics();
@@ -2648,6 +2632,19 @@
return this->RunScripts(runScripts);
}
+ // Establish the working directory.
+ std::string const currDir = cmSystemTools::GetLogicalWorkingDirectory();
+ std::string workDir = currDir;
+ if (!this->Impl->TestDir.empty()) {
+ workDir = cmSystemTools::ToNormalizedPathOnDisk(this->Impl->TestDir);
+ }
+ cmWorkingDirectory changeDir(workDir);
+ if (changeDir.Failed()) {
+ cmCTestLog(this, ERROR_MESSAGE, changeDir.GetError() << std::endl);
+ return 1;
+ }
+ this->Impl->BinaryDir = workDir;
+
// -D, -T, and/or -M was specified
if (processSteps) {
return this->ProcessSteps();
@@ -2682,18 +2679,6 @@
this->Impl->ExtraVerbose = this->Impl->Verbose;
this->Impl->Verbose = true;
- std::string const currDir = cmSystemTools::GetLogicalWorkingDirectory();
- std::string workDir = currDir;
- if (!this->Impl->TestDir.empty()) {
- workDir = cmSystemTools::ToNormalizedPathOnDisk(this->Impl->TestDir);
- }
-
- cmWorkingDirectory changeDir(workDir);
- if (changeDir.Failed()) {
- cmCTestLog(this, ERROR_MESSAGE, changeDir.GetError() << std::endl);
- return 1;
- }
-
cmCTestLog(this, DEBUG, "Here: " << __LINE__ << std::endl);
if (!this->Impl->InteractiveDebugMode) {
this->BlockTestErrorDiagnostics();
@@ -2701,9 +2686,6 @@
cmSystemTools::PutEnv("CTEST_INTERACTIVE_DEBUG_MODE=1");
}
- this->Impl->BinaryDir = workDir;
- cmSystemTools::ConvertToUnixSlashes(this->Impl->BinaryDir);
-
this->UpdateCTestConfiguration();
cmCTestLog(this, DEBUG, "Here: " << __LINE__ << std::endl);
@@ -3187,11 +3169,6 @@
this->Impl->Parts[part].SubmitFiles.clear();
}
-void cmCTest::SetSuppressUpdatingCTestConfiguration(bool val)
-{
- this->Impl->SuppressUpdatingCTestConfiguration = val;
-}
-
void cmCTest::AddCTestConfigurationOverwrite(std::string const& overStr)
{
size_t epos = overStr.find('=');
diff --git a/Source/cmCTest.h b/Source/cmCTest.h
index 339c7e2..53e9b0e 100644
--- a/Source/cmCTest.h
+++ b/Source/cmCTest.h
@@ -299,12 +299,6 @@
static std::string DecodeURL(std::string const&);
/**
- * Should ctect configuration be updated. When using new style ctest
- * script, this should be true.
- */
- void SetSuppressUpdatingCTestConfiguration(bool val);
-
- /**
* Add overwrite to ctest configuration.
*
* The format is key=value
diff --git a/Source/cmDyndepCollation.cxx b/Source/cmDyndepCollation.cxx
index 98aaab2..54d283b 100644
--- a/Source/cmDyndepCollation.cxx
+++ b/Source/cmDyndepCollation.cxx
@@ -644,6 +644,9 @@
result = false;
}
}
+ for (auto const& req : object.Requires) {
+ bdb_entry->second->Requires.push_back(req.LogicalName);
+ }
} else if (export_info.DatabaseInfo) {
cmSystemTools::Error(cmStrCat(
"Failed to find module database entry for ", file_set.SourcePath));
diff --git a/Source/cmExperimental.cxx b/Source/cmExperimental.cxx
index 397cca7..8e4033f 100644
--- a/Source/cmExperimental.cxx
+++ b/Source/cmExperimental.cxx
@@ -68,7 +68,7 @@
false },
// ExportBuildDatabase
{ "ExportBuildDatabase",
- "4bd552e2-b7fb-429a-ab23-c83ef53f3f13",
+ "73194a1d-c0b5-41b9-9190-a4512925e192",
"CMAKE_EXPERIMENTAL_EXPORT_BUILD_DATABASE",
"CMake's support for exporting build databases is experimental. It is "
"meant only for experimentation and feedback to CMake developers.",
diff --git a/Source/cmExportBuildFileGenerator.cxx b/Source/cmExportBuildFileGenerator.cxx
index 86e1b91..332a6c1 100644
--- a/Source/cmExportBuildFileGenerator.cxx
+++ b/Source/cmExportBuildFileGenerator.cxx
@@ -186,15 +186,20 @@
target->GetLocalGenerator()->GetGlobalGenerator()->GetBuildExportSets();
for (auto const& exp : allExportSets) {
- auto const& exportSet = exp.second;
+ cmExportBuildFileGenerator const* const bfg = exp.second;
+ cmExportSet const* const exportSet = bfg->GetExportSet();
std::vector<TargetExport> targets;
- exportSet->GetTargets(targets);
+ bfg->GetTargets(targets);
if (std::any_of(
targets.begin(), targets.end(),
[&name](TargetExport const& te) { return te.Name == name; })) {
- exportSets.insert(exp.first);
+ if (exportSet) {
+ exportSets.insert(exportSet->GetName());
+ } else {
+ exportSets.insert(exp.first);
+ }
exportFiles.push_back(exp.first);
- namespaces.insert(exportSet->GetNamespace());
+ namespaces.insert(bfg->GetNamespace());
}
}
diff --git a/Source/cmExportBuildPackageInfoGenerator.cxx b/Source/cmExportBuildPackageInfoGenerator.cxx
new file mode 100644
index 0000000..f609624
--- /dev/null
+++ b/Source/cmExportBuildPackageInfoGenerator.cxx
@@ -0,0 +1,119 @@
+/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+ file LICENSE.rst or https://cmake.org/licensing for details. */
+#include "cmExportBuildPackageInfoGenerator.h"
+
+#include <cassert>
+#include <utility>
+#include <vector>
+
+#include <cmext/string_view>
+
+#include <cm3p/json/value.h>
+
+#include "cmGeneratorExpression.h"
+#include "cmStateTypes.h"
+#include "cmStringAlgorithms.h"
+
+cmExportBuildPackageInfoGenerator::cmExportBuildPackageInfoGenerator(
+ std::string packageName, std::string version, std::string versionCompat,
+ std::string versionSchema, std::vector<std::string> defaultTargets,
+ std::vector<std::string> defaultConfigurations)
+ : cmExportPackageInfoGenerator(
+ std::move(packageName), std::move(version), std::move(versionCompat),
+ std::move(versionSchema), std::move(defaultTargets),
+ std::move(defaultConfigurations))
+{
+ this->SetNamespace(cmStrCat(this->GetPackageName(), "::"_s));
+}
+
+bool cmExportBuildPackageInfoGenerator::GenerateMainFile(std::ostream& os)
+{
+ if (!this->CollectExports([&](cmGeneratorTarget const*) {})) {
+ return false;
+ }
+
+ if (!this->CheckDefaultTargets()) {
+ return false;
+ }
+
+ Json::Value root = this->GeneratePackageInfo();
+ root["cps_path"] = "@prefix@";
+
+ Json::Value& components = root["components"];
+
+ // Create all the imported targets.
+ for (auto const& exp : this->Exports) {
+ cmGeneratorTarget* const target = exp.Target;
+ cmStateEnums::TargetType targetType = this->GetExportTargetType(target);
+
+ Json::Value* const component =
+ this->GenerateImportTarget(components, target, targetType);
+ if (!component) {
+ return false;
+ }
+
+ ImportPropertyMap properties;
+ if (!this->PopulateInterfaceProperties(target, properties)) {
+ return false;
+ }
+ this->PopulateInterfaceLinkLibrariesProperty(
+ target, cmGeneratorExpression::InstallInterface, properties);
+
+ if (targetType != cmStateEnums::INTERFACE_LIBRARY) {
+ auto configurations = Json::Value{ Json::objectValue };
+
+ // Add per-configuration properties.
+ for (std::string const& c : this->Configurations) {
+ this->GenerateInterfacePropertiesConfig(configurations, target, c);
+ }
+
+ if (!configurations.empty()) {
+ (*component)["configurations"] = configurations;
+ }
+ }
+
+ // Set configuration-agnostic properties for component.
+ this->GenerateInterfaceProperties(*component, target, properties);
+ }
+
+ this->GeneratePackageRequires(root);
+
+ // Write the primary packing information file.
+ this->WritePackageInfo(root, os);
+
+ bool result = true;
+
+ return result;
+}
+
+void cmExportBuildPackageInfoGenerator::GenerateInterfacePropertiesConfig(
+ Json::Value& configurations, cmGeneratorTarget* target,
+ std::string const& config)
+{
+ std::string const& suffix = PropertyConfigSuffix(config);
+
+ ImportPropertyMap properties;
+
+ assert(this->GetExportTargetType(target) != cmStateEnums::INTERFACE_LIBRARY);
+ this->SetImportLocationProperty(config, suffix, target, properties);
+ if (properties.empty()) {
+ return;
+ }
+
+ this->SetImportDetailProperties(config, suffix, target, properties);
+
+ // TODO: PUBLIC_HEADER_LOCATION
+
+ Json::Value component =
+ this->GenerateInterfaceConfigProperties(suffix, properties);
+ if (!component.empty()) {
+ configurations[config] = std::move(component);
+ }
+}
+
+std::string cmExportBuildPackageInfoGenerator::GetCxxModulesDirectory() const
+{
+ // TODO: Implement a not-CMake-specific mechanism for providing module
+ // information.
+ return {};
+}
diff --git a/Source/cmExportBuildPackageInfoGenerator.h b/Source/cmExportBuildPackageInfoGenerator.h
new file mode 100644
index 0000000..7bca3e2
--- /dev/null
+++ b/Source/cmExportBuildPackageInfoGenerator.h
@@ -0,0 +1,53 @@
+/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+ file LICENSE.rst or https://cmake.org/licensing for details. */
+#pragma once
+
+#include "cmConfigure.h" // IWYU pragma: keep
+
+#include <iosfwd>
+#include <string>
+#include <vector>
+
+#include "cmExportBuildFileGenerator.h"
+#include "cmExportPackageInfoGenerator.h"
+
+namespace Json {
+class Value;
+}
+
+class cmGeneratorTarget;
+
+/** \class cmExportBuildPackageInfoGenerator
+ * \brief Generate a file exporting targets from a build tree.
+ *
+ * cmExportBuildCMakeConfigGenerator generates a file exporting targets from
+ * a build tree. This exports the targets to the Common Package Specification
+ * (https://cps-org.github.io/cps/).
+ *
+ * This is used to implement the export() command.
+ */
+class cmExportBuildPackageInfoGenerator
+ : public cmExportBuildFileGenerator
+ , public cmExportPackageInfoGenerator
+{
+public:
+ cmExportBuildPackageInfoGenerator(
+ std::string packageName, std::string version, std::string versionCompat,
+ std::string versionSchema, std::vector<std::string> defaultTargets,
+ std::vector<std::string> defaultConfigurations);
+
+protected:
+ // Implement virtual methods from the superclass.
+ bool GenerateMainFile(std::ostream& os) override;
+ void GenerateImportTargetsConfig(std::ostream&, std::string const&,
+ std::string const&) override
+ {
+ }
+
+ void GenerateInterfacePropertiesConfig(Json::Value& configurations,
+ cmGeneratorTarget* target,
+ std::string const& config);
+
+ std::string GetCxxModulesDirectory() const override;
+ // TODO: Generate C++ module info in a not-CMake-specific format.
+};
diff --git a/Source/cmExportCMakeConfigGenerator.cxx b/Source/cmExportCMakeConfigGenerator.cxx
index 1bf43ca..ce9610a 100644
--- a/Source/cmExportCMakeConfigGenerator.cxx
+++ b/Source/cmExportCMakeConfigGenerator.cxx
@@ -173,7 +173,7 @@
// Isolate the file policy level.
// Support CMake versions as far back as the
// RequiredCMakeVersion{Major,Minor,Patch}, but also support using NEW
- // policy settings for up to CMake 3.30 (this upper limit may be reviewed
+ // policy settings for up to CMake 3.31 (this upper limit may be reviewed
// and increased from time to time). This reduces the opportunity for CMake
// warnings when an older export file is later used with newer CMake
// versions.
@@ -182,7 +182,7 @@
"cmake_policy(VERSION "
<< this->RequiredCMakeVersionMajor << '.'
<< this->RequiredCMakeVersionMinor << '.'
- << this->RequiredCMakeVersionPatch << "...3.30)\n";
+ << this->RequiredCMakeVersionPatch << "...3.31)\n";
/* clang-format on */
}
diff --git a/Source/cmExportCommand.cxx b/Source/cmExportCommand.cxx
index 21b6d53..dc82bbc 100644
--- a/Source/cmExportCommand.cxx
+++ b/Source/cmExportCommand.cxx
@@ -21,8 +21,10 @@
#include "cmExportBuildAndroidMKGenerator.h"
#include "cmExportBuildCMakeConfigGenerator.h"
#include "cmExportBuildFileGenerator.h"
+#include "cmExportBuildPackageInfoGenerator.h"
#include "cmExportSet.h"
#include "cmGeneratedFileStream.h"
+#include "cmGeneratorExpression.h"
#include "cmGlobalGenerator.h"
#include "cmMakefile.h"
#include "cmMessageType.h"
@@ -63,14 +65,22 @@
struct Arguments
{
- std::string ExportSetName;
cm::optional<ArgumentParser::MaybeEmpty<std::vector<std::string>>> Targets;
- std::string Namespace;
- std::string Filename;
- std::string AndroidMKFile;
- std::string CxxModulesDirectory;
+ ArgumentParser::NonEmpty<std::string> ExportSetName;
+ ArgumentParser::NonEmpty<std::string> Namespace;
+ ArgumentParser::NonEmpty<std::string> Filename;
+ ArgumentParser::NonEmpty<std::string> AndroidMKFile;
+ ArgumentParser::NonEmpty<std::string> PackageName;
+ ArgumentParser::NonEmpty<std::string> Appendix;
+ ArgumentParser::NonEmpty<std::string> Version;
+ ArgumentParser::NonEmpty<std::string> VersionCompat;
+ ArgumentParser::NonEmpty<std::string> VersionSchema;
+ ArgumentParser::NonEmpty<std::string> CxxModulesDirectory;
+ ArgumentParser::NonEmpty<std::vector<std::string>> DefaultTargets;
+ ArgumentParser::NonEmpty<std::vector<std::string>> DefaultConfigs;
bool Append = false;
bool ExportOld = false;
+ bool LowerCase = false;
std::vector<std::vector<std::string>> PackageDependencyArgs;
bool ExportPackageDependencies = false;
@@ -92,6 +102,17 @@
parser.Bind("EXPORT_PACKAGE_DEPENDENCIES"_s,
&Arguments::ExportPackageDependencies);
}
+ if (cmExperimental::HasSupportEnabled(
+ status.GetMakefile(), cmExperimental::Feature::ExportPackageInfo)) {
+ parser.Bind("PACKAGE_INFO"_s, &Arguments::PackageName);
+ parser.Bind("LOWER_CASE_FILE"_s, &Arguments::LowerCase);
+ parser.Bind("APPENDIX"_s, &Arguments::Appendix);
+ parser.Bind("VERSION"_s, &Arguments::Version);
+ parser.Bind("COMPAT_VERSION"_s, &Arguments::VersionCompat);
+ parser.Bind("VERSION_SCHEMA"_s, &Arguments::VersionSchema);
+ parser.Bind("DEFAULT_TARGETS"_s, &Arguments::DefaultTargets);
+ parser.Bind("DEFAULT_CONFIGURATIONS"_s, &Arguments::DefaultConfigs);
+ }
} else if (args[0] == "SETUP") {
parser.Bind("SETUP"_s, &Arguments::ExportSetName);
if (cmExperimental::HasSupportEnabled(
@@ -200,19 +221,98 @@
return true;
}
+ if (arguments.PackageName.empty()) {
+ if (arguments.LowerCase) {
+ status.SetError("LOWER_CASE_FILE requires PACKAGE_INFO.");
+ return false;
+ }
+ if (!arguments.Appendix.empty()) {
+ status.SetError("APPENDIX requires PACKAGE_INFO.");
+ return false;
+ }
+ if (!arguments.Version.empty()) {
+ status.SetError("VERSION requires PACKAGE_INFO.");
+ return false;
+ }
+ if (!arguments.DefaultTargets.empty()) {
+ status.SetError("DEFAULT_TARGETS requires PACKAGE_INFO.");
+ return false;
+ }
+ if (!arguments.DefaultConfigs.empty()) {
+ status.SetError("DEFAULT_CONFIGURATIONS requires PACKAGE_INFO.");
+ return false;
+ }
+ } else {
+ if (!arguments.Filename.empty()) {
+ status.SetError("PACKAGE_INFO and FILE are mutually exclusive.");
+ return false;
+ }
+ if (!arguments.Namespace.empty()) {
+ status.SetError("PACKAGE_INFO and NAMESPACE are mutually exclusive.");
+ return false;
+ }
+ if (!arguments.Appendix.empty()) {
+ if (!arguments.Version.empty()) {
+ status.SetError("APPENDIX and VERSION are mutually exclusive.");
+ return false;
+ }
+ if (!arguments.DefaultTargets.empty()) {
+ status.SetError("APPENDIX and DEFAULT_TARGETS "
+ "are mutually exclusive.");
+ return false;
+ }
+ if (!arguments.DefaultConfigs.empty()) {
+ status.SetError("APPENDIX and DEFAULT_CONFIGURATIONS "
+ "are mutually exclusive.");
+ return false;
+ }
+ }
+ }
+ if (arguments.Version.empty()) {
+ if (!arguments.VersionCompat.empty()) {
+ status.SetError("COMPAT_VERSION requires VERSION.");
+ return false;
+ }
+ if (!arguments.VersionSchema.empty()) {
+ status.SetError("VERSION_SCHEMA requires VERSION.");
+ return false;
+ }
+ }
+
std::string fname;
bool android = false;
+ bool cps = false;
if (!arguments.AndroidMKFile.empty()) {
fname = arguments.AndroidMKFile;
android = true;
- }
- if (arguments.Filename.empty() && fname.empty()) {
+ } else if (arguments.Filename.empty()) {
if (args[0] != "EXPORT") {
status.SetError("FILE <filename> option missing.");
return false;
}
- fname = arguments.ExportSetName + ".cmake";
- } else if (fname.empty()) {
+ if (arguments.PackageName.empty()) {
+ fname = arguments.ExportSetName + ".cmake";
+ } else {
+ // Validate the package name.
+ if (!cmGeneratorExpression::IsValidTargetName(arguments.PackageName) ||
+ arguments.PackageName.find(':') != std::string::npos) {
+ status.SetError(
+ cmStrCat(R"(PACKAGE_INFO given invalid package name ")"_s,
+ arguments.PackageName, R"(".)"_s));
+ return false;
+ }
+
+ std::string const pkgNameOnDisk =
+ (arguments.LowerCase ? cmSystemTools::LowerCase(arguments.PackageName)
+ : std::string{ arguments.PackageName });
+ if (arguments.Appendix.empty()) {
+ fname = cmStrCat(pkgNameOnDisk, ".cps"_s);
+ } else {
+ fname = cmStrCat(pkgNameOnDisk, '-', arguments.Appendix, ".cps"_s);
+ }
+ cps = true;
+ }
+ } else {
// Make sure the file has a .cmake extension.
if (cmSystemTools::GetFilenameLastExtension(arguments.Filename) !=
".cmake") {
@@ -298,6 +398,11 @@
// and APPEND is not specified, if CMP0103 is OLD ignore previous definition
// else raise an error
if (gg->GetExportedTargetsFile(fname)) {
+ if (cps) {
+ status.SetError(cmStrCat("command already specified for the file "_s,
+ cmSystemTools::GetFilenameName(fname), '.'));
+ return false;
+ }
switch (mf.GetPolicyStatus(cmPolicies::CMP0103)) {
case cmPolicies::WARN:
mf.IssueMessage(
@@ -316,21 +421,28 @@
}
}
- // Setup export file generation.
+ // Set up export file generation.
std::unique_ptr<cmExportBuildFileGenerator> ebfg = nullptr;
if (android) {
auto ebag = cm::make_unique<cmExportBuildAndroidMKGenerator>();
+ ebag->SetNamespace(arguments.Namespace);
ebag->SetAppendMode(arguments.Append);
ebfg = std::move(ebag);
+ } else if (cps) {
+ auto ebpg = cm::make_unique<cmExportBuildPackageInfoGenerator>(
+ arguments.PackageName, arguments.Version, arguments.VersionCompat,
+ arguments.VersionSchema, arguments.DefaultTargets,
+ arguments.DefaultConfigs);
+ ebfg = std::move(ebpg);
} else {
auto ebcg = cm::make_unique<cmExportBuildCMakeConfigGenerator>();
+ ebcg->SetNamespace(arguments.Namespace);
ebcg->SetAppendMode(arguments.Append);
ebcg->SetExportOld(arguments.ExportOld);
ebcg->SetExportPackageDependencies(arguments.ExportPackageDependencies);
ebfg = std::move(ebcg);
}
ebfg->SetExportFile(fname.c_str());
- ebfg->SetNamespace(arguments.Namespace);
ebfg->SetCxxModuleDirectory(arguments.CxxModulesDirectory);
if (exportSet) {
ebfg->SetExportSet(exportSet);
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
index 583a256..3e69038 100644
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@ -78,19 +78,21 @@
return this->GenerateImportFile(*foutPtr);
}
+std::string cmExportFileGenerator::PropertyConfigSuffix(
+ std::string const& config)
+{
+ // Construct the property configuration suffix.
+ if (config.empty()) {
+ return "_NOCONFIG";
+ }
+ return cmStrCat('_', cmSystemTools::UpperCase(config));
+}
+
void cmExportFileGenerator::GenerateImportConfig(std::ostream& os,
std::string const& config)
{
- // Construct the property configuration suffix.
- std::string suffix = "_";
- if (!config.empty()) {
- suffix += cmSystemTools::UpperCase(config);
- } else {
- suffix += "NOCONFIG";
- }
-
// Generate the per-config target information.
- this->GenerateImportTargetsConfig(os, config, suffix);
+ this->GenerateImportTargetsConfig(os, config, PropertyConfigSuffix(config));
}
bool cmExportFileGenerator::PopulateInterfaceProperties(
diff --git a/Source/cmExportFileGenerator.h b/Source/cmExportFileGenerator.h
index 740fbba..c32d82b 100644
--- a/Source/cmExportFileGenerator.h
+++ b/Source/cmExportFileGenerator.h
@@ -170,6 +170,8 @@
bool AddTargetNamespace(std::string& input, cmGeneratorTarget const* target,
cmLocalGenerator const* lg);
+ static std::string PropertyConfigSuffix(std::string const& config);
+
// The namespace in which the exports are placed in the generated file.
std::string Namespace;
diff --git a/Source/cmExportInstallPackageInfoGenerator.cxx b/Source/cmExportInstallPackageInfoGenerator.cxx
index 930c593..98959d3 100644
--- a/Source/cmExportInstallPackageInfoGenerator.cxx
+++ b/Source/cmExportInstallPackageInfoGenerator.cxx
@@ -71,8 +71,8 @@
}
root["cps_path"] = packagePath;
- bool requiresConfigFiles = false;
// Create all the imported targets.
+ bool requiresConfigFiles = false;
for (cmTargetExport const* te : allTargets) {
cmGeneratorTarget* gt = te->Target;
cmStateEnums::TargetType targetType = this->GetExportTargetType(te);
@@ -139,8 +139,11 @@
this->PopulateImportProperties(config, suffix, te.get(), properties,
importedLocations);
- this->GenerateInterfaceConfigProperties(components, te->Target, suffix,
- properties);
+ Json::Value component =
+ this->GenerateInterfaceConfigProperties(suffix, properties);
+ if (!component.empty()) {
+ components[te->Target->GetExportName()] = std::move(component);
+ }
}
this->WritePackageInfo(root, os);
diff --git a/Source/cmExportPackageInfoGenerator.cxx b/Source/cmExportPackageInfoGenerator.cxx
index bd8b8f8..b5e0428 100644
--- a/Source/cmExportPackageInfoGenerator.cxx
+++ b/Source/cmExportPackageInfoGenerator.cxx
@@ -277,7 +277,7 @@
return true;
}
- // Target belongs to multiple namespaces or multiple export sets.
+ // Target belongs to another export from this build.
auto const& exportInfo = this->FindExportInfo(linkedTarget);
if (exportInfo.Namespaces.size() == 1 && exportInfo.Sets.size() == 1) {
auto const& linkNamespace = *exportInfo.Namespaces.begin();
@@ -302,6 +302,7 @@
return true;
}
+ // Target belongs to multiple namespaces or multiple export sets.
// cmExportFileGenerator::HandleMissingTarget should have complained about
// this already.
return false;
@@ -424,8 +425,7 @@
}
}
-void cmExportPackageInfoGenerator::GenerateInterfaceConfigProperties(
- Json::Value& components, cmGeneratorTarget const* target,
+Json::Value cmExportPackageInfoGenerator::GenerateInterfaceConfigProperties(
std::string const& suffix, ImportPropertyMap const& properties) const
{
Json::Value component;
@@ -456,7 +456,5 @@
}
}
- if (!component.empty()) {
- components[target->GetExportName()] = component;
- }
+ return component;
}
diff --git a/Source/cmExportPackageInfoGenerator.h b/Source/cmExportPackageInfoGenerator.h
index 4ca9dd3..338547c 100644
--- a/Source/cmExportPackageInfoGenerator.h
+++ b/Source/cmExportPackageInfoGenerator.h
@@ -62,8 +62,7 @@
bool GenerateInterfaceProperties(Json::Value& component,
cmGeneratorTarget const* target,
ImportPropertyMap const& properties) const;
- void GenerateInterfaceConfigProperties(
- Json::Value& components, cmGeneratorTarget const* target,
+ Json::Value GenerateInterfaceConfigProperties(
std::string const& suffix, ImportPropertyMap const& properties) const;
cm::string_view GetImportPrefixWithSlash() const override;
diff --git a/Source/cmFindBase.cxx b/Source/cmFindBase.cxx
index a7e00fd..c498ce3 100644
--- a/Source/cmFindBase.cxx
+++ b/Source/cmFindBase.cxx
@@ -94,6 +94,7 @@
this->SelectDefaultMacMode();
bool newStyle = false;
+ bool haveRequiredOrOptional = false;
enum Doing
{
DoingNone,
@@ -129,8 +130,21 @@
this->NoDefaultPath = true;
} else if (args[j] == "REQUIRED") {
doing = DoingNone;
+ if (haveRequiredOrOptional && !this->Required) {
+ this->SetError("cannot be both REQUIRED and OPTIONAL");
+ return false;
+ }
this->Required = true;
newStyle = true;
+ haveRequiredOrOptional = true;
+ } else if (args[j] == "OPTIONAL") {
+ doing = DoingNone;
+ if (haveRequiredOrOptional && this->Required) {
+ this->SetError("cannot be both REQUIRED and OPTIONAL");
+ return false;
+ }
+ newStyle = true;
+ haveRequiredOrOptional = true;
} else if (args[j] == "REGISTRY_VIEW") {
if (++j == args.size()) {
this->SetError("missing required argument for REGISTRY_VIEW");
@@ -187,6 +201,10 @@
}
}
+ if (!haveRequiredOrOptional) {
+ this->Required = this->Makefile->IsOn("CMAKE_FIND_REQUIRED");
+ }
+
if (this->VariableDocumentation.empty()) {
this->VariableDocumentation = "Where can ";
if (this->Names.empty()) {
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx
index ce2f536..8ba00be 100644
--- a/Source/cmFindPackageCommand.cxx
+++ b/Source/cmFindPackageCommand.cxx
@@ -532,6 +532,7 @@
this->DeprecatedFindModules["Boost"] = cmPolicies::CMP0167;
this->DeprecatedFindModules["CUDA"] = cmPolicies::CMP0146;
this->DeprecatedFindModules["Dart"] = cmPolicies::CMP0145;
+ this->DeprecatedFindModules["GCCXML"] = cmPolicies::CMP0188;
this->DeprecatedFindModules["PythonInterp"] = cmPolicies::CMP0148;
this->DeprecatedFindModules["PythonLibs"] = cmPolicies::CMP0148;
this->DeprecatedFindModules["Qt"] = cmPolicies::CMP0084;
@@ -677,7 +678,7 @@
}
if (cmValue const sd =
this->Makefile->GetDefinition("CMAKE_FIND_PACKAGE_SORT_DIRECTION")) {
- this->SortDirection = (*sd == "ASC") ? Asc : Dec;
+ this->SortDirection = (*sd == "DEC") ? Dec : Asc;
}
// Find what search path locations have been enabled/disable.
@@ -746,7 +747,18 @@
configArgs.push_back(i);
doing = DoingNone;
} else if (args[i] == "REQUIRED") {
- this->Required = true;
+ if (this->Required == RequiredStatus::OptionalExplicit) {
+ this->SetError("cannot be both REQUIRED and OPTIONAL");
+ return false;
+ }
+ this->Required = RequiredStatus::RequiredExplicit;
+ doing = DoingComponents;
+ } else if (args[i] == "OPTIONAL") {
+ if (this->Required == RequiredStatus::RequiredExplicit) {
+ this->SetError("cannot be both REQUIRED and OPTIONAL");
+ return false;
+ }
+ this->Required = RequiredStatus::OptionalExplicit;
doing = DoingComponents;
} else if (args[i] == "COMPONENTS") {
doing = DoingComponents;
@@ -843,6 +855,11 @@
}
}
+ if (this->Required == RequiredStatus::Optional &&
+ this->Makefile->IsOn("CMAKE_FIND_REQUIRED")) {
+ this->Required = RequiredStatus::RequiredFromFindVar;
+ }
+
if (!this->GlobalScope) {
cmValue value(
this->Makefile->GetDefinition("CMAKE_FIND_PACKAGE_TARGETS_GLOBAL"));
@@ -977,21 +994,21 @@
bool const makePackageRequiredSet =
this->Makefile->IsOn(makePackageRequiredVar);
if (makePackageRequiredSet) {
- if (this->Required) {
+ if (this->IsRequired()) {
this->Makefile->IssueMessage(
MessageType::WARNING,
cmStrCat("for module ", this->Name,
" already called with REQUIRED, thus ",
makePackageRequiredVar, " has no effect."));
} else {
- this->Required = true;
+ this->Required = RequiredStatus::RequiredFromPackageVar;
}
}
std::string const disableFindPackageVar =
cmStrCat("CMAKE_DISABLE_FIND_PACKAGE_", this->Name);
if (this->Makefile->IsOn(disableFindPackageVar)) {
- if (this->Required) {
+ if (this->IsRequired()) {
this->SetError(
cmStrCat("for module ", this->Name,
(makePackageRequiredSet
@@ -1309,6 +1326,9 @@
{
this->AddFindDefinition("CMAKE_FIND_PACKAGE_NAME", this->Name);
+ // Nested find calls are not automatically required.
+ this->AddFindDefinition("CMAKE_FIND_REQUIRED", ""_s);
+
// Store the list of components and associated variable definitions.
std::string components_var = this->Name + "_FIND_COMPONENTS";
this->AddFindDefinition(components_var, this->Components);
@@ -1328,7 +1348,7 @@
this->AddFindDefinition(quietly, "1"_s);
}
- if (this->Required) {
+ if (this->IsRequired()) {
// Tell the module that is about to be read that it should report
// a fatal error if the package is not found.
std::string req = cmStrCat(this->Name, "_FIND_REQUIRED");
@@ -1586,11 +1606,13 @@
// package not found
if (result && !found) {
- // warn if package required or neither quiet nor in config mode
- if (this->Required ||
- !(this->Quiet ||
- (this->UseConfigFiles && !this->UseFindModules &&
- this->ConsideredConfigs.empty()))) {
+ // warn if package required or
+ // (neither quiet nor in config mode and not explicitly optional)
+ if (this->IsRequired() ||
+ (!(this->Quiet ||
+ (this->UseConfigFiles && !this->UseFindModules &&
+ this->ConsideredConfigs.empty())) &&
+ this->Required != RequiredStatus::OptionalExplicit)) {
// The variable is not set.
std::ostringstream e;
std::ostringstream aw;
@@ -1694,11 +1716,19 @@
"without ensuring that it is actually available.\n";
}
}
+ if (this->Required == RequiredStatus::RequiredFromFindVar) {
+ e << "\nThis package is considered required because the "
+ "CMAKE_FIND_REQUIRED variable has been enabled.\n";
+ } else if (this->Required == RequiredStatus::RequiredFromPackageVar) {
+ e << "\nThis package is considered required because the "
+ << cmStrCat("CMAKE_REQUIRE_FIND_PACKAGE_", this->Name)
+ << " variable has been enabled.\n";
+ }
- this->Makefile->IssueMessage(this->Required ? MessageType::FATAL_ERROR
- : MessageType::WARNING,
- e.str());
- if (this->Required) {
+ this->Makefile->IssueMessage(
+ this->IsRequired() ? MessageType::FATAL_ERROR : MessageType::WARNING,
+ e.str());
+ if (this->IsRequired()) {
cmSystemTools::SetFatalErrorOccurred();
}
@@ -1931,7 +1961,7 @@
// Loop over appendices.
auto iter = this->CpsAppendices.begin();
while (iter != this->CpsAppendices.end()) {
- bool required = false;
+ RequiredStatus required = RequiredStatus::Optional;
bool important = false;
// Check if this appendix provides any requested components.
@@ -1991,7 +2021,7 @@
bool cmFindPackageCommand::FindPackageDependencies(
std::string const& fileName, cmPackageInfoReader const& reader,
- bool required)
+ RequiredStatus required)
{
// Get package requirements.
for (cmPackageRequirement const& dep : reader.GetRequirements()) {
@@ -2130,7 +2160,7 @@
}
this->Makefile->GetState()->SetGlobalProperty(versionInfoPropName,
versionInfo);
- if (this->Required) {
+ if (this->IsRequired()) {
std::string const requiredInfoPropName =
cmStrCat("_CMAKE_", this->Name, "_TYPE");
this->Makefile->GetState()->SetGlobalProperty(requiredInfoPropName,
@@ -3290,6 +3320,13 @@
return TryGeneratedPaths(searchFn, pdt::Cps, prefix, pkgDirGen);
}
+bool cmFindPackageCommand::IsRequired() const
+{
+ return this->Required == RequiredStatus::RequiredExplicit ||
+ this->Required == RequiredStatus::RequiredFromPackageVar ||
+ this->Required == RequiredStatus::RequiredFromFindVar;
+}
+
// TODO: Debug cmsys::Glob double slash problem.
bool cmFindPackage(std::vector<std::string> const& args,
diff --git a/Source/cmFindPackageCommand.h b/Source/cmFindPackageCommand.h
index bac09ee..adf6476 100644
--- a/Source/cmFindPackageCommand.h
+++ b/Source/cmFindPackageCommand.h
@@ -151,9 +151,17 @@
using AppendixMap = std::map<std::string, Appendix>;
AppendixMap FindAppendices(std::string const& base,
cmPackageInfoReader const& baseReader) const;
+ enum RequiredStatus
+ {
+ Optional,
+ OptionalExplicit,
+ RequiredExplicit,
+ RequiredFromPackageVar,
+ RequiredFromFindVar
+ };
bool FindPackageDependencies(std::string const& fileName,
cmPackageInfoReader const& reader,
- bool required);
+ RequiredStatus required);
bool ImportPackageTargets(std::string const& fileName,
cmPackageInfoReader& reader);
@@ -194,6 +202,8 @@
bool SearchAppBundlePrefix(std::string const& prefix);
bool SearchEnvironmentPrefix(std::string const& prefix);
+ bool IsRequired() const;
+
struct OriginalDef
{
bool exists;
@@ -234,7 +244,7 @@
unsigned int VersionFoundCount = 0;
KWIML_INT_uint64_t RequiredCMakeVersion = 0;
bool Quiet = false;
- bool Required = false;
+ RequiredStatus Required = RequiredStatus::Optional;
bool UseCpsFiles = false;
bool UseConfigFiles = true;
bool UseFindModules = true;
diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx
index 31923d6..ed61993 100644
--- a/Source/cmGeneratorExpressionNode.cxx
+++ b/Source/cmGeneratorExpressionNode.cxx
@@ -1711,6 +1711,11 @@
return std::string{};
}
+ if (!selector) {
+ selector = cmList::TransformSelector::New();
+ }
+ selector->Makefile = ctx->LG->GetMakefile();
+
return list
.transform(descriptor->Action, arguments,
std::move(selector))
@@ -4177,8 +4182,7 @@
return std::string();
}
- return target->GetPDBOutputName(context->Config) +
- target->GetFilePostfix(context->Config);
+ return target->GetPDBOutputName(context->Config);
}
};
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 99ee0ec..43ab2d3 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -3772,7 +3772,8 @@
std::string const& config) const
{
std::string base =
- this->GetOutputName(config, cmStateEnums::RuntimeBinaryArtifact);
+ this->GetOutputName(config, cmStateEnums::RuntimeBinaryArtifact) +
+ this->GetFilePostfix(config);
std::vector<std::string> props;
std::string configUpper = cmSystemTools::UpperCase(config);
diff --git a/Source/cmGeneratorTarget_TransitiveProperty.cxx b/Source/cmGeneratorTarget_TransitiveProperty.cxx
index 3cc2fe4..89ee8eb 100644
--- a/Source/cmGeneratorTarget_TransitiveProperty.cxx
+++ b/Source/cmGeneratorTarget_TransitiveProperty.cxx
@@ -45,6 +45,7 @@
{ "INTERFACE_INCLUDE_DIRECTORIES"_s, UseTo::Compile } },
{ "LINK_DEPENDS"_s, { "INTERFACE_LINK_DEPENDS"_s, UseTo::Link } },
{ "LINK_DIRECTORIES"_s, { "INTERFACE_LINK_DIRECTORIES"_s, UseTo::Link } },
+ { "LINK_LIBRARIES"_s, { "INTERFACE_LINK_LIBRARIES"_s, UseTo::Link } },
{ "LINK_OPTIONS"_s, { "INTERFACE_LINK_OPTIONS"_s, UseTo::Link } },
{ "PRECOMPILE_HEADERS"_s,
{ "INTERFACE_PRECOMPILE_HEADERS"_s, UseTo::Compile } },
@@ -196,6 +197,13 @@
prop = prop.substr(kINTERFACE_.length());
}
auto i = BuiltinTransitiveProperties.find(prop);
+ if (i != BuiltinTransitiveProperties.end() &&
+ // Look up CMP0189 in the context where evaluation occurs,
+ // not where the target was created.
+ lg->GetPolicyStatus(cmPolicies::CMP0189) != cmPolicies::NEW &&
+ prop == "LINK_LIBRARIES"_s) {
+ i = BuiltinTransitiveProperties.end();
+ }
if (i != BuiltinTransitiveProperties.end()) {
result = i->second;
if (result->Usage != cmGeneratorTarget::UseTo::Compile) {
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index fe07b92..29f0d70 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -387,7 +387,6 @@
std::string cmd = command; // NOLINT(*)
#ifdef _WIN32
if (cmd.empty())
- // TODO Shouldn't an empty command be handled by ninja?
cmd = "cmd.exe /c";
#endif
vars["COMMAND"] = std::move(cmd);
@@ -1223,11 +1222,8 @@
*this->CompileCommandsStream << ",\n";
}
- std::string sourceFileName = sourceFile;
- if (!cmSystemTools::FileIsFullPath(sourceFileName)) {
- sourceFileName = cmSystemTools::CollapseFullPath(
- sourceFileName, this->GetCMakeInstance()->GetHomeOutputDirectory());
- }
+ std::string sourceFileName =
+ cmSystemTools::CollapseFullPath(sourceFile, buildFileDir);
/* clang-format off */
*this->CompileCommandsStream << "{\n"
@@ -1238,7 +1234,9 @@
<< R"( "file": ")"
<< cmGlobalGenerator::EscapeJSON(sourceFileName) << "\",\n"
<< R"( "output": ")"
- << cmGlobalGenerator::EscapeJSON(objPath) << "\"\n"
+ << cmGlobalGenerator::EscapeJSON(
+ cmSystemTools::CollapseFullPath(objPath, buildFileDir))
+ << "\"\n"
<< "}";
/* clang-format on */
}
@@ -1246,7 +1244,7 @@
void cmGlobalNinjaGenerator::CloseCompileCommandsStream()
{
if (this->CompileCommandsStream) {
- *this->CompileCommandsStream << "\n]";
+ *this->CompileCommandsStream << "\n]\n";
this->CompileCommandsStream.reset();
}
}
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 58a5707..69acd1c 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -1814,9 +1814,37 @@
// create prelink phase
preLinkPhase =
this->CreateRunScriptBuildPhase("CMake PreLink Rules", gtgt, prelink);
+
+ std::vector<std::string> depends;
+ if (gtgt->IsBundleOnApple()) {
+ // In Xcode 16+ the POST_BUILD phase needs explicit dependencies to
+ // ensure it runs after certain bundle files are generated.
+ depends = {
+ "${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/"
+ "Contents/Resources/DWARF/${PRODUCT_NAME}",
+ "${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/"
+ "Contents/Info.plist",
+ "$(TARGET_BUILD_DIR)/$(EXECUTABLE_PATH)",
+ "$(TARGET_BUILD_DIR)/$(INFOPLIST_PATH)",
+ };
+ if (resourceBuildPhase) {
+ auto resourceFiles = resourceBuildPhase->GetAttribute("files");
+ for (auto xsf : resourceFiles->GetObjectList()) {
+ auto fileRef = xsf->GetAttribute("fileRef");
+ auto fileObj = fileRef->GetObject();
+ auto path = fileObj->GetAttribute("path");
+ auto fileName = cmSystemTools::GetFilenameName(path->GetString());
+ if (cmSystemTools::GetFilenameLastExtension(fileName) == ".plist") {
+ depends.push_back(
+ "$(TARGET_BUILD_DIR)/$(UNLOCALIZED_RESOURCES_FOLDER_PATH)/" +
+ fileName);
+ }
+ }
+ }
+ }
// create postbuild phase
postBuildPhase = this->CreateRunScriptBuildPhase("CMake PostBuild Rules",
- gtgt, postbuild);
+ gtgt, postbuild, depends);
} else {
std::vector<cmSourceFile*> classes;
if (!gtgt->GetConfigCommonSourceFilesForXcode(classes)) {
@@ -2030,7 +2058,8 @@
cmXCodeObject* cmGlobalXCodeGenerator::CreateRunScriptBuildPhase(
std::string const& name, cmGeneratorTarget const* gt,
- std::vector<cmCustomCommand> const& commands)
+ std::vector<cmCustomCommand> const& commands,
+ std::vector<std::string> const& depends)
{
if (commands.empty()) {
return nullptr;
@@ -2066,6 +2095,13 @@
buildPhase->AddAttribute("shellScript", this->CreateString(shellScript));
buildPhase->AddAttribute("showEnvVarsInLog", this->CreateString("0"));
{
+ cmXCodeObject* inputPaths = this->CreateObject(cmXCodeObject::OBJECT_LIST);
+ for (std::string const& s : depends) {
+ inputPaths->AddUniqueObject(this->CreateString(s));
+ }
+ buildPhase->AddAttribute("inputPaths", inputPaths);
+ }
+ {
cmXCodeObject* outputPaths =
this->CreateObject(cmXCodeObject::OBJECT_LIST);
for (std::string const& o : allConfigOutputs) {
diff --git a/Source/cmGlobalXCodeGenerator.h b/Source/cmGlobalXCodeGenerator.h
index b12540f..be42d94 100644
--- a/Source/cmGlobalXCodeGenerator.h
+++ b/Source/cmGlobalXCodeGenerator.h
@@ -296,7 +296,8 @@
cmCustomCommand const& cc);
cmXCodeObject* CreateRunScriptBuildPhase(
std::string const& name, cmGeneratorTarget const* gt,
- std::vector<cmCustomCommand> const& commands);
+ std::vector<cmCustomCommand> const& commands,
+ std::vector<std::string> const& depends = {});
std::string ConstructScript(cmCustomCommandGenerator const& ccg);
void CreateReRunCMakeFile(cmLocalGenerator* root,
std::vector<cmLocalGenerator*> const& gens);
diff --git a/Source/cmIncludeCommand.cxx b/Source/cmIncludeCommand.cxx
index d4759da..7381a42 100644
--- a/Source/cmIncludeCommand.cxx
+++ b/Source/cmIncludeCommand.cxx
@@ -25,6 +25,7 @@
DeprecatedModules["FindBoost"] = cmPolicies::CMP0167;
DeprecatedModules["FindCUDA"] = cmPolicies::CMP0146;
DeprecatedModules["FindDart"] = cmPolicies::CMP0145;
+ DeprecatedModules["FindGCCXML"] = cmPolicies::CMP0188;
DeprecatedModules["FindPythonInterp"] = cmPolicies::CMP0148;
DeprecatedModules["FindPythonLibs"] = cmPolicies::CMP0148;
DeprecatedModules["WriteCompilerDetectionHeader"] = cmPolicies::CMP0120;
diff --git a/Source/cmList.cxx b/Source/cmList.cxx
index 9b3827b..08d6468 100644
--- a/Source/cmList.cxx
+++ b/Source/cmList.cxx
@@ -523,8 +523,8 @@
std::string const& replace) override
{
TransformAction::Initialize(selector);
- this->ReplaceHelper =
- cm::make_unique<cmStringReplaceHelper>(regex, replace);
+ this->ReplaceHelper = cm::make_unique<cmStringReplaceHelper>(
+ regex, replace, selector->Makefile);
if (!this->ReplaceHelper->IsRegularExpressionValid()) {
throw transform_error(
@@ -643,6 +643,11 @@
}
}
+std::unique_ptr<cmList::TransformSelector> cmList::TransformSelector::New()
+{
+ return cm::make_unique<TransformNoSelector>();
+}
+
std::unique_ptr<cmList::TransformSelector> cmList::TransformSelector::NewAT(
std::initializer_list<index_type> indexes)
{
diff --git a/Source/cmList.h b/Source/cmList.h
index 2dbeadf..c355910 100644
--- a/Source/cmList.h
+++ b/Source/cmList.h
@@ -23,6 +23,7 @@
template <typename T>
class BT;
+class cmMakefile;
/**
* CMake lists management
@@ -893,6 +894,7 @@
// cmList::TransformSelector::New<AT>({1, 2, 5, 6});
// or
// cmList::TransformSelector::New<REGEX>("^XX.*");
+ static std::unique_ptr<TransformSelector> New();
template <typename Type>
static std::unique_ptr<TransformSelector> New(
std::initializer_list<index_type>);
@@ -907,6 +909,8 @@
template <typename Type>
static std::unique_ptr<TransformSelector> New(std::string&&);
+ cmMakefile* Makefile = nullptr;
+
private:
static std::unique_ptr<TransformSelector> NewAT(
std::initializer_list<index_type> init);
diff --git a/Source/cmListCommand.cxx b/Source/cmListCommand.cxx
index 47b6c39..60bd083 100644
--- a/Source/cmListCommand.cxx
+++ b/Source/cmListCommand.cxx
@@ -678,6 +678,11 @@
return true;
}
+ if (!selector) {
+ selector = cmList::TransformSelector::New();
+ }
+ selector->Makefile = &status.GetMakefile();
+
list->transform(descriptor->Action, arguments, std::move(selector));
status.GetMakefile().AddDefinition(outputName, list->to_string());
return true;
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index beca10d..4624370 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -4043,14 +4043,14 @@
}
// Deprecate old policies.
- if (status == cmPolicies::OLD && id <= cmPolicies::CMP0139 &&
+ if (status == cmPolicies::OLD && id <= cmPolicies::CMP0142 &&
!(this->GetCMakeInstance()->GetIsInTryCompile() &&
(
// Policies set by cmCoreTryCompile::TryCompileCode.
id == cmPolicies::CMP0083 || id == cmPolicies::CMP0091 ||
id == cmPolicies::CMP0104 || id == cmPolicies::CMP0123 ||
id == cmPolicies::CMP0126 || id == cmPolicies::CMP0128 ||
- id == cmPolicies::CMP0136)) &&
+ id == cmPolicies::CMP0136 || id == cmPolicies::CMP0141)) &&
(!this->IsSet("CMAKE_WARN_DEPRECATED") ||
this->IsOn("CMAKE_WARN_DEPRECATED"))) {
this->IssueMessage(MessageType::DEPRECATION_WARNING,
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index 99c0761..df1da05 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -18,6 +18,7 @@
#include "cmCustomCommand.h" // IWYU pragma: keep
#include "cmCustomCommandGenerator.h"
#include "cmGeneratedFileStream.h"
+#include "cmGeneratorExpression.h"
#include "cmGeneratorOptions.h"
#include "cmGeneratorTarget.h"
#include "cmGlobalNinjaGenerator.h"
@@ -446,8 +447,10 @@
this->GetGlobalGenerator()->AddRule(rule);
}
-void cmNinjaNormalTargetGenerator::WriteLinkRule(bool useResponseFile,
- std::string const& config)
+void cmNinjaNormalTargetGenerator::WriteLinkRule(
+ bool useResponseFile, std::string const& config,
+ std::vector<std::string> const& preLinkComments,
+ std::vector<std::string> const& postBuildComments)
{
cmStateEnums::TargetType targetType = this->GetGeneratorTarget()->GetType();
@@ -604,9 +607,19 @@
rule.Comment =
cmStrCat("Rule for linking ", this->TargetLinkLanguage(config), ' ',
this->GetVisibleTypeName(), '.');
- rule.Description =
- cmStrCat("Linking ", this->TargetLinkLanguage(config), ' ',
- this->GetVisibleTypeName(), " $TARGET_FILE");
+ char const* presep = "";
+ char const* postsep = "";
+ auto prelink = cmJoin(preLinkComments, "; ");
+ if (!prelink.empty()) {
+ presep = "; ";
+ }
+ auto postbuild = cmJoin(postBuildComments, "; ");
+ if (!postbuild.empty()) {
+ postsep = "; ";
+ }
+ rule.Description = cmStrCat(
+ prelink, presep, "Linking ", this->TargetLinkLanguage(config), ' ',
+ this->GetVisibleTypeName(), " $TARGET_FILE", postsep, postbuild);
rule.Restat = "$RESTAT";
this->GetGlobalGenerator()->AddRule(rule);
}
@@ -1398,12 +1411,19 @@
>->GetPostBuildCommands()
};
+ std::vector<std::string> preLinkComments;
+ std::vector<std::string> postBuildComments;
+
std::vector<std::string> preLinkCmdLines;
std::vector<std::string> postBuildCmdLines;
+ std::vector<std::string>* cmdComments[3] = { &preLinkComments,
+ &preLinkComments,
+ &postBuildComments };
std::vector<std::string>* cmdLineLists[3] = { &preLinkCmdLines,
&preLinkCmdLines,
&postBuildCmdLines };
+ cmGeneratorExpression ge(*this->GetLocalGenerator()->GetCMakeInstance());
for (unsigned i = 0; i != 3; ++i) {
for (cmCustomCommand const& cc : *cmdLists[i]) {
@@ -1413,6 +1433,11 @@
cmCustomCommandGenerator ccg(cc, fileConfig, this->GetLocalGenerator(),
true, config);
localGen.AppendCustomCommandLines(ccg, *cmdLineLists[i]);
+ if (cc.GetComment()) {
+ auto cge = ge.Parse(cc.GetComment());
+ cmdComments[i]->emplace_back(
+ cge->Evaluate(this->GetLocalGenerator(), config));
+ }
std::vector<std::string> const& ccByproducts = ccg.GetByproducts();
byproducts.Add(ccByproducts);
std::transform(
@@ -1566,7 +1591,8 @@
bool usedResponseFile = false;
globalGen->WriteBuild(this->GetImplFileStream(fileConfig), linkBuild,
commandLineLengthLimit, &usedResponseFile);
- this->WriteLinkRule(usedResponseFile, config);
+ this->WriteLinkRule(usedResponseFile, config, preLinkComments,
+ postBuildComments);
if (symlinkNeeded) {
if (targetType == cmStateEnums::EXECUTABLE) {
diff --git a/Source/cmNinjaNormalTargetGenerator.h b/Source/cmNinjaNormalTargetGenerator.h
index fd2c69f..488bcfd 100644
--- a/Source/cmNinjaNormalTargetGenerator.h
+++ b/Source/cmNinjaNormalTargetGenerator.h
@@ -30,7 +30,9 @@
char const* GetVisibleTypeName() const;
void WriteLanguagesRules(std::string const& config);
- void WriteLinkRule(bool useResponseFile, std::string const& config);
+ void WriteLinkRule(bool useResponseFile, std::string const& config,
+ std::vector<std::string> const& preLinkComments,
+ std::vector<std::string> const& postBuildComments);
void WriteDeviceLinkRules(std::string const& config);
void WriteNvidiaDeviceLinkRule(bool useResponseFile,
std::string const& config);
diff --git a/Source/cmNinjaUtilityTargetGenerator.cxx b/Source/cmNinjaUtilityTargetGenerator.cxx
index f4b95eb..0b33d36 100644
--- a/Source/cmNinjaUtilityTargetGenerator.cxx
+++ b/Source/cmNinjaUtilityTargetGenerator.cxx
@@ -5,6 +5,7 @@
#include <algorithm>
#include <array>
#include <iterator>
+#include <memory>
#include <set>
#include <string>
#include <utility>
@@ -13,6 +14,7 @@
#include "cmCustomCommand.h"
#include "cmCustomCommandGenerator.h"
#include "cmGeneratedFileStream.h"
+#include "cmGeneratorExpression.h"
#include "cmGeneratorTarget.h"
#include "cmGlobalNinjaGenerator.h"
#include "cmLocalNinjaGenerator.h"
@@ -76,6 +78,8 @@
cmGlobalNinjaGenerator::CCOutputs util_outputs(gg);
util_outputs.ExplicitOuts.emplace_back(utilCommandName);
+ std::string commandDesc;
+ cmGeneratorExpression ge(*this->GetLocalGenerator()->GetCMakeInstance());
bool uses_terminal = false;
{
std::array<std::vector<cmCustomCommand> const*, 2> const cmdLists = {
@@ -87,6 +91,13 @@
cmCustomCommandGenerator ccg(ci, fileConfig, lg);
lg->AppendCustomCommandDeps(ccg, deps, fileConfig);
lg->AppendCustomCommandLines(ccg, commands);
+ if (ci.GetComment()) {
+ if (!commandDesc.empty()) {
+ commandDesc += "; ";
+ }
+ auto cge = ge.Parse(ci.GetComment());
+ commandDesc += cge->Evaluate(this->GetLocalGenerator(), config);
+ }
util_outputs.Add(ccg.GetByproducts());
if (ci.GetUsesTerminal()) {
uses_terminal = true;
@@ -144,6 +155,8 @@
cmValue echoStr = genTarget->GetProperty("EchoString");
if (echoStr) {
desc = *echoStr;
+ } else if (!commandDesc.empty()) {
+ desc = commandDesc;
} else {
desc = "Running utility command for " + this->GetTargetName();
}
diff --git a/Source/cmPathResolver.cxx b/Source/cmPathResolver.cxx
index 71ce7b4..32f3ef7 100644
--- a/Source/cmPathResolver.cxx
+++ b/Source/cmPathResolver.cxx
@@ -492,6 +492,14 @@
static constexpr Options::Symlinks Symlinks = Options::Symlinks::None;
static constexpr Options::Existence Existence = Options::Existence::Agnostic;
};
+struct CasePath
+{
+#if defined(_WIN32) || defined(__APPLE__)
+ static constexpr Options::ActualCase ActualCase = Options::ActualCase::Yes;
+#endif
+ static constexpr Options::Symlinks Symlinks = Options::Symlinks::None;
+ static constexpr Options::Existence Existence = Options::Existence::Agnostic;
+};
struct RealPath
{
#if defined(_WIN32) || defined(__APPLE__)
@@ -512,6 +520,8 @@
#if defined(__SUNPRO_CC)
constexpr Options::Symlinks NaivePath::Symlinks;
constexpr Options::Existence NaivePath::Existence;
+constexpr Options::Symlinks CasePath::Symlinks;
+constexpr Options::Existence CasePath::Existence;
constexpr Options::Symlinks RealPath::Symlinks;
constexpr Options::Existence RealPath::Existence;
constexpr Options::Symlinks LogicalPath::Symlinks;
@@ -535,6 +545,7 @@
template class Resolver<Policies::LogicalPath>;
template class Resolver<Policies::RealPath>;
+template class Resolver<Policies::CasePath>;
template class Resolver<Policies::NaivePath>;
}
diff --git a/Source/cmPathResolver.h b/Source/cmPathResolver.h
index 1f96e0a..e2399ba 100644
--- a/Source/cmPathResolver.h
+++ b/Source/cmPathResolver.h
@@ -78,13 +78,18 @@
/** Normalizes paths while resolving symlinks only when followed
by '..' components. Does not require paths to exist, but
- reads on-disk case of paths that do exist (on Windows). */
+ reads on-disk case of paths that do exist (on Windows and macOS). */
struct LogicalPath;
-/** Normalizes paths while resolving all symlinks.
- Requires paths to exist, and reads their on-disk case (on Windows). */
+/** Normalizes paths while resolving all symlinks. Requires paths to exist,
+ and reads their on-disk case (on Windows and macOS). */
struct RealPath;
+/** Normalizes paths while assuming components followed by '..'
+ components are not symlinks. Does not require paths to exist, but
+ reads on-disk case of paths that do exist (on Windows and macOS). */
+struct CasePath;
+
/** Normalizes paths in memory without disk access.
Assumes components followed by '..' components are not symlinks. */
struct NaivePath;
@@ -94,6 +99,7 @@
extern template class Resolver<Policies::LogicalPath>;
extern template class Resolver<Policies::RealPath>;
+extern template class Resolver<Policies::CasePath>;
extern template class Resolver<Policies::NaivePath>;
}
diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h
index 637e710..a64558e 100644
--- a/Source/cmPolicies.h
+++ b/Source/cmPolicies.h
@@ -555,6 +555,20 @@
WARN) \
SELECT(POLICY, CMP0185, \
"FindRuby no longer provides upper-case RUBY_* variables.", 4, 0, 0, \
+ WARN) \
+ SELECT(POLICY, CMP0186, \
+ "Regular expressions match ^ at most once in repeated searches.", 4, \
+ 1, 0, WARN) \
+ SELECT(POLICY, CMP0187, \
+ "Include source file without an extension after the same name with " \
+ "an extension.", \
+ 4, 1, 0, WARN) \
+ SELECT(POLICY, CMP0188, "The FindGCCXML module is removed.", 4, 1, 0, WARN) \
+ SELECT(POLICY, CMP0189, \
+ "TARGET_PROPERTY evaluates LINK_LIBRARIES properties transitively.", \
+ 4, 1, 0, WARN) \
+ SELECT(POLICY, CMP0190, \
+ "FindPython enforce consistency in cross-compiling mode.", 4, 1, 0, \
WARN)
#define CM_SELECT_ID(F, A1, A2, A3, A4, A5, A6) F(A1)
diff --git a/Source/cmSourceFileLocation.cxx b/Source/cmSourceFileLocation.cxx
index d8f9d0d..fd2fd37 100644
--- a/Source/cmSourceFileLocation.cxx
+++ b/Source/cmSourceFileLocation.cxx
@@ -9,11 +9,19 @@
#include "cmGlobalGenerator.h"
#include "cmMakefile.h"
#include "cmMessageType.h"
+#include "cmPolicies.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmake.h"
-cmSourceFileLocation::cmSourceFileLocation() = default;
+// if CMP0187 and CMP0115 are NEW, then we assume that source files that do not
+// include a file extension are not ambiguous but intentionally do not have an
+// extension.
+bool NoAmbiguousExtensions(cmMakefile const& makefile)
+{
+ return makefile.GetPolicyStatus(cmPolicies::CMP0115) == cmPolicies::NEW &&
+ makefile.GetPolicyStatus(cmPolicies::CMP0187) == cmPolicies::NEW;
+}
cmSourceFileLocation::cmSourceFileLocation(cmSourceFileLocation const& loc)
: Makefile(loc.Makefile)
@@ -30,7 +38,12 @@
: Makefile(mf)
{
this->AmbiguousDirectory = !cmSystemTools::FileIsFullPath(name);
- this->AmbiguousExtension = true;
+ // If ambiguous extensions are allowed then the extension is assumed to be
+ // ambiguous unless the name has an extension, in which case
+ // `UpdateExtension` will update this. If ambiguous extensions are not
+ // allowed, then set this to false as the file extension must be provided or
+ // the file doesn't have an extension.
+ this->AmbiguousExtension = !NoAmbiguousExtensions(*mf);
this->Directory = cmSystemTools::GetFilenamePath(name);
if (cmSystemTools::FileIsFullPath(this->Directory)) {
this->Directory = cmSystemTools::CollapseFullPath(this->Directory);
diff --git a/Source/cmStringCommand.cxx b/Source/cmStringCommand.cxx
index 2fad917..02e9a92 100644
--- a/Source/cmStringCommand.cxx
+++ b/Source/cmStringCommand.cxx
@@ -29,6 +29,7 @@
#include "cmGeneratorExpression.h"
#include "cmMakefile.h"
#include "cmMessageType.h"
+#include "cmPolicies.h"
#include "cmRange.h"
#include "cmStringAlgorithms.h"
#include "cmStringReplaceHelper.h"
@@ -250,15 +251,7 @@
std::string output;
if (re.find(input)) {
status.GetMakefile().StoreMatches(re);
- std::string::size_type l = re.start();
- std::string::size_type r = re.end();
- if (r - l == 0) {
- std::string e = "sub-command REGEX, mode MATCH regex \"" + regex +
- "\" matched an empty string.";
- status.SetError(e);
- return false;
- }
- output = input.substr(l, r - l);
+ output = re.match();
}
// Store the output in the provided variable.
@@ -288,25 +281,33 @@
// Concatenate all the last arguments together.
std::string input = cmJoin(cmMakeRange(args).advance(4), std::string());
+ unsigned optAnchor = 0;
+ if (status.GetMakefile().GetPolicyStatus(cmPolicies::CMP0186) !=
+ cmPolicies::NEW) {
+ optAnchor = cmsys::RegularExpression::BOL_AT_OFFSET;
+ }
+
// Scan through the input for all matches.
std::string output;
- char const* p = input.c_str();
- while (re.find(p)) {
+ std::string::size_type base = 0;
+ unsigned optNonEmpty = 0;
+ while (re.find(input, base, optAnchor | optNonEmpty)) {
status.GetMakefile().ClearMatches();
status.GetMakefile().StoreMatches(re);
- std::string::size_type l = re.start();
- std::string::size_type r = re.end();
- if (r - l == 0) {
- std::string e = "sub-command REGEX, mode MATCHALL regex \"" + regex +
- "\" matched an empty string.";
- status.SetError(e);
- return false;
- }
- if (!output.empty()) {
+ if (!output.empty() || optNonEmpty) {
output += ";";
}
- output += std::string(p + l, r - l);
- p += r;
+ output += re.match();
+ base = re.end();
+
+ if (re.start() == input.length()) {
+ break;
+ }
+ if (re.start() == re.end()) {
+ optNonEmpty = cmsys::RegularExpression::NONEMPTY_AT_OFFSET;
+ } else {
+ optNonEmpty = 0;
+ }
}
// Store the output in the provided variable.
diff --git a/Source/cmStringReplaceHelper.cxx b/Source/cmStringReplaceHelper.cxx
index c3e44df..6dad0b0 100644
--- a/Source/cmStringReplaceHelper.cxx
+++ b/Source/cmStringReplaceHelper.cxx
@@ -7,6 +7,7 @@
#include <utility>
#include "cmMakefile.h"
+#include "cmPolicies.h"
cmStringReplaceHelper::cmStringReplaceHelper(std::string const& regex,
std::string replace_expr,
@@ -24,26 +25,25 @@
{
output.clear();
+ unsigned optAnchor = 0;
+ if (this->Makefile &&
+ this->Makefile->GetPolicyStatus(cmPolicies::CMP0186) !=
+ cmPolicies::NEW) {
+ optAnchor = cmsys::RegularExpression::BOL_AT_OFFSET;
+ }
+
// Scan through the input for all matches.
+ auto& re = this->RegularExpression;
std::string::size_type base = 0;
- while (this->RegularExpression.find(input.c_str() + base)) {
+ unsigned optNonEmpty = 0;
+ while (re.find(input, base, optAnchor | optNonEmpty)) {
if (this->Makefile) {
this->Makefile->ClearMatches();
- this->Makefile->StoreMatches(this->RegularExpression);
+ this->Makefile->StoreMatches(re);
}
- auto l2 = this->RegularExpression.start();
- auto r = this->RegularExpression.end();
// Concatenate the part of the input that was not matched.
- output += input.substr(base, l2);
-
- // Make sure the match had some text.
- if (r - l2 == 0) {
- std::ostringstream error;
- error << "regex \"" << this->RegExString << "\" matched an empty string";
- this->ErrorString = error.str();
- return false;
- }
+ output += input.substr(base, re.start() - base);
// Concatenate the replacement for the match.
for (auto const& replacement : this->Replacements) {
@@ -53,13 +53,7 @@
} else {
// Replace with part of the match.
auto n = replacement.Number;
- auto start = this->RegularExpression.start(n);
- auto end = this->RegularExpression.end(n);
- auto len = input.length() - base;
- if ((start != std::string::npos) && (end != std::string::npos) &&
- (start <= len) && (end <= len)) {
- output += input.substr(base + start, end - start);
- } else {
+ if (n > re.num_groups()) {
std::ostringstream error;
error << "replace expression \"" << this->ReplaceExpression
<< "\" contains an out-of-range escape for regex \""
@@ -67,15 +61,25 @@
this->ErrorString = error.str();
return false;
}
+ output += re.match(n);
}
}
// Move past the match.
- base += r;
+ base = re.end();
+
+ if (re.start() == input.length()) {
+ break;
+ }
+ if (re.start() == re.end()) {
+ optNonEmpty = cmsys::RegularExpression::NONEMPTY_AT_OFFSET;
+ } else {
+ optNonEmpty = 0;
+ }
}
// Concatenate the text after the last match.
- output += input.substr(base, input.length() - base);
+ output += input.substr(base);
return true;
}
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index 7d2ac65..45e59ec 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -4298,10 +4298,6 @@
systemName = "BSDOS";
}
- // fix for GNU/kFreeBSD, remove the GNU/
- if (systemName.find("kFreeBSD") != cm::string_view::npos) {
- systemName = "kFreeBSD";
- }
return systemName;
}
return "";
diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h
index f7ac20b..d6967b6 100644
--- a/Source/cmSystemTools.h
+++ b/Source/cmSystemTools.h
@@ -441,9 +441,11 @@
/** Convert an input path to an absolute path with no '/..' components.
Backslashes in the input path are converted to forward slashes.
Relative paths are interpreted w.r.t. GetLogicalWorkingDirectory.
- On Windows, the on-disk capitalization is loaded for existing paths.
This is similar to 'realpath', but preserves symlinks that are
- not erased by '../' components. */
+ not erased by '../' components.
+
+ On Windows and macOS, the on-disk capitalization is loaded for
+ existing paths. */
static std::string ToNormalizedPathOnDisk(std::string p);
#ifndef CMAKE_BOOTSTRAP
diff --git a/Source/cmTimestamp.cxx b/Source/cmTimestamp.cxx
index d7de091..d921a89 100644
--- a/Source/cmTimestamp.cxx
+++ b/Source/cmTimestamp.cxx
@@ -16,6 +16,7 @@
#include <cstdlib>
#include <cstring>
+#include <ctime>
#include <sstream>
#include <utility>
@@ -275,7 +276,8 @@
return std::string();
}
- return std::to_string(static_cast<long int>(difftime(timeT, unixEpoch)));
+ return std::to_string(
+ static_cast<int64_t>(std::difftime(timeT, unixEpoch)));
}
case 'f': // microseconds
{
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index caa541b..c5bbad2 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -4590,6 +4590,13 @@
}
linkOptions.AddFlag("ProgramDataBaseFile", pdb);
+ // Add image version
+ int major, minor;
+ this->GeneratorTarget->GetTargetVersion(major, minor);
+ if (major || minor) {
+ linkOptions.AddFlag("Version", cmStrCat(major, '.', minor));
+ }
+
// A Windows Runtime component uses internal .NET metadata,
// so does not have an import library.
if (this->GeneratorTarget->GetPropertyAsBool("VS_WINRT_COMPONENT") &&
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index df71ed3..fd410af 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -3870,7 +3870,8 @@
std::string cachePath = FindCacheFile(dir);
if (!this->LoadCache(cachePath)) {
- std::cerr << "Error: could not load cache\n";
+ std::cerr
+ << "Error: not a CMake build directory (missing CMakeCache.txt)\n";
return 1;
}
cmValue cachedGenerator = this->State->GetCacheEntryValue("CMAKE_GENERATOR");
@@ -4021,7 +4022,8 @@
std::string cachePath = FindCacheFile(dir);
if (!this->LoadCache(cachePath)) {
- std::cerr << "Error: could not load cache\n";
+ std::cerr
+ << "Error: not a CMake build directory (missing CMakeCache.txt)\n";
return false;
}
cmValue genName = this->State->GetCacheEntryValue("CMAKE_GENERATOR");
diff --git a/Templates/TestDriver.cxx.in b/Templates/TestDriver.cxx.in
index 3bb2fd6..0ccecfd 100644
--- a/Templates/TestDriver.cxx.in
+++ b/Templates/TestDriver.cxx.in
@@ -97,7 +97,7 @@
/* If no test name was given */
/* process command line with user function. */
- if (ac < 2) {
+ if (ac > 0 && ac < 2) {
/* Ask for a test. */
printf("Available tests:\n");
for (i = 0; i < NumTests; ++i) {
diff --git a/Tests/CMakeGUI/CMakeGUITest.cxx b/Tests/CMakeGUI/CMakeGUITest.cxx
index 69855e7..b4777f7 100644
--- a/Tests/CMakeGUI/CMakeGUITest.cxx
+++ b/Tests/CMakeGUI/CMakeGUITest.cxx
@@ -75,7 +75,8 @@
Qt::QueuedConnection);
QVERIFY(configureDoneSpy.wait(timeout));
- QCOMPARE(configureDoneSpy, { { expectedResult } });
+ QList<QVariant> configureDoneSignalArguments = configureDoneSpy.takeFirst();
+ QCOMPARE(configureDoneSignalArguments.at(0).toInt(), expectedResult);
}
void CMakeGUITest::sourceBinaryArgs()
@@ -359,13 +360,15 @@
QCOMPARE(this->m_window->Preset->isEnabled(), false);
writePresets("build1", { "preset" });
- loopSleep(1500);
+ this->m_window->ReloadPresetsButton->click();
+ loopSleep();
QCOMPARE(this->m_window->Preset->presetName(), QString{});
QCOMPARE(this->m_window->Preset->presets().size(), 1);
QCOMPARE(this->m_window->BinaryDirectory->currentText(), "");
QCOMPARE(this->m_window->Preset->isEnabled(), true);
this->m_window->Preset->setPresetName("preset");
+ this->m_window->ReloadPresetsButton->click();
loopSleep();
QCOMPARE(this->m_window->Preset->presetName(), "preset");
QCOMPARE(this->m_window->Preset->presets().size(), 1);
@@ -374,7 +377,8 @@
QCOMPARE(this->m_window->Preset->isEnabled(), true);
writePresets("build2", { "preset2", "preset" });
- loopSleep(1500);
+ this->m_window->ReloadPresetsButton->click();
+ loopSleep();
QCOMPARE(this->m_window->Preset->presetName(), "preset");
QCOMPARE(this->m_window->Preset->presets().size(), 2);
QCOMPARE(this->m_window->BinaryDirectory->currentText(),
@@ -382,7 +386,8 @@
QCOMPARE(this->m_window->Preset->isEnabled(), true);
writePresets("build3", { "preset2" });
- loopSleep(1500);
+ this->m_window->ReloadPresetsButton->click();
+ loopSleep();
QCOMPARE(this->m_window->Preset->presetName(), QString{});
QCOMPARE(this->m_window->Preset->presets().size(), 1);
QCOMPARE(this->m_window->BinaryDirectory->currentText(),
@@ -420,7 +425,8 @@
QFile(CMakeGUITest_BINARY_DIR "/changingPresets/src2/CMakePresets.json")
.remove();
- loopSleep(1500);
+ this->m_window->ReloadPresetsButton->click();
+ loopSleep();
QCOMPARE(this->m_window->Preset->presetName(), QString{});
QCOMPARE(this->m_window->Preset->presets().size(), 0);
QCOMPARE(this->m_window->BinaryDirectory->currentText(),
diff --git a/Tests/CMakeGUI/CMakeLists.txt b/Tests/CMakeGUI/CMakeLists.txt
index c9f44e9..d4c9bf8 100644
--- a/Tests/CMakeGUI/CMakeLists.txt
+++ b/Tests/CMakeGUI/CMakeLists.txt
@@ -1,6 +1,8 @@
include(CMakeParseArguments)
-find_package(Qt5Test REQUIRED)
+get_property(CMake_QT_MAJOR_VERSION TARGET cmake-gui PROPERTY CMake_QT_MAJOR_VERSION)
+
+find_package(Qt${CMake_QT_MAJOR_VERSION}Test REQUIRED)
if(MSVC)
# QTBUG-118993: Qt uses deprecated stdext::checked_array_iterator
@@ -14,21 +16,40 @@
)
set(MOC_SRCS)
-qt5_wrap_cpp(MOC_SRCS
- CatchShow.h
- )
+if(CMake_QT_MAJOR_VERSION VERSION_LESS 6)
+ qt5_wrap_cpp(MOC_SRCS
+ CatchShow.h
+ )
+else()
+ qt_wrap_cpp(MOC_SRCS
+ CatchShow.h
+ )
+endif()
add_library(CMakeGUITestLib STATIC ${MOC_SRCS}
CatchShow.cxx
CatchShow.h
)
-target_link_libraries(CMakeGUITestLib Qt5::Core Qt5::Gui Qt5::Widgets)
+target_link_libraries(CMakeGUITestLib
+ Qt${CMake_QT_MAJOR_VERSION}::Core
+ Qt${CMake_QT_MAJOR_VERSION}::Gui
+ Qt${CMake_QT_MAJOR_VERSION}::Widgets)
set(MOC_SRCS)
-qt5_wrap_cpp(MOC_SRCS
- CMakeGUITest.h
- )
+if(CMake_QT_MAJOR_VERSION VERSION_LESS 6)
+ qt5_wrap_cpp(MOC_SRCS
+ CMakeGUITest.h
+ )
+else()
+ qt_wrap_cpp(MOC_SRCS
+ CMakeGUITest.h
+ )
+endif()
add_executable(CMakeGUITest CMakeGUITest.cxx ${MOC_SRCS})
-target_link_libraries(CMakeGUITest CMakeGUIMainLib CMakeGUITestLib Qt5::Core Qt5::Test Qt5::Widgets)
+target_link_libraries(CMakeGUITest CMakeGUIMainLib CMakeGUITestLib
+ Qt${CMake_QT_MAJOR_VERSION}::Core
+ Qt${CMake_QT_MAJOR_VERSION}::Test
+ Qt${CMake_QT_MAJOR_VERSION}::Widgets
+)
target_compile_definitions(CMakeGUITest PRIVATE
"CMakeGUITest_SOURCE_DIR=\"${CMAKE_CURRENT_SOURCE_DIR}\""
"CMakeGUITest_BINARY_DIR=\"${CMAKE_CURRENT_BINARY_DIR}\""
@@ -47,11 +68,20 @@
cmake_parse_arguments(_t "" "" "SOURCES;MOC_SOURCES" ${ARGN})
set(MOC_SRCS)
- qt5_wrap_cpp(MOC_SRCS
- ${_t_MOC_SOURCES}
- )
+ if(CMake_QT_MAJOR_VERSION VERSION_LESS 6)
+ qt5_wrap_cpp(MOC_SRCS
+ ${_t_MOC_SOURCES}
+ )
+ else()
+ qt_wrap_cpp(MOC_SRCS
+ ${_t_MOC_SOURCES}
+ )
+ endif()
add_executable(${name} ${_t_SOURCES} ${MOC_SRCS})
- target_link_libraries(${name} CMakeGUILib CMakeGUITestLib Qt5::Core Qt5::Test Qt5::Widgets)
+ target_link_libraries(${name} CMakeGUILib CMakeGUITestLib
+ Qt${CMake_QT_MAJOR_VERSION}::Core
+ Qt${CMake_QT_MAJOR_VERSION}::Test
+ Qt${CMake_QT_MAJOR_VERSION}::Widgets)
add_test(NAME "CMakeGUILib.${name}" COMMAND ${name})
endfunction()
diff --git a/Tests/CMakeGUI/QCMakePresetItemModelTest.cxx b/Tests/CMakeGUI/QCMakePresetItemModelTest.cxx
index 5d5401b..edceeb8 100644
--- a/Tests/CMakeGUI/QCMakePresetItemModelTest.cxx
+++ b/Tests/CMakeGUI/QCMakePresetItemModelTest.cxx
@@ -17,7 +17,9 @@
void QCMakePresetItemModelTest::initTestCase()
{
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QMetaType::registerComparators<QCMakePreset>();
+#endif
}
void QCMakePresetItemModelTest::initTestCase_data()
diff --git a/Tests/CMakeLib/testCMExtEnumSet.cxx b/Tests/CMakeLib/testCMExtEnumSet.cxx
index 218b837..d480be6 100644
--- a/Tests/CMakeLib/testCMExtEnumSet.cxx
+++ b/Tests/CMakeLib/testCMExtEnumSet.cxx
@@ -14,24 +14,44 @@
int failed = 0;
+enum class Test : std::uint8_t
+{
+ A,
+ B,
+ C,
+ D,
+ E
+};
+
+using EnumSetTest = cm::enum_set<Test>;
+
+enum class Test2 : std::uint8_t
+{
+ A,
+ B,
+ C,
+ D,
+ E
+};
+
+using EnumSetTest2 = cm::enum_set<Test2, 5>;
+}
+
+CM_ENUM_SET_TRAITS(EnumSetTest)
+CM_ENUM_SET_TRAITS(EnumSetTest2)
+
+namespace {
void testDeclaration()
{
std::cout << "testDeclaration()" << std::endl;
{
- enum class Test : std::uint8_t
- {
- A,
- B,
- C,
- D
- };
- cm::enum_set<Test> testSet1;
- cm::enum_set<Test> testSet2 = Test::A;
- cm::enum_set<Test> testSet3 = Test::A | Test::C;
- cm::enum_set<Test> testSet4 = Test::A + Test::C;
- cm::enum_set<Test> testSet5{ Test::A, Test::C };
- cm::enum_set<Test> testSet6 = testSet3;
+ EnumSetTest testSet1;
+ EnumSetTest testSet2 = Test::A;
+ EnumSetTest testSet3 = Test::A | Test::C;
+ EnumSetTest testSet4 = Test::A + Test::C;
+ EnumSetTest testSet5{ Test::A, Test::C };
+ EnumSetTest testSet6 = testSet3;
if (!testSet1.empty()) {
++failed;
@@ -48,15 +68,50 @@
}
}
{
- enum class Test : std::uint8_t
- {
- A,
- B,
- C,
- D
- };
- cm::enum_set<Test> testSet1;
- cm::enum_set<Test, 4> testSet2;
+ EnumSetTest2 testSet1;
+ EnumSetTest2 testSet2 = Test2::A;
+ EnumSetTest2 testSet3 = Test2::A | Test2::C;
+ EnumSetTest2 testSet4 = Test2::A + Test2::C;
+ EnumSetTest2 testSet5{ Test2::A, Test2::C };
+ EnumSetTest2 testSet6 = testSet3;
+
+ if (!testSet1.empty()) {
+ ++failed;
+ }
+ if (testSet2.size() != 1) {
+ ++failed;
+ }
+ if (testSet3.size() != 2 || testSet4.size() != 2 || testSet5.size() != 2 ||
+ testSet6.size() != 2) {
+ ++failed;
+ }
+ if (testSet3 != testSet4 || testSet4 != testSet5 || testSet5 != testSet6) {
+ ++failed;
+ }
+ }
+ {
+ using LocalEnumSetTest = cm::enum_set<Test>;
+ LocalEnumSetTest testSet1;
+ LocalEnumSetTest testSet2 = Test::A;
+ LocalEnumSetTest testSet3{ Test::A, Test::C };
+ LocalEnumSetTest testSet4 = testSet3;
+
+ if (!testSet1.empty()) {
+ ++failed;
+ }
+ if (testSet2.size() != 1) {
+ ++failed;
+ }
+ if (testSet3.size() != 2 || testSet4.size() != 2) {
+ ++failed;
+ }
+ if (testSet3 != testSet4) {
+ ++failed;
+ }
+ }
+ {
+ EnumSetTest testSet1;
+ EnumSetTest2 testSet2;
if (testSet1.size() != 0 ||
testSet1.max_size() !=
@@ -64,7 +119,7 @@
typename std::underlying_type<Test>::type>::digits) {
++failed;
}
- if (testSet2.size() != 0 || testSet2.max_size() != 4) {
+ if (testSet2.size() != 0 || testSet2.max_size() != 5) {
++failed;
}
}
@@ -74,14 +129,7 @@
{
std::cout << "testIteration()" << std::endl;
- enum class Test : std::uint8_t
- {
- A,
- B,
- C,
- D
- };
- cm::enum_set<Test, 4> testSet{ Test::A, Test::C, Test::B };
+ EnumSetTest2 testSet{ Test2::A, Test2::C, Test2::B };
if (testSet.size() != 3) {
++failed;
@@ -112,17 +160,8 @@
{
std::cout << "testEdition()" << std::endl;
- enum class Test : std::uint8_t
{
- A,
- B,
- C,
- D,
- E
- };
-
- {
- cm::enum_set<Test> testSet{ Test::A, Test::C, Test::B };
+ EnumSetTest testSet{ Test::A, Test::C, Test::B };
auto pos = testSet.insert(Test::E);
if (!pos.second || testSet.size() != 4 || *(pos.first) != Test::E ||
@@ -144,7 +183,7 @@
}
}
{
- cm::enum_set<Test> testSet{ Test::A, Test::C, Test::B };
+ EnumSetTest testSet{ Test::A, Test::C, Test::B };
testSet += { Test::D, Test::E };
@@ -173,8 +212,8 @@
}
}
{
- cm::enum_set<Test> testSet1{ Test::A, Test::C, Test::B };
- cm::enum_set<Test> testSet2{ Test::A, Test::D, Test::E };
+ EnumSetTest testSet1{ Test::A, Test::C, Test::B };
+ EnumSetTest testSet2{ Test::A, Test::D, Test::E };
testSet1.insert(testSet2.cbegin(), testSet2.cend());
std::set<std::uint8_t> reference{ static_cast<std::uint8_t>(Test::A),
@@ -204,8 +243,8 @@
}
}
{
- cm::enum_set<Test> testSet1{ Test::A, Test::C, Test::B };
- cm::enum_set<Test> testSet2{ Test::C, Test::E };
+ EnumSetTest testSet1{ Test::A, Test::C, Test::B };
+ EnumSetTest testSet2{ Test::C, Test::E };
testSet1.flip(Test::A);
if (testSet1.size() != 2 || testSet1.contains(Test::A)) {
@@ -224,7 +263,7 @@
}
}
{
- cm::enum_set<Test> testSet1;
+ EnumSetTest testSet1;
auto testSet2 = Test::A + Test::C + Test::B;
testSet1.set({ Test::A, Test::C, Test::B });
@@ -264,39 +303,38 @@
}
}
{
- using ESet = cm::enum_set<Test, 5>;
- ESet testSet1;
- ESet testSet2{ Test::A, Test::C, Test::B };
+ EnumSetTest2 testSet1;
+ EnumSetTest2 testSet2{ Test2::A, Test2::C, Test2::B };
testSet1.set();
if (testSet1.size() != 5 || testSet1.size() != testSet1.max_size()) {
++failed;
}
- testSet1.flip({ Test::D, Test::E });
+ testSet1.flip({ Test2::D, Test2::E });
if (testSet1.size() != 3 || testSet1 != testSet2) {
++failed;
}
- testSet1.flip(Test::D | Test::E);
- testSet2 += Test::D + Test::E;
+ testSet1.flip(Test2::D | Test2::E);
+ testSet2 += Test2::D + Test2::E;
if (testSet1.size() != 5 || testSet1 != testSet2) {
++failed;
}
- testSet1.flip(Test::E);
- testSet2 -= Test::E;
+ testSet1.flip(Test2::E);
+ testSet2 -= Test2::E;
if (testSet1.size() != 4 || testSet1 != testSet2) {
++failed;
}
- testSet1 ^= { Test::A, Test::B, Test::E, Test::D };
- testSet2 = { Test::C, Test::E };
+ testSet1 ^= { Test2::A, Test2::B, Test2::E, Test2::D };
+ testSet2 = { Test2::C, Test2::E };
if (testSet1.size() != 2 || testSet1 != testSet2) {
++failed;
}
- testSet1 ^= { Test::A, Test::B, Test::E };
- testSet2 = { Test::A, Test::B, Test::C };
+ testSet1 ^= { Test2::A, Test2::B, Test2::E };
+ testSet2 = { Test2::A, Test2::B, Test2::C };
if (testSet1.size() != 3 || testSet1 != testSet2) {
++failed;
}
- testSet2 = Test::A | Test::B | Test::C;
+ testSet2 = Test2::A | Test2::B | Test2::C;
if (testSet1.size() != 3 || testSet1 != testSet2) {
++failed;
}
@@ -308,15 +346,7 @@
std::cout << "testChecks()" << std::endl;
{
- enum class Test : std::uint8_t
- {
- A,
- B,
- C,
- D
- };
-
- cm::enum_set<Test> testSet;
+ EnumSetTest testSet;
if (!testSet.empty()) {
++failed;
@@ -340,15 +370,7 @@
}
}
{
- enum class Test : std::uint8_t
- {
- A,
- B,
- C,
- D
- };
-
- cm::enum_set<Test, 4> testSet;
+ EnumSetTest2 testSet;
if (!testSet.none()) {
++failed;
@@ -357,7 +379,7 @@
++failed;
}
- testSet = Test::A;
+ testSet = Test2::A;
if (!testSet.any() || testSet.none() || testSet.all()) {
++failed;
}
@@ -368,16 +390,8 @@
}
}
{
- enum class Test : std::uint8_t
- {
- A,
- B,
- C,
- D
- };
-
- cm::enum_set<Test> testSet1;
- cm::enum_set<Test> testSet2{ Test::A, Test::C };
+ EnumSetTest testSet1;
+ EnumSetTest testSet2{ Test::A, Test::C };
if (!testSet1.none_of(testSet2) || testSet1.any_of(testSet2) ||
testSet1.all_of(testSet2)) {
diff --git a/Tests/CMakeLib/testList.cxx b/Tests/CMakeLib/testList.cxx
index ef15a6b..810ca91 100644
--- a/Tests/CMakeLib/testList.cxx
+++ b/Tests/CMakeLib/testList.cxx
@@ -740,7 +740,7 @@
cmList list({ "ABC", "BBCB", "BCCCBC", "BCBCDD", "EBCBCEBC" });
list.transform(cmList::TransformAction::REPLACE, "^BC|BC$", "X");
- if (list.to_string() != "AX;BBCB;XCCX;XXDD;EBCBCEX") {
+ if (list.to_string() != "AX;BBCB;XCCX;XBCDD;EBCBCEX") {
result = false;
}
}
diff --git a/Tests/CMakeLib/testPathResolver.cxx b/Tests/CMakeLib/testPathResolver.cxx
index d79afd9..d5cee74 100644
--- a/Tests/CMakeLib/testPathResolver.cxx
+++ b/Tests/CMakeLib/testPathResolver.cxx
@@ -24,6 +24,7 @@
// IWYU pragma: no_forward_declare cm::PathResolver::Policies::LogicalPath
// IWYU pragma: no_forward_declare cm::PathResolver::Policies::NaivePath
+// IWYU pragma: no_forward_declare cm::PathResolver::Policies::CasePath
// IWYU pragma: no_forward_declare cm::PathResolver::Policies::RealPath
namespace {
@@ -213,6 +214,22 @@
});
{
+ Resolver<Policies::CasePath> const r(os);
+ EXPECT_RESOLVE("/link-a", "/link-a");
+ EXPECT_RESOLVE("/link-a-excess", "/link-a-excess");
+ EXPECT_RESOLVE("/link-a-excess/b", "/link-a-excess/b");
+ EXPECT_RESOLVE("/link-broken", "/link-broken");
+ EXPECT_RESOLVE("/link-a/../missing", "/missing");
+ EXPECT_RESOLVE("/a/b/link-c", "/a/b/link-c");
+ EXPECT_RESOLVE("/a/link-b/c", "/a/link-b/c");
+ EXPECT_RESOLVE("/a/link-b/link-c/..", "/a/link-b");
+ EXPECT_RESOLVE("/a/b/c/link-..|..", "/a/b/c/link-..|..");
+ EXPECT_RESOLVE("/a/b/c/link-..|../link-b", "/a/b/c/link-..|../link-b");
+ EXPECT_RESOLVE("/a/link-|1|2/3", "/a/link-|1|2/3");
+ EXPECT_RESOLVE("/a/link-|1|2/../2/3", "/a/2/3");
+ }
+
+ {
Resolver<Policies::LogicalPath> const r(os);
EXPECT_RESOLVE("/link-a", "/link-a");
EXPECT_RESOLVE("/link-a-excess", "/link-a-excess");
@@ -264,6 +281,16 @@
});
{
+ Resolver<Policies::CasePath> const r(os);
+ EXPECT_RESOLVE("/mIxEd/MiSsInG", "/MiXeD/MiSsInG");
+ EXPECT_RESOLVE("/mIxEd/link-MiXeD", "/MiXeD/LiNk-MiXeD");
+ EXPECT_RESOLVE("/mIxEd/link-c-MiXeD", "/MiXeD/LiNk-C-MiXeD");
+ EXPECT_RESOLVE("/upper/mIsSiNg", "/UPPER/mIsSiNg");
+ EXPECT_RESOLVE("/upper/link-upper", "/UPPER/LINK-UPPER");
+ EXPECT_RESOLVE("/upper/link-c-upper", "/UPPER/LINK-C-UPPER");
+ }
+
+ {
Resolver<Policies::LogicalPath> const r(os);
EXPECT_RESOLVE("/mIxEd/MiSsInG", "/MiXeD/MiSsInG");
EXPECT_RESOLVE("/mIxEd/link-MiXeD", "/MiXeD/LiNk-MiXeD");
@@ -302,6 +329,16 @@
EXPECT_RESOLVE("C:/..", "C:/");
EXPECT_RESOLVE("c:/../", "c:/");
}
+ {
+ Resolver<Policies::CasePath> const r(os);
+ EXPECT_RESOLVE("c:/", "C:/");
+ EXPECT_RESOLVE("C:/", "C:/");
+ EXPECT_RESOLVE("c://", "C:/");
+ EXPECT_RESOLVE("C:/.", "C:/");
+ EXPECT_RESOLVE("c:/./", "C:/");
+ EXPECT_RESOLVE("C:/..", "C:/");
+ EXPECT_RESOLVE("c:/../", "C:/");
+ }
os.SetPaths({
{ "c:/", { {}, {} } },
{ "//host/", { {}, {} } },
@@ -361,6 +398,16 @@
});
{
+ Resolver<Policies::CasePath> const r(os);
+ EXPECT_RESOLVE("c:/mIxEd/MiSsInG", "C:/MiXeD/MiSsInG");
+ EXPECT_RESOLVE("c:/mIxEd/link-MiXeD", "C:/MiXeD/LiNk-MiXeD");
+ EXPECT_RESOLVE("c:/mIxEd/link-c-MiXeD", "C:/MiXeD/LiNk-C-MiXeD");
+ EXPECT_RESOLVE("c:/upper/mIsSiNg", "C:/UPPER/mIsSiNg");
+ EXPECT_RESOLVE("c:/upper/link-upper", "C:/UPPER/LINK-UPPER");
+ EXPECT_RESOLVE("c:/upper/link-c-upper", "C:/UPPER/LINK-C-UPPER");
+ }
+
+ {
Resolver<Policies::LogicalPath> const r(os);
EXPECT_RESOLVE("c:/mIxEd/MiSsInG", "C:/MiXeD/MiSsInG");
EXPECT_RESOLVE("c:/mIxEd/link-MiXeD", "C:/MiXeD/LiNk-MiXeD");
@@ -441,6 +488,27 @@
EXPECT_RESOLVE("E:.", "E:/");
EXPECT_RESOLVE("E:..", "E:/");
}
+ {
+ Resolver<Policies::CasePath> const r(os);
+ EXPECT_RESOLVE("c:", "C:/cwd");
+ EXPECT_RESOLVE("c:.", "C:/cwd");
+ EXPECT_RESOLVE("c:..", "C:/");
+ EXPECT_RESOLVE("C:", "C:/cwd");
+ EXPECT_RESOLVE("C:.", "C:/cwd");
+ EXPECT_RESOLVE("C:..", "C:/");
+ EXPECT_RESOLVE("d:", "D:/cwd-d");
+ EXPECT_RESOLVE("d:.", "D:/cwd-d");
+ EXPECT_RESOLVE("d:..", "D:/");
+ EXPECT_RESOLVE("D:", "D:/cwd-d");
+ EXPECT_RESOLVE("D:.", "D:/cwd-d");
+ EXPECT_RESOLVE("D:..", "D:/");
+ EXPECT_RESOLVE("e:", "E:/");
+ EXPECT_RESOLVE("e:.", "E:/");
+ EXPECT_RESOLVE("e:..", "E:/");
+ EXPECT_RESOLVE("E:", "E:/");
+ EXPECT_RESOLVE("E:.", "E:/");
+ EXPECT_RESOLVE("E:..", "E:/");
+ }
os.SetPaths({
{ "c:/", { {}, {} } },
{ "c:/cwd", { {}, {} } },
@@ -496,6 +564,13 @@
EXPECT_RESOLVE("link-to-host-share/..", "//host/");
EXPECT_RESOLVE("link-to-host-share/../missing", "//host/missing");
}
+
+ {
+ Resolver<Policies::CasePath> const r(os);
+ EXPECT_RESOLVE("link-to-host-share", "C:/cwd/link-to-host-share");
+ EXPECT_RESOLVE("link-to-host-share/..", "C:/cwd");
+ EXPECT_RESOLVE("link-to-host-share/../missing", "C:/cwd/missing");
+ }
return true;
}
#endif
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 6617455..c8c1810 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -328,6 +328,36 @@
endif()
endif()
+ if(CMake_TEST_FindPython)
+ set(CMake_TEST_FindPython2 TRUE)
+ set(CMake_TEST_FindPython3 TRUE)
+ endif()
+ if(CMake_TEST_FindPython_SABIModule)
+ set(CMake_TEST_FindPython2_SABIModule TRUE)
+ set(CMake_TEST_FindPython3_SABIModule TRUE)
+ endif()
+ if(CMake_TEST_FindPython_NumPy)
+ set(CMake_TEST_FindPython2_NumPy TRUE)
+ set(CMake_TEST_FindPython3_NumPy TRUE)
+ endif()
+ if(CMake_TEST_FindPython_Conda)
+ set(CMake_TEST_FindPython3_Conda TRUE)
+ endif()
+ if(CMake_TEST_FindPython_IronPython)
+ set(CMake_TEST_FindPython2_IronPython TRUE)
+ set(CMake_TEST_FindPython3_IronPython TRUE)
+ endif()
+ if(CMake_TEST_FindPython_PyPy)
+ set(CMake_TEST_FindPython2_PyPy TRUE)
+ set(CMake_TEST_FindPython3_PyPy TRUE)
+ endif()
+ if (CMake_TEST_FindPython2 AND CMAKE_SYSTEM_NAME MATCHES "Linux|Darwin")
+ set(CMake_TEST_FindPython2_SABIModule TRUE)
+ endif()
+ if (CMake_TEST_FindPython3 AND CMAKE_SYSTEM_NAME MATCHES "Linux|Darwin")
+ set(CMake_TEST_FindPython3_SABIModule TRUE)
+ endif()
+
# Use 1500 or CTEST_TEST_TIMEOUT for long test timeout value,
# whichever is greater.
set(CMAKE_LONG_TEST_TIMEOUT 1500)
@@ -1522,44 +1552,6 @@
add_subdirectory(GoogleTest)
endif()
- if(CMake_TEST_FindPython)
- set(CMake_TEST_FindPython2 TRUE)
- set(CMake_TEST_FindPython3 TRUE)
- endif()
- if(CMake_TEST_FindPython_SABIModule)
- set(CMake_TEST_FindPython2_SABIModule TRUE)
- set(CMake_TEST_FindPython3_SABIModule TRUE)
- endif()
- if(CMake_TEST_FindPython_NumPy)
- set(CMake_TEST_FindPython2_NumPyy TRUE)
- set(CMake_TEST_FindPython3_NumPy TRUE)
- endif()
- if(CMake_TEST_FindPython_Conda)
- set(CMake_TEST_FindPython3_Conda TRUE)
- endif()
- if(CMake_TEST_FindPython_IronPython)
- set(CMake_TEST_FindPython2_IronPython TRUE)
- set(CMake_TEST_FindPython3_IronPython TRUE)
- endif()
- if(CMake_TEST_FindPython_PyPy)
- set(CMake_TEST_FindPython2_PyPy TRUE)
- set(CMake_TEST_FindPython3_PyPy TRUE)
- endif()
- if(CMake_TEST_FindPython2 OR CMake_TEST_FindPython3
- OR CMake_TEST_FindPython2_SABIModule OR CMake_TEST_FindPython3_SABIModule
- OR CMake_TEST_FindPython2_NumPy OR CMake_TEST_FindPython3_NumPy
- OR CMake_TEST_FindPython3_Conda
- OR CMake_TEST_FindPython2_IronPython OR CMake_TEST_FindPython3_IronPython
- OR CMake_TEST_FindPython2_PyPy OR CMake_TEST_FindPython3_PyPy)
- if (CMake_TEST_FindPython2 AND CMAKE_SYSTEM_NAME MATCHES "Linux|Darwin")
- set(CMake_TEST_FindPython2_SABIModule TRUE)
- endif()
- if (CMake_TEST_FindPython3 AND CMAKE_SYSTEM_NAME MATCHES "Linux|Darwin")
- set(CMake_TEST_FindPython3_SABIModule TRUE)
- endif()
- add_subdirectory(FindPython)
- endif()
-
if(CMake_TEST_UseSWIG)
add_subdirectory(UseSWIG)
endif()
diff --git a/Tests/CMakeTests/StringTest.cmake.in b/Tests/CMakeTests/StringTest.cmake.in
index 6a94cc5..ca2ee02 100644
--- a/Tests/CMakeTests/StringTest.cmake.in
+++ b/Tests/CMakeTests/StringTest.cmake.in
@@ -84,7 +84,7 @@
# Execute each test listed in StringTestScript.cmake:
#
set(scriptname "@CMAKE_CURRENT_SOURCE_DIR@/StringTestScript.cmake")
-set(number_of_tests_expected 72)
+set(number_of_tests_expected 70)
include("@CMAKE_CURRENT_SOURCE_DIR@/ExecuteScriptTests.cmake")
execute_all_script_tests(${scriptname} number_of_tests_executed)
diff --git a/Tests/CMakeTests/StringTestScript.cmake b/Tests/CMakeTests/StringTestScript.cmake
index 7c45857..84b404c 100644
--- a/Tests/CMakeTests/StringTestScript.cmake
+++ b/Tests/CMakeTests/StringTestScript.cmake
@@ -73,9 +73,6 @@
elseif(testname STREQUAL regex_match_bad_regex) # fail
string(REGEX MATCH "(.*" v input)
-elseif(testname STREQUAL regex_match_empty_string) # fail
- string(REGEX MATCH "x*" v "")
-
elseif(testname STREQUAL regex_match_no_match) # pass
string(REGEX MATCH "xyz" v "abc")
message(STATUS "v='${v}'")
@@ -87,9 +84,6 @@
elseif(testname STREQUAL regex_matchall_bad_regex) # fail
string(REGEX MATCHALL "(.*" v input)
-elseif(testname STREQUAL regex_matchall_empty_string) # fail
- string(REGEX MATCHALL "x*" v "")
-
elseif(testname STREQUAL regex_replace_ends_with_backslash) # fail
string(REGEX REPLACE "input" "output\\" v input1 input2 input3 input4)
@@ -107,15 +101,16 @@
elseif(testname STREQUAL regex_replace_bad_regex) # fail
string(REGEX REPLACE "this (.*" "with that" v input)
-elseif(testname STREQUAL regex_replace_empty_string) # fail
- string(REGEX REPLACE "x*" "that" v "")
-
elseif(testname STREQUAL regex_replace_index_too_small) # fail
string(REGEX REPLACE "^this (.*)$" "with \\1 \\-1" v "this input")
elseif(testname STREQUAL regex_replace_index_too_large) # fail
string(REGEX REPLACE "^this (.*)$" "with \\1 \\2" v "this input")
+elseif(testname STREQUAL regex_replace_index_no_match) # pass
+ string(REGEX REPLACE "^(this (.*)|(that .*))$" "with \\1 \\2 \\3" v "this input")
+ message(STATUS "v='${v}'")
+
elseif(testname STREQUAL compare_no_mode) # fail
string(COMPARE)
diff --git a/Tests/CustomTransitiveProperties/CMP0189/CMakeLists.txt b/Tests/CustomTransitiveProperties/CMP0189/CMakeLists.txt
new file mode 100644
index 0000000..04fb1b4
--- /dev/null
+++ b/Tests/CustomTransitiveProperties/CMP0189/CMakeLists.txt
@@ -0,0 +1,57 @@
+cmake_policy(SET CMP0189 NEW)
+set(out "${CMAKE_CURRENT_BINARY_DIR}/out-$<CONFIG>.txt")
+file(GENERATE OUTPUT "${out}" CONTENT "# file(GENERATE) produced:
+${in_LINK_LIBRARIES}
+")
+add_custom_target(check-CMP0189-NEW ALL VERBATIM
+ COMMAND ${CMAKE_COMMAND} -Dconfig=$<CONFIG> -Dout=${out} -P${CMAKE_CURRENT_SOURCE_DIR}/check.cmake
+ COMMAND check-args
+ "$<TARGET_PROPERTY:iface1,LINK_LIBRARIES>" ""
+ "$<TARGET_PROPERTY:iface1,INTERFACE_LINK_LIBRARIES>" ""
+ "$<TARGET_PROPERTY:iface2,LINK_LIBRARIES>" ""
+ "$<TARGET_PROPERTY:iface2,INTERFACE_LINK_LIBRARIES>" "iface1"
+ "$<TARGET_PROPERTY:static1,LINK_LIBRARIES>" "iface2;iface1"
+ "$<TARGET_PROPERTY:static1,INTERFACE_LINK_LIBRARIES>" "iface2;iface1"
+ "$<TARGET_PROPERTY:CustomTransitiveProperties,LINK_LIBRARIES>" "static1;object1;iface2;iface1;iface2"
+ "$<TARGET_PROPERTY:CustomTransitiveProperties,INTERFACE_LINK_LIBRARIES>" ""
+ COMMAND check-args
+ "$<TARGET_PROPERTY:iface10,LINK_LIBRARIES>" ""
+ "$<TARGET_PROPERTY:iface10,INTERFACE_LINK_LIBRARIES>" ""
+ "$<TARGET_PROPERTY:iface11,LINK_LIBRARIES>" ""
+ "$<TARGET_PROPERTY:iface11,INTERFACE_LINK_LIBRARIES>" "iface10"
+ "$<TARGET_PROPERTY:static10,LINK_LIBRARIES>" "iface11;iface10"
+ # _/ \__
+ # / \
+ # "static10[iface11];iface11[iface10]"
+ "$<TARGET_PROPERTY:static10,INTERFACE_LINK_LIBRARIES>" "iface11;iface10"
+ "$<TARGET_PROPERTY:static11,LINK_LIBRARIES>" "static10;iface11;iface11;iface10"
+ # __/ __/ \__ \__________
+ # / / \ \
+ # "static11[static10;iface11];static10[iface11;iface11[iface10]]"
+ "$<TARGET_PROPERTY:static11,INTERFACE_LINK_LIBRARIES>" "static10;iface11;iface11;iface10"
+ "$<TARGET_PROPERTY:main10,LINK_LIBRARIES>" "static11;static10;static10;iface11;iface11;iface10"
+ # _______/ _______/ | | \______ \______________
+ # / / | | \ \
+ # "main10[static11;static10];static11[static10;iface11;static10[iface11;iface11[iface10]]]"
+ "$<TARGET_PROPERTY:main10,INTERFACE_LINK_LIBRARIES>" ""
+ COMMAND check-args
+ "$<TARGET_PROPERTY:iface20,LINK_LIBRARIES>" ""
+ "$<TARGET_PROPERTY:iface20,INTERFACE_LINK_LIBRARIES>" ""
+ "$<TARGET_PROPERTY:iface21,LINK_LIBRARIES>" ""
+ "$<TARGET_PROPERTY:iface21,INTERFACE_LINK_LIBRARIES>" "iface20"
+ "$<TARGET_PROPERTY:static20,LINK_LIBRARIES>" "iface21;iface20"
+ # _/ \__
+ # / \
+ # "static20[iface21];iface21[iface20]"
+ "$<TARGET_PROPERTY:static20,INTERFACE_LINK_LIBRARIES>" "iface21;iface20"
+ "$<TARGET_PROPERTY:static21,LINK_LIBRARIES>" "static20;iface21;iface21;iface20"
+ # __/ __/ \__ \__________
+ # / / \ \
+ # "static21[static20;iface21];static20[iface21;iface21[iface20]]"
+ "$<TARGET_PROPERTY:static21,INTERFACE_LINK_LIBRARIES>" "static20;iface21;iface21;iface20"
+ "$<TARGET_PROPERTY:main20,LINK_LIBRARIES>" "static21;static20;static20;iface21;iface21;iface20"
+ # _______/ _______/ | | \______ \______________
+ # / / | | \ \
+ # "main20[static21;static20];static21[static20;iface21;static20[iface21;iface21[iface20]]]"
+ "$<TARGET_PROPERTY:main20,INTERFACE_LINK_LIBRARIES>" ""
+ )
diff --git a/Tests/CustomTransitiveProperties/CMP0189/check.cmake b/Tests/CustomTransitiveProperties/CMP0189/check.cmake
new file mode 100644
index 0000000..f8e7125
--- /dev/null
+++ b/Tests/CustomTransitiveProperties/CMP0189/check.cmake
@@ -0,0 +1,32 @@
+set(expect [[
+# file\(GENERATE\) produced:
+iface1 LINK_LIBRARIES: ''
+iface1 INTERFACE_LINK_LIBRARIES: ''
+iface2 LINK_LIBRARIES: ''
+iface2 INTERFACE_LINK_LIBRARIES: 'iface1'
+static1 LINK_LIBRARIES: 'iface2;iface1'
+static1 INTERFACE_LINK_LIBRARIES: 'iface2;iface1'
+main LINK_LIBRARIES: 'static1;object1;iface2;iface1;iface2'
+main INTERFACE_LINK_LIBRARIES: ''
+iface10 LINK_LIBRARIES: ''
+iface10 INTERFACE_LINK_LIBRARIES: ''
+iface11 LINK_LIBRARIES: ''
+iface11 INTERFACE_LINK_LIBRARIES: 'iface10'
+static10 LINK_LIBRARIES: 'iface11;iface10'
+static10 INTERFACE_LINK_LIBRARIES: 'iface11;iface10'
+static11 LINK_LIBRARIES: 'static10;iface11;iface11;iface10'
+static11 INTERFACE_LINK_LIBRARIES: 'static10;iface11;iface11;iface10'
+main10 LINK_LIBRARIES: 'static11;static10;static10;iface11;iface11;iface10'
+main10 INTERFACE_LINK_LIBRARIES: ''
+iface20 LINK_LIBRARIES: ''
+iface20 INTERFACE_LINK_LIBRARIES: ''
+iface21 LINK_LIBRARIES: ''
+iface21 INTERFACE_LINK_LIBRARIES: 'iface20'
+static20 LINK_LIBRARIES: 'iface21;iface20'
+static20 INTERFACE_LINK_LIBRARIES: 'iface21;iface20'
+static21 LINK_LIBRARIES: 'static20;iface21;iface21;iface20'
+static21 INTERFACE_LINK_LIBRARIES: 'static20;iface21;iface21;iface20'
+main20 LINK_LIBRARIES: 'static21;static20;static20;iface21;iface21;iface20'
+main20 INTERFACE_LINK_LIBRARIES: ''
+]])
+include(${CMAKE_CURRENT_LIST_DIR}/../check-common.cmake)
diff --git a/Tests/CustomTransitiveProperties/CMakeLists.txt b/Tests/CustomTransitiveProperties/CMakeLists.txt
index a9ac2b8..8d800ea 100644
--- a/Tests/CustomTransitiveProperties/CMakeLists.txt
+++ b/Tests/CustomTransitiveProperties/CMakeLists.txt
@@ -102,6 +102,17 @@
add_executable(main10 main10.c)
target_link_libraries(main10 PRIVATE static11 static10)
+# Test CMP0189 OLD and NEW behavior.
+add_library(iface20 INTERFACE)
+add_library(iface21 INTERFACE)
+target_link_libraries(iface21 INTERFACE iface20)
+add_library(static20 STATIC static20.c)
+target_link_libraries(static20 PRIVATE iface21)
+add_library(static21 STATIC static21.c)
+target_link_libraries(static21 PRIVATE static20 iface21)
+add_executable(main20 main20.c)
+target_link_libraries(main20 PRIVATE static21 static20)
+
# Test TRANSITIVE_*_PROPERTY evaluation outside of usage requirements.
add_executable(check-args check-args.c)
set(out "${CMAKE_CURRENT_BINARY_DIR}/out-$<CONFIG>.txt")
@@ -158,6 +169,16 @@
static11 INTERFACE_LINK_LIBRARIES: '$<TARGET_PROPERTY:static11,INTERFACE_LINK_LIBRARIES>'
main10 LINK_LIBRARIES: '$<TARGET_PROPERTY:main10,LINK_LIBRARIES>'
main10 INTERFACE_LINK_LIBRARIES: '$<TARGET_PROPERTY:main10,INTERFACE_LINK_LIBRARIES>'
+iface20 LINK_LIBRARIES: '$<TARGET_PROPERTY:iface20,LINK_LIBRARIES>'
+iface20 INTERFACE_LINK_LIBRARIES: '$<TARGET_PROPERTY:iface20,INTERFACE_LINK_LIBRARIES>'
+iface21 LINK_LIBRARIES: '$<TARGET_PROPERTY:iface21,LINK_LIBRARIES>'
+iface21 INTERFACE_LINK_LIBRARIES: '$<TARGET_PROPERTY:iface21,INTERFACE_LINK_LIBRARIES>'
+static20 LINK_LIBRARIES: '$<TARGET_PROPERTY:static20,LINK_LIBRARIES>'
+static20 INTERFACE_LINK_LIBRARIES: '$<TARGET_PROPERTY:static20,INTERFACE_LINK_LIBRARIES>'
+static21 LINK_LIBRARIES: '$<TARGET_PROPERTY:static21,LINK_LIBRARIES>'
+static21 INTERFACE_LINK_LIBRARIES: '$<TARGET_PROPERTY:static21,INTERFACE_LINK_LIBRARIES>'
+main20 LINK_LIBRARIES: '$<TARGET_PROPERTY:main20,LINK_LIBRARIES>'
+main20 INTERFACE_LINK_LIBRARIES: '$<TARGET_PROPERTY:main20,INTERFACE_LINK_LIBRARIES>'
]====])
file(GENERATE OUTPUT "${out}" CONTENT "# file(GENERATE) produced:
${in_CUSTOM}
@@ -210,4 +231,17 @@
# / / | | \ \
# "main10[static11;static10];static11[static10;iface11;static10[iface11;iface11[iface10]]]"
"$<TARGET_PROPERTY:main10,INTERFACE_LINK_LIBRARIES>" ""
+ COMMAND check-args
+ "$<TARGET_PROPERTY:iface20,LINK_LIBRARIES>" ""
+ "$<TARGET_PROPERTY:iface20,INTERFACE_LINK_LIBRARIES>" ""
+ "$<TARGET_PROPERTY:iface21,LINK_LIBRARIES>" ""
+ "$<TARGET_PROPERTY:iface21,INTERFACE_LINK_LIBRARIES>" "iface20"
+ "$<TARGET_PROPERTY:static20,LINK_LIBRARIES>" "iface21"
+ "$<TARGET_PROPERTY:static20,INTERFACE_LINK_LIBRARIES>" "$<LINK_ONLY:iface21$<ANGLE-R>"
+ "$<TARGET_PROPERTY:static21,LINK_LIBRARIES>" "static20;iface21"
+ "$<TARGET_PROPERTY:static21,INTERFACE_LINK_LIBRARIES>" "$<LINK_ONLY:static20$<ANGLE-R>;$<LINK_ONLY:iface21$<ANGLE-R>"
+ "$<TARGET_PROPERTY:main20,LINK_LIBRARIES>" "static21;static20"
+ "$<TARGET_PROPERTY:main20,INTERFACE_LINK_LIBRARIES>" ""
)
+
+add_subdirectory(CMP0189)
diff --git a/Tests/CustomTransitiveProperties/check-common.cmake b/Tests/CustomTransitiveProperties/check-common.cmake
new file mode 100644
index 0000000..28ea94f
--- /dev/null
+++ b/Tests/CustomTransitiveProperties/check-common.cmake
@@ -0,0 +1,12 @@
+string(REGEX REPLACE "\r\n" "\n" expect "${expect}")
+string(REGEX REPLACE "\n+$" "" expect "${expect}")
+
+file(READ "${out}" actual)
+string(REGEX REPLACE "\r\n" "\n" actual "${actual}")
+string(REGEX REPLACE "\n+$" "" actual "${actual}")
+
+if(NOT actual MATCHES "^${expect}$")
+ string(REPLACE "\n" "\n expect> " expect " expect> ${expect}")
+ string(REPLACE "\n" "\n actual> " actual " actual> ${actual}")
+ message(FATAL_ERROR "Expected file(GENERATE) output:\n${expect}\ndoes not match actual output:\n${actual}")
+endif()
diff --git a/Tests/CustomTransitiveProperties/check.cmake b/Tests/CustomTransitiveProperties/check.cmake
index 0798542..ffebca1 100644
--- a/Tests/CustomTransitiveProperties/check.cmake
+++ b/Tests/CustomTransitiveProperties/check.cmake
@@ -51,16 +51,15 @@
static11 INTERFACE_LINK_LIBRARIES: 'static10;iface11;iface11;iface10'
main10 LINK_LIBRARIES: 'static11;static10;static10;iface11;iface11;iface10'
main10 INTERFACE_LINK_LIBRARIES: ''
+iface20 LINK_LIBRARIES: ''
+iface20 INTERFACE_LINK_LIBRARIES: ''
+iface21 LINK_LIBRARIES: ''
+iface21 INTERFACE_LINK_LIBRARIES: 'iface20'
+static20 LINK_LIBRARIES: 'iface21'
+static20 INTERFACE_LINK_LIBRARIES: '\$<LINK_ONLY:iface21>'
+static21 LINK_LIBRARIES: 'static20;iface21'
+static21 INTERFACE_LINK_LIBRARIES: '\$<LINK_ONLY:static20>;\$<LINK_ONLY:iface21>'
+main20 LINK_LIBRARIES: 'static21;static20'
+main20 INTERFACE_LINK_LIBRARIES: ''
]])
-string(REGEX REPLACE "\r\n" "\n" expect "${expect}")
-string(REGEX REPLACE "\n+$" "" expect "${expect}")
-
-file(READ "${out}" actual)
-string(REGEX REPLACE "\r\n" "\n" actual "${actual}")
-string(REGEX REPLACE "\n+$" "" actual "${actual}")
-
-if(NOT actual MATCHES "^${expect}$")
- string(REPLACE "\n" "\n expect> " expect " expect> ${expect}")
- string(REPLACE "\n" "\n actual> " actual " actual> ${actual}")
- message(FATAL_ERROR "Expected file(GENERATE) output:\n${expect}\ndoes not match actual output:\n${actual}")
-endif()
+include(${CMAKE_CURRENT_LIST_DIR}/check-common.cmake)
diff --git a/Tests/CustomTransitiveProperties/main20.c b/Tests/CustomTransitiveProperties/main20.c
new file mode 100644
index 0000000..4b7dab5
--- /dev/null
+++ b/Tests/CustomTransitiveProperties/main20.c
@@ -0,0 +1,7 @@
+extern int static20(void);
+extern int static21(void);
+
+int main(void)
+{
+ return static20() + static21();
+}
diff --git a/Tests/CustomTransitiveProperties/static20.c b/Tests/CustomTransitiveProperties/static20.c
new file mode 100644
index 0000000..1718d2f
--- /dev/null
+++ b/Tests/CustomTransitiveProperties/static20.c
@@ -0,0 +1,4 @@
+int static20(void)
+{
+ return 0;
+}
diff --git a/Tests/CustomTransitiveProperties/static21.c b/Tests/CustomTransitiveProperties/static21.c
new file mode 100644
index 0000000..669cdb4
--- /dev/null
+++ b/Tests/CustomTransitiveProperties/static21.c
@@ -0,0 +1,4 @@
+int static21(void)
+{
+ return 0;
+}
diff --git a/Tests/FindBLAS/Test/CMakeLists.txt b/Tests/FindBLAS/Test/CMakeLists.txt
index 3183776..6d9461b 100644
--- a/Tests/FindBLAS/Test/CMakeLists.txt
+++ b/Tests/FindBLAS/Test/CMakeLists.txt
@@ -4,6 +4,9 @@
find_package(BLAS REQUIRED)
+# Configure the test case to match BLAS's integer type ABI.
+# FindBLAS defaults to 32-bit integers if BLA_SIZEOF_INTEGER
+# is not already set in the cache.
if(NOT BLA_SIZEOF_INTEGER)
set(BLA_SIZEOF_INTEGER 4)
endif()
diff --git a/Tests/FindBLAS/add_BLAS_LAPACK_tests.cmake b/Tests/FindBLAS/add_BLAS_LAPACK_tests.cmake
index 42fe386..4fe0426 100644
--- a/Tests/FindBLAS/add_BLAS_LAPACK_tests.cmake
+++ b/Tests/FindBLAS/add_BLAS_LAPACK_tests.cmake
@@ -9,12 +9,13 @@
set(compiler "")
set(model "")
set(static "")
+ set(thread "")
set(sizeof_int_lp64 4)
set(sizeof_int_ilp64 8)
foreach(variant IN LISTS ${var})
- if(variant MATCHES "^(all|compiler|model|static)=(.*)$")
+ if(variant MATCHES "^(all|compiler|model|static|thread)=(.*)$")
set("${CMAKE_MATCH_1}" "${CMAKE_MATCH_2}")
continue()
elseif(variant MATCHES "^([^=]+)=(.*)$")
@@ -39,6 +40,10 @@
string(APPEND variant_name "_Static")
list(APPEND variant_options "-DBLA_STATIC=ON")
endif()
+ if(thread)
+ string(APPEND variant_name "_${thread}")
+ list(APPEND variant_options "-DBLA_THREAD=${thread}")
+ endif()
add_test(NAME Find${package}.Test_${variant_name} COMMAND
${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
--build-and-test
diff --git a/Tests/FindLAPACK/Test/CMakeLists.txt b/Tests/FindLAPACK/Test/CMakeLists.txt
index 55cd1ee..439d026 100644
--- a/Tests/FindLAPACK/Test/CMakeLists.txt
+++ b/Tests/FindLAPACK/Test/CMakeLists.txt
@@ -4,6 +4,9 @@
find_package(LAPACK REQUIRED)
+# Configure the test case to match LAPACK's integer type ABI.
+# FindLAPACK defaults to 32-bit integers if BLA_SIZEOF_INTEGER
+# is not already set in the cache.
if(NOT BLA_SIZEOF_INTEGER)
set(BLA_SIZEOF_INTEGER 4)
endif()
diff --git a/Tests/FindOpenMP/Test/CMakeLists.txt b/Tests/FindOpenMP/Test/CMakeLists.txt
index 7b05372..bf87e62 100644
--- a/Tests/FindOpenMP/Test/CMakeLists.txt
+++ b/Tests/FindOpenMP/Test/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.30)
+cmake_minimum_required(VERSION 4.0)
project(TestFindOpenMP NONE)
include(CTest)
@@ -44,6 +44,19 @@
endif()
endif()
+# FIXME(#26701) Needed to check target offload conditions
+foreach(c C CXX Fortran)
+ if(NOT "${OpenMP_TEST_${c}}")
+ continue()
+ endif()
+ if(CMAKE_${c}_COMPILER_ID MATCHES "^(Cray|CrayClang)$")
+ get_target_property(link_options OpenMP::OpenMP_${c} INTERFACE_LINK_OPTIONS)
+ if(NOT link_options)
+ message(FATAL_ERROR "OpenMP_${c} Interface Link Options not set for Cray Compiler")
+ endif()
+ endif()
+endforeach()
+
foreach(c C CXX CUDA Fortran)
if(NOT "${OpenMP_TEST_${c}}")
continue()
diff --git a/Tests/FindPackageCMakeTest/CMakeLists.txt b/Tests/FindPackageCMakeTest/CMakeLists.txt
index 3e01029..bd1887a 100644
--- a/Tests/FindPackageCMakeTest/CMakeLists.txt
+++ b/Tests/FindPackageCMakeTest/CMakeLists.txt
@@ -554,14 +554,15 @@
##Test FIND_PACKAGE using sorting
set(CMAKE_PREFIX_PATH ${CMAKE_CURRENT_SOURCE_DIR})
-set(SortLib_DIR "" CACHE FILEPATH "Wipe out find results for testing." FORCE)
-SET(CMAKE_FIND_PACKAGE_SORT_ORDER NAME)
-SET(CMAKE_FIND_PACKAGE_SORT_DIRECTION ASC)
-FIND_PACKAGE(SortLib CONFIG)
-IF (NOT "${SortLib_VERSION}" STREQUAL "3.1.1")
- message(SEND_ERROR "FIND_PACKAGE_SORT_ORDER Name Asc! ${SortLib_VERSION}")
-endif()
-unset(SortLib_VERSION)
+foreach(CMAKE_FIND_PACKAGE_SORT_DIRECTION IN ITEMS "" ASC Bogus)
+ set(SortLib_DIR "" CACHE FILEPATH "Wipe out find results for testing." FORCE)
+ SET(CMAKE_FIND_PACKAGE_SORT_ORDER NAME)
+ FIND_PACKAGE(SortLib CONFIG)
+ IF (NOT "${SortLib_VERSION}" STREQUAL "3.1.1")
+ message(SEND_ERROR "FIND_PACKAGE_SORT_ORDER Name Asc! ${SortLib_VERSION}")
+ endif()
+ unset(SortLib_VERSION)
+endforeach()
set(SortLib_DIR "" CACHE FILEPATH "Wipe out find results for testing." FORCE)
diff --git a/Tests/FindPackageCpsTest/CMakeLists.txt b/Tests/FindPackageCpsTest/CMakeLists.txt
index 561d401..8f076ae 100644
--- a/Tests/FindPackageCpsTest/CMakeLists.txt
+++ b/Tests/FindPackageCpsTest/CMakeLists.txt
@@ -80,14 +80,15 @@
###############################################################################
# Test glob sorting.
-set(SortLib_DIR "" CACHE FILEPATH "Wipe out find results for testing." FORCE)
-set(CMAKE_FIND_PACKAGE_SORT_ORDER NAME)
-set(CMAKE_FIND_PACKAGE_SORT_DIRECTION ASC)
-find_package(SortLib CONFIG)
-if(NOT "${SortLib_VERSION}" STREQUAL "3.1.1")
- message(SEND_ERROR "FIND_PACKAGE_SORT_ORDER Name Asc! ${SortLib_VERSION}")
-endif()
-unset(SortLib_VERSION)
+foreach(CMAKE_FIND_PACKAGE_SORT_DIRECTION IN ITEMS "" ASC Bogus)
+ set(SortLib_DIR "" CACHE FILEPATH "Wipe out find results for testing." FORCE)
+ set(CMAKE_FIND_PACKAGE_SORT_ORDER NAME)
+ find_package(SortLib CONFIG)
+ if(NOT "${SortLib_VERSION}" STREQUAL "3.1.1")
+ message(SEND_ERROR "FIND_PACKAGE_SORT_ORDER Name Asc! ${SortLib_VERSION}")
+ endif()
+ unset(SortLib_VERSION)
+endforeach()
set(SortLib_DIR "" CACHE FILEPATH "Wipe out find results for testing." FORCE)
set(CMAKE_FIND_PACKAGE_SORT_ORDER NATURAL)
diff --git a/Tests/FindPython/CMakeLists.txt b/Tests/FindPython/CMakeLists.txt
deleted file mode 100644
index f275013..0000000
--- a/Tests/FindPython/CMakeLists.txt
+++ /dev/null
@@ -1,955 +0,0 @@
-if(CMake_TEST_FindPython2)
- add_test(NAME FindPython.Python2.LOCATION COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/Python2"
- "${CMake_BINARY_DIR}/Tests/FindPython/Python2.LOCATION"
- ${build_generator_args}
- --build-project TestPython2
- --build-options ${build_options} -DPython2_FIND_STRATEGY=LOCATION
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
- add_test(NAME FindPython.Python2.VERSION COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/Python2"
- "${CMake_BINARY_DIR}/Tests/FindPython/Python2.VERSION"
- ${build_generator_args}
- --build-project TestPython2
- --build-options ${build_options} -DPython2_FIND_STRATEGY=VERSION
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
-
- add_test(NAME FindPython.Python2.Development.Module COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/Python2Module"
- "${CMake_BINARY_DIR}/Tests/FindPython/Python2Module"
- ${build_generator_args}
- --build-project TestPython2Module
- --build-options ${build_options}
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
-
- add_test(NAME FindPython.Python2Fail COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/Python2Fail"
- "${CMake_BINARY_DIR}/Tests/FindPython/Python2Fail"
- ${build_generator_args}
- --build-project TestPython2Fail
- --build-options ${build_options}
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
- set_tests_properties(FindPython.Python2Fail PROPERTIES
- PASS_REGULAR_EXPRESSION "Could NOT find Python2 \\(missing: foobar\\)")
-
- add_test(NAME FindPython.Python.V2.LOCATION COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/Python"
- "${CMake_BINARY_DIR}/Tests/FindPython/Python.V2.LOCATION"
- ${build_generator_args}
- --build-project TestPython
- --build-options ${build_options} -DPython_REQUESTED_VERSION=2 -DPython_FIND_STRATEGY=LOCATION
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
- add_test(NAME FindPython.Python.V2.VERSION COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/Python"
- "${CMake_BINARY_DIR}/Tests/FindPython/Python.V2.VERSION"
- ${build_generator_args}
- --build-project TestPython
- --build-options ${build_options} -DPython_REQUESTED_VERSION=2 -DPython_FIND_STRATEGY=VERSION
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
-
- add_test(NAME FindPython.Python2.ExactVersion.LOCATION COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/ExactVersion"
- "${CMake_BINARY_DIR}/Tests/FindPython/Python2.ExactVersion.LOCATION"
- ${build_generator_args}
- --build-project TestExactVersion
- --build-options ${build_options} -DPython_MAJOR_VERSION=2
- -DPython_REQUESTED_VERSION=2.1.2
- -DPython2_FIND_STRATEGY=LOCATION
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
- add_test(NAME FindPython.Python2.ExactVersion.VERSION COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/ExactVersion"
- "${CMake_BINARY_DIR}/Tests/FindPython/Python2.ExactVersion.VERSION"
- ${build_generator_args}
- --build-project TestExactVersion
- --build-options ${build_options} -DPython_MAJOR_VERSION=2
- -DPython_REQUESTED_VERSION=2.1.2
- -DPython2_FIND_STRATEGY=VERSION
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
-
- add_test(NAME FindPython.Python.V2.ExactVersion.LOCATION COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/ExactVersion"
- "${CMake_BINARY_DIR}/Tests/FindPython/Python.V2.ExactVersion.LOCATION"
- ${build_generator_args}
- --build-project TestExactVersion
- --build-options ${build_options} -DPython_REQUESTED_VERSION=2.1.2
- -DPython_FIND_STRATEGY=LOCATION
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
- add_test(NAME FindPython.Python.V2.ExactVersion.VERSION COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/ExactVersion"
- "${CMake_BINARY_DIR}/Tests/FindPython/Python.V2.ExactVersion.VERSION"
- ${build_generator_args}
- --build-project TestExactVersion
- --build-options ${build_options} -DPython_REQUESTED_VERSION=2.1.2
- -DPython_FIND_STRATEGY=VERSION
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
-
- add_test(NAME FindPython.Python2.VersionRange.LOCATION COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/VersionRange"
- "${CMake_BINARY_DIR}/Tests/FindPython/Python2.VersionRange.LOCATION"
- ${build_generator_args}
- --build-project TestVersionRange
- --build-options ${build_options} -DPython=Python2 -DPython_REQUESTED_VERSION=2
- -DPython2_FIND_STRATEGY=LOCATION
- )
- add_test(NAME FindPython.Python2.VersionRange.VERSION COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/VersionRange"
- "${CMake_BINARY_DIR}/Tests/FindPython/Python2.VersionRange.VERSION"
- ${build_generator_args}
- --build-project TestVersionRange
- --build-options ${build_options} -DPython=Python2 -DPython_REQUESTED_VERSION=2
- -DPython2_FIND_STRATEGY=VERSION
- )
- add_test(NAME FindPython.Python.V2.VersionRange.LOCATION COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/VersionRange"
- "${CMake_BINARY_DIR}/Tests/FindPython/Python.V2.VersionRange.LOCATION"
- ${build_generator_args}
- --build-project TestVersionRange
- --build-options ${build_options} -DPython=Python -DPython_REQUESTED_VERSION=2
- -DPython_FIND_STRATEGY=LOCATION
- )
- add_test(NAME FindPython.Python.V2.VersionRange.VERSION COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/VersionRange"
- "${CMake_BINARY_DIR}/Tests/FindPython/Python.V2.VersionRange.VERSION"
- ${build_generator_args}
- --build-project TestVersionRange
- --build-options ${build_options} -DPython=Python -DPython_REQUESTED_VERSION=2
- -DPython_FIND_STRATEGY=VERSION
- )
-
- add_test(NAME FindPython.Python2Embedded COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/Python2Embedded"
- "${CMake_BINARY_DIR}/Tests/FindPython/Python2Embedded"
- ${build_generator_args}
- --build-project TestPython2Embedded
- --build-options ${build_options}
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
-
- set_property(TEST FindPython.Python2.LOCATION FindPython.Python2.VERSION
- FindPython.Python2.Development.Module FindPython.Python2Fail
- FindPython.Python.V2.LOCATION FindPython.Python.V2.VERSION
- FindPython.Python2.ExactVersion.LOCATION FindPython.Python2.ExactVersion.VERSION
- FindPython.Python.V2.ExactVersion.LOCATION FindPython.Python.V2.ExactVersion.VERSION
- FindPython.Python2.VersionRange.LOCATION FindPython.Python2.VersionRange.VERSION
- FindPython.Python.V2.VersionRange.LOCATION FindPython.Python.V2.VersionRange.VERSION
- FindPython.Python2Embedded
- APPEND PROPERTY LABELS Python2)
-endif()
-
-if(CMake_TEST_FindPython3)
- add_test(NAME FindPython.Python3.LOCATION COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/Python3"
- "${CMake_BINARY_DIR}/Tests/FindPython/Python3.LOCATION"
- ${build_generator_args}
- --build-project TestPython3
- --build-options ${build_options} -DPython3_FIND_STRATEGY=LOCATION
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
- add_test(NAME FindPython.Python3.VERSION COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/Python3"
- "${CMake_BINARY_DIR}/Tests/FindPython/Python3.VERSION"
- ${build_generator_args}
- --build-project TestPython3
- --build-options ${build_options} -DPython3_FIND_STRATEGY=VERSION
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
-
- add_test(NAME FindPython.Python3.Development.Module COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/Python3Module"
- "${CMake_BINARY_DIR}/Tests/FindPython/Python3Module"
- ${build_generator_args}
- --build-project TestPython3Module
- --build-options ${build_options}
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
-
- add_test(NAME FindPython.Python3Fail COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/Python3Fail"
- "${CMake_BINARY_DIR}/Tests/FindPython/Python3Fail"
- ${build_generator_args}
- --build-project TestPython3Fail
- --build-options ${build_options}
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
- set_tests_properties(FindPython.Python3Fail PROPERTIES
- PASS_REGULAR_EXPRESSION "Could NOT find Python3 \\(missing: foobar\\)")
-
- add_test(NAME FindPython.Python.V3.LOCATION COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/Python"
- "${CMake_BINARY_DIR}/Tests/FindPython/Python.V3.LOCATION"
- ${build_generator_args}
- --build-project TestPython
- --build-options ${build_options} -DPython_REQUESTED_VERSION=3 -DPython_FIND_STRATEGY=LOCATION
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
- add_test(NAME FindPython.Python.V3.VERSION COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/Python"
- "${CMake_BINARY_DIR}/Tests/FindPython/Python.V3.VERSION"
- ${build_generator_args}
- --build-project TestPython
- --build-options ${build_options} -DPython_REQUESTED_VERSION=3 -DPython_FIND_STRATEGY=VERSION
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
-
- add_test(NAME FindPython.Python3.ExactVersion.LOCATION COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/ExactVersion"
- "${CMake_BINARY_DIR}/Tests/FindPython/Python3.ExactVersion.LOCATION"
- ${build_generator_args}
- --build-project TestExactVersion
- --build-options ${build_options} -DPython_MAJOR_VERSION=3
- -DPython_REQUESTED_VERSION=3.1.2
- -DPython3_FIND_STRATEGY=LOCATION
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
- add_test(NAME FindPython.Python3.ExactVersion.VERSION COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/ExactVersion"
- "${CMake_BINARY_DIR}/Tests/FindPython/Python3.ExactVersion.VERSION"
- ${build_generator_args}
- --build-project TestExactVersion
- --build-options ${build_options} -DPython_MAJOR_VERSION=3
- -DPython_REQUESTED_VERSION=3.1.2
- -DPython3_FIND_STRATEGY=VERSION
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
- add_test(NAME FindPython.Python.V3.ExactVersion.LOCATION COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/ExactVersion"
- "${CMake_BINARY_DIR}/Tests/FindPython/Python.V3.ExactVersion.LOCATION"
- ${build_generator_args}
- --build-project TestExactVersion
- --build-options ${build_options} -DPython_REQUESTED_VERSION=3.1.2
- -DPython_FIND_STRATEGY=LOCATION
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
- add_test(NAME FindPython.Python.V3.ExactVersion.VERSION COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/ExactVersion"
- "${CMake_BINARY_DIR}/Tests/FindPython/Python.V3.ExactVersion.VERSION"
- ${build_generator_args}
- --build-project TestExactVersion
- --build-options ${build_options} -DPython_REQUESTED_VERSION=3.1.2
- -DPython_FIND_STRATEGY=VERSION
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
-
- add_test(NAME FindPython.Python3.VersionRange.LOCATION COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/VersionRange"
- "${CMake_BINARY_DIR}/Tests/FindPython/Python3.VersionRange.LOCATION"
- ${build_generator_args}
- --build-project TestVersionRange
- --build-options ${build_options} -DPython=Python3 -DPython_REQUESTED_VERSION=3
- -DPython3_FIND_STRATEGY=LOCATION
- )
- add_test(NAME FindPython.Python3.VersionRange.VERSION COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/VersionRange"
- "${CMake_BINARY_DIR}/Tests/FindPython/Python3.VersionRange.VERSION"
- ${build_generator_args}
- --build-project TestVersionRange
- --build-options ${build_options} -DPython=Python3 -DPython_REQUESTED_VERSION=3
- -DPython3_FIND_STRATEGY=VERSION
- )
- add_test(NAME FindPython.Python.V3.VersionRange.LOCATION COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/VersionRange"
- "${CMake_BINARY_DIR}/Tests/FindPython/Python.V3.VersionRange.LOCATION"
- ${build_generator_args}
- --build-project TestVersionRange
- --build-options ${build_options} -DPython=Python -DPython_REQUESTED_VERSION=3
- -DPython_FIND_STRATEGY=LOCATION
- )
- add_test(NAME FindPython.Python.V3.VersionRange.VERSION COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/VersionRange"
- "${CMake_BINARY_DIR}/Tests/FindPython/Python.V3.VersionRange.VERSION"
- ${build_generator_args}
- --build-project TestVersionRange
- --build-options ${build_options} -DPython=Python -DPython_REQUESTED_VERSION=3
- -DPython_FIND_STRATEGY=VERSION
- )
-
- add_test(NAME FindPython.VirtualEnv COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/VirtualEnv"
- "${CMake_BINARY_DIR}/Tests/FindPython/VirtualEnv"
- ${build_generator_args}
- --build-project TestVirtualEnv
- --build-options ${build_options}
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
-
- if(NOT CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "4.8")
- add_test(NAME FindPython.Python3Embedded COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/Python3Embedded"
- "${CMake_BINARY_DIR}/Tests/FindPython/Python3Embedded"
- ${build_generator_args}
- --build-project TestPython3Embedded
- --build-options ${build_options}
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
- endif()
-
- add_test(NAME FindPython.RequiredArtifacts COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/RequiredArtifacts"
- "${CMake_BINARY_DIR}/Tests/FindPython/RequiredArtifacts"
- ${build_generator_args}
- --build-project TestRequiredArtifacts
- --build-options ${build_options} "-Dbuild_generator_args=${build_generator_args}"
- "-DCMake_SOURCE_DIR=${CMake_SOURCE_DIR}"
- "-DCMake_BINARY_DIR=${CMake_BINARY_DIR}"
- "-DCMake_TEST_FindPython3_SABIModule=${CMake_TEST_FindPython3_SABIModule}"
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
-
- add_test(NAME FindPython.ArtifactsInteractive.ON COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/ArtifactsInteractive"
- "${CMake_BINARY_DIR}/Tests/FindPython/ArtifactsInteractive.ON"
- ${build_generator_args}
- --build-project TestArtifactsScope
- --build-options ${build_options} "-Dbuild_generator_args=${build_generator_args}"
- "-DCMake_SOURCE_DIR=${CMake_SOURCE_DIR}"
- "-DCMake_BINARY_DIR=${CMake_BINARY_DIR}"
- "-DCMake_TEST_FindPython3_NumPy=${CMake_TEST_FindPython3_NumPy}"
- "-DPython3_ARTIFACTS_INTERACTIVE=ON"
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
- add_test(NAME FindPython.ArtifactsInteractive.OFF COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/ArtifactsInteractive"
- "${CMake_BINARY_DIR}/Tests/FindPython/ArtifactsInteractive.OFF"
- ${build_generator_args}
- --build-project TestArtifactsScope
- --build-options ${build_options} "-Dbuild_generator_args=${build_generator_args}"
- "-DCMake_SOURCE_DIR=${CMake_SOURCE_DIR}"
- "-DCMake_BINARY_DIR=${CMake_BINARY_DIR}"
- "-DCMake_TEST_FindPython3_NumPy=${CMake_TEST_FindPython3_NumPy}"
- "-DPython3_ARTIFACTS_INTERACTIVE=OFF"
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
-
- add_test(NAME FindPython.CustomFailureMessage COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/CustomFailureMessage"
- "${CMake_BINARY_DIR}/Tests/FindPython/CustomFailureMessage"
- ${build_generator_args}
- --build-project TestCustomFailureMessage
- --build-options ${build_options} "-Dbuild_generator_args=${build_generator_args}"
- "-DCMake_SOURCE_DIR=${CMake_SOURCE_DIR}"
- "-DCMake_BINARY_DIR=${CMake_BINARY_DIR}"
- "-DCMake_TEST_FindPython3_NumPy=${CMake_TEST_FindPython3_NumPy}"
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
-
- add_test(NAME FindPython.DifferentComponents COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/DifferentComponents"
- "${CMake_BINARY_DIR}/Tests/FindPython/DifferentComponents"
- ${build_generator_args}
- --build-project DifferentComponents
- --build-options ${build_options} "-Dbuild_generator_args=${build_generator_args}"
- "-DCMake_SOURCE_DIR=${CMake_SOURCE_DIR}"
- "-DCMake_BINARY_DIR=${CMake_BINARY_DIR}"
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
-
- set_property(TEST FindPython.Python3.LOCATION FindPython.Python3.VERSION
- FindPython.Python3.Development.Module FindPython.Python3Fail
- FindPython.Python.V3.LOCATION FindPython.Python.V3.VERSION
- FindPython.Python3.ExactVersion.LOCATION FindPython.Python3.ExactVersion.VERSION
- FindPython.Python.V3.ExactVersion.LOCATION FindPython.Python.V3.ExactVersion.VERSION
- FindPython.Python3.VersionRange.LOCATION FindPython.Python3.VersionRange.VERSION
- FindPython.Python.V3.VersionRange.LOCATION FindPython.Python.V3.VersionRange.VERSION
- FindPython.VirtualEnv FindPython.RequiredArtifacts
- FindPython.ArtifactsInteractive.ON FindPython.ArtifactsInteractive.OFF
- FindPython.CustomFailureMessage FindPython.DifferentComponents
- APPEND PROPERTY LABELS Python3)
- if(TEST FindPython.Python3Embedded)
- set_property(TEST FindPython.Python3Embedded APPEND PROPERTY LABELS Python3)
- endif()
-
- if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
- add_test(NAME FindPython.UnversionedNames COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/UnversionedNames"
- "${CMake_BINARY_DIR}/Tests/FindPython/UnversionedNames"
- ${build_generator_args}
- --build-project UnversionedNames
- --build-options ${build_options}
- )
- set_property(TEST FindPython.UnversionedNames APPEND PROPERTY LABELS Python3)
- endif()
-endif()
-
-if(CMake_TEST_FindPython2 OR CMake_TEST_FindPython3)
- add_test(NAME FindPython.Python.LOCATION COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/Python"
- "${CMake_BINARY_DIR}/Tests/FindPython/Python.LOCATION"
- ${build_generator_args}
- --build-project TestPython
- --build-options ${build_options} -DPython_FIND_STRATEGY=LOCATION
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
- add_test(NAME FindPython.Python.VERSION COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/Python"
- "${CMake_BINARY_DIR}/Tests/FindPython/Python.VERSION"
- ${build_generator_args}
- --build-project TestPython
- --build-options ${build_options} -DPython_FIND_STRATEGY=VERSION
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
-
- if (CMAKE_SYSTEM_NAME MATCHES "Linux|Darwin")
- add_test(NAME FindPython.Interpreter.SOABI COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/SOABI"
- "${CMake_BINARY_DIR}/Tests/FindPython/SOABI.Interpreter"
- ${build_generator_args}
- --build-project TestSOABI
- --build-options ${build_options} "-Dbuild_generator_args=${build_generator_args}"
- "-DCMake_SOURCE_DIR=${CMake_SOURCE_DIR}"
- "-DCMake_BINARY_DIR=${CMake_BINARY_DIR}"
- "-DCMake_TEST_FindPython_COMPONENT=Interpreter"
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
- add_test(NAME FindPython.Development.SOABI COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/SOABI"
- "${CMake_BINARY_DIR}/Tests/FindPython/SOABI.Development"
- ${build_generator_args}
- --build-project TestSOABI
- --build-options ${build_options} "-Dbuild_generator_args=${build_generator_args}"
- "-DCMake_SOURCE_DIR=${CMake_SOURCE_DIR}"
- "-DCMake_BINARY_DIR=${CMake_BINARY_DIR}"
- "-DCMake_TEST_FindPython_COMPONENT=Development"
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
-
- set_property(TEST FindPython.Interpreter.SOABI FindPython.Development.SOABI
- APPEND PROPERTY LABELS Python2 Python3)
- endif()
-
- add_test(NAME FindPython.MultiplePackages COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/MultiplePackages"
- "${CMake_BINARY_DIR}/Tests/FindPython/MultiplePackages"
- ${build_generator_args}
- --build-project TestMultiplePackages
- --build-options ${build_options}
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
-
- set_property(TEST FindPython.Python.LOCATION FindPython.Python.VERSION FindPython.MultiplePackages
- APPEND PROPERTY LABELS Python2 Python3)
-endif()
-
-if(CMake_TEST_FindPython2 AND CMake_TEST_FindPython3)
- add_test(NAME FindPython.ArtifactsPrefix COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/ArtifactsPrefix"
- "${CMake_BINARY_DIR}/Tests/FindPython/ArtifactsPrefix"
- ${build_generator_args}
- --build-project TestArtifactsPrefix
- --build-options ${build_options}
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
-
- set_property(TEST FindPython.ArtifactsPrefix
- APPEND PROPERTY LABELS Python2 Python3)
-endif()
-
-if(CMake_TEST_FindPython2_SABIModule)
- add_test(NAME FindPython.Python2.Development.SABIModule COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/Python2SABIModule"
- "${CMake_BINARY_DIR}/Tests/FindPython/Python2SABIModule"
- ${build_generator_args}
- --build-project TestPython2SABIModule
- --build-options ${build_options}
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
- set_tests_properties(FindPython.Python2.Development.SABIModule PROPERTIES
- PASS_REGULAR_EXPRESSION "Could NOT find Python2 \\(missing: .*Development\\.SABIModule")
- set_property(TEST FindPython.Python2.Development.SABIModule APPEND PROPERTY LABELS Python2)
-endif()
-
-if(CMake_TEST_FindPython3_SABIModule)
- # Use exclusively Release configuration because Debug is, on Windows with MSVC,
- # unusable with SABI: Python force link with debug version of full versioned library rather than
- # the stable ABI one.
- add_test(NAME FindPython.Python3.Development.SABIModule COMMAND
- ${CMAKE_CTEST_COMMAND} -C Release
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/Python3SABIModule"
- "${CMake_BINARY_DIR}/Tests/FindPython/Python3SABIModule"
- ${build_generator_args}
- --build-project TestPython3SABIModule
- --build-options ${build_options}
- --test-command ${CMAKE_CTEST_COMMAND} -V -C Release
- )
- set_property(TEST FindPython.Python3.Development.SABIModule APPEND PROPERTY LABELS Python3)
-endif()
-
-if(CMake_TEST_FindPython2_NumPy OR CMake_TEST_FindPython3_NumPy)
- add_test(NAME FindPython.NumPy COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/NumPy"
- "${CMake_BINARY_DIR}/Tests/FindPython/NumPy"
- ${build_generator_args}
- --build-project TestNumPy
- --build-options ${build_options}
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
- add_test(NAME FindPython.NumPyOnly COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/NumPyOnly"
- "${CMake_BINARY_DIR}/Tests/FindPython/NumPyOnly"
- ${build_generator_args}
- --build-project TestNumPyOnly
- --build-options ${build_options}
- )
-
- set_property(TEST FindPython.NumPy FindPython.NumPyOnly APPEND PROPERTY LABELS Python2 Python3)
-endif()
-
-if(CMake_TEST_FindPython3_Conda)
- add_test(NAME FindPython.VirtualEnvConda COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/VirtualEnvConda"
- "${CMake_BINARY_DIR}/Tests/FindPython/VirtualEnvConda"
- ${build_generator_args}
- --build-project TestVirtualEnvConda
- --build-options ${build_options}
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
- set_property(TEST FindPython.VirtualEnvConda APPEND PROPERTY LABELS Python3)
-endif()
-
-if (CMake_TEST_FindPython2 AND CMake_TEST_FindPython2_IronPython)
- add_test(NAME FindPython.Implementation.CPython2 COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/Implementation"
- "${CMake_BINARY_DIR}/Tests/FindPython/Implementation.CPython2"
- ${build_generator_args}
- --build-project TestImplementationCPython
- --build-options ${build_options} -DPython_REQUESTED_VERSION=2 -DPython_REQUESTED_IMPLEMENTATIONS=CPython
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
- add_test(NAME FindPython.Implementation.IronPython2 COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/Implementation"
- "${CMake_BINARY_DIR}/Tests/FindPython/Implementation.IronPython2"
- ${build_generator_args}
- --build-project TestImplementationIronPython
- --build-options ${build_options} -DPython_REQUESTED_VERSION=2 -DPython_REQUESTED_IMPLEMENTATION=IronPython
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
-
- set_property(TEST FindPython.Implementation.CPython2 FindPython.Implementation.IronPython2
- APPEND PROPERTY LABELS Python2)
-endif()
-
-if (CMake_TEST_FindPython3 AND CMake_TEST_FindPython3_IronPython)
- add_test(NAME FindPython.Implementation.CPython3 COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/Implementation"
- "${CMake_BINARY_DIR}/Tests/FindPython/Implementation.CPython3"
- ${build_generator_args}
- --build-project TestImplementationCPython
- --build-options ${build_options} -DPython_REQUESTED_VERSION=3 -DPython_REQUESTED_IMPLEMENTATIONS=CPython
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
- add_test(NAME FindPython.Implementation.IronPython3 COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/Implementation"
- "${CMake_BINARY_DIR}/Tests/FindPython/Implementation.IronPython3"
- ${build_generator_args}
- --build-project TestImplementationIronPython
- --build-options ${build_options} -DPython_REQUESTED_VERSION=3 -DPython_REQUESTED_IMPLEMENTATION=IronPython
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
-
- set_property(TEST FindPython.Implementation.CPython3 FindPython.Implementation.IronPython3
- APPEND PROPERTY LABELS Python3)
-endif()
-
-if(CMake_TEST_FindPython2_IronPython)
- add_test(NAME FindPython.IronPython2.LOCATION COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/IronPython2"
- "${CMake_BINARY_DIR}/Tests/FindPython/IronPython2.LOCATION"
- ${build_generator_args}
- --build-project TestIronPython2
- --build-options ${build_options} -DPython2_FIND_STRATEGY=LOCATION
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
- add_test(NAME FindPython.IronPython2.VERSION COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/IronPython2"
- "${CMake_BINARY_DIR}/Tests/FindPython/IronPython2.VERSION"
- ${build_generator_args}
- --build-project TestIronPython2
- --build-options ${build_options} -DPython2_FIND_STRATEGY=VERSION
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
-
- add_test(NAME FindPython.IronPython.V2.LOCATION COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/IronPython"
- "${CMake_BINARY_DIR}/Tests/FindPython/IronPython.V2.LOCATION"
- ${build_generator_args}
- --build-project TestIronPython
- --build-options ${build_options} -DPython_REQUESTED_VERSION=2 -DPython_FIND_STRATEGY=LOCATION
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
- add_test(NAME FindPython.IronPython.V2.VERSION COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/IronPython"
- "${CMake_BINARY_DIR}/Tests/FindPython/IronPython.V2.VERSION"
- ${build_generator_args}
- --build-project TestIronPython
- --build-options ${build_options} -DPython_REQUESTED_VERSION=2 -DPython_FIND_STRATEGY=VERSION
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
-
- add_test(NAME FindPython.IronPython2.VersionRange.LOCATION COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/VersionRange"
- "${CMake_BINARY_DIR}/Tests/FindPython/IronPython2.VersionRange.LOCATION"
- ${build_generator_args}
- --build-project TestVersionRange
- --build-options ${build_options} -DPython=Python2 -DPython_REQUESTED_VERSION=2
- -DPython2_FIND_IMPLEMENTATIONS=IronPython
- -DPython2_FIND_STRATEGY=LOCATION
- )
- add_test(NAME FindPython.IronPython2.VersionRange.VERSION COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/VersionRange"
- "${CMake_BINARY_DIR}/Tests/FindPython/IronPython2.VersionRange.VERSION"
- ${build_generator_args}
- --build-project TestVersionRange
- --build-options ${build_options} -DPython=Python2 -DPython_REQUESTED_VERSION=2
- -DPython2_FIND_IMPLEMENTATIONS=IronPython
- -DPython2_FIND_STRATEGY=VERSION
- )
-
- set_property(TEST FindPython.IronPython2.LOCATION FindPython.IronPython2.VERSION
- FindPython.IronPython.V2.LOCATION FindPython.IronPython.V2.VERSION
- FindPython.IronPython2.VersionRange.LOCATION FindPython.IronPython2.VersionRange.VERSION
- APPEND PROPERTY LABELS Python2)
-endif()
-
-if(CMake_TEST_FindPython3_IronPython)
- add_test(NAME FindPython.IronPython3.LOCATION COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/IronPython3"
- "${CMake_BINARY_DIR}/Tests/FindPython/IronPython3.LOCATION"
- ${build_generator_args}
- --build-project TestIronPython3
- --build-options ${build_options} -DPython3_FIND_STRATEGY=LOCATION
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
- add_test(NAME FindPython.IronPython3.VERSION COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/IronPython3"
- "${CMake_BINARY_DIR}/Tests/FindPython/IronPython3.VERSION"
- ${build_generator_args}
- --build-project TestIronPython3
- --build-options ${build_options} -DPython3_FIND_STRATEGY=VERSION
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
-
- add_test(NAME FindPython.IronPython.V3.LOCATION COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/IronPython"
- "${CMake_BINARY_DIR}/Tests/FindPython/IronPython.V3.LOCATION"
- ${build_generator_args}
- --build-project TestIronPython
- --build-options ${build_options} -DPython_REQUESTED_VERSION=3 -DPython_FIND_STRATEGY=LOCATION
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
- add_test(NAME FindPython.IronPython.V3.VERSION COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/IronPython"
- "${CMake_BINARY_DIR}/Tests/FindPython/IronPython.V3.VERSION"
- ${build_generator_args}
- --build-project TestIronPython
- --build-options ${build_options} -DPython_REQUESTED_VERSION=3 -DPython_FIND_STRATEGY=VERSION
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
-
- add_test(NAME FindPython.IronPython3.VersionRange.LOCATION COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/VersionRange"
- "${CMake_BINARY_DIR}/Tests/FindPython/IronPython3.VersionRange.LOCATION"
- ${build_generator_args}
- --build-project TestVersionRange
- --build-options ${build_options} -DPython=Python3 -DPython_REQUESTED_VERSION=3
- -DPython3_FIND_IMPLEMENTATIONS=IronPython
- -DPython3_FIND_STRATEGY=LOCATION
- )
- add_test(NAME FindPython.IronPython3.VersionRange.VERSION COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/VersionRange"
- "${CMake_BINARY_DIR}/Tests/FindPython/IronPython3.VersionRange.VERSION"
- ${build_generator_args}
- --build-project TestVersionRange
- --build-options ${build_options} -DPython=Python3 -DPython_REQUESTED_VERSION=3
- -DPython3_FIND_IMPLEMENTATIONS=IronPython
- -DPython3_FIND_STRATEGY=VERSION
- )
-
- set_property(TEST FindPython.IronPython3.LOCATION FindPython.IronPython3.VERSION
- FindPython.IronPython.V3.LOCATION FindPython.IronPython.V3.VERSION
- FindPython.IronPython3.VersionRange.LOCATION FindPython.IronPython3.VersionRange.VERSION
- APPEND PROPERTY LABELS Python3)
-endif()
-
-if(CMake_TEST_FindPython2_IronPython OR CMake_TEST_FindPython3_IronPython)
- add_test(NAME FindPython.IronPython.LOCATION COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/IronPython"
- "${CMake_BINARY_DIR}/Tests/FindPython/IronPython.LOCATION"
- ${build_generator_args}
- --build-project TestIronPython
- --build-options ${build_options} -DPython_FIND_STRATEGY=LOCATION
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
- add_test(NAME FindPython.IronPython.VERSION COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/IronPython"
- "${CMake_BINARY_DIR}/Tests/FindPython/IronPython.VERSION"
- ${build_generator_args}
- --build-project TestIronPython
- --build-options ${build_options} -DPython_FIND_STRATEGY=VERSION
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
-
- set_property(TEST FindPython.IronPython.LOCATION FindPython.IronPython.VERSION
- APPEND PROPERTY LABELS Python2 Python3)
-endif()
-
-if(CMake_TEST_FindPython2_PyPy)
- add_test(NAME FindPython.PyPy2.LOCATION COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy2"
- "${CMake_BINARY_DIR}/Tests/FindPython/PyPy2.LOCATION"
- ${build_generator_args}
- --build-project TestPyPy2
- --build-options ${build_options} -DPython2_FIND_STRATEGY=LOCATION
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
- add_test(NAME FindPython.PyPy2.VERSION COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy2"
- "${CMake_BINARY_DIR}/Tests/FindPython/PyPy2.VERSION"
- ${build_generator_args}
- --build-project TestPyPy2
- --build-options ${build_options} -DPython2_FIND_STRATEGY=VERSION
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
-
- add_test(NAME FindPython.PyPy.V2.LOCATION COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy"
- "${CMake_BINARY_DIR}/Tests/FindPython/PyPy.V2.LOCATION"
- ${build_generator_args}
- --build-project TestPyPy
- --build-options ${build_options} -DPython_REQUESTED_VERSION=2 -DPython_FIND_STRATEGY=LOCATION
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
- add_test(NAME FindPython.PyPy.V2.VERSION COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy"
- "${CMake_BINARY_DIR}/Tests/FindPython/PyPy.V2.VERSION"
- ${build_generator_args}
- --build-project TestPyPy
- --build-options ${build_options} -DPython_REQUESTED_VERSION=2 -DPython_FIND_STRATEGY=VERSION
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
-
- set_property(TEST FindPython.PyPy2.LOCATION FindPython.PyPy2.VERSION
- FindPython.PyPy.V2.LOCATION FindPython.PyPy.V2.VERSION
- APPEND PROPERTY LABELS Python2)
-endif()
-
-if(CMake_TEST_FindPython3_PyPy)
- add_test(NAME FindPython.PyPy3.LOCATION COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy3"
- "${CMake_BINARY_DIR}/Tests/FindPython/PyPy3.LOCATION"
- ${build_generator_args}
- --build-project TestPyPy3
- --build-options ${build_options} -DPython3_FIND_STRATEGY=LOCATION
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
- add_test(NAME FindPython.PyPy3.VERSION COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy3"
- "${CMake_BINARY_DIR}/Tests/FindPython/PyPy3.VERSION"
- ${build_generator_args}
- --build-project TestPyPy3
- --build-options ${build_options} -DPython3_FIND_STRATEGY=VERSION
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
-
- add_test(NAME FindPython.PyPy.V3.LOCATION COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy"
- "${CMake_BINARY_DIR}/Tests/FindPython/PyPy.V3.LOCATION"
- ${build_generator_args}
- --build-project TestPyPy
- --build-options ${build_options} -DPython_REQUESTED_VERSION=3 -DPython_FIND_STRATEGY=LOCATION
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
- add_test(NAME FindPython.PyPy.V3.VERSION COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy"
- "${CMake_BINARY_DIR}/Tests/FindPython/PyPy.V3.VERSION"
- ${build_generator_args}
- --build-project TestPyPy
- --build-options ${build_options} -DPython_REQUESTED_VERSION=3 -DPython_FIND_STRATEGY=VERSION
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
-
- set_property(TEST FindPython.PyPy3.LOCATION FindPython.PyPy3.VERSION
- FindPython.PyPy.V3.LOCATION FindPython.PyPy.V3.VERSION
- APPEND PROPERTY LABELS Python3)
-endif()
-
-if(CMake_TEST_FindPython2_PyPy OR CMake_TEST_FindPython3_PyPy)
- add_test(NAME FindPython.PyPy.LOCATION COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy"
- "${CMake_BINARY_DIR}/Tests/FindPython/PyPy.LOCATION"
- ${build_generator_args}
- --build-project TestPyPy
- --build-options ${build_options} -DPython_FIND_STRATEGY=LOCATION
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
- add_test(NAME FindPython.PyPy.VERSION COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy"
- "${CMake_BINARY_DIR}/Tests/FindPython/PyPy.VERSION"
- ${build_generator_args}
- --build-project TestPyPy
- --build-options ${build_options} -DPython_FIND_STRATEGY=VERSION
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
-
- set_property(TEST FindPython.PyPy.LOCATION FindPython.PyPy.VERSION
- APPEND PROPERTY LABELS Python2 Python3)
-endif()
diff --git a/Tests/FindPython/CustomFailureMessage/CMakeLists.txt b/Tests/FindPython/CustomFailureMessage/CMakeLists.txt
deleted file mode 100644
index e9d14f5..0000000
--- a/Tests/FindPython/CustomFailureMessage/CMakeLists.txt
+++ /dev/null
@@ -1,79 +0,0 @@
-cmake_minimum_required(VERSION 3.15)
-
-project(TestCustomFailureMessage LANGUAGES NONE)
-
-include(CTest)
-
-add_test(NAME FindPython.CustomFailureMessage.Interpreter COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/CustomFailureMessage/Check"
- "${CMake_BINARY_DIR}/Tests/FindPython/CustomFailureMessage/Interpreter"
- ${build_generator_args}
- --build-project TestCustomFailureMessage.Check
- --build-options "-DCHECK_COMPONENTS=Interpreter"
- "-DPython3_EXECUTABLE=/not/found/interpreter"
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
-set_tests_properties(FindPython.CustomFailureMessage.Interpreter PROPERTIES
- PASS_REGULAR_EXPRESSION "Reason given by package:.+Interpreter: Cannot run the interpreter")
-
-add_test(NAME FindPython.CustomFailureMessage.Library COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/CustomFailureMessage/Check"
- "${CMake_BINARY_DIR}/Tests/FindPython/CustomFailureMessage/Library"
- ${build_generator_args}
- --build-project TestCustomFailureMessage.Check
- --build-options "-DCHECK_COMPONENTS=Development"
- "-DPython3_LIBRARY=/not/found/library"
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
-set_tests_properties(FindPython.CustomFailureMessage.Library PROPERTIES
- PASS_REGULAR_EXPRESSION "Reason given by package:.+Development: Cannot find the library")
-
-add_test(NAME FindPython.CustomFailureMessage.Include COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/CustomFailureMessage/Check"
- "${CMake_BINARY_DIR}/Tests/FindPython/CustomFailureMessage/Include"
- ${build_generator_args}
- --build-project TestCustomFailureMessage.Check
- --build-options "-DCHECK_COMPONENTS=Development"
- "-DPython3_INCLUDE_DIR=/not/found/include"
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
-set_tests_properties(FindPython.CustomFailureMessage.Include PROPERTIES
- PASS_REGULAR_EXPRESSION "Reason given by package:.+Development: Cannot find the directory")
-
-add_test(NAME FindPython.CustomFailureMessage.Multiple COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/CustomFailureMessage/Check"
- "${CMake_BINARY_DIR}/Tests/FindPython/CustomFailureMessage/Multiple"
- ${build_generator_args}
- --build-project TestCustomFailureMessage.Check
- --build-options "-DCHECK_COMPONENTS=Interpreter;Development"
- "-DPython3_EXECUTABLE=/not/found/interpreter"
- "-DPython3_LIBRARY=/not/found/library"
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
-set_tests_properties(FindPython.CustomFailureMessage.Multiple PROPERTIES
- PASS_REGULAR_EXPRESSION "Reason given by package:.+Interpreter: Cannot run the interpreter.+Development: Cannot find the library")
-
-
-if (CMake_TEST_FindPython3_NumPy)
- add_test(NAME FindPython.CustomFailureMessage.NumPy COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/CustomFailureMessage/Check"
- "${CMake_BINARY_DIR}/Tests/FindPython/CustomFailureMessage/NumPy"
- ${build_generator_args}
- --build-project TestCustomFailureMessage.Check
- --build-options "-DCHECK_COMPONENTS=Interpreter;Development;NumPy"
- "-DPython3_NumPy_INCLUDE_DIR=/not/found/numpy/include"
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
- set_tests_properties(FindPython.CustomFailureMessage.NumPy PROPERTIES
- PASS_REGULAR_EXPRESSION "Reason given by package:.+NumPy: Cannot find the directory")
-endif()
diff --git a/Tests/FindPython/CustomFailureMessage/Check/CMakeLists.txt b/Tests/FindPython/CustomFailureMessage/Check/CMakeLists.txt
deleted file mode 100644
index d72d258..0000000
--- a/Tests/FindPython/CustomFailureMessage/Check/CMakeLists.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-cmake_minimum_required(VERSION 3.15)
-
-project(TestCustomFailureMessage.Check LANGUAGES NONE)
-
-find_package (Python3 REQUIRED COMPONENTS ${CHECK_COMPONENTS})
diff --git a/Tests/FindPython/DifferentComponents/CMakeLists.txt b/Tests/FindPython/DifferentComponents/CMakeLists.txt
deleted file mode 100644
index e72b4bf..0000000
--- a/Tests/FindPython/DifferentComponents/CMakeLists.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-cmake_minimum_required(VERSION 3.15)
-
-project(TestDifferentComponents LANGUAGES C)
-
-add_subdirectory(subdir)
-
-find_package(Python3 REQUIRED COMPONENTS Development.Module)
diff --git a/Tests/FindPython/ExactVersion/CMakeLists.txt b/Tests/FindPython/ExactVersion/CMakeLists.txt
deleted file mode 100644
index e3bb43b..0000000
--- a/Tests/FindPython/ExactVersion/CMakeLists.txt
+++ /dev/null
@@ -1,56 +0,0 @@
-cmake_minimum_required(VERSION 3.15)
-
-project(TestExactVersion LANGUAGES C)
-
-find_package(Python${Python_MAJOR_VERSION} ${Python_REQUESTED_VERSION} COMPONENTS Interpreter Development)
-if(NOT Python${Python_MAJOR_VERSION}_FOUND)
- message (FATAL_ERROR "Failed to find Python ${Python_REQUESTED_VERSION}")
-endif()
-if(NOT Python${Python_MAJOR_VERSION}_Interpreter_FOUND)
- message (FATAL_ERROR "Failed to find Python ${Python_REQUESTED_VERSION} Interpreter")
-endif()
-if(NOT Python${Python_MAJOR_VERSION}_Development_FOUND)
- message (FATAL_ERROR "Failed to find Python ${Python_REQUESTED_VERSION} Development")
-endif()
-
-if(NOT TARGET Python${Python_MAJOR_VERSION}::Interpreter)
- message(SEND_ERROR "Python${Python_MAJOR_VERSION}::Interpreter not found")
-endif()
-
-if(NOT TARGET Python${Python_MAJOR_VERSION}::Python)
- message(SEND_ERROR "Python${Python_MAJOR_VERSION}::Python not found")
-endif()
-if(NOT TARGET Python${Python_MAJOR_VERSION}::Module)
- message(SEND_ERROR "Python${Python_MAJOR_VERSION}::Module not found")
-endif()
-
-
-# reset artifacts and second search with exact version already founded
-unset(Python${Python_MAJOR_VERSION}_EXECUTABLE)
-unset(_Python${Python_MAJOR_VERSION}_EXECUTABLE CACHE)
-
-unset(_Python${Python_MAJOR_VERSION}_LIBRARY_RELEASE CACHE)
-unset(_Python${Python_MAJOR_VERSION}_INCLUDE_DIR CACHE)
-
-set(Python_REQUESTED_VERSION ${Python${Python_MAJOR_VERSION}_VERSION})
-find_package(Python${Python_MAJOR_VERSION} ${Python_REQUESTED_VERSION} EXACT COMPONENTS Interpreter Development)
-if(NOT Python${Python_MAJOR_VERSION}_FOUND)
- message (FATAL_ERROR "Failed to find Python ${Python_REQUESTED_VERSION}")
-endif()
-if(NOT Python${Python_MAJOR_VERSION}_Interpreter_FOUND)
- message (FATAL_ERROR "Failed to find Python ${Python_REQUESTED_VERSION} Interpreter")
-endif()
-if(NOT Python${Python_MAJOR_VERSION}_Development_FOUND)
- message (FATAL_ERROR "Failed to find Python ${Python_REQUESTED_VERSION} Development")
-endif()
-
-if(NOT TARGET Python${Python_MAJOR_VERSION}::Interpreter)
- message(SEND_ERROR "Python${Python_MAJOR_VERSION}::Interpreter not found")
-endif()
-
-if(NOT TARGET Python${Python_MAJOR_VERSION}::Python)
- message(SEND_ERROR "Python${Python_MAJOR_VERSION}::Python not found")
-endif()
-if(NOT TARGET Python${Python_MAJOR_VERSION}::Module)
- message(SEND_ERROR "Python${Python_MAJOR_VERSION}::Module not found")
-endif()
diff --git a/Tests/FindPython/IronPython/CMakeLists.txt b/Tests/FindPython/IronPython/CMakeLists.txt
deleted file mode 100644
index 3c28527..0000000
--- a/Tests/FindPython/IronPython/CMakeLists.txt
+++ /dev/null
@@ -1,31 +0,0 @@
-cmake_minimum_required(VERSION 3.15)
-
-project(TestIronPython LANGUAGES NONE)
-
-set (Python_FIND_IMPLEMENTATIONS IronPython)
-
-find_package(Python ${Python_REQUESTED_VERSION} COMPONENTS Interpreter Compiler)
-if (NOT Python_FOUND)
- message (FATAL_ERROR "Failed to find Python ${Python_REQUESTED_VERSION}")
-endif()
-
-if (NOT Python_Interpreter_FOUND)
- message (FATAL_ERROR "Failed to find Python Interpreter")
-endif()
-if (NOT Python_INTERPRETER_ID STREQUAL "IronPython")
- message (FATAL_ERROR "Erroneous interpreter ID (${Python_INTERPRETER_ID})")
-endif()
-
-if (NOT Python_Compiler_FOUND)
- message (FATAL_ERROR "Failed to find Python Compiler")
-endif()
-if (NOT Python_COMPILER_ID STREQUAL "IronPython")
- message (FATAL_ERROR "Erroneous compiler ID (${Python_COMPILER_ID})")
-endif()
-
-if(NOT TARGET Python::Interpreter)
- message(SEND_ERROR "Python::Interpreter not found")
-endif()
-if(NOT TARGET Python::Compiler)
- message(SEND_ERROR "Python::Interpreter not found")
-endif()
diff --git a/Tests/FindPython/IronPython2/CMakeLists.txt b/Tests/FindPython/IronPython2/CMakeLists.txt
deleted file mode 100644
index 0a4dcb4..0000000
--- a/Tests/FindPython/IronPython2/CMakeLists.txt
+++ /dev/null
@@ -1,31 +0,0 @@
-cmake_minimum_required(VERSION 3.15)
-
-project(TestIronPython2 LANGUAGES NONE)
-
-set (Python2_FIND_IMPLEMENTATIONS "IronPython")
-
-find_package(Python2 COMPONENTS Interpreter Compiler)
-if (NOT Python2_FOUND)
- message (FATAL_ERROR "Failed to find Python 2")
-endif()
-
-if (NOT Python2_Interpreter_FOUND)
- message (FATAL_ERROR "Failed to find Python 2 Interpreter")
-endif()
-if (NOT Python2_INTERPRETER_ID STREQUAL "IronPython")
- message (FATAL_ERROR "Erroneous interpreter ID (${Python2_INTERPRETER_ID})")
-endif()
-
-if (NOT Python2_Compiler_FOUND)
- message (FATAL_ERROR "Failed to find Python 2 Compiler")
-endif()
-if (NOT Python2_COMPILER_ID STREQUAL "IronPython")
- message (FATAL_ERROR "Erroneous compiler ID (${Python2_COMPILER_ID})")
-endif()
-
-if(NOT TARGET Python2::Interpreter)
- message(SEND_ERROR "Python2::Interpreter not found")
-endif()
-if(NOT TARGET Python2::Compiler)
- message(SEND_ERROR "Python2::Compiler not found")
-endif()
diff --git a/Tests/FindPython/IronPython3/CMakeLists.txt b/Tests/FindPython/IronPython3/CMakeLists.txt
deleted file mode 100644
index f39b84d..0000000
--- a/Tests/FindPython/IronPython3/CMakeLists.txt
+++ /dev/null
@@ -1,31 +0,0 @@
-cmake_minimum_required(VERSION 3.15)
-
-project(TestIronPython3 LANGUAGES NONE)
-
-set (Python3_FIND_IMPLEMENTATIONS "IronPython")
-
-find_package(Python3 COMPONENTS Interpreter Compiler)
-if (NOT Python3_FOUND)
- message (FATAL_ERROR "Failed to find Python 3")
-endif()
-
-if (NOT Python3_Interpreter_FOUND)
- message (FATAL_ERROR "Failed to find Python 3 Interpreter")
-endif()
-if (NOT Python3_INTERPRETER_ID STREQUAL "IronPython")
- message (FATAL_ERROR "Erroneous interpreter ID (${Python3_INTERPRETER_ID})")
-endif()
-
-if (NOT Python3_Compiler_FOUND)
- message (FATAL_ERROR "Failed to find Python 3 Compiler")
-endif()
-if (NOT Python3_COMPILER_ID STREQUAL "IronPython")
- message (FATAL_ERROR "Erroneous compiler ID (${Python3_COMPILER_ID})")
-endif()
-
-if(NOT TARGET Python3::Interpreter)
- message(SEND_ERROR "Python3::Interpreter not found")
-endif()
-if(NOT TARGET Python3::Compiler)
- message(SEND_ERROR "Python3::Compiler not found")
-endif()
diff --git a/Tests/FindPython/NumPyOnly/CMakeLists.txt b/Tests/FindPython/NumPyOnly/CMakeLists.txt
deleted file mode 100644
index db7e68e..0000000
--- a/Tests/FindPython/NumPyOnly/CMakeLists.txt
+++ /dev/null
@@ -1,24 +0,0 @@
-cmake_minimum_required(VERSION 3.15)
-
-project(TestNumPyOnly LANGUAGES C)
-
-if(CMake_TEST_FindPython2_NumPy)
-
- find_package(Python2 REQUIRED COMPONENTS NumPy)
-
- Python2_add_library (arraytest2 MODULE ../NumPy/arraytest.c)
- target_compile_definitions (arraytest2 PRIVATE PYTHON2)
- target_link_libraries (arraytest2 PRIVATE Python2::NumPy)
-
-endif()
-
-
-if(CMake_TEST_FindPython3_NumPy)
-
-find_package(Python3 REQUIRED COMPONENTS NumPy)
-
-Python3_add_library (arraytest3 MODULE ../NumPy/arraytest.c)
-target_compile_definitions (arraytest3 PRIVATE PYTHON3)
-target_link_libraries (arraytest3 PRIVATE Python3::NumPy)
-
-endif()
diff --git a/Tests/FindPython/PyPy/CMakeLists.txt b/Tests/FindPython/PyPy/CMakeLists.txt
deleted file mode 100644
index 2e8bc58..0000000
--- a/Tests/FindPython/PyPy/CMakeLists.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-cmake_minimum_required(VERSION 3.15)
-
-project(TestPyPy LANGUAGES C)
-
-set (Python_FIND_IMPLEMENTATIONS PyPy)
-
-find_package(Python ${Python_REQUESTED_VERSION} COMPONENTS Interpreter Development)
-if (NOT Python_FOUND)
- message (FATAL_ERROR "Failed to find Python PyPy ${Python_REQUESTED_VERSION}")
-endif()
-
-if (NOT Python_Interpreter_FOUND)
- message (FATAL_ERROR "Failed to find Python PyPy Interpreter")
-endif()
-if (NOT Python_INTERPRETER_ID STREQUAL "PyPy")
- message (FATAL_ERROR "Erroneous interpreter ID (${Python_INTERPRETER_ID})")
-endif()
-
-if (NOT Python_Development.Module_FOUND)
- message (FATAL_ERROR "Failed to find Python PyPy ${Python_REQUESTED_VERSION} Development.Module")
-endif()
-if (NOT Python_Development.Embed_FOUND)
- message (FATAL_ERROR "Failed to find Python PyPy ${Python_REQUESTED_VERSION} Development.Embed")
-endif()
-if (NOT Python_Development_FOUND)
- message (FATAL_ERROR "Failed to find Python PyPy ${Python_REQUESTED_VERSION} Development")
-endif()
-
-if(NOT TARGET Python::Interpreter)
- message(SEND_ERROR "Python::Interpreter not found")
-endif()
-if(NOT TARGET Python::Module)
- message(SEND_ERROR "Python::Module not found")
-endif()
-if(NOT TARGET Python::Python)
- message(SEND_ERROR "Python::Python not found")
-endif()
diff --git a/Tests/FindPython/PyPy2/CMakeLists.txt b/Tests/FindPython/PyPy2/CMakeLists.txt
deleted file mode 100644
index 2d89531..0000000
--- a/Tests/FindPython/PyPy2/CMakeLists.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-cmake_minimum_required(VERSION 3.15)
-
-project(TestPyPy2 LANGUAGES C)
-
-set (Python2_FIND_IMPLEMENTATIONS "PyPy")
-
-find_package(Python2 COMPONENTS Interpreter Development)
-if (NOT Python2_FOUND)
- message (FATAL_ERROR "Failed to find Python PyPy 2")
-endif()
-
-if (NOT Python2_Interpreter_FOUND)
- message (FATAL_ERROR "Failed to find Python PyPy 2 Interpreter")
-endif()
-if (NOT Python2_INTERPRETER_ID STREQUAL "PyPy")
- message (FATAL_ERROR "Erroneous interpreter ID (${Python2_INTERPRETER_ID})")
-endif()
-
-if (NOT Python2_Development.Module_FOUND)
- message (FATAL_ERROR "Failed to find Python PyPy 2 Development.Module")
-endif()
-if (NOT Python2_Development.Embed_FOUND)
- message (FATAL_ERROR "Failed to find Python PyPy 2 Development.Embed")
-endif()
-if (NOT Python2_Development_FOUND)
- message (FATAL_ERROR "Failed to find Python PyPy 2 Development")
-endif()
-
-if(NOT TARGET Python2::Interpreter)
- message(SEND_ERROR "Python2::Interpreter not found")
-endif()
-if(NOT TARGET Python2::Module)
- message(SEND_ERROR "Python2::Module not found")
-endif()
-if(NOT TARGET Python2::Python)
- message(SEND_ERROR "Python2::Python not found")
-endif()
diff --git a/Tests/FindPython/PyPy3/CMakeLists.txt b/Tests/FindPython/PyPy3/CMakeLists.txt
deleted file mode 100644
index 93388a0..0000000
--- a/Tests/FindPython/PyPy3/CMakeLists.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-cmake_minimum_required(VERSION 3.15)
-
-project(TestPyPy3 LANGUAGES C)
-
-set (Python3_FIND_IMPLEMENTATIONS "PyPy")
-
-find_package(Python3 COMPONENTS Interpreter Development)
-if (NOT Python3_FOUND)
- message (FATAL_ERROR "Failed to find Python PyPy 3")
-endif()
-
-if (NOT Python3_Interpreter_FOUND)
- message (FATAL_ERROR "Failed to find Python PyPy 3 Interpreter")
-endif()
-if (NOT Python3_INTERPRETER_ID STREQUAL "PyPy")
- message (FATAL_ERROR "Erroneous interpreter ID (${Python3_INTERPRETER_ID})")
-endif()
-
-if (NOT Python3_Development.Module_FOUND)
- message (FATAL_ERROR "Failed to find Python PyPy 3 Development.Module")
-endif()
-if (NOT Python3_Development.Embed_FOUND)
- message (FATAL_ERROR "Failed to find Python PyPy 3 Development.Embed")
-endif()
-if (NOT Python3_Development_FOUND)
- message (FATAL_ERROR "Failed to find Python PyPy 3 Development")
-endif()
-
-if(NOT TARGET Python3::Interpreter)
- message(SEND_ERROR "Python3::Interpreter not found")
-endif()
-if(NOT TARGET Python3::Module)
- message(SEND_ERROR "Python3::Module not found")
-endif()
-if(NOT TARGET Python3::Python)
- message(SEND_ERROR "Python3::Python not found")
-endif()
diff --git a/Tests/FindPython/Python2Fail/CMakeLists.txt b/Tests/FindPython/Python2Fail/CMakeLists.txt
deleted file mode 100644
index 7f7b906..0000000
--- a/Tests/FindPython/Python2Fail/CMakeLists.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-cmake_minimum_required(VERSION 3.15)
-
-project(TestPython2Fail C)
-
-include(CTest)
-
-find_package(Python2 REQUIRED COMPONENTS Interpreter Development foobar)
-
-Python2_add_library (spam2 MODULE ../spam.c)
-target_compile_definitions (spam2 PRIVATE PYTHON2)
-
-add_test (NAME python2_spam2
- COMMAND "${CMAKE_COMMAND}" -E env "PYTHONPATH=$<TARGET_FILE_DIR:spam2>"
- "${Python2_EXECUTABLE}" -c "import spam2; spam2.system(\"cd\")")
diff --git a/Tests/FindPython/Python2SABIModule/CMakeLists.txt b/Tests/FindPython/Python2SABIModule/CMakeLists.txt
deleted file mode 100644
index c43dedc..0000000
--- a/Tests/FindPython/Python2SABIModule/CMakeLists.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-cmake_minimum_required(VERSION 3.15)
-
-project(TestPython2SABIModule LANGUAGES C)
-
-find_package(Python2 REQUIRED COMPONENTS Interpreter Development.Module Development.SABIModule)
diff --git a/Tests/FindPython/Python3/CMakeLists.txt b/Tests/FindPython/Python3/CMakeLists.txt
deleted file mode 100644
index bac6ed5..0000000
--- a/Tests/FindPython/Python3/CMakeLists.txt
+++ /dev/null
@@ -1,145 +0,0 @@
-cmake_minimum_required(VERSION 3.15)
-
-project(TestPython3 LANGUAGES C)
-
-include(CTest)
-
-find_package(Python3 2 QUIET)
-if (Python3_FOUND)
- message (FATAL_ERROR "Wrong python version found: ${Python3_VERSION}")
-endif()
-
-find_package(Python3 REQUIRED COMPONENTS Interpreter Development)
-if (NOT Python3_FOUND)
- message (FATAL_ERROR "Failed to find Python 3")
-endif()
-if (NOT Python3_Development_FOUND)
- message (FATAL_ERROR "Failed to find Python 3 'Development' component")
-endif()
-if (NOT Python3_Development.Module_FOUND)
- message (FATAL_ERROR "Failed to find Python 3 'Development.Module' component")
-endif()
-if (NOT Python3_Development.Embed_FOUND)
- message (FATAL_ERROR "Failed to find Python 3 'Development.Embed' component")
-endif()
-
-if(NOT TARGET Python3::Interpreter)
- message(SEND_ERROR "Python3::Interpreter not found")
-endif()
-
-if(NOT TARGET Python3::Python)
- message(SEND_ERROR "Python3::Python not found")
-endif()
-if(NOT TARGET Python3::Module)
- message(SEND_ERROR "Python3::Module not found")
-endif()
-
-Python3_add_library (spam3 MODULE ../spam.c)
-target_compile_definitions (spam3 PRIVATE PYTHON3)
-
-add_test (NAME python3_spam3
- COMMAND "${CMAKE_COMMAND}" -E env "PYTHONPATH=$<TARGET_FILE_DIR:spam3>"
- "${Python3_INTERPRETER}" -c "import spam3; spam3.system(\"cd\")")
-
-add_test(NAME findpython3_script
- COMMAND "${CMAKE_COMMAND}" -DPYTHON_PACKAGE_NAME=Python3
- -DPython3_FIND_STRATEGY=${Python3_FIND_STRATEGY}
- -P "${CMAKE_CURRENT_LIST_DIR}/../FindPythonScript.cmake")
-
-
-## Try a new search specifying only expected ABI
-# retrieve ABI of python interpreter
-execute_process (COMMAND "${Python3_EXECUTABLE}" -c
- "import sys; sys.stdout.write(sys.abiflags)"
- RESULT_VARIABLE result
- OUTPUT_VARIABLE abi
- ERROR_QUIET
- OUTPUT_STRIP_TRAILING_WHITESPACE)
-if (result)
- # assume ABI is not supported
- set (abi "")
-endif()
-
-# define FIND_ABI variable
-if (abi MATCHES "d")
- set (Python3_VALID_ABI "ON")
-else()
- set (Python3_VALID_ABI "OFF")
-endif()
-if (abi MATCHES "m")
- list (APPEND Python3_VALID_ABI "ON")
-else()
- list (APPEND Python3_VALID_ABI "OFF")
-endif()
-if (abi MATCHES "u")
- list (APPEND Python3_VALID_ABI "ON")
-else()
- list (APPEND Python3_VALID_ABI "OFF")
-endif()
-if (abi MATCHES "t")
- list (APPEND Python3_VALID_ABI "ON")
-else()
- list (APPEND Python3_VALID_ABI "OFF")
-endif()
-# build an invalid pattern for ABI
-set (Python3_INVALID_ABI)
-foreach (abi IN LISTS Python3_VALID_ABI)
- if (abi)
- list (APPEND Python3_INVALID_ABI "OFF")
- else()
- list (APPEND Python3_INVALID_ABI "ON")
- endif()
-endforeach()
-
-add_test(NAME python3_find_valid_abi
- COMMAND "${CMAKE_COMMAND}" -DPYTHON_PACKAGE_NAME=Python3
- -DPython3_FIND_STRATEGY=${Python3_FIND_STRATEGY}
- "-DPython3_FIND_ABI=${Python3_VALID_ABI}"
- -P "${CMAKE_CURRENT_LIST_DIR}/../FindPythonScript.cmake")
-add_test(NAME python3_find_invalid_abi
- COMMAND "${CMAKE_COMMAND}" -DPYTHON_PACKAGE_NAME=Python3
- -DPYTHON_MUST_NOT_BE_FOUND=ON
- -DPython3_FIND_STRATEGY=${Python3_FIND_STRATEGY}
- "-DPython3_FIND_ABI=${Python3_INVALID_ABI}"
- -P "${CMAKE_CURRENT_LIST_DIR}/../FindPythonScript.cmake")
-
-
-#
-# New search with user's prefix
-#
-foreach(item IN ITEMS FOUND Development_FOUND Development.Module_FOUND Development.Embed_FOUND)
- unset(Python3_${item})
-endforeach()
-
-set(Python3_ARTIFACTS_PREFIX "_TEST")
-find_package(Python3 REQUIRED COMPONENTS Interpreter Development)
-if (NOT Python3_TEST_FOUND OR NOT Python3_FOUND)
- message (FATAL_ERROR "Failed to find Python 3 (TEST prefix)")
-endif()
-if (NOT Python3_TEST_Development_FOUND OR NOT Python3_Development_FOUND)
- message (FATAL_ERROR "Failed to find Python 3 'Development' component (TEST prefix)")
-endif()
-if (NOT Python3_TEST_Development.Module_FOUND OR NOT Python3_Development.Module_FOUND)
- message (FATAL_ERROR "Failed to find Python 3 'Development.Module' component (TEST prefix)")
-endif()
-if (NOT Python3_TEST_Development.Embed_FOUND OR NOT Python3_Development.Embed_FOUND)
- message (FATAL_ERROR "Failed to find Python 3 'Development.Embed' component (TEST prefix)")
-endif()
-
-if(NOT TARGET Python3_TEST::Interpreter)
- message(SEND_ERROR "Python3_TEST::Interpreter not found")
-endif()
-
-if(NOT TARGET Python3_TEST::Python)
- message(SEND_ERROR "Python3_TEST::Python not found")
-endif()
-if(NOT TARGET Python3_TEST::Module)
- message(SEND_ERROR "Python3_TEST::Module not found")
-endif()
-
-Python3_TEST_add_library (TEST_spam3 MODULE ../TEST_spam.c)
-target_compile_definitions (TEST_spam3 PRIVATE PYTHON3)
-
-add_test (NAME python3_TEST_spam3
- COMMAND "${CMAKE_COMMAND}" -E env "PYTHONPATH=$<TARGET_FILE_DIR:TEST_spam3>"
- "${Python3_TEST_INTERPRETER}" -c "import TEST_spam3; TEST_spam3.system(\"cd\")")
diff --git a/Tests/FindPython/Python3Fail/CMakeLists.txt b/Tests/FindPython/Python3Fail/CMakeLists.txt
deleted file mode 100644
index 810375b..0000000
--- a/Tests/FindPython/Python3Fail/CMakeLists.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-cmake_minimum_required(VERSION 3.15)
-
-project(TestPython3Fail C)
-
-include(CTest)
-
-find_package(Python3 REQUIRED COMPONENTS Interpreter Development foobar)
-
-Python3_add_library (spam3 MODULE ../spam.c)
-target_compile_definitions (spam3 PRIVATE PYTHON3)
-
-add_test (NAME python3_spam3
- COMMAND "${CMAKE_COMMAND}" -E env "PYTHONPATH=$<TARGET_FILE_DIR:spam3>"
- "${Python3_EXECUTABLE}" -c "import spam3; spam3.system(\"cd\")")
diff --git a/Tests/FindPython/RequiredArtifacts/CMakeLists.txt b/Tests/FindPython/RequiredArtifacts/CMakeLists.txt
deleted file mode 100644
index 8be39bf..0000000
--- a/Tests/FindPython/RequiredArtifacts/CMakeLists.txt
+++ /dev/null
@@ -1,196 +0,0 @@
-cmake_minimum_required(VERSION 3.15)
-
-project(TestRequiredArtifacts LANGUAGES C)
-
-include(CTest)
-
-if(CMake_TEST_FindPython2)
- find_package(Python2 REQUIRED COMPONENTS Interpreter Development)
- if (NOT Python2_FOUND)
- message (FATAL_ERROR "Failed to find Python 2")
- endif()
- set(USER_LIBRARY "${Python2_LIBRARY_RELEASE}")
- set(USER_INCLUDE_DIR "${Python2_INCLUDE_DIRS}")
-else()
- set(USER_LIBRARY "/path/to/invalid${CMAKE_C_LINK_LIBRARY_SUFFIX}")
- set(USER_INCLUDE_DIR "/path/to/invalid/dir")
-endif()
-
-# check some combinations for modules search without interpreter
-block(SCOPE_FOR VARIABLES)
- find_package(Python3 REQUIRED COMPONENTS Development.SABIModule)
- if (NOT Python3_FOUND)
- message (FATAL_ERROR "Failed to find Python 3")
- endif()
- if (Python3_Development_FOUND)
- message (FATAL_ERROR "Python 3, COMPONENT 'Development' unexpectedly found")
- endif()
- if (Python3_Interpreter_FOUND)
- message (FATAL_ERROR "Python 3, COMPONENT 'Interpreter' unexpectedly found")
- endif()
- if (Python3_Development.Embed_FOUND)
- message (FATAL_ERROR "Python 3, COMPONENT 'Development.Embed' unexpectedly found")
- endif()
- if (Python3_Development.Module_FOUND)
- message (FATAL_ERROR "Python 3, COMPONENT 'Development.Module' unexpectedly found")
- endif()
- if (NOT Python3_Development.SABIModule_FOUND)
- message (FATAL_ERROR "Python 3, COMPONENT 'Development.SABIModule' not found")
- endif()
- unset(_Python3_SABI_LIBRARY_RELEASE CACHE)
-endblock()
-
-block(SCOPE_FOR VARIABLES)
- find_package(Python3 REQUIRED COMPONENTS Development.Module Development.SABIModule)
- if (NOT Python3_FOUND)
- message (FATAL_ERROR "Failed to find Python 3")
- endif()
- if (Python3_Development_FOUND)
- message (FATAL_ERROR "Python 3, COMPONENT 'Development' unexpectedly found")
- endif()
- if (Python3_Interpreter_FOUND)
- message (FATAL_ERROR "Python 3, COMPONENT 'Interpreter' unexpectedly found")
- endif()
- if (Python3_Development.Embed_FOUND)
- message (FATAL_ERROR "Python 3, COMPONENT 'Development.Embed' unexpectedly found")
- endif()
- if (NOT Python3_Development.Module_FOUND)
- message (FATAL_ERROR "Python 3, COMPONENT 'Development.Module' not found")
- endif()
- if (NOT Python3_Development.SABIModule_FOUND)
- message (FATAL_ERROR "Python 3, COMPONENT 'Development.SABIModule' not found")
- endif()
- unset(_Python3_LIBRARY_RELEASE CACHE)
- unset(_Python3_SABI_LIBRARY_RELEASE CACHE)
-endblock()
-
-
-set(components Interpreter Development)
-if (CMake_TEST_FindPython3_SABIModule AND WIN32)
- list (APPEND components Development.SABIModule)
-endif()
-find_package(Python3 REQUIRED COMPONENTS ${components})
-if (NOT Python3_FOUND)
- message (FATAL_ERROR "Failed to find Python 3")
-endif()
-
-
-add_test(NAME FindPython.RequiredArtifacts.Interpreter.VALID COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/RequiredArtifacts/Check"
- "${CMake_BINARY_DIR}/Tests/FindPython/RequiredArtifacts/Interpreter.VALID"
- ${build_generator_args}
- --build-project TestRequiredArtifacts.Check
- --build-options -DPYTHON_IS_FOUND=TRUE -DCHECK_INTERPRETER=ON
- "-DPython3_EXECUTABLE=${Python3_EXECUTABLE}"
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
-add_test(NAME FindPython.RequiredArtifacts.Interpreter.INVALID COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/RequiredArtifacts/Check"
- "${CMake_BINARY_DIR}/Tests/FindPython/RequiredArtifacts/Interpreter.INVALID"
- ${build_generator_args}
- --build-project TestRequiredArtifacts.Check
- --build-options -DPYTHON_IS_FOUND=FALSE -DCHECK_INTERPRETER=ON
- "-DPython3_EXECUTABLE=${Python3_EXECUTABLE}-bad${CMAKE_EXECUTABLE_SUFFIX}"
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
-
-add_test(NAME FindPython.RequiredArtifacts.Library.VALID COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/RequiredArtifacts/Check"
- "${CMake_BINARY_DIR}/Tests/FindPython/RequiredArtifacts/Library.VALID"
- ${build_generator_args}
- --build-project TestRequiredArtifacts.Check
- --build-options -DPYTHON_IS_FOUND=TRUE -DCHECK_LIBRARY=ON
- "-DPython3_LIBRARY=${Python3_LIBRARY_RELEASE}"
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
-add_test(NAME FindPython.RequiredArtifacts.Library.INVALID COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/RequiredArtifacts/Check"
- "${CMake_BINARY_DIR}/Tests/FindPython/RequiredArtifacts/Library.INVALID"
- ${build_generator_args}
- --build-project TestRequiredArtifacts.Check
- --build-options -DPYTHON_IS_FOUND=FALSE -DCHECK_LIBRARY=ON
- "-DPython3_LIBRARY=${USER_LIBRARY}"
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
-
-add_test(NAME FindPython.RequiredArtifacts.Include.VALID COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/RequiredArtifacts/Check"
- "${CMake_BINARY_DIR}/Tests/FindPython/RequiredArtifacts/Include.VALID"
- ${build_generator_args}
- --build-project TestRequiredArtifacts.Check
- --build-options -DPYTHON_IS_FOUND=TRUE -DCHECK_INCLUDE=ON
- "-DPython3_INCLUDE_DIR=${Python3_INCLUDE_DIRS}"
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
-add_test(NAME FindPython.RequiredArtifacts.Include.INVALID COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/RequiredArtifacts/Check"
- "${CMake_BINARY_DIR}/Tests/FindPython/RequiredArtifacts/Include.INVALID"
- ${build_generator_args}
- --build-project TestRequiredArtifacts.Check
- --build-options -DPYTHON_IS_FOUND=FALSE -DCHECK_INCLUDE=ON
- "-DPython3_INCLUDE_DIR=${USER_INCLUDE_DIR}"
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
-
-add_test(NAME FindPython.RequiredArtifacts.Interpreter-Library.INVALID COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/RequiredArtifacts/Check"
- "${CMake_BINARY_DIR}/Tests/FindPython/RequiredArtifacts/Interpreter-Library.INVALID"
- ${build_generator_args}
- --build-project TestRequiredArtifacts.Check
- --build-options -DPYTHON_IS_FOUND=FALSE -DCHECK_INTERPRETER=ON -DCHECK_LIBRARY=ON
- "-DPython3_EXECUTABLE=${Python3_EXECUTABLE}"
- "-DPython3_LIBRARY=${USER_LIBRARY}"
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
-
-add_test(NAME FindPython.RequiredArtifacts.Library-Include.INVALID COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/RequiredArtifacts/Check"
- "${CMake_BINARY_DIR}/Tests/FindPython/RequiredArtifacts/Library-Include.INVALID"
- ${build_generator_args}
- --build-project TestRequiredArtifacts.Check
- --build-options -DPYTHON_IS_FOUND=FALSE -DCHECK_LIBRARY=ON -DCHECK_INCLUDE=ON
- "-DPython3_LIBRARY=${Python3_LIBRARY_RELEASE}"
- "-DPython3_INCLUDE_DIR=${USER_INCLUDE_DIR}"
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
-
-if (CMake_TEST_FindPython3_SABIModule AND WIN32)
- add_test(NAME FindPython.RequiredArtifacts.SABILibrary.VALID COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/RequiredArtifacts/Check"
- "${CMake_BINARY_DIR}/Tests/FindPython/RequiredArtifacts/SABILibrary.VALID"
- ${build_generator_args}
- --build-project TestRequiredArtifacts.Check
- --build-options -DPYTHON_IS_FOUND=TRUE -DCHECK_SABI_LIBRARY=ON
- "-DPython3_SABI_LIBRARY=${Python3_SABI_LIBRARY_RELEASE}"
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
- add_test(NAME FindPython.RequiredArtifacts.SABILibrary.INVALID COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/RequiredArtifacts/Check"
- "${CMake_BINARY_DIR}/Tests/FindPython/RequiredArtifacts/SABILibrary.INVALID"
- ${build_generator_args}
- --build-project TestRequiredArtifacts.Check
- --build-options -DPYTHON_IS_FOUND=FALSE -DCHECK_SABI_LIBRARY=ON
- "-DPython3_SABI_LIBRARY=${USER_LIBRARY}"
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
-endif()
diff --git a/Tests/FindPython/VersionRange/CMakeLists.txt b/Tests/FindPython/VersionRange/CMakeLists.txt
deleted file mode 100644
index 957941d..0000000
--- a/Tests/FindPython/VersionRange/CMakeLists.txt
+++ /dev/null
@@ -1,64 +0,0 @@
-cmake_minimum_required (VERSION 3.18...3.19)
-
-project (TestVersionRange LANGUAGES C)
-
-
-find_package (${Python} ${Python_REQUESTED_VERSION} EXACT COMPONENTS Interpreter)
-if (NOT ${Python}_FOUND)
- message (FATAL_ERROR "Failed to find ${Python} ${Python_REQUESTED_VERSION}")
-endif()
-
-if (Python_REQUESTED_VERSION VERSION_LESS 3.0)
- set (IN_VERSION_RANGE 2.0...<3.0)
- set (OUT_VERSION_RANGE 2.0...<${${Python}_VERSION})
-else()
- set (IN_VERSION_RANGE 3.0...<4.0)
- set (OUT_VERSION_RANGE 3.0...<${${Python}_VERSION})
-endif()
-
-function (FIND_PYTHON EXPECTED_VERSION RANGE)
- macro (FIND_PYTHON_PACKAGE)
- unset (_${Python}_EXECUTABLE CACHE)
- unset (_${Python}_LIBRARY_RELEASE CACHE)
- unset (_${Python}_INCLUDE_DIR CACHE)
- unset (${Python}_FOUND)
-
- find_package (${Python} ${ARGV})
- endmacro()
-
- find_python_package(${RANGE} ${ARGN})
-
- if (EXPECTED_VERSION STREQUAL "NONE")
- while (${Python}_FOUND AND ${Python}_VERSION VERSION_GREATER ${Python_REQUESTED_VERSION})
- # Possible if multiple versions are installed
- # Try with a different range
- find_python_package(${Python_REQUESTED_VERSION}.0...<${${Python}_VERSION} ${ARGN})
- endwhile()
- if (${Python}_FOUND)
- message (SEND_ERROR "Unexpectedly found version: ${${Python}_VERSION} for '${Python} ${Python_REQUESTED_VERSION}.0...<${${Python}_VERSION} ${ARGN}'")
- endif()
- return()
- endif()
-
- if (NOT ${Python}_FOUND)
- message (SEND_ERROR "Not found: ${Python} ${RANGE} ${ARGN}")
- elseif (NOT ${Python}_VERSION VERSION_EQUAL EXPECTED_VERSION)
- message (SEND_ERROR "Wrong version: ${${Python}_VERSION} for '${Python} ${RANGE} ${ARGN}'")
- endif()
-endfunction()
-
-find_python (${${Python}_VERSION} ${IN_VERSION_RANGE} COMPONENTS Interpreter)
-if (${Python}_FIND_IMPLEMENTATIONS STREQUAL "IronPython")
- find_python (${${Python}_VERSION} ${IN_VERSION_RANGE} COMPONENTS Compiler)
-else()
- find_python (${${Python}_VERSION} ${IN_VERSION_RANGE} COMPONENTS Development)
-endif()
-
-find_python ("NONE" ${OUT_VERSION_RANGE} COMPONENTS Interpreter)
-if (${Python}_FIND_IMPLEMENTATIONS STREQUAL "IronPython")
- find_python ("NONE" ${OUT_VERSION_RANGE} COMPONENTS Compiler)
-else()
- find_python ("NONE" ${OUT_VERSION_RANGE} COMPONENTS Development)
-endif()
-
-find_python ("NONE" 5...6 COMPONENTS Interpreter)
diff --git a/Tests/FindPython/VirtualEnv/CMakeLists.txt b/Tests/FindPython/VirtualEnv/CMakeLists.txt
deleted file mode 100644
index 7837916..0000000
--- a/Tests/FindPython/VirtualEnv/CMakeLists.txt
+++ /dev/null
@@ -1,49 +0,0 @@
-cmake_minimum_required(VERSION 3.15)
-
-project(TestVirtualEnv LANGUAGES NONE)
-
-include(CTest)
-
-find_package(Python3 REQUIRED COMPONENTS Interpreter)
-if (NOT Python3_FOUND)
- message (FATAL_ERROR "Failed to find Python 3")
-endif()
-
-set (Python3_VIRTUAL_ENV "${CMAKE_CURRENT_BINARY_DIR}/py3venv")
-file (REMOVE_RECURSE "${CMAKE_CURRENT_BINARY_DIR}/py3venv")
-
-execute_process (COMMAND "${Python3_EXECUTABLE}" -m venv "${Python3_VIRTUAL_ENV}"
- RESULT_VARIABLE result
- OUTPUT_VARIABLE outputs
- ERROR_VARIABLE outputs)
-if (result)
- message (FATAL_ERROR "Fail to create virtual environment: ${outputs}")
-endif()
-
-add_test(NAME FindPython3.VirtualEnvDefault
- COMMAND "${CMAKE_COMMAND}" -E env --unset=PYTHONHOME
- --unset=CONDA_PREFIX
- "VIRTUAL_ENV=${Python3_VIRTUAL_ENV}"
- "${CMAKE_COMMAND}" "-DPYTHON3_VIRTUAL_ENV=${Python3_VIRTUAL_ENV}"
- -P "${CMAKE_CURRENT_LIST_DIR}/VirtualEnvDefault.cmake")
-
-add_test(NAME FindPython3.VirtualEnvStandard
- COMMAND "${CMAKE_COMMAND}" -E env --unset=PYTHONHOME
- --unset=CONDA_PREFIX
- "VIRTUAL_ENV=${Python3_VIRTUAL_ENV}"
- "${CMAKE_COMMAND}" "-DPYTHON3_VIRTUAL_ENV=${Python3_VIRTUAL_ENV}"
- -P "${CMAKE_CURRENT_LIST_DIR}/VirtualEnvStandard.cmake")
-
-if(CMake_TEST_FindPython2)
- add_test(NAME FindPython3.VirtualEnvOnly
- COMMAND "${CMAKE_COMMAND}" -E env --unset=PYTHONHOME
- --unset=CONDA_PREFIX
- "VIRTUAL_ENV=${Python3_VIRTUAL_ENV}"
- "${CMAKE_COMMAND}" "-DPYTHON3_VIRTUAL_ENV=${Python3_VIRTUAL_ENV}"
- -P "${CMAKE_CURRENT_LIST_DIR}/VirtualEnvOnly.cmake")
- add_test(NAME FindPython3.UnsetVirtualEnvOnly
- COMMAND "${CMAKE_COMMAND}" -E env --unset=PYTHONHOME
- --unset=VIRTUAL_ENV
- --unset=CONDA_PREFIX
- "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_LIST_DIR}/VirtualEnvOnly.cmake")
-endif()
diff --git a/Tests/FindPython/VirtualEnvConda/CMakeLists.txt b/Tests/FindPython/VirtualEnvConda/CMakeLists.txt
deleted file mode 100644
index 6482793..0000000
--- a/Tests/FindPython/VirtualEnvConda/CMakeLists.txt
+++ /dev/null
@@ -1,48 +0,0 @@
-cmake_minimum_required(VERSION 3.15)
-
-project(TestVirtualEnvConda LANGUAGES NONE)
-
-include(CTest)
-
-find_program(CONDA_EXECUTABLE conda)
-if (CONDA_EXECUTABLE EQUAL NOTFOUND)
- message (FATAL_ERROR "Failed to find Conda")
-endif()
-
-set (Python3_VIRTUAL_ENV "${CMAKE_CURRENT_BINARY_DIR}/condaenv")
-
-execute_process (COMMAND "${CONDA_EXECUTABLE}" create --no-default-packages --prefix "${Python3_VIRTUAL_ENV}" --yes python=3
- RESULT_VARIABLE result
- OUTPUT_VARIABLE outputs
- ERROR_VARIABLE outputs)
-if (result)
- message (FATAL_ERROR "Fail to create virtual environment: ${outputs}")
-endif()
-
-add_test(NAME FindPython3.VirtualEnvDefaultConda
- COMMAND "${CMAKE_COMMAND}" -E env --unset=PYTHONHOME
- --unset=VIRTUAL_ENV
- "CONDA_PREFIX=${Python3_VIRTUAL_ENV}"
- "${CMAKE_COMMAND}" "-DPYTHON3_VIRTUAL_ENV=${Python3_VIRTUAL_ENV}"
- -P "${CMAKE_CURRENT_LIST_DIR}/VirtualEnvDefault.cmake")
-
-add_test(NAME FindPython3.VirtualEnvStandardConda
- COMMAND "${CMAKE_COMMAND}" -E env --unset=PYTHONHOME
- --unset=VIRTUAL_ENV
- "CONDA_PREFIX=${Python3_VIRTUAL_ENV}"
- "${CMAKE_COMMAND}" "-DPYTHON3_VIRTUAL_ENV=${Python3_VIRTUAL_ENV}"
- -P "${CMAKE_CURRENT_LIST_DIR}/VirtualEnvStandard.cmake")
-
-if(Cmake_TEST_FindPython2)
- add_test(NAME FindPython3.VirtualEnvOnlyConda
- COMMAND "${CMAKE_COMMAND}" -E env --unset=PYTHONHOME
- --unset=VIRTUAL_ENV
- "CONDA_PREFIX=${Python3_VIRTUAL_ENV}"
- "${CMAKE_COMMAND}" "-DPYTHON3_VIRTUAL_ENV=${Python3_VIRTUAL_ENV}"
- -P "${CMAKE_CURRENT_LIST_DIR}/VirtualEnvOnly.cmake")
- add_test(NAME FindPython3.UnsetVirtualEnvOnlyConda
- COMMAND "${CMAKE_COMMAND}" -E env --unset=PYTHONHOME
- --unset=CONDA_PREFIX
- --unset=VIRTUAL_ENV
- "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_LIST_DIR}/VirtualEnvOnly.cmake")
-endif()
diff --git a/Tests/FindPython/VirtualEnvConda/VirtualEnvDefault.cmake b/Tests/FindPython/VirtualEnvConda/VirtualEnvDefault.cmake
deleted file mode 100644
index 8f56d00..0000000
--- a/Tests/FindPython/VirtualEnvConda/VirtualEnvDefault.cmake
+++ /dev/null
@@ -1,7 +0,0 @@
-cmake_minimum_required(VERSION 3.15)
-
-find_package (Python3 REQUIRED)
-
-if (NOT Python3_EXECUTABLE MATCHES "^${PYTHON3_VIRTUAL_ENV}/.+")
- message (FATAL_ERROR "Fail to use virtual environment")
-endif()
diff --git a/Tests/FindPython/VirtualEnvConda/VirtualEnvOnly.cmake b/Tests/FindPython/VirtualEnvConda/VirtualEnvOnly.cmake
deleted file mode 100644
index 9ae4975..0000000
--- a/Tests/FindPython/VirtualEnvConda/VirtualEnvOnly.cmake
+++ /dev/null
@@ -1,17 +0,0 @@
-cmake_minimum_required(VERSION 3.15)
-
-#
-# Virtual environment is defined for python3
-# Trying to find a python2 using only virtual environment
-# It is expecting to fail if a virtual environment is active and to success otherwise.
-#
-set (Python2_FIND_VIRTUALENV ONLY)
-find_package (Python2 QUIET)
-
-if (PYTHON3_VIRTUAL_ENV AND Python2_FOUND)
- message (FATAL_ERROR "Python2 unexpectedly found.")
-endif()
-
-if (NOT PYTHON3_VIRTUAL_ENV AND NOT Python2_FOUND)
- message (FATAL_ERROR "Fail to find Python2.")
-endif()
diff --git a/Tests/FindPython/VirtualEnvConda/VirtualEnvStandard.cmake b/Tests/FindPython/VirtualEnvConda/VirtualEnvStandard.cmake
deleted file mode 100644
index 353a91b..0000000
--- a/Tests/FindPython/VirtualEnvConda/VirtualEnvStandard.cmake
+++ /dev/null
@@ -1,8 +0,0 @@
-cmake_minimum_required(VERSION 3.15)
-
-set (Python3_FIND_VIRTUALENV STANDARD)
-find_package (Python3 REQUIRED)
-
-if (Python3_EXECUTABLE MATCHES "^${PYTHON3_VIRTUAL_ENV}/.+")
- message (FATAL_ERROR "Python3 virtual env unexpectedly found.")
-endif()
diff --git a/Tests/RunCMake/CMP0187/CMP0187-NEW-CMP0115-OLD-build-result.txt b/Tests/RunCMake/CMP0187/CMP0187-NEW-CMP0115-OLD-build-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/CMP0187/CMP0187-NEW-CMP0115-OLD-build-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CMP0187/CMP0187-NEW-CMP0115-OLD-stderr.txt b/Tests/RunCMake/CMP0187/CMP0187-NEW-CMP0115-OLD-stderr.txt
new file mode 100644
index 0000000..ac1885a
--- /dev/null
+++ b/Tests/RunCMake/CMP0187/CMP0187-NEW-CMP0115-OLD-stderr.txt
@@ -0,0 +1,3 @@
+^CMake Deprecation Warning at CMP0187-NEW-CMP0115-OLD\.cmake:[0-9]+ \(cmake_policy\):
+ The OLD behavior for policy CMP0115 will be removed from a future version
+ of CMake\.
diff --git a/Tests/RunCMake/CMP0187/CMP0187-NEW-CMP0115-OLD.cmake b/Tests/RunCMake/CMP0187/CMP0187-NEW-CMP0115-OLD.cmake
new file mode 100644
index 0000000..ee45dfb
--- /dev/null
+++ b/Tests/RunCMake/CMP0187/CMP0187-NEW-CMP0115-OLD.cmake
@@ -0,0 +1,4 @@
+cmake_policy(SET CMP0115 OLD)
+cmake_policy(SET CMP0187 NEW)
+
+include(CMP0187.cmake)
diff --git a/Tests/RunCMake/PackageInfo/BadArgs1-result.txt b/Tests/RunCMake/CMP0187/CMP0187-NEW-build-result.txt
similarity index 100%
copy from Tests/RunCMake/PackageInfo/BadArgs1-result.txt
copy to Tests/RunCMake/CMP0187/CMP0187-NEW-build-result.txt
diff --git a/Tests/RunCMake/CMP0187/CMP0187-NEW.cmake b/Tests/RunCMake/CMP0187/CMP0187-NEW.cmake
new file mode 100644
index 0000000..a140325
--- /dev/null
+++ b/Tests/RunCMake/CMP0187/CMP0187-NEW.cmake
@@ -0,0 +1,3 @@
+cmake_policy(SET CMP0187 NEW)
+
+include(CMP0187.cmake)
diff --git a/Tests/RunCMake/CMP0187/CMP0187-OLD-build-result.txt b/Tests/RunCMake/CMP0187/CMP0187-OLD-build-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/CMP0187/CMP0187-OLD-build-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CMP0187/CMP0187-OLD.cmake b/Tests/RunCMake/CMP0187/CMP0187-OLD.cmake
new file mode 100644
index 0000000..d48b4bb
--- /dev/null
+++ b/Tests/RunCMake/CMP0187/CMP0187-OLD.cmake
@@ -0,0 +1,3 @@
+cmake_policy(SET CMP0187 OLD)
+
+include(CMP0187.cmake)
diff --git a/Tests/RunCMake/CMP0187/CMP0187.cmake b/Tests/RunCMake/CMP0187/CMP0187.cmake
new file mode 100644
index 0000000..029d0c9
--- /dev/null
+++ b/Tests/RunCMake/CMP0187/CMP0187.cmake
@@ -0,0 +1,4 @@
+add_custom_command(OUTPUT z.h COMMAND ${CMAKE_COMMAND} -E true)
+add_custom_command(OUTPUT z COMMAND ${CMAKE_COMMAND} -E false)
+
+add_library(lib INTERFACE z z.h)
diff --git a/Tests/RunCMake/CMP0187/CMakeLists.txt b/Tests/RunCMake/CMP0187/CMakeLists.txt
new file mode 100644
index 0000000..7e8fde0
--- /dev/null
+++ b/Tests/RunCMake/CMP0187/CMakeLists.txt
@@ -0,0 +1,4 @@
+cmake_minimum_required(VERSION 4.0)
+
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/CMP0187/RunCMakeTest.cmake b/Tests/RunCMake/CMP0187/RunCMakeTest.cmake
new file mode 100644
index 0000000..f28cc70
--- /dev/null
+++ b/Tests/RunCMake/CMP0187/RunCMakeTest.cmake
@@ -0,0 +1,34 @@
+include(RunCMake)
+
+block()
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/CMP0187-NEW-build)
+ run_cmake_with_options(CMP0187-NEW "-DCMAKE_POLICY_DEFAULT_CMP0187=NEW")
+
+ if(RunCMake_GENERATOR MATCHES "Ninja.*")
+ set(RunCMake_TEST_NO_CLEAN 1)
+ # -n: dry-run to avoid actually compiling, -v: verbose to capture executed command
+ run_cmake_command(CMP0187-NEW-build ${CMAKE_COMMAND} --build .)
+ endif()
+endblock()
+
+block()
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/CMP0187-OLD-build)
+ run_cmake_with_options(CMP0187-OLD "-DCMAKE_POLICY_DEFAULT_CMP0187=OLD")
+
+ if(RunCMake_GENERATOR MATCHES "Ninja.*")
+ set(RunCMake_TEST_NO_CLEAN 1)
+ # -n: dry-run to avoid actually compiling, -v: verbose to capture executed command
+ run_cmake_command(CMP0187-OLD-build ${CMAKE_COMMAND} --build .)
+ endif()
+endblock()
+
+block()
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/CMP0187-NEW-CMP0115-OLD-build)
+ run_cmake(CMP0187-NEW-CMP0115-OLD)
+
+ if(RunCMake_GENERATOR MATCHES "Ninja.*")
+ set(RunCMake_TEST_NO_CLEAN 1)
+ # -n: dry-run to avoid actually compiling, -v: verbose to capture executed command
+ run_cmake_command(CMP0187-NEW-CMP0115-OLD-build ${CMAKE_COMMAND} --build .)
+ endif()
+endblock()
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index 2e00a91..593f481 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -179,6 +179,7 @@
add_RunCMake_test(CMP0170)
add_RunCMake_test(CMP0171)
add_RunCMake_test(CMP0173)
+add_RunCMake_test(CMP0187)
# The test for Policy 65 requires the use of the
# CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS variable, which both the VS and Xcode
@@ -396,7 +397,8 @@
add_RunCMake_test(CompilerTest ${CMake_TEST_LANG_VARS})
set_property(TEST RunCMake.CompilerTest APPEND PROPERTY LABELS "CUDA" "HIP" "ISPC" "Fortran")
add_RunCMake_test(Configure -DMSVC_IDE=${MSVC_IDE})
-add_RunCMake_test(CpsExportImport)
+add_RunCMake_test(CpsExportImportBuild)
+add_RunCMake_test(CpsExportImportInstall)
add_RunCMake_test(DisallowedCommands)
if("${CMAKE_GENERATOR}" MATCHES "Unix Makefiles|Ninja")
add_RunCMake_test(ExportCompileCommands)
@@ -419,6 +421,71 @@
add_RunCMake_test(Instrumentation)
endif()
add_RunCMake_test(ConfigDir)
+if(CMake_TEST_FindPython2)
+ add_RunCMake_test(FindPython2.CPython TEST_DIR FindPython
+ -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}
+ "-DRunCMake_BUILD_TYPE=${CMAKE_BUILD_TYPE}"
+ -DCMake_TEST_FindPython2_CPython=TRUE
+ -DCMake_TEST_FindPython2=TRUE)
+ set_property(TEST RunCMake.FindPython2.CPython PROPERTY LABELS Python2)
+endif()
+if(CMake_TEST_FindPython3)
+ add_RunCMake_test(FindPython3.CPython TEST_DIR FindPython
+ -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}
+ "-DRunCMake_BUILD_TYPE=${CMAKE_BUILD_TYPE}"
+ -DCMAKE_C_COMPILER_ID=${CMAKE_C_COMPILER_ID}
+ -DCMAKE_C_COMPILER_VERSION=${CMAKE_C_COMPILER_VERSION}
+ -DCMake_TEST_FindPython3_CPython=TRUE
+ -DCMake_TEST_FindPython3=TRUE)
+ set_property(TEST RunCMake.FindPython3.CPython PROPERTY LABELS Python3)
+endif()
+if(CMake_TEST_FindPython2_IronPython)
+ add_RunCMake_test(FindPython2.IronPython TEST_DIR FindPython
+ -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}
+ "-DRunCMake_BUILD_TYPE=${CMAKE_BUILD_TYPE}"
+ -DCMake_TEST_FindPython2=${CMake_TEST_FindPython2}
+ -DCMake_TEST_FindPython2_IronPython=${CMake_TEST_FindPython2_IronPython})
+ set_property(TEST RunCMake.FindPython2.IronPython PROPERTY LABELS Python2)
+endif()
+if(CMake_TEST_FindPython3_IronPython)
+ add_RunCMake_test(FindPython3.IronPython TEST_DIR FindPython
+ -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}
+ "-DRunCMake_BUILD_TYPE=${CMAKE_BUILD_TYPE}"
+ -DCMake_TEST_FindPython3=${CMake_TEST_FindPython3}
+ -DCMake_TEST_FindPython3_IronPython=${CMake_TEST_FindPython3_IronPython})
+ set_property(TEST RunCMake.FindPython3.IronPython PROPERTY LABELS Python3)
+endif()
+if(CMake_TEST_FindPython2_PyPy)
+ add_RunCMake_test(FindPython2.PyPy TEST_DIR FindPython
+ -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}
+ "-DRunCMake_BUILD_TYPE=${CMAKE_BUILD_TYPE}"
+ -DCMake_TEST_FindPython2_PyPy=${CMake_TEST_FindPython2_PyPy})
+ set_property(TEST RunCMake.FindPython2.PyPy PROPERTY LABELS Python2)
+endif()
+if(CMake_TEST_FindPython3_PyPy)
+ add_RunCMake_test(FindPython3.PyPy TEST_DIR FindPython
+ -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}
+ "-DRunCMake_BUILD_TYPE=${CMAKE_BUILD_TYPE}"
+ -DCMake_TEST_FindPython3_PyPy=${CMake_TEST_FindPython3_PyPy})
+ set_property(TEST RunCMake.FindPython3.PyPy PROPERTY LABELS Python3)
+endif()
+if(CMake_TEST_FindPython2 OR CMake_TEST_FindPython2_SABIModule OR CMake_TEST_FindPython2_NumPy
+ OR CMake_TEST_FindPython3 OR CMake_TEST_FindPython3_SABIModule OR CMake_TEST_FindPython3_NumPy
+ OR CMake_TEST_FindPython3_Conda)
+ add_RunCMake_test(FindPython.Various TEST_DIR FindPython
+ -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}
+ "-DRunCMake_BUILD_TYPE=${CMAKE_BUILD_TYPE}"
+ -DCMake_TEST_FindPython_Various=TRUE
+ -DCMake_TEST_FindPython2=${CMake_TEST_FindPython2}
+ -DCMake_TEST_FindPython2_SABIModule=${CMake_TEST_FindPython2_SABIModule}
+ -DCMake_TEST_FindPython2_NumPy=${CMake_TEST_FindPython2_NumPy}
+ -DCMake_TEST_FindPython3=${CMake_TEST_FindPython3}
+
+ -DCMake_TEST_FindPython3_SABIModule=${CMake_TEST_FindPython3_SABIModule}
+ -DCMake_TEST_FindPython3_NumPy=${CMake_TEST_FindPython3_NumPy}
+ -DCMake_TEST_FindPython3_Conda=${CMake_TEST_FindPython3_Conda})
+ set_property(TEST RunCMake.FindPython.Various PROPERTY LABELS Python2 Python3)
+endif()
add_RunCMake_test(FindBoost)
add_RunCMake_test(FindLua)
add_RunCMake_test(FindOpenGL)
@@ -659,7 +726,10 @@
add_RunCMake_test(SarifOutput)
add_RunCMake_test(separate_arguments)
add_RunCMake_test(set_property)
-add_RunCMake_test(string)
+add_RunCMake_test(string
+ -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}
+ -DCMAKE_SYSTEM_PROCESSOR=${CMAKE_SYSTEM_PROCESSOR}
+ )
add_RunCMake_test(test_include_dirs)
add_RunCMake_test(BundleUtilities)
if(APPLE)
@@ -1125,6 +1195,9 @@
RPM.EXTRA_SLASH_IN_PATH
RPM.SOURCE_PACKAGE
RPM.SUGGESTS
+ RPM.ENHANCES
+ RPM.RECOMMENDS
+ RPM.SUPPLEMENTS
RPM.SYMLINKS
RPM.USER_FILELIST
RPM.PROJECT_META
@@ -1204,7 +1277,8 @@
)
add_RunCMake_test(AndroidMK)
-add_RunCMake_test(PackageInfo)
+add_RunCMake_test(ExportPackageInfo)
+add_RunCMake_test(InstallPackageInfo)
if(CMake_TEST_ANDROID_NDK OR CMake_TEST_ANDROID_STANDALONE_TOOLCHAIN)
if(NOT "${CMAKE_GENERATOR}" MATCHES "Make|Ninja|Visual Studio 1[456]")
diff --git a/Tests/RunCMake/CPack/ArchiveCommon/common_helpers.cmake b/Tests/RunCMake/CPack/ArchiveCommon/common_helpers.cmake
index 948c6ab..34c8abf 100644
--- a/Tests/RunCMake/CPack/ArchiveCommon/common_helpers.cmake
+++ b/Tests/RunCMake/CPack/ArchiveCommon/common_helpers.cmake
@@ -60,7 +60,7 @@
unset(filtered_)
foreach(part_ IN LISTS prepared_)
- string(REGEX REPLACE "^/" "" part_ "${part_}")
+ string(REGEX REPLACE "^/+" "" part_ "${part_}")
if(part_)
list(APPEND filtered_ "${prefix_}${part_}")
diff --git a/Tests/RunCMake/CPack/RunCMakeTest.cmake b/Tests/RunCMake/CPack/RunCMakeTest.cmake
index 57f86ca..b6cacaa 100644
--- a/Tests/RunCMake/CPack/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CPack/RunCMakeTest.cmake
@@ -54,6 +54,9 @@
run_cpack_source_test(SOURCE_PACKAGE "RPM.SOURCE_PACKAGE")
endif()
run_cpack_test(SUGGESTS "RPM.SUGGESTS" false "MONOLITHIC")
+run_cpack_test(ENHANCES "RPM.ENHANCES" false "MONOLITHIC")
+run_cpack_test(RECOMMENDS "RPM.RECOMMENDS" false "MONOLITHIC")
+run_cpack_test(SUPPLEMENTS "RPM.SUPPLEMENTS" false "MONOLITHIC")
run_cpack_test(SYMLINKS "RPM.SYMLINKS;TGZ" false "MONOLITHIC;COMPONENT")
set(ENVIRONMENT "SOURCE_DATE_EPOCH=123456789")
run_cpack_test(TIMESTAMPS "DEB.TIMESTAMPS;TGZ" false "COMPONENT")
diff --git a/Tests/RunCMake/CPack/tests/ENHANCES/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/ENHANCES/ExpectedFiles.cmake
new file mode 100644
index 0000000..d1a3a5f
--- /dev/null
+++ b/Tests/RunCMake/CPack/tests/ENHANCES/ExpectedFiles.cmake
@@ -0,0 +1,2 @@
+set(EXPECTED_FILES_COUNT "1")
+set(EXPECTED_FILE_CONTENT_1_LIST "/foo;/foo/CMakeLists.txt")
diff --git a/Tests/RunCMake/CPack/tests/ENHANCES/RPM-stderr.txt b/Tests/RunCMake/CPack/tests/ENHANCES/RPM-stderr.txt
new file mode 100644
index 0000000..a5deb04
--- /dev/null
+++ b/Tests/RunCMake/CPack/tests/ENHANCES/RPM-stderr.txt
@@ -0,0 +1 @@
+^CPackRPM: Will use GENERATED spec file: (/[^/]*)*/Tests/RunCMake/RPM\.ENHANCES/CPack/[^-]*-build/_CPack_Packages/.*/RPM/SPECS/[^\.]*\.spec$
diff --git a/Tests/RunCMake/CPack/tests/ENHANCES/VerifyResult.cmake b/Tests/RunCMake/CPack/tests/ENHANCES/VerifyResult.cmake
new file mode 100644
index 0000000..2fb79bb
--- /dev/null
+++ b/Tests/RunCMake/CPack/tests/ENHANCES/VerifyResult.cmake
@@ -0,0 +1,35 @@
+# CPack uses `rpm --enhances` to check if rpmbuild supports the "Enhances:" tag.
+# This test intentionally uses a different method (build a test .spec) so any
+# problems will be caught early if functionality should change in the future.
+execute_process(
+ COMMAND ${RPMBUILD_EXECUTABLE} --nobuild test_enhances.spec
+ ERROR_QUIET
+ WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
+ RESULT_VARIABLE RPMBUILD_ENHANCES_RESULT)
+
+if(RPMBUILD_ENHANCES_RESULT EQUAL 0)
+ set(should_contain_enhances_tag_ true)
+endif()
+
+# Only verify that enhances tag is present only if that tag is supported.
+# If it is not supported the rpm package was correctly generated by ignoring
+# that tag and that was already checked by expected files test.
+if(should_contain_enhances_tag_)
+ execute_process(COMMAND ${RPM_EXECUTABLE} -q --enhances -p "${FOUND_FILE_1}"
+ RESULT_VARIABLE rpm_result_
+ OUTPUT_VARIABLE rpm_stdout_
+ ERROR_VARIABLE rpm_stderr_
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+ if(rpm_result_ OR NOT rpm_stdout_ STREQUAL "libenhanced")
+ string(REPLACE "\n" "\n " rpm_stdout_ "${rpm_stdout_}")
+ string(REPLACE "\n" "\n " rpm_stderr_ "${rpm_stderr_}")
+ message(FATAL_ERROR "RPM_ENHANCED package error: no enhanced packages\n"
+ "result: ${rpm_result_}\n"
+ "stdout:\n"
+ " ${rpm_stdout_}\n"
+ "stderr:\n"
+ " ${rpm_stderr_}\n"
+ )
+ endif()
+endif()
diff --git a/Tests/RunCMake/CPack/tests/ENHANCES/test.cmake b/Tests/RunCMake/CPack/tests/ENHANCES/test.cmake
new file mode 100644
index 0000000..1d742bd
--- /dev/null
+++ b/Tests/RunCMake/CPack/tests/ENHANCES/test.cmake
@@ -0,0 +1,3 @@
+install(FILES CMakeLists.txt DESTINATION foo)
+
+set(CPACK_RPM_PACKAGE_ENHANCES "libenhanced")
diff --git a/Tests/RunCMake/CPack/tests/ENHANCES/test_enhances.spec b/Tests/RunCMake/CPack/tests/ENHANCES/test_enhances.spec
new file mode 100644
index 0000000..1120f91
--- /dev/null
+++ b/Tests/RunCMake/CPack/tests/ENHANCES/test_enhances.spec
@@ -0,0 +1,22 @@
+# This spec file is used to check if the provided version of rpmbuild supports the "Enhances:" tag
+
+Name: test
+Version: 0
+Release: 1
+Summary: test
+License: test
+
+Enhances: enhanced_package
+
+%description
+
+
+%prep
+
+%build
+%configure
+%install
+%clean
+%files
+%doc
+%changelog
diff --git a/Tests/RunCMake/CPack/tests/RECOMMENDS/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/RECOMMENDS/ExpectedFiles.cmake
new file mode 100644
index 0000000..d1a3a5f
--- /dev/null
+++ b/Tests/RunCMake/CPack/tests/RECOMMENDS/ExpectedFiles.cmake
@@ -0,0 +1,2 @@
+set(EXPECTED_FILES_COUNT "1")
+set(EXPECTED_FILE_CONTENT_1_LIST "/foo;/foo/CMakeLists.txt")
diff --git a/Tests/RunCMake/CPack/tests/RECOMMENDS/RPM-stderr.txt b/Tests/RunCMake/CPack/tests/RECOMMENDS/RPM-stderr.txt
new file mode 100644
index 0000000..5dc907a
--- /dev/null
+++ b/Tests/RunCMake/CPack/tests/RECOMMENDS/RPM-stderr.txt
@@ -0,0 +1 @@
+^CPackRPM: Will use GENERATED spec file: (/[^/]*)*/Tests/RunCMake/RPM\.RECOMMENDS/CPack/[^-]*-build/_CPack_Packages/.*/RPM/SPECS/[^\.]*\.spec$
diff --git a/Tests/RunCMake/CPack/tests/RECOMMENDS/VerifyResult.cmake b/Tests/RunCMake/CPack/tests/RECOMMENDS/VerifyResult.cmake
new file mode 100644
index 0000000..aca1a7d
--- /dev/null
+++ b/Tests/RunCMake/CPack/tests/RECOMMENDS/VerifyResult.cmake
@@ -0,0 +1,35 @@
+# CPack uses `rpm --recommends` to check if rpmbuild supports the "Recommends:" tag.
+# This test intentionally uses a different method (build a test .spec) so any
+# problems will be caught early if functionality should change in the future.
+execute_process(
+ COMMAND ${RPMBUILD_EXECUTABLE} --nobuild test_recommends.spec
+ ERROR_QUIET
+ WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
+ RESULT_VARIABLE RPMBUILD_RECOMMENDS_RESULT)
+
+if(RPMBUILD_RECOMMENDS_RESULT EQUAL 0)
+ set(should_contain_recommends_tag_ true)
+endif()
+
+# Only verify that recommends tag is present only if that tag is supported.
+# If it is not supported the rpm package was correctly generated by ignoring
+# that tag and that was already checked by expected files test.
+if(should_contain_recommends_tag_)
+ execute_process(COMMAND ${RPM_EXECUTABLE} -q --recommends -p "${FOUND_FILE_1}"
+ RESULT_VARIABLE rpm_result_
+ OUTPUT_VARIABLE rpm_stdout_
+ ERROR_VARIABLE rpm_stderr_
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+ if(rpm_result_ OR NOT rpm_stdout_ STREQUAL "librecommended")
+ string(REPLACE "\n" "\n " rpm_stdout_ "${rpm_stdout_}")
+ string(REPLACE "\n" "\n " rpm_stderr_ "${rpm_stderr_}")
+ message(FATAL_ERROR "RPM_RECOMMENDED package error: no recommended packages\n"
+ "result: ${rpm_result_}\n"
+ "stdout:\n"
+ " ${rpm_stdout_}\n"
+ "stderr:\n"
+ " ${rpm_stderr_}\n"
+ )
+ endif()
+endif()
diff --git a/Tests/RunCMake/CPack/tests/RECOMMENDS/test.cmake b/Tests/RunCMake/CPack/tests/RECOMMENDS/test.cmake
new file mode 100644
index 0000000..706ee6f
--- /dev/null
+++ b/Tests/RunCMake/CPack/tests/RECOMMENDS/test.cmake
@@ -0,0 +1,3 @@
+install(FILES CMakeLists.txt DESTINATION foo)
+
+set(CPACK_RPM_PACKAGE_RECOMMENDS "librecommended")
diff --git a/Tests/RunCMake/CPack/tests/RECOMMENDS/test_recommends.spec b/Tests/RunCMake/CPack/tests/RECOMMENDS/test_recommends.spec
new file mode 100644
index 0000000..2a650bc
--- /dev/null
+++ b/Tests/RunCMake/CPack/tests/RECOMMENDS/test_recommends.spec
@@ -0,0 +1,22 @@
+# This spec file is used to check if the provided version of rpmbuild supports the "Recommends:" tag
+
+Name: test
+Version: 0
+Release: 1
+Summary: test
+License: test
+
+Recommends: recommended_package
+
+%description
+
+
+%prep
+
+%build
+%configure
+%install
+%clean
+%files
+%doc
+%changelog
diff --git a/Tests/RunCMake/CPack/tests/SUGGESTS/RPM-stderr.txt b/Tests/RunCMake/CPack/tests/SUGGESTS/RPM-stderr.txt
index 53d71d9..09711c7 100644
--- a/Tests/RunCMake/CPack/tests/SUGGESTS/RPM-stderr.txt
+++ b/Tests/RunCMake/CPack/tests/SUGGESTS/RPM-stderr.txt
@@ -1 +1 @@
-^(.*CPackRPM:Warning: SUGGESTS not supported in provided rpmbuild.*)?CPackRPM: Will use GENERATED spec file: (/[^/]*)*/Tests/RunCMake/RPM\.SUGGESTS/CPack/[^-]*-build/_CPack_Packages/.*/RPM/SPECS/[^\.]*\.spec$
+^CPackRPM: Will use GENERATED spec file: (/[^/]*)*/Tests/RunCMake/RPM\.SUGGESTS/CPack/[^-]*-build/_CPack_Packages/.*/RPM/SPECS/[^\.]*\.spec$
diff --git a/Tests/RunCMake/CPack/tests/SUPPLEMENTS/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/SUPPLEMENTS/ExpectedFiles.cmake
new file mode 100644
index 0000000..d1a3a5f
--- /dev/null
+++ b/Tests/RunCMake/CPack/tests/SUPPLEMENTS/ExpectedFiles.cmake
@@ -0,0 +1,2 @@
+set(EXPECTED_FILES_COUNT "1")
+set(EXPECTED_FILE_CONTENT_1_LIST "/foo;/foo/CMakeLists.txt")
diff --git a/Tests/RunCMake/CPack/tests/SUPPLEMENTS/RPM-stderr.txt b/Tests/RunCMake/CPack/tests/SUPPLEMENTS/RPM-stderr.txt
new file mode 100644
index 0000000..d62afc5
--- /dev/null
+++ b/Tests/RunCMake/CPack/tests/SUPPLEMENTS/RPM-stderr.txt
@@ -0,0 +1 @@
+^CPackRPM: Will use GENERATED spec file: (/[^/]*)*/Tests/RunCMake/RPM\.SUPPLEMENTS/CPack/[^-]*-build/_CPack_Packages/.*/RPM/SPECS/[^\.]*\.spec$
diff --git a/Tests/RunCMake/CPack/tests/SUPPLEMENTS/VerifyResult.cmake b/Tests/RunCMake/CPack/tests/SUPPLEMENTS/VerifyResult.cmake
new file mode 100644
index 0000000..6ab182a
--- /dev/null
+++ b/Tests/RunCMake/CPack/tests/SUPPLEMENTS/VerifyResult.cmake
@@ -0,0 +1,35 @@
+# CPack uses `rpm --supplements` to check if rpmbuild supports the "Supplements:" tag.
+# This test intentionally uses a different method (build a test .spec) so any
+# problems will be caught early if functionality should change in the future.
+execute_process(
+ COMMAND ${RPMBUILD_EXECUTABLE} --nobuild test_supplements.spec
+ ERROR_QUIET
+ WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
+ RESULT_VARIABLE RPMBUILD_SUPPLEMENTS_RESULT)
+
+if(RPMBUILD_SUPPLEMENTS_RESULT EQUAL 0)
+ set(should_contain_supplements_tag_ true)
+endif()
+
+# Only verify that supplements tag is present only if that tag is supported.
+# If it is not supported the rpm package was correctly generated by ignoring
+# that tag and that was already checked by expected files test.
+if(should_contain_supplements_tag_)
+ execute_process(COMMAND ${RPM_EXECUTABLE} -q --supplements -p "${FOUND_FILE_1}"
+ RESULT_VARIABLE rpm_result_
+ OUTPUT_VARIABLE rpm_stdout_
+ ERROR_VARIABLE rpm_stderr_
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+ if(rpm_result_ OR NOT rpm_stdout_ STREQUAL "libsupplemented")
+ string(REPLACE "\n" "\n " rpm_stdout_ "${rpm_stdout_}")
+ string(REPLACE "\n" "\n " rpm_stderr_ "${rpm_stderr_}")
+ message(FATAL_ERROR "RPM_SUPPLEMENTED package error: no supplemented packages\n"
+ "result: ${rpm_result_}\n"
+ "stdout:\n"
+ " ${rpm_stdout_}\n"
+ "stderr:\n"
+ " ${rpm_stderr_}\n"
+ )
+ endif()
+endif()
diff --git a/Tests/RunCMake/CPack/tests/SUPPLEMENTS/test.cmake b/Tests/RunCMake/CPack/tests/SUPPLEMENTS/test.cmake
new file mode 100644
index 0000000..58169bd
--- /dev/null
+++ b/Tests/RunCMake/CPack/tests/SUPPLEMENTS/test.cmake
@@ -0,0 +1,3 @@
+install(FILES CMakeLists.txt DESTINATION foo)
+
+set(CPACK_RPM_PACKAGE_SUPPLEMENTS "libsupplemented")
diff --git a/Tests/RunCMake/CPack/tests/SUPPLEMENTS/test_supplements.spec b/Tests/RunCMake/CPack/tests/SUPPLEMENTS/test_supplements.spec
new file mode 100644
index 0000000..acd1a07
--- /dev/null
+++ b/Tests/RunCMake/CPack/tests/SUPPLEMENTS/test_supplements.spec
@@ -0,0 +1,22 @@
+# This spec file is used to check if the provided version of rpmbuild supports the "Supplements:" tag
+
+Name: test
+Version: 0
+Release: 1
+Summary: test
+License: test
+
+Supplements: supplemented_package
+
+%description
+
+
+%prep
+
+%build
+%configure
+%install
+%clean
+%files
+%doc
+%changelog
diff --git a/Tests/RunCMake/CTestCommandLine/EmptyDirCoverage-ctest-result.txt b/Tests/RunCMake/CTestCommandLine/EmptyDirCoverage-ctest-result.txt
deleted file mode 100644
index f5c8955..0000000
--- a/Tests/RunCMake/CTestCommandLine/EmptyDirCoverage-ctest-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-32
diff --git a/Tests/RunCMake/CTestCommandLine/EmptyDirCoverage-ctest-stderr.txt b/Tests/RunCMake/CTestCommandLine/EmptyDirCoverage-ctest-stderr.txt
index f6d28a1..45230f7 100644
--- a/Tests/RunCMake/CTestCommandLine/EmptyDirCoverage-ctest-stderr.txt
+++ b/Tests/RunCMake/CTestCommandLine/EmptyDirCoverage-ctest-stderr.txt
@@ -1,3 +1,3 @@
Cannot find file: [^
]*/Tests/RunCMake/CTestCommandLine/EmptyDirCoverage-ctest-build/DartConfiguration.tcl
-CTEST_BINARY_DIRECTORY not set
+ Cannot find any coverage files\. Ignoring Coverage request\.$
diff --git a/Tests/RunCMake/CTestCommandLine/EmptyDirTest-ctest-stderr.txt b/Tests/RunCMake/CTestCommandLine/EmptyDirTest-ctest-stderr.txt
new file mode 100644
index 0000000..d9c2ecb
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/EmptyDirTest-ctest-stderr.txt
@@ -0,0 +1,3 @@
+Cannot find file: [^
+]*/Tests/RunCMake/CTestCommandLine/EmptyDirTest-ctest-build/DartConfiguration.tcl
+No tests were found!!!$
diff --git a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
index 0786499..31f3b72 100644
--- a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
@@ -554,6 +554,10 @@
run_FailDrop(TLSVerify-OFF-env)
unset(ENV{CMAKE_TLS_VERIFY})
+run_cmake_command(EmptyDirTest-ctest
+ ${CMAKE_CTEST_COMMAND} -C Debug -M Experimental -T Test
+ )
+
run_cmake_command(EmptyDirCoverage-ctest
${CMAKE_CTEST_COMMAND} -C Debug -M Experimental -T Coverage
)
diff --git a/Tests/RunCMake/CXXModules/NinjaDependInfoCompileDatabase.cmake b/Tests/RunCMake/CXXModules/NinjaDependInfoCompileDatabase.cmake
index 91a6884..27daba0 100644
--- a/Tests/RunCMake/CXXModules/NinjaDependInfoCompileDatabase.cmake
+++ b/Tests/RunCMake/CXXModules/NinjaDependInfoCompileDatabase.cmake
@@ -2,7 +2,7 @@
# here.
set(CMAKE_CXX_SCANDEP_SOURCE "")
-set(CMAKE_EXPERIMENTAL_EXPORT_BUILD_DATABASE "4bd552e2-b7fb-429a-ab23-c83ef53f3f13")
+set(CMAKE_EXPERIMENTAL_EXPORT_BUILD_DATABASE "73194a1d-c0b5-41b9-9190-a4512925e192")
enable_language(CXX)
diff --git a/Tests/RunCMake/CXXModules/examples/build-database-check.cmake b/Tests/RunCMake/CXXModules/examples/build-database-check.cmake
index c09acea..9b440a8 100644
--- a/Tests/RunCMake/CXXModules/examples/build-database-check.cmake
+++ b/Tests/RunCMake/CXXModules/examples/build-database-check.cmake
@@ -70,7 +70,19 @@
file(READ "${RunCMake_TEST_BINARY_DIR}/${fname}" actual)
file(READ "${expected_file}" expect)
+ set(RunCMake_TEST_FAILED_before "${RunCMake_TEST_FAILED}")
+ set(RunCMake_TEST_FAILED "")
+
check_json("${actual}" "${expect}")
+ if (RunCMake_TEST_FAILED)
+ string(PREPEND RunCMake_TEST_FAILED
+ "${RunCMake_TEST_FAILED_before}\n"
+ "actual file: ${RunCMake_TEST_BINARY_DIR}/${fname}\n"
+ "expect file: ${expected_file}\n")
+ else ()
+ set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED_before}")
+ endif ()
+
set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE)
endfunction ()
diff --git a/Tests/RunCMake/CXXModules/examples/expect/export-build-database-all-multi.json b/Tests/RunCMake/CXXModules/examples/expect/export-build-database-all-multi.json
index e1603be..b7b9c03 100644
--- a/Tests/RunCMake/CXXModules/examples/expect/export-build-database-all-multi.json
+++ b/Tests/RunCMake/CXXModules/examples/expect/export-build-database-all-multi.json
@@ -138,7 +138,7 @@
"-Dfrom_source_option"
],
"object": "PATH:CMakeFiles/export_build_database.dir<CONFIG_DIR>/importable.cxx<OBJEXT>",
- "private": true,
+ "private": false,
"provides": {
"importable": "PATH:<BINARY_DIR>/CMakeFiles/export_build_database.dir<CONFIG_DIR>/importable<BMIEXT>"
},
@@ -285,7 +285,7 @@
"-Dfrom_source_option"
],
"object": "PATH:CMakeFiles/export_build_database.dir<CONFIG_OTHER_DIR>/importable.cxx<OBJEXT>",
- "private": true,
+ "private": false,
"provides": {
"importable": "<BINARY_DIR>/CMakeFiles/export_build_database.dir<CONFIG_OTHER_DIR>/importable<BMIEXT>"
},
diff --git a/Tests/RunCMake/CXXModules/examples/expect/export-build-database-all.json b/Tests/RunCMake/CXXModules/examples/expect/export-build-database-all.json
index 440bc4e..e08ee35 100644
--- a/Tests/RunCMake/CXXModules/examples/expect/export-build-database-all.json
+++ b/Tests/RunCMake/CXXModules/examples/expect/export-build-database-all.json
@@ -138,7 +138,7 @@
"-Dfrom_source_option"
],
"object": "PATH:CMakeFiles/export_build_database.dir<CONFIG_DIR>/importable.cxx<OBJEXT>",
- "private": true,
+ "private": false,
"provides": {
"importable": "<BINARY_DIR>/CMakeFiles/export_build_database.dir<CONFIG_DIR>/importable<BMIEXT>"
},
diff --git a/Tests/RunCMake/CXXModules/examples/expect/export-build-database-config.json b/Tests/RunCMake/CXXModules/examples/expect/export-build-database-config.json
index 8877165..df5308f 100644
--- a/Tests/RunCMake/CXXModules/examples/expect/export-build-database-config.json
+++ b/Tests/RunCMake/CXXModules/examples/expect/export-build-database-config.json
@@ -138,7 +138,7 @@
"-Dfrom_source_option"
],
"object": "PATH:CMakeFiles/export_build_database.dir<CONFIG_DIR>/importable.cxx<OBJEXT>",
- "private": true,
+ "private": false,
"provides": {
"importable": "PATH:<BINARY_DIR>/CMakeFiles/export_build_database.dir<CONFIG_DIR>/importable<BMIEXT>"
},
diff --git a/Tests/RunCMake/CXXModules/examples/expect/export-build-database-cxx-config.json b/Tests/RunCMake/CXXModules/examples/expect/export-build-database-cxx-config.json
index 8877165..df5308f 100644
--- a/Tests/RunCMake/CXXModules/examples/expect/export-build-database-cxx-config.json
+++ b/Tests/RunCMake/CXXModules/examples/expect/export-build-database-cxx-config.json
@@ -138,7 +138,7 @@
"-Dfrom_source_option"
],
"object": "PATH:CMakeFiles/export_build_database.dir<CONFIG_DIR>/importable.cxx<OBJEXT>",
- "private": true,
+ "private": false,
"provides": {
"importable": "PATH:<BINARY_DIR>/CMakeFiles/export_build_database.dir<CONFIG_DIR>/importable<BMIEXT>"
},
diff --git a/Tests/RunCMake/CXXModules/examples/expect/export-build-database-cxx-multi.json b/Tests/RunCMake/CXXModules/examples/expect/export-build-database-cxx-multi.json
index 0a27fec..4a3a439 100644
--- a/Tests/RunCMake/CXXModules/examples/expect/export-build-database-cxx-multi.json
+++ b/Tests/RunCMake/CXXModules/examples/expect/export-build-database-cxx-multi.json
@@ -138,7 +138,7 @@
"-Dfrom_source_option"
],
"object": "PATH:CMakeFiles/export_build_database.dir<CONFIG_DIR>/importable.cxx<OBJEXT>",
- "private": true,
+ "private": false,
"provides": {
"importable": "PATH:<BINARY_DIR>/CMakeFiles/export_build_database.dir<CONFIG_DIR>/importable<BMIEXT>"
},
@@ -285,7 +285,7 @@
"-Dfrom_source_option"
],
"object": "PATH:CMakeFiles/export_build_database.dir<CONFIG_OTHER_DIR>/importable.cxx<OBJEXT>",
- "private": true,
+ "private": false,
"provides": {
"importable": "PATH:<BINARY_DIR>/CMakeFiles/export_build_database.dir<CONFIG_OTHER_DIR>/importable<BMIEXT>"
},
diff --git a/Tests/RunCMake/CXXModules/examples/expect/export-build-database-cxx.json b/Tests/RunCMake/CXXModules/examples/expect/export-build-database-cxx.json
index 8877165..df5308f 100644
--- a/Tests/RunCMake/CXXModules/examples/expect/export-build-database-cxx.json
+++ b/Tests/RunCMake/CXXModules/examples/expect/export-build-database-cxx.json
@@ -138,7 +138,7 @@
"-Dfrom_source_option"
],
"object": "PATH:CMakeFiles/export_build_database.dir<CONFIG_DIR>/importable.cxx<OBJEXT>",
- "private": true,
+ "private": false,
"provides": {
"importable": "PATH:<BINARY_DIR>/CMakeFiles/export_build_database.dir<CONFIG_DIR>/importable<BMIEXT>"
},
diff --git a/Tests/RunCMake/CXXModules/examples/expect/export-build-database-imported-all-multi.json b/Tests/RunCMake/CXXModules/examples/expect/export-build-database-imported-all-multi.json
index 2fdaef5..a1817d4 100644
--- a/Tests/RunCMake/CXXModules/examples/expect/export-build-database-imported-all-multi.json
+++ b/Tests/RunCMake/CXXModules/examples/expect/export-build-database-imported-all-multi.json
@@ -180,7 +180,7 @@
"-Dtarget_interface_option"
],
"object": "PATH:CMakeFiles/use_import_interfaces.dir<CONFIG_DIR>/use.cxx<OBJEXT>",
- "private": true,
+ "private": false,
"provides": {
"importable": "<IGNORE>"
},
@@ -263,7 +263,7 @@
"-Dtarget_interface_option"
],
"object": "PATH:CMakeFiles/use_import_interfaces.dir<CONFIG_OTHER_DIR>/use.cxx<OBJEXT>",
- "private": true,
+ "private": false,
"provides": {
"importable": "<IGNORE>"
},
diff --git a/Tests/RunCMake/CXXModules/examples/expect/export-build-database-imported-all.json b/Tests/RunCMake/CXXModules/examples/expect/export-build-database-imported-all.json
index cb3b3a2..42d934b 100644
--- a/Tests/RunCMake/CXXModules/examples/expect/export-build-database-imported-all.json
+++ b/Tests/RunCMake/CXXModules/examples/expect/export-build-database-imported-all.json
@@ -127,7 +127,7 @@
"-Dtarget_interface_option"
],
"object": "PATH:CMakeFiles/use_import_interfaces.dir<CONFIG_DIR>/use.cxx<OBJEXT>",
- "private": true,
+ "private": false,
"provides": {
"importable": "<IGNORE>"
},
diff --git a/Tests/RunCMake/CXXModules/examples/expect/export-build-database-imported-config.json b/Tests/RunCMake/CXXModules/examples/expect/export-build-database-imported-config.json
index cb3b3a2..42d934b 100644
--- a/Tests/RunCMake/CXXModules/examples/expect/export-build-database-imported-config.json
+++ b/Tests/RunCMake/CXXModules/examples/expect/export-build-database-imported-config.json
@@ -127,7 +127,7 @@
"-Dtarget_interface_option"
],
"object": "PATH:CMakeFiles/use_import_interfaces.dir<CONFIG_DIR>/use.cxx<OBJEXT>",
- "private": true,
+ "private": false,
"provides": {
"importable": "<IGNORE>"
},
diff --git a/Tests/RunCMake/CXXModules/examples/expect/export-build-database-imported-cxx-config.json b/Tests/RunCMake/CXXModules/examples/expect/export-build-database-imported-cxx-config.json
index cb3b3a2..42d934b 100644
--- a/Tests/RunCMake/CXXModules/examples/expect/export-build-database-imported-cxx-config.json
+++ b/Tests/RunCMake/CXXModules/examples/expect/export-build-database-imported-cxx-config.json
@@ -127,7 +127,7 @@
"-Dtarget_interface_option"
],
"object": "PATH:CMakeFiles/use_import_interfaces.dir<CONFIG_DIR>/use.cxx<OBJEXT>",
- "private": true,
+ "private": false,
"provides": {
"importable": "<IGNORE>"
},
diff --git a/Tests/RunCMake/CXXModules/examples/expect/export-build-database-imported-cxx-multi.json b/Tests/RunCMake/CXXModules/examples/expect/export-build-database-imported-cxx-multi.json
index 2fdaef5..a1817d4 100644
--- a/Tests/RunCMake/CXXModules/examples/expect/export-build-database-imported-cxx-multi.json
+++ b/Tests/RunCMake/CXXModules/examples/expect/export-build-database-imported-cxx-multi.json
@@ -180,7 +180,7 @@
"-Dtarget_interface_option"
],
"object": "PATH:CMakeFiles/use_import_interfaces.dir<CONFIG_DIR>/use.cxx<OBJEXT>",
- "private": true,
+ "private": false,
"provides": {
"importable": "<IGNORE>"
},
@@ -263,7 +263,7 @@
"-Dtarget_interface_option"
],
"object": "PATH:CMakeFiles/use_import_interfaces.dir<CONFIG_OTHER_DIR>/use.cxx<OBJEXT>",
- "private": true,
+ "private": false,
"provides": {
"importable": "<IGNORE>"
},
diff --git a/Tests/RunCMake/CXXModules/examples/expect/export-build-database-imported-cxx.json b/Tests/RunCMake/CXXModules/examples/expect/export-build-database-imported-cxx.json
index cb3b3a2..42d934b 100644
--- a/Tests/RunCMake/CXXModules/examples/expect/export-build-database-imported-cxx.json
+++ b/Tests/RunCMake/CXXModules/examples/expect/export-build-database-imported-cxx.json
@@ -127,7 +127,7 @@
"-Dtarget_interface_option"
],
"object": "PATH:CMakeFiles/use_import_interfaces.dir<CONFIG_DIR>/use.cxx<OBJEXT>",
- "private": true,
+ "private": false,
"provides": {
"importable": "<IGNORE>"
},
diff --git a/Tests/RunCMake/CXXModules/examples/expect/export-build-database-target.json b/Tests/RunCMake/CXXModules/examples/expect/export-build-database-target.json
index 440bc4e..e08ee35 100644
--- a/Tests/RunCMake/CXXModules/examples/expect/export-build-database-target.json
+++ b/Tests/RunCMake/CXXModules/examples/expect/export-build-database-target.json
@@ -138,7 +138,7 @@
"-Dfrom_source_option"
],
"object": "PATH:CMakeFiles/export_build_database.dir<CONFIG_DIR>/importable.cxx<OBJEXT>",
- "private": true,
+ "private": false,
"provides": {
"importable": "<BINARY_DIR>/CMakeFiles/export_build_database.dir<CONFIG_DIR>/importable<BMIEXT>"
},
diff --git a/Tests/RunCMake/CXXModules/examples/export-build-database-setup.cmake b/Tests/RunCMake/CXXModules/examples/export-build-database-setup.cmake
index 20a9e90..bbff95f 100644
--- a/Tests/RunCMake/CXXModules/examples/export-build-database-setup.cmake
+++ b/Tests/RunCMake/CXXModules/examples/export-build-database-setup.cmake
@@ -1,4 +1,4 @@
-set(CMAKE_EXPERIMENTAL_EXPORT_BUILD_DATABASE "4bd552e2-b7fb-429a-ab23-c83ef53f3f13")
+set(CMAKE_EXPERIMENTAL_EXPORT_BUILD_DATABASE "73194a1d-c0b5-41b9-9190-a4512925e192")
get_property(is_multiconfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
if (is_multiconfig)
diff --git a/Tests/RunCMake/CommandLine/build-invalid-target-syntax-stderr.txt b/Tests/RunCMake/CommandLine/build-invalid-target-syntax-stderr.txt
index fa3adc8..1eebfc6 100644
--- a/Tests/RunCMake/CommandLine/build-invalid-target-syntax-stderr.txt
+++ b/Tests/RunCMake/CommandLine/build-invalid-target-syntax-stderr.txt
@@ -1 +1 @@
-^Error: could not load cache
+^Error: not a CMake build directory \(missing CMakeCache\.txt\)$
diff --git a/Tests/RunCMake/CommandLine/build-no-cache-stderr.txt b/Tests/RunCMake/CommandLine/build-no-cache-stderr.txt
index 40dd3c0..1eebfc6 100644
--- a/Tests/RunCMake/CommandLine/build-no-cache-stderr.txt
+++ b/Tests/RunCMake/CommandLine/build-no-cache-stderr.txt
@@ -1 +1 @@
-^Error: could not load cache$
+^Error: not a CMake build directory \(missing CMakeCache\.txt\)$
diff --git a/Tests/RunCMake/CpsExportImportBuild/CMakeLists.txt b/Tests/RunCMake/CpsExportImportBuild/CMakeLists.txt
new file mode 100644
index 0000000..e7a6ddd
--- /dev/null
+++ b/Tests/RunCMake/CpsExportImportBuild/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 4.0.20250220)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/CpsExportImportBuild/RunCMakeTest.cmake b/Tests/RunCMake/CpsExportImportBuild/RunCMakeTest.cmake
new file mode 100644
index 0000000..e414e73
--- /dev/null
+++ b/Tests/RunCMake/CpsExportImportBuild/RunCMakeTest.cmake
@@ -0,0 +1,23 @@
+include(RunCMake)
+
+set(RunCMake_TEST_OPTIONS
+ -Wno-dev
+ "-DCMAKE_EXPERIMENTAL_EXPORT_PACKAGE_INFO:STRING=b80be207-778e-46ba-8080-b23bba22639e"
+ "-DCMAKE_EXPERIMENTAL_FIND_CPS_PACKAGES:STRING=e82e467b-f997-4464-8ace-b00808fff261"
+ )
+
+function(build_project test)
+ set(RunCMake_TEST_NO_CLEAN FALSE)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${test}-build)
+ if (NOT RunCMake_GENERATOR_IS_MULTI_CONFIG)
+ list(APPEND RunCMake_TEST_OPTIONS -DCMAKE_BUILD_TYPE=Release)
+ endif()
+
+ run_cmake(${test})
+
+ set(RunCMake_TEST_NO_CLEAN TRUE)
+ run_cmake_command(${test}-build ${CMAKE_COMMAND} --build . --config Release)
+endfunction()
+
+build_project(TestLibrary)
+build_project(TestExecutable)
diff --git a/Tests/RunCMake/CpsExportImportBuild/TestExecutable.cmake b/Tests/RunCMake/CpsExportImportBuild/TestExecutable.cmake
new file mode 100644
index 0000000..325088d
--- /dev/null
+++ b/Tests/RunCMake/CpsExportImportBuild/TestExecutable.cmake
@@ -0,0 +1,12 @@
+project(TestLibrary C)
+
+set(liba_DIR "${CMAKE_BINARY_DIR}/../TestLibrary-build")
+set(libb_DIR "${CMAKE_BINARY_DIR}/../TestLibrary-build")
+
+find_package(libb REQUIRED COMPONENTS libb)
+
+add_executable(app app.c)
+
+target_link_libraries(app PUBLIC libb::libb)
+
+install(TARGETS app DESTINATION bin)
diff --git a/Tests/RunCMake/CpsExportImportBuild/TestLibrary.cmake b/Tests/RunCMake/CpsExportImportBuild/TestLibrary.cmake
new file mode 100644
index 0000000..13e9e01
--- /dev/null
+++ b/Tests/RunCMake/CpsExportImportBuild/TestLibrary.cmake
@@ -0,0 +1,12 @@
+project(TestLibrary C)
+
+add_library(liba SHARED liba.c)
+add_library(libb SHARED libb.c)
+
+target_link_libraries(libb PUBLIC liba)
+
+install(TARGETS liba EXPORT liba DESTINATION lib)
+export(EXPORT liba PACKAGE_INFO liba)
+
+install(TARGETS libb EXPORT libb DESTINATION lib)
+export(EXPORT libb PACKAGE_INFO libb)
diff --git a/Tests/RunCMake/CpsExportImport/app.c b/Tests/RunCMake/CpsExportImportBuild/app.c
similarity index 100%
rename from Tests/RunCMake/CpsExportImport/app.c
rename to Tests/RunCMake/CpsExportImportBuild/app.c
diff --git a/Tests/RunCMake/CpsExportImport/liba.c b/Tests/RunCMake/CpsExportImportBuild/liba.c
similarity index 100%
rename from Tests/RunCMake/CpsExportImport/liba.c
rename to Tests/RunCMake/CpsExportImportBuild/liba.c
diff --git a/Tests/RunCMake/CpsExportImport/libb.c b/Tests/RunCMake/CpsExportImportBuild/libb.c
similarity index 100%
rename from Tests/RunCMake/CpsExportImport/libb.c
rename to Tests/RunCMake/CpsExportImportBuild/libb.c
diff --git a/Tests/RunCMake/CpsExportImport/CMakeLists.txt b/Tests/RunCMake/CpsExportImportInstall/CMakeLists.txt
similarity index 100%
rename from Tests/RunCMake/CpsExportImport/CMakeLists.txt
rename to Tests/RunCMake/CpsExportImportInstall/CMakeLists.txt
diff --git a/Tests/RunCMake/CpsExportImport/RunCMakeTest.cmake b/Tests/RunCMake/CpsExportImportInstall/RunCMakeTest.cmake
similarity index 100%
rename from Tests/RunCMake/CpsExportImport/RunCMakeTest.cmake
rename to Tests/RunCMake/CpsExportImportInstall/RunCMakeTest.cmake
diff --git a/Tests/RunCMake/CpsExportImport/TestExecutable.cmake b/Tests/RunCMake/CpsExportImportInstall/TestExecutable.cmake
similarity index 100%
rename from Tests/RunCMake/CpsExportImport/TestExecutable.cmake
rename to Tests/RunCMake/CpsExportImportInstall/TestExecutable.cmake
diff --git a/Tests/RunCMake/CpsExportImport/TestLibrary.cmake b/Tests/RunCMake/CpsExportImportInstall/TestLibrary.cmake
similarity index 100%
rename from Tests/RunCMake/CpsExportImport/TestLibrary.cmake
rename to Tests/RunCMake/CpsExportImportInstall/TestLibrary.cmake
diff --git a/Tests/RunCMake/CpsExportImport/app.c b/Tests/RunCMake/CpsExportImportInstall/app.c
similarity index 100%
copy from Tests/RunCMake/CpsExportImport/app.c
copy to Tests/RunCMake/CpsExportImportInstall/app.c
diff --git a/Tests/RunCMake/CpsExportImport/liba.c b/Tests/RunCMake/CpsExportImportInstall/liba.c
similarity index 100%
copy from Tests/RunCMake/CpsExportImport/liba.c
copy to Tests/RunCMake/CpsExportImportInstall/liba.c
diff --git a/Tests/RunCMake/CpsExportImport/libb.c b/Tests/RunCMake/CpsExportImportInstall/libb.c
similarity index 100%
copy from Tests/RunCMake/CpsExportImport/libb.c
copy to Tests/RunCMake/CpsExportImportInstall/libb.c
diff --git a/Tests/RunCMake/ExportPackageInfo/Appendix-check.cmake b/Tests/RunCMake/ExportPackageInfo/Appendix-check.cmake
new file mode 100644
index 0000000..c4f617f
--- /dev/null
+++ b/Tests/RunCMake/ExportPackageInfo/Appendix-check.cmake
@@ -0,0 +1,16 @@
+include(${CMAKE_CURRENT_LIST_DIR}/Assertions.cmake)
+
+set(out_dir "${RunCMake_BINARY_DIR}/Appendix-build")
+
+file(READ "${out_dir}/foo.cps" content)
+expect_value("${content}" "foo" "name")
+expect_value("${content}" "interface" "components" "mammal" "type")
+expect_value("${content}" "1.0" "version")
+
+file(READ "${out_dir}/foo-dog.cps" content)
+expect_value("${content}" "foo" "name")
+expect_value("${content}" "interface" "components" "canine" "type")
+expect_missing("${content}" "version")
+
+expect_array("${content}" 1 "components" "canine" "requires")
+expect_value("${content}" ":mammal" "components" "canine" "requires" 0)
diff --git a/Tests/RunCMake/ExportPackageInfo/Appendix.cmake b/Tests/RunCMake/ExportPackageInfo/Appendix.cmake
new file mode 100644
index 0000000..153231f
--- /dev/null
+++ b/Tests/RunCMake/ExportPackageInfo/Appendix.cmake
@@ -0,0 +1,9 @@
+add_library(mammal INTERFACE)
+add_library(canine INTERFACE)
+target_link_libraries(canine INTERFACE mammal)
+
+install(TARGETS mammal EXPORT mammal DESTINATION .)
+install(TARGETS canine EXPORT canine DESTINATION .)
+
+export(EXPORT mammal PACKAGE_INFO foo VERSION 1.0)
+export(EXPORT canine PACKAGE_INFO foo APPENDIX dog)
diff --git a/Tests/RunCMake/PackageInfo/Assertions.cmake b/Tests/RunCMake/ExportPackageInfo/Assertions.cmake
similarity index 100%
rename from Tests/RunCMake/PackageInfo/Assertions.cmake
rename to Tests/RunCMake/ExportPackageInfo/Assertions.cmake
diff --git a/Tests/RunCMake/PackageInfo/BadArgs1-result.txt b/Tests/RunCMake/ExportPackageInfo/BadArgs1-result.txt
similarity index 100%
rename from Tests/RunCMake/PackageInfo/BadArgs1-result.txt
rename to Tests/RunCMake/ExportPackageInfo/BadArgs1-result.txt
diff --git a/Tests/RunCMake/ExportPackageInfo/BadArgs1-stderr.txt b/Tests/RunCMake/ExportPackageInfo/BadArgs1-stderr.txt
new file mode 100644
index 0000000..5455b36
--- /dev/null
+++ b/Tests/RunCMake/ExportPackageInfo/BadArgs1-stderr.txt
@@ -0,0 +1,10 @@
+CMake Error at BadArgs1\.cmake:3 \(export\):
+ export COMPAT_VERSION requires VERSION\.
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:3 \(include\)
+
+
+CMake Error at BadArgs1\.cmake:4 \(export\):
+ export VERSION_SCHEMA requires VERSION\.
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:3 \(include\)
diff --git a/Tests/RunCMake/ExportPackageInfo/BadArgs1.cmake b/Tests/RunCMake/ExportPackageInfo/BadArgs1.cmake
new file mode 100644
index 0000000..cd11146
--- /dev/null
+++ b/Tests/RunCMake/ExportPackageInfo/BadArgs1.cmake
@@ -0,0 +1,4 @@
+add_library(foo INTERFACE)
+install(TARGETS foo EXPORT foo DESTINATION .)
+export(EXPORT foo PACKAGE_INFO foo COMPAT_VERSION 1.0)
+export(EXPORT foo PACKAGE_INFO foo VERSION_SCHEMA simple)
diff --git a/Tests/RunCMake/PackageInfo/BadArgs2-result.txt b/Tests/RunCMake/ExportPackageInfo/BadArgs2-result.txt
similarity index 100%
rename from Tests/RunCMake/PackageInfo/BadArgs2-result.txt
rename to Tests/RunCMake/ExportPackageInfo/BadArgs2-result.txt
diff --git a/Tests/RunCMake/ExportPackageInfo/BadArgs2-stderr.txt b/Tests/RunCMake/ExportPackageInfo/BadArgs2-stderr.txt
new file mode 100644
index 0000000..792cd5c
--- /dev/null
+++ b/Tests/RunCMake/ExportPackageInfo/BadArgs2-stderr.txt
@@ -0,0 +1,16 @@
+CMake Error at BadArgs2\.cmake:3 \(export\):
+ export APPENDIX and VERSION are mutually exclusive\.
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:3 \(include\)
+
+
+CMake Error at BadArgs2\.cmake:4 \(export\):
+ export APPENDIX and DEFAULT_TARGETS are mutually exclusive\.
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:3 \(include\)
+
+
+CMake Error at BadArgs2\.cmake:5 \(export\):
+ export APPENDIX and DEFAULT_CONFIGURATIONS are mutually exclusive\.
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:3 \(include\)
diff --git a/Tests/RunCMake/ExportPackageInfo/BadArgs2.cmake b/Tests/RunCMake/ExportPackageInfo/BadArgs2.cmake
new file mode 100644
index 0000000..4c83bd4
--- /dev/null
+++ b/Tests/RunCMake/ExportPackageInfo/BadArgs2.cmake
@@ -0,0 +1,5 @@
+add_library(foo INTERFACE)
+install(TARGETS foo EXPORT foo DESTINATION .)
+export(EXPORT foo PACKAGE_INFO foo APPENDIX test VERSION 1.0)
+export(EXPORT foo PACKAGE_INFO foo APPENDIX test DEFAULT_TARGETS foo)
+export(EXPORT foo PACKAGE_INFO foo APPENDIX test DEFAULT_CONFIGURATIONS Release)
diff --git a/Tests/RunCMake/PackageInfo/BadArgs3-result.txt b/Tests/RunCMake/ExportPackageInfo/BadArgs3-result.txt
similarity index 100%
rename from Tests/RunCMake/PackageInfo/BadArgs3-result.txt
rename to Tests/RunCMake/ExportPackageInfo/BadArgs3-result.txt
diff --git a/Tests/RunCMake/ExportPackageInfo/BadArgs3-stderr.txt b/Tests/RunCMake/ExportPackageInfo/BadArgs3-stderr.txt
new file mode 100644
index 0000000..4d15b6e
--- /dev/null
+++ b/Tests/RunCMake/ExportPackageInfo/BadArgs3-stderr.txt
@@ -0,0 +1,10 @@
+CMake Error at BadArgs3\.cmake:3 \(export\):
+ export PACKAGE_INFO and FILE are mutually exclusive\.
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:3 \(include\)
+
+
+CMake Error at BadArgs3\.cmake:4 \(export\):
+ export PACKAGE_INFO and NAMESPACE are mutually exclusive\.
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:3 \(include\)
diff --git a/Tests/RunCMake/ExportPackageInfo/BadArgs3.cmake b/Tests/RunCMake/ExportPackageInfo/BadArgs3.cmake
new file mode 100644
index 0000000..106f083
--- /dev/null
+++ b/Tests/RunCMake/ExportPackageInfo/BadArgs3.cmake
@@ -0,0 +1,4 @@
+add_library(foo INTERFACE)
+install(TARGETS foo EXPORT foo DESTINATION .)
+export(EXPORT foo PACKAGE_INFO foo FILE foo.cps)
+export(EXPORT foo PACKAGE_INFO foo NAMESPACE foo::)
diff --git a/Tests/RunCMake/PackageInfo/BadArgs4-result.txt b/Tests/RunCMake/ExportPackageInfo/BadArgs4-result.txt
similarity index 100%
rename from Tests/RunCMake/PackageInfo/BadArgs4-result.txt
rename to Tests/RunCMake/ExportPackageInfo/BadArgs4-result.txt
diff --git a/Tests/RunCMake/ExportPackageInfo/BadArgs4-stderr.txt b/Tests/RunCMake/ExportPackageInfo/BadArgs4-stderr.txt
new file mode 100644
index 0000000..36c6dcc
--- /dev/null
+++ b/Tests/RunCMake/ExportPackageInfo/BadArgs4-stderr.txt
@@ -0,0 +1,28 @@
+CMake Error at BadArgs4\.cmake:3 \(export\):
+ export LOWER_CASE_FILE requires PACKAGE_INFO\.
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:3 \(include\)
+
+
+CMake Error at BadArgs4\.cmake:4 \(export\):
+ export APPENDIX requires PACKAGE_INFO\.
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:3 \(include\)
+
+
+CMake Error at BadArgs4\.cmake:5 \(export\):
+ export VERSION requires PACKAGE_INFO\.
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:3 \(include\)
+
+
+CMake Error at BadArgs4\.cmake:6 \(export\):
+ export DEFAULT_TARGETS requires PACKAGE_INFO\.
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:3 \(include\)
+
+
+CMake Error at BadArgs4\.cmake:7 \(export\):
+ export DEFAULT_CONFIGURATIONS requires PACKAGE_INFO\.
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:3 \(include\)
diff --git a/Tests/RunCMake/ExportPackageInfo/BadArgs4.cmake b/Tests/RunCMake/ExportPackageInfo/BadArgs4.cmake
new file mode 100644
index 0000000..930f6e8
--- /dev/null
+++ b/Tests/RunCMake/ExportPackageInfo/BadArgs4.cmake
@@ -0,0 +1,7 @@
+add_library(foo INTERFACE)
+install(TARGETS foo EXPORT foo DESTINATION .)
+export(EXPORT foo LOWER_CASE_FILE)
+export(EXPORT foo APPENDIX test)
+export(EXPORT foo VERSION 1.0)
+export(EXPORT foo DEFAULT_TARGETS foo)
+export(EXPORT foo DEFAULT_CONFIGURATIONS Release)
diff --git a/Tests/RunCMake/PackageInfo/BadDefaultTarget-result.txt b/Tests/RunCMake/ExportPackageInfo/BadDefaultTarget-result.txt
similarity index 100%
rename from Tests/RunCMake/PackageInfo/BadDefaultTarget-result.txt
rename to Tests/RunCMake/ExportPackageInfo/BadDefaultTarget-result.txt
diff --git a/Tests/RunCMake/PackageInfo/BadDefaultTarget-stderr.txt b/Tests/RunCMake/ExportPackageInfo/BadDefaultTarget-stderr.txt
similarity index 100%
rename from Tests/RunCMake/PackageInfo/BadDefaultTarget-stderr.txt
rename to Tests/RunCMake/ExportPackageInfo/BadDefaultTarget-stderr.txt
diff --git a/Tests/RunCMake/ExportPackageInfo/BadDefaultTarget.cmake b/Tests/RunCMake/ExportPackageInfo/BadDefaultTarget.cmake
new file mode 100644
index 0000000..c1a2253
--- /dev/null
+++ b/Tests/RunCMake/ExportPackageInfo/BadDefaultTarget.cmake
@@ -0,0 +1,5 @@
+add_library(foo INTERFACE)
+add_library(dog INTERFACE)
+install(TARGETS foo EXPORT foo DESTINATION .)
+install(TARGETS dog EXPORT dog DESTINATION .)
+export(EXPORT foo PACKAGE_INFO test DEFAULT_TARGETS dog cat)
diff --git a/Tests/RunCMake/PackageInfo/BadArgs1-result.txt b/Tests/RunCMake/ExportPackageInfo/BadName-result.txt
similarity index 100%
copy from Tests/RunCMake/PackageInfo/BadArgs1-result.txt
copy to Tests/RunCMake/ExportPackageInfo/BadName-result.txt
diff --git a/Tests/RunCMake/ExportPackageInfo/BadName-stderr.txt b/Tests/RunCMake/ExportPackageInfo/BadName-stderr.txt
new file mode 100644
index 0000000..d0d84ba
--- /dev/null
+++ b/Tests/RunCMake/ExportPackageInfo/BadName-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at BadName\.cmake:3 \(export\):
+ export PACKAGE_INFO given invalid package name "%foo"\.
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:3 \(include\)
diff --git a/Tests/RunCMake/ExportPackageInfo/BadName.cmake b/Tests/RunCMake/ExportPackageInfo/BadName.cmake
new file mode 100644
index 0000000..6e17a73
--- /dev/null
+++ b/Tests/RunCMake/ExportPackageInfo/BadName.cmake
@@ -0,0 +1,3 @@
+add_library(foo INTERFACE)
+install(TARGETS foo EXPORT foo DESTINATION .)
+export(EXPORT foo PACKAGE_INFO "%foo")
diff --git a/Tests/RunCMake/ExportPackageInfo/CMakeLists.txt b/Tests/RunCMake/ExportPackageInfo/CMakeLists.txt
new file mode 100644
index 0000000..8c400cc
--- /dev/null
+++ b/Tests/RunCMake/ExportPackageInfo/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 4.0.20240220)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/PackageInfo/DependsMultiple.cmake b/Tests/RunCMake/ExportPackageInfo/DependsMultiple.cmake
similarity index 100%
rename from Tests/RunCMake/PackageInfo/DependsMultiple.cmake
rename to Tests/RunCMake/ExportPackageInfo/DependsMultiple.cmake
diff --git a/Tests/RunCMake/ExportPackageInfo/DependsMultipleCommon.cmake b/Tests/RunCMake/ExportPackageInfo/DependsMultipleCommon.cmake
new file mode 100644
index 0000000..1e95085
--- /dev/null
+++ b/Tests/RunCMake/ExportPackageInfo/DependsMultipleCommon.cmake
@@ -0,0 +1,11 @@
+add_library(foo foo.cxx)
+add_library(bar foo.cxx)
+target_link_libraries(bar foo)
+
+install(TARGETS foo EXPORT foo)
+export(EXPORT foo NAMESPACE ${NAMESPACE})
+export(EXPORT foo PACKAGE_INFO foo)
+
+install(TARGETS bar EXPORT bar)
+export(EXPORT bar)
+export(EXPORT bar PACKAGE_INFO bar)
diff --git a/Tests/RunCMake/PackageInfo/DependsMultipleDifferentNamespace-result.txt b/Tests/RunCMake/ExportPackageInfo/DependsMultipleDifferentNamespace-result.txt
similarity index 100%
rename from Tests/RunCMake/PackageInfo/DependsMultipleDifferentNamespace-result.txt
rename to Tests/RunCMake/ExportPackageInfo/DependsMultipleDifferentNamespace-result.txt
diff --git a/Tests/RunCMake/ExportPackageInfo/DependsMultipleDifferentNamespace-stderr.txt b/Tests/RunCMake/ExportPackageInfo/DependsMultipleDifferentNamespace-stderr.txt
new file mode 100644
index 0000000..5e47e73
--- /dev/null
+++ b/Tests/RunCMake/ExportPackageInfo/DependsMultipleDifferentNamespace-stderr.txt
@@ -0,0 +1,22 @@
+CMake Error in CMakeLists\.txt:
+ export called with target "bar" which requires target "foo" that is not in
+ this export set, but in another export set which is exported multiple times
+ with different namespaces:.*
+ .*/Tests/RunCMake/ExportPackageInfo/DependsMultipleDifferentNamespace-build/foo\.cmake,.*
+ .*/Tests/RunCMake/ExportPackageInfo/DependsMultipleDifferentNamespace-build/foo\.cps\.
+
+ An exported target cannot depend upon another target which is exported in
+ more than one export set or with more than one namespace\. Consider
+ consolidating the exports of the "foo" target to a single export\.
+
+
+CMake Error in CMakeLists\.txt:
+ export called with target "bar" which requires target "foo" that is not in
+ this export set, but in another export set which is exported multiple times
+ with different namespaces:.*
+ .*/Tests/RunCMake/ExportPackageInfo/DependsMultipleDifferentNamespace-build/foo\.cmake,.*
+ .*/Tests/RunCMake/ExportPackageInfo/DependsMultipleDifferentNamespace-build/foo\.cps\.
+
+ An exported target cannot depend upon another target which is exported in
+ more than one export set or with more than one namespace\. Consider
+ consolidating the exports of the "foo" target to a single export\.
diff --git a/Tests/RunCMake/PackageInfo/DependsMultipleDifferentNamespace.cmake b/Tests/RunCMake/ExportPackageInfo/DependsMultipleDifferentNamespace.cmake
similarity index 100%
rename from Tests/RunCMake/PackageInfo/DependsMultipleDifferentNamespace.cmake
rename to Tests/RunCMake/ExportPackageInfo/DependsMultipleDifferentNamespace.cmake
diff --git a/Tests/RunCMake/PackageInfo/DependsMultipleDifferentSets-result.txt b/Tests/RunCMake/ExportPackageInfo/DependsMultipleDifferentSets-result.txt
similarity index 100%
rename from Tests/RunCMake/PackageInfo/DependsMultipleDifferentSets-result.txt
rename to Tests/RunCMake/ExportPackageInfo/DependsMultipleDifferentSets-result.txt
diff --git a/Tests/RunCMake/ExportPackageInfo/DependsMultipleDifferentSets-stderr.txt b/Tests/RunCMake/ExportPackageInfo/DependsMultipleDifferentSets-stderr.txt
new file mode 100644
index 0000000..643c9f0
--- /dev/null
+++ b/Tests/RunCMake/ExportPackageInfo/DependsMultipleDifferentSets-stderr.txt
@@ -0,0 +1,22 @@
+CMake Error in CMakeLists\.txt:
+ export called with target "bar" which requires target "foo" that is not in
+ this export set, but in multiple other export sets:.*
+ .*/Tests/RunCMake/ExportPackageInfo/DependsMultipleDifferentSets-build/foo-alt\.cmake,.*
+ .*/Tests/RunCMake/ExportPackageInfo/DependsMultipleDifferentSets-build/foo\.cmake,.*
+ .*/Tests/RunCMake/ExportPackageInfo/DependsMultipleDifferentSets-build/foo\.cps\.
+
+ An exported target cannot depend upon another target which is exported in
+ more than one export set or with more than one namespace\. Consider
+ consolidating the exports of the "foo" target to a single export\.
+
+
+CMake Error in CMakeLists\.txt:
+ export called with target "bar" which requires target "foo" that is not in
+ this export set, but in multiple other export sets:.*
+ .*/Tests/RunCMake/ExportPackageInfo/DependsMultipleDifferentSets-build/foo-alt\.cmake,.*
+ .*/Tests/RunCMake/ExportPackageInfo/DependsMultipleDifferentSets-build/foo\.cmake,.*
+ .*/Tests/RunCMake/ExportPackageInfo/DependsMultipleDifferentSets-build/foo\.cps\.
+
+ An exported target cannot depend upon another target which is exported in
+ more than one export set or with more than one namespace\. Consider
+ consolidating the exports of the "foo" target to a single export\.
diff --git a/Tests/RunCMake/ExportPackageInfo/DependsMultipleDifferentSets.cmake b/Tests/RunCMake/ExportPackageInfo/DependsMultipleDifferentSets.cmake
new file mode 100644
index 0000000..9d4dea1
--- /dev/null
+++ b/Tests/RunCMake/ExportPackageInfo/DependsMultipleDifferentSets.cmake
@@ -0,0 +1,5 @@
+project(DependsMultipleDifferentSets CXX)
+include(DependsMultipleCommon.cmake)
+
+install(TARGETS foo EXPORT foo-alt)
+export(EXPORT foo-alt)
diff --git a/Tests/RunCMake/PackageInfo/BadDefaultTarget-result.txt b/Tests/RunCMake/ExportPackageInfo/DuplicateOutput-result.txt
similarity index 100%
copy from Tests/RunCMake/PackageInfo/BadDefaultTarget-result.txt
copy to Tests/RunCMake/ExportPackageInfo/DuplicateOutput-result.txt
diff --git a/Tests/RunCMake/ExportPackageInfo/DuplicateOutput-stderr.txt b/Tests/RunCMake/ExportPackageInfo/DuplicateOutput-stderr.txt
new file mode 100644
index 0000000..b9947a5
--- /dev/null
+++ b/Tests/RunCMake/ExportPackageInfo/DuplicateOutput-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at DuplicateOutput\.cmake:4 \(export\):
+ export command already specified for the file foo\.cps\.
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:3 \(include\)
diff --git a/Tests/RunCMake/ExportPackageInfo/DuplicateOutput.cmake b/Tests/RunCMake/ExportPackageInfo/DuplicateOutput.cmake
new file mode 100644
index 0000000..de901f3
--- /dev/null
+++ b/Tests/RunCMake/ExportPackageInfo/DuplicateOutput.cmake
@@ -0,0 +1,4 @@
+add_library(foo INTERFACE)
+install(TARGETS foo EXPORT foo DESTINATION .)
+export(EXPORT foo PACKAGE_INFO foo)
+export(EXPORT foo PACKAGE_INFO foo)
diff --git a/Tests/RunCMake/PackageInfo/ExperimentalGate-result.txt b/Tests/RunCMake/ExportPackageInfo/ExperimentalGate-result.txt
similarity index 100%
rename from Tests/RunCMake/PackageInfo/ExperimentalGate-result.txt
rename to Tests/RunCMake/ExportPackageInfo/ExperimentalGate-result.txt
diff --git a/Tests/RunCMake/ExportPackageInfo/ExperimentalGate-stderr.txt b/Tests/RunCMake/ExportPackageInfo/ExperimentalGate-stderr.txt
new file mode 100644
index 0000000..36725b3
--- /dev/null
+++ b/Tests/RunCMake/ExportPackageInfo/ExperimentalGate-stderr.txt
@@ -0,0 +1,2 @@
+CMake Error at ExperimentalGate.cmake:5 \(export\):
+ export Unknown argument: "PACKAGE_INFO"\.
diff --git a/Tests/RunCMake/ExportPackageInfo/ExperimentalGate.cmake b/Tests/RunCMake/ExportPackageInfo/ExperimentalGate.cmake
new file mode 100644
index 0000000..6f23324
--- /dev/null
+++ b/Tests/RunCMake/ExportPackageInfo/ExperimentalGate.cmake
@@ -0,0 +1,5 @@
+unset(CMAKE_EXPERIMENTAL_EXPORT_PACKAGE_INFO)
+
+add_library(foo INTERFACE)
+install(TARGETS foo EXPORT foo DESTINATION .)
+export(EXPORT foo PACKAGE_INFO foo)
diff --git a/Tests/RunCMake/ExportPackageInfo/ExperimentalWarning-stderr.txt b/Tests/RunCMake/ExportPackageInfo/ExperimentalWarning-stderr.txt
new file mode 100644
index 0000000..bc6ec3e
--- /dev/null
+++ b/Tests/RunCMake/ExportPackageInfo/ExperimentalWarning-stderr.txt
@@ -0,0 +1,7 @@
+CMake Warning \(dev\) at ExperimentalWarning.cmake:8 \(export\):
+ CMake's support for exporting package information in the Common Package
+ Specification format is experimental\. It is meant only for experimentation
+ and feedback to CMake developers\.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/ExportPackageInfo/ExperimentalWarning.cmake b/Tests/RunCMake/ExportPackageInfo/ExperimentalWarning.cmake
new file mode 100644
index 0000000..822a8bb
--- /dev/null
+++ b/Tests/RunCMake/ExportPackageInfo/ExperimentalWarning.cmake
@@ -0,0 +1,8 @@
+set(
+ CMAKE_EXPERIMENTAL_EXPORT_PACKAGE_INFO
+ "b80be207-778e-46ba-8080-b23bba22639e"
+ )
+
+add_library(foo INTERFACE)
+install(TARGETS foo EXPORT foo DESTINATION .)
+export(EXPORT foo PACKAGE_INFO foo)
diff --git a/Tests/RunCMake/ExportPackageInfo/InterfaceProperties-check.cmake b/Tests/RunCMake/ExportPackageInfo/InterfaceProperties-check.cmake
new file mode 100644
index 0000000..1573dd8
--- /dev/null
+++ b/Tests/RunCMake/ExportPackageInfo/InterfaceProperties-check.cmake
@@ -0,0 +1,24 @@
+include(${CMAKE_CURRENT_LIST_DIR}/Assertions.cmake)
+
+set(out_dir "${RunCMake_BINARY_DIR}/InterfaceProperties-build")
+
+file(READ "${out_dir}/foo.cps" content)
+expect_value("${content}" "foo" "name")
+
+string(JSON component GET "${content}" "components" "foo")
+
+expect_value("${component}" "interface" "type")
+expect_array("${component}" 1 "includes")
+expect_value("${component}" "${CMAKE_CURRENT_LIST_DIR}/foo" "includes" 0)
+expect_array("${component}" 1 "compile_features")
+expect_value("${component}" "c++23" "compile_features" 0)
+expect_array("${component}" 1 "compile_flags")
+expect_value("${component}" "-ffast-math" "compile_flags" 0)
+expect_null("${component}" "compile_definitions" "*" "FOO")
+expect_value("${component}" "BAR" "compile_definitions" "*" "BAR")
+expect_array("${component}" 1 "link_directories")
+expect_value("${component}" "/opt/foo/lib" "link_directories" 0)
+expect_array("${component}" 1 "link_flags")
+expect_value("${component}" "--needed" "link_flags" 0)
+expect_array("${component}" 1 "link_libraries")
+expect_value("${component}" "/usr/lib/libm.so" "link_libraries" 0)
diff --git a/Tests/RunCMake/ExportPackageInfo/InterfaceProperties.cmake b/Tests/RunCMake/ExportPackageInfo/InterfaceProperties.cmake
new file mode 100644
index 0000000..0b519ee
--- /dev/null
+++ b/Tests/RunCMake/ExportPackageInfo/InterfaceProperties.cmake
@@ -0,0 +1,15 @@
+add_library(foo INTERFACE)
+
+target_compile_features(foo INTERFACE cxx_std_23)
+target_compile_options(foo INTERFACE -ffast-math)
+target_compile_definitions(foo INTERFACE -DFOO -DBAR=BAR)
+target_include_directories(
+ foo INTERFACE
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/foo>
+ )
+target_link_directories(foo INTERFACE /opt/foo/lib)
+target_link_options(foo INTERFACE --needed)
+target_link_libraries(foo INTERFACE /usr/lib/libm.so)
+
+install(TARGETS foo EXPORT foo DESTINATION .)
+export(EXPORT foo PACKAGE_INFO foo)
diff --git a/Tests/RunCMake/ExportPackageInfo/LowerCaseFile-check.cmake b/Tests/RunCMake/ExportPackageInfo/LowerCaseFile-check.cmake
new file mode 100644
index 0000000..279521c
--- /dev/null
+++ b/Tests/RunCMake/ExportPackageInfo/LowerCaseFile-check.cmake
@@ -0,0 +1,9 @@
+include(${CMAKE_CURRENT_LIST_DIR}/Assertions.cmake)
+
+set(out_dir "${RunCMake_BINARY_DIR}/LowerCaseFile-build")
+
+file(READ "${out_dir}/lowercase.cps" content)
+expect_value("${content}" "LowerCase" "name")
+
+file(READ "${out_dir}/PreserveCase.cps" content)
+expect_value("${content}" "PreserveCase" "name")
diff --git a/Tests/RunCMake/ExportPackageInfo/LowerCaseFile.cmake b/Tests/RunCMake/ExportPackageInfo/LowerCaseFile.cmake
new file mode 100644
index 0000000..9becb5f
--- /dev/null
+++ b/Tests/RunCMake/ExportPackageInfo/LowerCaseFile.cmake
@@ -0,0 +1,4 @@
+add_library(foo INTERFACE)
+install(TARGETS foo EXPORT foo DESTINATION .)
+export(EXPORT foo PACKAGE_INFO LowerCase LOWER_CASE_FILE)
+export(EXPORT foo PACKAGE_INFO PreserveCase)
diff --git a/Tests/RunCMake/ExportPackageInfo/Metadata-check.cmake b/Tests/RunCMake/ExportPackageInfo/Metadata-check.cmake
new file mode 100644
index 0000000..76e5e55
--- /dev/null
+++ b/Tests/RunCMake/ExportPackageInfo/Metadata-check.cmake
@@ -0,0 +1,16 @@
+include(${CMAKE_CURRENT_LIST_DIR}/Assertions.cmake)
+
+set(out_dir "${RunCMake_BINARY_DIR}/Metadata-build")
+
+file(READ "${out_dir}/foo.cps" content)
+expect_value("${content}" "foo" "name")
+expect_value("${content}" "1.2.3" "version")
+expect_value("${content}" "1.2.0" "compat_version")
+expect_value("${content}" "simple" "version_schema")
+
+expect_array("${content}" 1 "default_components")
+expect_value("${content}" "foo" "default_components" 0)
+
+expect_array("${content}" 2 "configurations")
+expect_value("${content}" "release" "configurations" 0)
+expect_value("${content}" "debug" "configurations" 1)
diff --git a/Tests/RunCMake/ExportPackageInfo/Metadata.cmake b/Tests/RunCMake/ExportPackageInfo/Metadata.cmake
new file mode 100644
index 0000000..1de0021
--- /dev/null
+++ b/Tests/RunCMake/ExportPackageInfo/Metadata.cmake
@@ -0,0 +1,11 @@
+add_library(foo INTERFACE)
+install(TARGETS foo EXPORT foo DESTINATION .)
+export(
+ EXPORT foo
+ PACKAGE_INFO foo
+ VERSION 1.2.3
+ VERSION_SCHEMA simple
+ COMPAT_VERSION 1.2.0
+ DEFAULT_TARGETS foo
+ DEFAULT_CONFIGURATIONS release debug
+ )
diff --git a/Tests/RunCMake/ExportPackageInfo/Minimal-check.cmake b/Tests/RunCMake/ExportPackageInfo/Minimal-check.cmake
new file mode 100644
index 0000000..deba94e
--- /dev/null
+++ b/Tests/RunCMake/ExportPackageInfo/Minimal-check.cmake
@@ -0,0 +1,18 @@
+include(${CMAKE_CURRENT_LIST_DIR}/Assertions.cmake)
+
+set(out_dir "${RunCMake_BINARY_DIR}/Minimal-build")
+
+file(READ "${out_dir}/foo.cps" content)
+expect_value("${content}" "foo" "name")
+expect_value("${content}" "interface" "components" "foo" "type")
+expect_missing("${content}" "version")
+expect_missing("${content}" "configurations")
+expect_missing("${content}" "default_targets")
+expect_missing("${content}" "components" "foo" "compile_definitions")
+expect_missing("${content}" "components" "foo" "compile_features")
+expect_missing("${content}" "components" "foo" "compile_flags")
+expect_missing("${content}" "components" "foo" "link_directories")
+expect_missing("${content}" "components" "foo" "link_features")
+expect_missing("${content}" "components" "foo" "link_flags")
+expect_missing("${content}" "components" "foo" "link_libraries")
+expect_missing("${content}" "components" "foo" "requires")
diff --git a/Tests/RunCMake/ExportPackageInfo/Minimal.cmake b/Tests/RunCMake/ExportPackageInfo/Minimal.cmake
new file mode 100644
index 0000000..9af1fed
--- /dev/null
+++ b/Tests/RunCMake/ExportPackageInfo/Minimal.cmake
@@ -0,0 +1,3 @@
+add_library(foo INTERFACE)
+install(TARGETS foo EXPORT foo DESTINATION .)
+export(EXPORT foo PACKAGE_INFO foo)
diff --git a/Tests/RunCMake/ExportPackageInfo/MinimalVersion-check.cmake b/Tests/RunCMake/ExportPackageInfo/MinimalVersion-check.cmake
new file mode 100644
index 0000000..025c5fc
--- /dev/null
+++ b/Tests/RunCMake/ExportPackageInfo/MinimalVersion-check.cmake
@@ -0,0 +1,21 @@
+include(${CMAKE_CURRENT_LIST_DIR}/Assertions.cmake)
+
+set(out_dir "${RunCMake_BINARY_DIR}/MinimalVersion-build")
+
+file(READ "${out_dir}/foo1.cps" content)
+expect_value("${content}" "foo1" "name")
+expect_value("${content}" "1.0" "version")
+expect_missing("${content}" "compat_version")
+expect_missing("${content}" "version_schema")
+
+file(READ "${out_dir}/foo2.cps" content)
+expect_value("${content}" "foo2" "name")
+expect_value("${content}" "1.5" "version")
+expect_value("${content}" "1.0" "compat_version")
+expect_missing("${content}" "version_schema")
+
+file(READ "${out_dir}/foo3.cps" content)
+expect_value("${content}" "foo3" "name")
+expect_value("${content}" "1.0" "version")
+expect_missing("${content}" "compat_version")
+expect_value("${content}" "simple" "version_schema")
diff --git a/Tests/RunCMake/ExportPackageInfo/MinimalVersion.cmake b/Tests/RunCMake/ExportPackageInfo/MinimalVersion.cmake
new file mode 100644
index 0000000..406ae2d
--- /dev/null
+++ b/Tests/RunCMake/ExportPackageInfo/MinimalVersion.cmake
@@ -0,0 +1,16 @@
+add_library(foo INTERFACE)
+install(TARGETS foo EXPORT foo DESTINATION .)
+
+export(EXPORT foo
+ PACKAGE_INFO foo1
+ VERSION 1.0)
+
+export(EXPORT foo
+ PACKAGE_INFO foo2
+ VERSION 1.5
+ COMPAT_VERSION 1.0)
+
+export(EXPORT foo
+ PACKAGE_INFO foo3
+ VERSION 1.0
+ VERSION_SCHEMA simple)
diff --git a/Tests/RunCMake/PackageInfo/ReferencesNonExportedTarget-result.txt b/Tests/RunCMake/ExportPackageInfo/ReferencesNonExportedTarget-result.txt
similarity index 100%
rename from Tests/RunCMake/PackageInfo/ReferencesNonExportedTarget-result.txt
rename to Tests/RunCMake/ExportPackageInfo/ReferencesNonExportedTarget-result.txt
diff --git a/Tests/RunCMake/ExportPackageInfo/ReferencesNonExportedTarget-stderr.txt b/Tests/RunCMake/ExportPackageInfo/ReferencesNonExportedTarget-stderr.txt
new file mode 100644
index 0000000..9307086
--- /dev/null
+++ b/Tests/RunCMake/ExportPackageInfo/ReferencesNonExportedTarget-stderr.txt
@@ -0,0 +1,3 @@
+CMake Error in CMakeLists.txt:
+ export called with target "canine" which requires target "mammal" that is
+ not in any export set.
diff --git a/Tests/RunCMake/ExportPackageInfo/ReferencesNonExportedTarget.cmake b/Tests/RunCMake/ExportPackageInfo/ReferencesNonExportedTarget.cmake
new file mode 100644
index 0000000..f8c1370
--- /dev/null
+++ b/Tests/RunCMake/ExportPackageInfo/ReferencesNonExportedTarget.cmake
@@ -0,0 +1,6 @@
+add_library(mammal INTERFACE)
+add_library(canine INTERFACE)
+target_link_libraries(canine INTERFACE mammal)
+
+install(TARGETS canine EXPORT dog DESTINATION .)
+export(EXPORT dog PACKAGE_INFO dog)
diff --git a/Tests/RunCMake/PackageInfo/ReferencesWronglyExportedTarget-result.txt b/Tests/RunCMake/ExportPackageInfo/ReferencesWronglyExportedTarget-result.txt
similarity index 100%
rename from Tests/RunCMake/PackageInfo/ReferencesWronglyExportedTarget-result.txt
rename to Tests/RunCMake/ExportPackageInfo/ReferencesWronglyExportedTarget-result.txt
diff --git a/Tests/RunCMake/PackageInfo/ReferencesWronglyExportedTarget-stderr.txt b/Tests/RunCMake/ExportPackageInfo/ReferencesWronglyExportedTarget-stderr.txt
similarity index 100%
rename from Tests/RunCMake/PackageInfo/ReferencesWronglyExportedTarget-stderr.txt
rename to Tests/RunCMake/ExportPackageInfo/ReferencesWronglyExportedTarget-stderr.txt
diff --git a/Tests/RunCMake/ExportPackageInfo/ReferencesWronglyExportedTarget.cmake b/Tests/RunCMake/ExportPackageInfo/ReferencesWronglyExportedTarget.cmake
new file mode 100644
index 0000000..66e51bd
--- /dev/null
+++ b/Tests/RunCMake/ExportPackageInfo/ReferencesWronglyExportedTarget.cmake
@@ -0,0 +1,14 @@
+add_library(foo INTERFACE)
+add_library(bar INTERFACE)
+
+add_library(test INTERFACE)
+target_link_libraries(test INTERFACE foo bar)
+
+install(TARGETS foo EXPORT foo DESTINATION .)
+install(TARGETS bar EXPORT bar DESTINATION .)
+
+export(EXPORT foo)
+export(EXPORT bar NAMESPACE bar_)
+
+install(TARGETS test EXPORT test DESTINATION .)
+export(EXPORT test PACKAGE_INFO test)
diff --git a/Tests/RunCMake/PackageInfo/ReferencesWronglyImportedTarget-result.txt b/Tests/RunCMake/ExportPackageInfo/ReferencesWronglyImportedTarget-result.txt
similarity index 100%
rename from Tests/RunCMake/PackageInfo/ReferencesWronglyImportedTarget-result.txt
rename to Tests/RunCMake/ExportPackageInfo/ReferencesWronglyImportedTarget-result.txt
diff --git a/Tests/RunCMake/PackageInfo/ReferencesWronglyImportedTarget-stderr.txt b/Tests/RunCMake/ExportPackageInfo/ReferencesWronglyImportedTarget-stderr.txt
similarity index 100%
rename from Tests/RunCMake/PackageInfo/ReferencesWronglyImportedTarget-stderr.txt
rename to Tests/RunCMake/ExportPackageInfo/ReferencesWronglyImportedTarget-stderr.txt
diff --git a/Tests/RunCMake/ExportPackageInfo/ReferencesWronglyImportedTarget.cmake b/Tests/RunCMake/ExportPackageInfo/ReferencesWronglyImportedTarget.cmake
new file mode 100644
index 0000000..93686f6
--- /dev/null
+++ b/Tests/RunCMake/ExportPackageInfo/ReferencesWronglyImportedTarget.cmake
@@ -0,0 +1,7 @@
+add_library(bar INTERFACE IMPORTED)
+
+add_library(foo INTERFACE)
+target_link_libraries(foo INTERFACE bar)
+
+install(TARGETS foo EXPORT foo DESTINATION .)
+export(EXPORT foo PACKAGE_INFO foo)
diff --git a/Tests/RunCMake/PackageInfo/ReferencesWronglyNamespacedTarget-result.txt b/Tests/RunCMake/ExportPackageInfo/ReferencesWronglyNamespacedTarget-result.txt
similarity index 100%
rename from Tests/RunCMake/PackageInfo/ReferencesWronglyNamespacedTarget-result.txt
rename to Tests/RunCMake/ExportPackageInfo/ReferencesWronglyNamespacedTarget-result.txt
diff --git a/Tests/RunCMake/PackageInfo/ReferencesWronglyNamespacedTarget-stderr.txt b/Tests/RunCMake/ExportPackageInfo/ReferencesWronglyNamespacedTarget-stderr.txt
similarity index 100%
rename from Tests/RunCMake/PackageInfo/ReferencesWronglyNamespacedTarget-stderr.txt
rename to Tests/RunCMake/ExportPackageInfo/ReferencesWronglyNamespacedTarget-stderr.txt
diff --git a/Tests/RunCMake/ExportPackageInfo/ReferencesWronglyNamespacedTarget.cmake b/Tests/RunCMake/ExportPackageInfo/ReferencesWronglyNamespacedTarget.cmake
new file mode 100644
index 0000000..d6188d3
--- /dev/null
+++ b/Tests/RunCMake/ExportPackageInfo/ReferencesWronglyNamespacedTarget.cmake
@@ -0,0 +1,11 @@
+find_package(
+ broken REQUIRED CONFIG
+ NO_DEFAULT_PATH
+ PATHS ${CMAKE_CURRENT_LIST_DIR}
+ )
+
+add_library(foo INTERFACE)
+target_link_libraries(foo INTERFACE wrong::lib)
+
+install(TARGETS foo EXPORT foo DESTINATION .)
+export(EXPORT foo PACKAGE_INFO foo)
diff --git a/Tests/RunCMake/ExportPackageInfo/Requirements-check.cmake b/Tests/RunCMake/ExportPackageInfo/Requirements-check.cmake
new file mode 100644
index 0000000..226c4c2
--- /dev/null
+++ b/Tests/RunCMake/ExportPackageInfo/Requirements-check.cmake
@@ -0,0 +1,22 @@
+include(${CMAKE_CURRENT_LIST_DIR}/Assertions.cmake)
+
+set(out_dir "${RunCMake_BINARY_DIR}/Requirements-build")
+
+file(READ "${out_dir}/foo.cps" content)
+expect_value("${content}" "foo" "name")
+expect_value("${content}" "interface" "components" "libb" "type")
+
+file(READ "${out_dir}/bar.cps" content)
+expect_value("${content}" "bar" "name")
+expect_array("${content}" 1 "requires" "foo" "components")
+expect_value("${content}" "libb" "requires" "foo" "components" 0)
+expect_array("${content}" 1 "requires" "test" "components")
+expect_value("${content}" "liba" "requires" "test" "components" 0)
+expect_value("${content}" "interface" "components" "libc" "type")
+expect_value("${content}" "interface" "components" "libd" "type")
+
+string(JSON component GET "${content}" "components" "libd")
+expect_array("${component}" 3 "requires")
+expect_value("${component}" "test:liba" "requires" 0)
+expect_value("${component}" "foo:libb" "requires" 1)
+expect_value("${component}" ":libc" "requires" 2)
diff --git a/Tests/RunCMake/ExportPackageInfo/Requirements.cmake b/Tests/RunCMake/ExportPackageInfo/Requirements.cmake
new file mode 100644
index 0000000..bf6ffbb
--- /dev/null
+++ b/Tests/RunCMake/ExportPackageInfo/Requirements.cmake
@@ -0,0 +1,20 @@
+find_package(
+ test REQUIRED CONFIG
+ NO_DEFAULT_PATH
+ PATHS ${CMAKE_CURRENT_LIST_DIR}
+ )
+
+add_library(libb INTERFACE)
+add_library(libc INTERFACE)
+add_library(libd INTERFACE)
+
+add_library(foo ALIAS libb)
+add_library(bar ALIAS libc)
+
+target_link_libraries(libd INTERFACE test::liba foo bar)
+
+install(TARGETS libb EXPORT foo DESTINATION .)
+export(EXPORT foo PACKAGE_INFO foo)
+
+install(TARGETS libc libd EXPORT bar DESTINATION .)
+export(EXPORT bar PACKAGE_INFO bar)
diff --git a/Tests/RunCMake/PackageInfo/RunCMakeTest.cmake b/Tests/RunCMake/ExportPackageInfo/RunCMakeTest.cmake
similarity index 94%
copy from Tests/RunCMake/PackageInfo/RunCMakeTest.cmake
copy to Tests/RunCMake/ExportPackageInfo/RunCMakeTest.cmake
index 6618ff4..b80ce53 100644
--- a/Tests/RunCMake/PackageInfo/RunCMakeTest.cmake
+++ b/Tests/RunCMake/ExportPackageInfo/RunCMakeTest.cmake
@@ -15,7 +15,8 @@
run_cmake(BadArgs2)
run_cmake(BadArgs3)
run_cmake(BadArgs4)
-run_cmake(BadArgs5)
+run_cmake(BadName)
+run_cmake(DuplicateOutput)
run_cmake(BadDefaultTarget)
run_cmake(ReferencesNonExportedTarget)
run_cmake(ReferencesWronglyExportedTarget)
diff --git a/Tests/RunCMake/ExportPackageInfo/TargetTypes-check.cmake b/Tests/RunCMake/ExportPackageInfo/TargetTypes-check.cmake
new file mode 100644
index 0000000..1c87fcf
--- /dev/null
+++ b/Tests/RunCMake/ExportPackageInfo/TargetTypes-check.cmake
@@ -0,0 +1,11 @@
+include(${CMAKE_CURRENT_LIST_DIR}/Assertions.cmake)
+
+set(out_dir "${RunCMake_BINARY_DIR}/TargetTypes-build")
+
+file(READ "${out_dir}/foo.cps" content)
+expect_value("${content}" "foo" "name")
+expect_value("${content}" "archive" "components" "foo-static" "type")
+expect_value("${content}" "dylib" "components" "foo-shared" "type")
+expect_value("${content}" "module" "components" "foo-module" "type")
+expect_value("${content}" "interface" "components" "bar" "type")
+expect_value("${content}" "executable" "components" "test" "type")
diff --git a/Tests/RunCMake/ExportPackageInfo/TargetTypes.cmake b/Tests/RunCMake/ExportPackageInfo/TargetTypes.cmake
new file mode 100644
index 0000000..414e35e
--- /dev/null
+++ b/Tests/RunCMake/ExportPackageInfo/TargetTypes.cmake
@@ -0,0 +1,20 @@
+project(TargetTypes CXX)
+
+add_library(foo-static STATIC foo.cxx)
+add_library(foo-shared SHARED foo.cxx)
+add_library(foo-module MODULE foo.cxx)
+add_library(bar INTERFACE)
+add_executable(test test.cxx)
+
+install(
+ TARGETS
+ foo-static
+ foo-shared
+ foo-module
+ bar
+ test
+ EXPORT foo
+ DESTINATION .
+ )
+
+export(EXPORT foo PACKAGE_INFO foo)
diff --git a/Tests/RunCMake/PackageInfo/broken-config.cmake b/Tests/RunCMake/ExportPackageInfo/broken-config.cmake
similarity index 100%
rename from Tests/RunCMake/PackageInfo/broken-config.cmake
rename to Tests/RunCMake/ExportPackageInfo/broken-config.cmake
diff --git a/Tests/RunCMake/PackageInfo/foo.cxx b/Tests/RunCMake/ExportPackageInfo/foo.cxx
similarity index 100%
rename from Tests/RunCMake/PackageInfo/foo.cxx
rename to Tests/RunCMake/ExportPackageInfo/foo.cxx
diff --git a/Tests/RunCMake/PackageInfo/test-config.cmake b/Tests/RunCMake/ExportPackageInfo/test-config.cmake
similarity index 100%
rename from Tests/RunCMake/PackageInfo/test-config.cmake
rename to Tests/RunCMake/ExportPackageInfo/test-config.cmake
diff --git a/Tests/RunCMake/PackageInfo/test.cxx b/Tests/RunCMake/ExportPackageInfo/test.cxx
similarity index 100%
rename from Tests/RunCMake/PackageInfo/test.cxx
rename to Tests/RunCMake/ExportPackageInfo/test.cxx
diff --git a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_CMP0126_NEW.cmake b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_CMP0126_NEW.cmake
index a419ab3..13dff4d 100644
--- a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_CMP0126_NEW.cmake
+++ b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_CMP0126_NEW.cmake
@@ -22,7 +22,7 @@
if(NOT DEFINED CMAKE_SYSTEM_NAME
- OR (CMAKE_SYSTEM_NAME MATCHES "^(Linux|kFreeBSD|GNU)$"
+ OR (CMAKE_SYSTEM_NAME MATCHES "^(Linux|GNU)$"
AND NOT CMAKE_CROSSCOMPILING))
if(EXISTS "/etc/debian_version") # is this a debian system ?
if(CMAKE_LIBRARY_ARCHITECTURE MATCHES "^(i386-linux-gnu|x86_64-linux-gnu)$")
diff --git a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_PKGCONFIG_PATH.cmake b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_PKGCONFIG_PATH.cmake
index d1d5385..16df085 100644
--- a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_PKGCONFIG_PATH.cmake
+++ b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_PKGCONFIG_PATH.cmake
@@ -19,7 +19,7 @@
if(NOT DEFINED CMAKE_SYSTEM_NAME
- OR (CMAKE_SYSTEM_NAME MATCHES "^(Linux|kFreeBSD|GNU)$"
+ OR (CMAKE_SYSTEM_NAME MATCHES "^(Linux|GNU)$"
AND NOT CMAKE_CROSSCOMPILING))
if(EXISTS "/etc/debian_version") # is this a debian system ?
if(CMAKE_LIBRARY_ARCHITECTURE MATCHES "^(i386-linux-gnu|x86_64-linux-gnu)$")
diff --git a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_PKGCONFIG_PATH_NO_CMAKE_ENVIRONMENT_PATH.cmake b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_PKGCONFIG_PATH_NO_CMAKE_ENVIRONMENT_PATH.cmake
index 166a617..ad53e35 100644
--- a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_PKGCONFIG_PATH_NO_CMAKE_ENVIRONMENT_PATH.cmake
+++ b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_PKGCONFIG_PATH_NO_CMAKE_ENVIRONMENT_PATH.cmake
@@ -19,7 +19,7 @@
if(NOT DEFINED CMAKE_SYSTEM_NAME
- OR (CMAKE_SYSTEM_NAME MATCHES "^(Linux|kFreeBSD|GNU)$"
+ OR (CMAKE_SYSTEM_NAME MATCHES "^(Linux|GNU)$"
AND NOT CMAKE_CROSSCOMPILING))
if(EXISTS "/etc/debian_version") # is this a debian system ?
if(CMAKE_LIBRARY_ARCHITECTURE MATCHES "^(i386-linux-gnu|x86_64-linux-gnu)$")
diff --git a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_PKGCONFIG_PATH_NO_CMAKE_PATH.cmake b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_PKGCONFIG_PATH_NO_CMAKE_PATH.cmake
index e4673b3..de1e81d 100644
--- a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_PKGCONFIG_PATH_NO_CMAKE_PATH.cmake
+++ b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_PKGCONFIG_PATH_NO_CMAKE_PATH.cmake
@@ -19,7 +19,7 @@
if(NOT DEFINED CMAKE_SYSTEM_NAME
- OR (CMAKE_SYSTEM_NAME MATCHES "^(Linux|kFreeBSD|GNU)$"
+ OR (CMAKE_SYSTEM_NAME MATCHES "^(Linux|GNU)$"
AND NOT CMAKE_CROSSCOMPILING))
if(EXISTS "/etc/debian_version") # is this a debian system ?
if(CMAKE_LIBRARY_ARCHITECTURE MATCHES "^(i386-linux-gnu|x86_64-linux-gnu)$")
diff --git a/Tests/FindPython/ArtifactsInteractive/CMakeLists.txt b/Tests/RunCMake/FindPython/ArtifactsInteractive.cmake
similarity index 89%
rename from Tests/FindPython/ArtifactsInteractive/CMakeLists.txt
rename to Tests/RunCMake/FindPython/ArtifactsInteractive.cmake
index f92db5f..bba4d71 100644
--- a/Tests/FindPython/ArtifactsInteractive/CMakeLists.txt
+++ b/Tests/RunCMake/FindPython/ArtifactsInteractive.cmake
@@ -1,6 +1,4 @@
-cmake_minimum_required(VERSION 3.15)
-
-project(TestArtifactsInteractive LANGUAGES C)
+enable_language(C)
set (components Interpreter Development)
if (CMake_TEST_FindPython3_NumPy)
diff --git a/Tests/FindPython/ArtifactsPrefix/CMakeLists.txt b/Tests/RunCMake/FindPython/ArtifactsPrefix.cmake
similarity index 89%
rename from Tests/FindPython/ArtifactsPrefix/CMakeLists.txt
rename to Tests/RunCMake/FindPython/ArtifactsPrefix.cmake
index d007017..8a8dde4 100644
--- a/Tests/FindPython/ArtifactsPrefix/CMakeLists.txt
+++ b/Tests/RunCMake/FindPython/ArtifactsPrefix.cmake
@@ -1,6 +1,4 @@
-cmake_minimum_required(VERSION 3.31)
-
-project(TestArtifactsPrefix C)
+enable_language(C)
set(Python_ARTIFACTS_PREFIX "_V2")
find_package (Python 2 EXACT REQUIRED)
diff --git a/Tests/RunCMake/FindPython/CMakeLists.txt b/Tests/RunCMake/FindPython/CMakeLists.txt
new file mode 100644
index 0000000..76190f4
--- /dev/null
+++ b/Tests/RunCMake/FindPython/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.20...4.1)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/FindPython/CrossCompiling-BOTH.cmake b/Tests/RunCMake/FindPython/CrossCompiling-BOTH.cmake
new file mode 100644
index 0000000..3f7cfee
--- /dev/null
+++ b/Tests/RunCMake/FindPython/CrossCompiling-BOTH.cmake
@@ -0,0 +1,33 @@
+cmake_policy(SET CMP0190 NEW)
+
+enable_language(C)
+
+
+# Search for host Interpreter
+set(${PYTHON}_ARTIFACTS_PREFIX "_HOST")
+
+find_package(${PYTHON} ${Python_REQUESTED_VERSION} REQUIRED COMPONENTS Interpreter)
+
+unset(${PYTHON}_ARTIFACTS_PREFIX)
+
+
+# Search cross-compilation artifacts
+## First, built an pseudo-emulator
+set(PSEUDO_EMULATOR_DIR "${CMAKE_CURRENT_BINARY_DIR}/pseudo_emulator")
+
+file(MAKE_DIRECTORY "${PSEUDO_EMULATOR_DIR}")
+
+execute_process(COMMAND "${CMAKE_COMMAND}" -G "${CMAKE_GENERATOR}" -DCMAKE_BUILD_TYPE=Release
+ -S "${CMAKE_CURRENT_SOURCE_DIR}/pseudo_emulator"
+ -B "${PSEUDO_EMULATOR_DIR}"
+ COMMAND_ERROR_IS_FATAL ANY)
+
+execute_process(COMMAND "${CMAKE_COMMAND}" --build "${PSEUDO_EMULATOR_DIR}"
+ COMMAND_ERROR_IS_FATAL ANY)
+
+## Now, configure this pseudo-emulator
+set(CMAKE_CROSSCOMPILING TRUE)
+set(CMAKE_CROSSCOMPILING_EMULATOR "${PSEUDO_EMULATOR_DIR}/pseudo_emulator")
+
+
+find_package(${PYTHON} ${Python_REQUESTED_VERSION} REQUIRED COMPONENTS Interpreter Development)
diff --git a/Tests/RunCMake/FindPython/CrossCompiling-CMP0190-NEW.Python.V2-stderr.txt b/Tests/RunCMake/FindPython/CrossCompiling-CMP0190-NEW.Python.V2-stderr.txt
new file mode 100644
index 0000000..aa4728f
--- /dev/null
+++ b/Tests/RunCMake/FindPython/CrossCompiling-CMP0190-NEW.Python.V2-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at .+/Support.cmake:[0-9]+ \(message\):
+ Python: When cross-compiling, Interpreter and/or Compiler components cannot
+ be searched when CMAKE_CROSSCOMPILING_EMULATOR variable is not specified
+ \(see policy CMP0190\).
diff --git a/Tests/RunCMake/FindPython/CrossCompiling-CMP0190-NEW.Python.V3-stderr.txt b/Tests/RunCMake/FindPython/CrossCompiling-CMP0190-NEW.Python.V3-stderr.txt
new file mode 100644
index 0000000..aa4728f
--- /dev/null
+++ b/Tests/RunCMake/FindPython/CrossCompiling-CMP0190-NEW.Python.V3-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at .+/Support.cmake:[0-9]+ \(message\):
+ Python: When cross-compiling, Interpreter and/or Compiler components cannot
+ be searched when CMAKE_CROSSCOMPILING_EMULATOR variable is not specified
+ \(see policy CMP0190\).
diff --git a/Tests/RunCMake/FindPython/CrossCompiling-CMP0190-NEW.Python2-stderr.txt b/Tests/RunCMake/FindPython/CrossCompiling-CMP0190-NEW.Python2-stderr.txt
new file mode 100644
index 0000000..65d1fb0
--- /dev/null
+++ b/Tests/RunCMake/FindPython/CrossCompiling-CMP0190-NEW.Python2-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at .+/Support.cmake:[0-9]+ \(message\):
+ Python2: When cross-compiling, Interpreter and/or Compiler components
+ cannot be searched when CMAKE_CROSSCOMPILING_EMULATOR variable is not
+ specified \(see policy CMP0190\).
diff --git a/Tests/RunCMake/FindPython/CrossCompiling-CMP0190-NEW.Python3-stderr.txt b/Tests/RunCMake/FindPython/CrossCompiling-CMP0190-NEW.Python3-stderr.txt
new file mode 100644
index 0000000..d45c2db
--- /dev/null
+++ b/Tests/RunCMake/FindPython/CrossCompiling-CMP0190-NEW.Python3-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at .+/Support.cmake:[0-9]+ \(message\):
+ Python3: When cross-compiling, Interpreter and/or Compiler components
+ cannot be searched when CMAKE_CROSSCOMPILING_EMULATOR variable is not
+ specified \(see policy CMP0190\).
diff --git a/Tests/RunCMake/FindPython/CrossCompiling-CMP0190-NEW.cmake b/Tests/RunCMake/FindPython/CrossCompiling-CMP0190-NEW.cmake
new file mode 100644
index 0000000..0e847ac
--- /dev/null
+++ b/Tests/RunCMake/FindPython/CrossCompiling-CMP0190-NEW.cmake
@@ -0,0 +1,4 @@
+
+cmake_policy(SET CMP0190 NEW)
+
+include(CrossCompiling-CMP0190.cmake)
diff --git a/Tests/RunCMake/FindPython/CrossCompiling-CMP0190-OLD.cmake b/Tests/RunCMake/FindPython/CrossCompiling-CMP0190-OLD.cmake
new file mode 100644
index 0000000..b608b7f
--- /dev/null
+++ b/Tests/RunCMake/FindPython/CrossCompiling-CMP0190-OLD.cmake
@@ -0,0 +1,4 @@
+
+cmake_policy(SET CMP0190 OLD)
+
+include(CrossCompiling-CMP0190.cmake)
diff --git a/Tests/RunCMake/FindPython/CrossCompiling-CMP0190.cmake b/Tests/RunCMake/FindPython/CrossCompiling-CMP0190.cmake
new file mode 100644
index 0000000..37a62bf
--- /dev/null
+++ b/Tests/RunCMake/FindPython/CrossCompiling-CMP0190.cmake
@@ -0,0 +1,6 @@
+set(CMAKE_CROSSCOMPILING TRUE)
+unset(CMAKE_CROSSCOMPILING_EMULATOR)
+
+enable_language(C)
+
+find_package(${PYTHON} ${Python_REQUESTED_VERSION} REQUIRED COMPONENTS Interpreter Development)
diff --git a/Tests/RunCMake/FindPython/CrossCompiling-HOST.cmake b/Tests/RunCMake/FindPython/CrossCompiling-HOST.cmake
new file mode 100644
index 0000000..2bda063
--- /dev/null
+++ b/Tests/RunCMake/FindPython/CrossCompiling-HOST.cmake
@@ -0,0 +1,8 @@
+cmake_policy(SET CMP0190 NEW)
+
+set(CMAKE_CROSSCOMPILING TRUE)
+set(CMAKE_CROSSCOMPILING_EMULATOR "${CMAKE_COMMAND}" -P raise-error.cmake)
+
+enable_language(C)
+
+find_package(${PYTHON} ${Python_REQUESTED_VERSION} REQUIRED COMPONENTS Interpreter)
diff --git a/Tests/RunCMake/FindPython/CrossCompiling-TARGET.cmake b/Tests/RunCMake/FindPython/CrossCompiling-TARGET.cmake
new file mode 100644
index 0000000..e272619
--- /dev/null
+++ b/Tests/RunCMake/FindPython/CrossCompiling-TARGET.cmake
@@ -0,0 +1,23 @@
+cmake_policy(SET CMP0190 NEW)
+
+enable_language(C)
+
+## First, built an pseudo-emulator
+set(PSEUDO_EMULATOR_DIR "${CMAKE_CURRENT_BINARY_DIR}/pseudo_emulator")
+
+file(MAKE_DIRECTORY "${PSEUDO_EMULATOR_DIR}")
+
+execute_process(COMMAND "${CMAKE_COMMAND}" -G "${CMAKE_GENERATOR}" -DCMAKE_BUILD_TYPE=Release
+ -S "${CMAKE_CURRENT_SOURCE_DIR}/pseudo_emulator"
+ -B "${PSEUDO_EMULATOR_DIR}"
+ COMMAND_ERROR_IS_FATAL ANY)
+
+execute_process(COMMAND "${CMAKE_COMMAND}" --build "${PSEUDO_EMULATOR_DIR}"
+ COMMAND_ERROR_IS_FATAL ANY)
+
+## Now, configure this pseudo-emulator
+set(CMAKE_CROSSCOMPILING TRUE)
+set(CMAKE_CROSSCOMPILING_EMULATOR "${PSEUDO_EMULATOR_DIR}/pseudo_emulator")
+
+
+find_package(${PYTHON} ${Python_REQUESTED_VERSION} REQUIRED COMPONENTS Interpreter Development)
diff --git a/Tests/RunCMake/FindPython/CustomFailureMessage.Include-stderr.txt b/Tests/RunCMake/FindPython/CustomFailureMessage.Include-stderr.txt
new file mode 100644
index 0000000..879cc7c
--- /dev/null
+++ b/Tests/RunCMake/FindPython/CustomFailureMessage.Include-stderr.txt
@@ -0,0 +1,4 @@
+ Could NOT find Python3 \(missing: .*Development.*\).*
+
+ Reason given by package: *
+ Development: Cannot find the directory "/not/found/include"
diff --git a/Tests/RunCMake/FindPython/CustomFailureMessage.Interpreter-stderr.txt b/Tests/RunCMake/FindPython/CustomFailureMessage.Interpreter-stderr.txt
new file mode 100644
index 0000000..9450a04
--- /dev/null
+++ b/Tests/RunCMake/FindPython/CustomFailureMessage.Interpreter-stderr.txt
@@ -0,0 +1,4 @@
+ Could NOT find Python3 \(missing: .*Interpreter.*\).*
+
+ Reason given by package: *
+ Interpreter: Cannot run the interpreter "/not/found/interpreter"
diff --git a/Tests/RunCMake/FindPython/CustomFailureMessage.Library-stderr.txt b/Tests/RunCMake/FindPython/CustomFailureMessage.Library-stderr.txt
new file mode 100644
index 0000000..5e806c4
--- /dev/null
+++ b/Tests/RunCMake/FindPython/CustomFailureMessage.Library-stderr.txt
@@ -0,0 +1,4 @@
+ Could NOT find Python3 \(missing: .*Development.*\).*
+
+ Reason given by package: *
+ Development: Cannot find the library "/not/found/library"
diff --git a/Tests/RunCMake/FindPython/CustomFailureMessage.Multiple-stderr.txt b/Tests/RunCMake/FindPython/CustomFailureMessage.Multiple-stderr.txt
new file mode 100644
index 0000000..26cec30
--- /dev/null
+++ b/Tests/RunCMake/FindPython/CustomFailureMessage.Multiple-stderr.txt
@@ -0,0 +1,6 @@
+ Could NOT find Python3 \(missing: .*Interpreter
+ Development.*\).*
+
+ Reason given by package: *
+ Interpreter: Cannot run the interpreter "/not/found/interpreter"
+ Development: Cannot find the library "/not/found/library"
diff --git a/Tests/RunCMake/FindPython/CustomFailureMessage.NumPy-stderr.txt b/Tests/RunCMake/FindPython/CustomFailureMessage.NumPy-stderr.txt
new file mode 100644
index 0000000..9d7bccd
--- /dev/null
+++ b/Tests/RunCMake/FindPython/CustomFailureMessage.NumPy-stderr.txt
@@ -0,0 +1,4 @@
+ Could NOT find Python3 \(missing: .*NumPy.*\).*
+
+ Reason given by package: *
+ NumPy: Cannot find the directory "/not/found/numpy/include"
diff --git a/Tests/RunCMake/FindPython/CustomFailureMessage.cmake b/Tests/RunCMake/FindPython/CustomFailureMessage.cmake
new file mode 100644
index 0000000..c604c74
--- /dev/null
+++ b/Tests/RunCMake/FindPython/CustomFailureMessage.cmake
@@ -0,0 +1,4 @@
+
+string(REPLACE ":" ";" CHECK_COMPONENTS "${CHECK_COMPONENTS}")
+
+find_package (Python3 REQUIRED COMPONENTS ${CHECK_COMPONENTS})
diff --git a/Tests/RunCMake/FindPython/DifferentComponents.cmake b/Tests/RunCMake/FindPython/DifferentComponents.cmake
new file mode 100644
index 0000000..30cd44e
--- /dev/null
+++ b/Tests/RunCMake/FindPython/DifferentComponents.cmake
@@ -0,0 +1,5 @@
+enable_language(C)
+
+add_subdirectory(subdir)
+
+find_package(Python3 REQUIRED COMPONENTS Development.Module)
diff --git a/Tests/RunCMake/FindPython/ExactVersion.cmake b/Tests/RunCMake/FindPython/ExactVersion.cmake
new file mode 100644
index 0000000..6c048bd
--- /dev/null
+++ b/Tests/RunCMake/FindPython/ExactVersion.cmake
@@ -0,0 +1,54 @@
+enable_language(C)
+
+find_package(${PYTHON} ${Python_REQUESTED_VERSION} COMPONENTS Interpreter Development)
+if(NOT ${PYTHON}_FOUND)
+ message (FATAL_ERROR "Failed to find Python ${Python_REQUESTED_VERSION}")
+endif()
+if(NOT ${PYTHON}_Interpreter_FOUND)
+ message (FATAL_ERROR "Failed to find Python ${Python_REQUESTED_VERSION} Interpreter")
+endif()
+if(NOT ${PYTHON}_Development_FOUND)
+ message (FATAL_ERROR "Failed to find Python ${Python_REQUESTED_VERSION} Development")
+endif()
+
+if(NOT TARGET ${PYTHON}::Interpreter)
+ message(SEND_ERROR "${PYTHON}::Interpreter not found")
+endif()
+
+if(NOT TARGET ${PYTHON}::Python)
+ message(SEND_ERROR "${PYTHON}::Python not found")
+endif()
+if(NOT TARGET ${PYTHON}::Module)
+ message(SEND_ERROR "${PYTHON}::Module not found")
+endif()
+
+
+# reset artifacts and second search with exact version already founded
+unset(${PYTHON}_EXECUTABLE)
+unset(_${PYTHON}_EXECUTABLE CACHE)
+
+unset(_${PYTHON}_LIBRARY_RELEASE CACHE)
+unset(_${PYTHON}_INCLUDE_DIR CACHE)
+
+set(Python_REQUESTED_VERSION ${${PYTHON}_VERSION})
+find_package(${PYTHON} ${Python_REQUESTED_VERSION} EXACT COMPONENTS Interpreter Development)
+if(NOT ${PYTHON}_FOUND)
+ message (FATAL_ERROR "Failed to find Python ${Python_REQUESTED_VERSION}")
+endif()
+if(NOT ${PYTHON}_Interpreter_FOUND)
+ message (FATAL_ERROR "Failed to find Python ${Python_REQUESTED_VERSION} Interpreter")
+endif()
+if(NOT ${PYTHON}_Development_FOUND)
+ message (FATAL_ERROR "Failed to find Python ${Python_REQUESTED_VERSION} Development")
+endif()
+
+if(NOT TARGET ${PYTHON}::Interpreter)
+ message(SEND_ERROR "${PYTHON}::Interpreter not found")
+endif()
+
+if(NOT TARGET ${PYTHON}::Python)
+ message(SEND_ERROR "${PYTHON}::Python not found")
+endif()
+if(NOT TARGET ${PYTHON}::Module)
+ message(SEND_ERROR "${PYTHON}::Module not found")
+endif()
diff --git a/Tests/FindPython/FindPythonScript.cmake b/Tests/RunCMake/FindPython/FindPythonScript.cmake
similarity index 100%
rename from Tests/FindPython/FindPythonScript.cmake
rename to Tests/RunCMake/FindPython/FindPythonScript.cmake
diff --git a/Tests/FindPython/Implementation/CMakeLists.txt b/Tests/RunCMake/FindPython/Implementation.cmake
similarity index 92%
rename from Tests/FindPython/Implementation/CMakeLists.txt
rename to Tests/RunCMake/FindPython/Implementation.cmake
index da33034..134c72c 100644
--- a/Tests/FindPython/Implementation/CMakeLists.txt
+++ b/Tests/RunCMake/FindPython/Implementation.cmake
@@ -1,7 +1,3 @@
-cmake_minimum_required(VERSION 3.15)
-
-project(TestImplementation${Python_REQUESTED_IMPLEMENTATION} LANGUAGES NONE)
-
set (Python${Python_REQUESTED_VERSION}_FIND_IMPLEMENTATIONS ${Python_REQUESTED_IMPLEMENTATION})
diff --git a/Tests/RunCMake/FindPython/IronPython.cmake b/Tests/RunCMake/FindPython/IronPython.cmake
new file mode 100644
index 0000000..d8f490b
--- /dev/null
+++ b/Tests/RunCMake/FindPython/IronPython.cmake
@@ -0,0 +1,36 @@
+
+set (${PYTHON}_FIND_IMPLEMENTATIONS IronPython)
+
+if(PYTHON STREQUAL "Python")
+ set(IronPython_VERSION "IronPython ${Python_REQUESTED_VERSION}")
+elseif(PYTHON STREQUAL "Python2")
+ set(IronPython_VERSION "IronPython2")
+else()
+ set(IronPython_VERSION "IronPython3")
+endif()
+
+find_package(${PYTHON} ${Python_REQUESTED_VERSION} COMPONENTS Interpreter Compiler)
+if (NOT ${PYTHON}_FOUND)
+ message (FATAL_ERROR "Failed to find Python ${Python_REQUESTED_VERSION}")
+endif()
+
+if (NOT ${PYTHON}_Interpreter_FOUND)
+ message (FATAL_ERROR "Failed to find Python Interpreter")
+endif()
+if (NOT ${PYTHON}_INTERPRETER_ID STREQUAL "IronPython")
+ message (FATAL_ERROR "Erroneous interpreter ID (${${PYTHON}_INTERPRETER_ID})")
+endif()
+
+if (NOT ${PYTHON}_Compiler_FOUND)
+ message (FATAL_ERROR "Failed to find Python Compiler")
+endif()
+if (NOT ${PYTHON}_COMPILER_ID STREQUAL "IronPython")
+ message (FATAL_ERROR "Erroneous compiler ID (${${PYTHON}_COMPILER_ID})")
+endif()
+
+if(NOT TARGET ${PYTHON}::Interpreter)
+ message(SEND_ERROR "${PYTHON}::Interpreter not found")
+endif()
+if(NOT TARGET ${PYTHON}::Compiler)
+ message(SEND_ERROR "${PYTHON}::Interpreter not found")
+endif()
diff --git a/Tests/FindPython/MultiplePackages/CMakeLists.txt b/Tests/RunCMake/FindPython/MultiplePackages.cmake
similarity index 86%
rename from Tests/FindPython/MultiplePackages/CMakeLists.txt
rename to Tests/RunCMake/FindPython/MultiplePackages.cmake
index 6536e46..e32e9ed 100644
--- a/Tests/FindPython/MultiplePackages/CMakeLists.txt
+++ b/Tests/RunCMake/FindPython/MultiplePackages.cmake
@@ -1,6 +1,6 @@
-cmake_minimum_required(VERSION 3.15)
+enable_language(C)
-project(TestMultiplePackages C)
+include(CTest)
find_package (Python REQUIRED)
@@ -15,11 +15,11 @@
)
endif()
- Python2_add_library (spam2 MODULE ../spam.c)
+ Python2_add_library (spam2 MODULE spam.c)
target_compile_definitions (spam2 PRIVATE PYTHON2)
add_test (NAME python2_spam2
- COMMAND "${CMAKE_COMMAND}" -E env "PYTHONPATH=$<TARGET_FILE_DIR:spam3>"
+ COMMAND "${CMAKE_COMMAND}" -E env "PYTHONPATH=$<TARGET_FILE_DIR:spam2>"
"${Python2_INTERPRETER}" -c "import spam2; spam2.system(\"cd\")")
endif()
@@ -35,7 +35,7 @@
)
endif()
- Python3_add_library (spam3 MODULE ../spam.c)
+ Python3_add_library (spam3 MODULE spam.c)
target_compile_definitions (spam3 PRIVATE PYTHON3)
add_test (NAME python3_spam3
diff --git a/Tests/FindPython/NumPy/CMakeLists.txt b/Tests/RunCMake/FindPython/NumPy.cmake
similarity index 92%
rename from Tests/FindPython/NumPy/CMakeLists.txt
rename to Tests/RunCMake/FindPython/NumPy.cmake
index c5552d8..274d38d 100644
--- a/Tests/FindPython/NumPy/CMakeLists.txt
+++ b/Tests/RunCMake/FindPython/NumPy.cmake
@@ -1,6 +1,6 @@
-cmake_minimum_required(VERSION 3.15)
+enable_language(C)
-project(TestNumPy LANGUAGES C)
+include(CTest)
if(CMake_TEST_FindPython2_NumPy)
diff --git a/Tests/FindPython/NumPy/CMakeLists.txt b/Tests/RunCMake/FindPython/NumPyOnly.cmake
similarity index 79%
copy from Tests/FindPython/NumPy/CMakeLists.txt
copy to Tests/RunCMake/FindPython/NumPyOnly.cmake
index c5552d8..0f98da7 100644
--- a/Tests/FindPython/NumPy/CMakeLists.txt
+++ b/Tests/RunCMake/FindPython/NumPyOnly.cmake
@@ -1,10 +1,10 @@
-cmake_minimum_required(VERSION 3.15)
+enable_language(C)
-project(TestNumPy LANGUAGES C)
+include(CTest)
if(CMake_TEST_FindPython2_NumPy)
- find_package (Python2 REQUIRED COMPONENTS Interpreter Development NumPy)
+ find_package (Python2 REQUIRED COMPONENTS NumPy)
Python2_add_library (arraytest2 MODULE arraytest.c)
target_compile_definitions (arraytest2 PRIVATE PYTHON2)
@@ -18,7 +18,7 @@
if(CMake_TEST_FindPython3_NumPy)
- find_package (Python3 REQUIRED COMPONENTS Interpreter Development NumPy)
+ find_package (Python3 REQUIRED COMPONENTS NumPy)
Python3_add_library (arraytest3 MODULE arraytest.c)
target_compile_definitions (arraytest3 PRIVATE PYTHON3)
diff --git a/Tests/RunCMake/FindPython/PyPy.cmake b/Tests/RunCMake/FindPython/PyPy.cmake
new file mode 100644
index 0000000..6bbbe84
--- /dev/null
+++ b/Tests/RunCMake/FindPython/PyPy.cmake
@@ -0,0 +1,43 @@
+enable_language(C)
+
+set (${PYTHON}_FIND_IMPLEMENTATIONS PyPy)
+
+if(PYTHON STREQUAL "Python")
+ set(PyPy_VERSION "PyPy ${Python_REQUESTED_VERSION}")
+elseif(PYTHON STREQUAL "Python2")
+ set(PyPy_VERSION "PyPy2")
+else()
+ set(PyPy_VERSION "PyPy3")
+endif()
+
+find_package(${PYTHON} ${Python_REQUESTED_VERSION} COMPONENTS Interpreter Development)
+if (NOT ${PYTHON}_FOUND)
+ message (FATAL_ERROR "Failed to find Python ${PyPy_VERSION}")
+endif()
+
+if (NOT ${PYTHON}_Interpreter_FOUND)
+ message (FATAL_ERROR "Failed to find Python ${PyPy_VERSION} Interpreter")
+endif()
+if (NOT ${PYTHON}_INTERPRETER_ID STREQUAL "PyPy")
+ message (FATAL_ERROR "Erroneous interpreter ID (${${PYTHON}_INTERPRETER_ID})")
+endif()
+
+if (NOT ${PYTHON}_Development.Module_FOUND)
+ message (FATAL_ERROR "Failed to find Python ${PyPy_VERSION} Development.Module")
+endif()
+if (NOT ${PYTHON}_Development.Embed_FOUND)
+ message (FATAL_ERROR "Failed to find Python ${PyPy_VERSION} Development.Embed")
+endif()
+if (NOT ${PYTHON}_Development_FOUND)
+ message (FATAL_ERROR "Failed to find Python ${PyPy_VERSION} Development")
+endif()
+
+if(NOT TARGET ${PYTHON}::Interpreter)
+ message(SEND_ERROR "${PYTHON}::Interpreter not found")
+endif()
+if(NOT TARGET ${PYTHON}::Module)
+ message(SEND_ERROR "${PYTHON}::Module not found")
+endif()
+if(NOT TARGET ${PYTHON}::Python)
+ message(SEND_ERROR "${PYTHON}::Python not found")
+endif()
diff --git a/Tests/FindPython/Python/CMakeLists.txt b/Tests/RunCMake/FindPython/Python.cmake
similarity index 92%
rename from Tests/FindPython/Python/CMakeLists.txt
rename to Tests/RunCMake/FindPython/Python.cmake
index 187a2e2..2171055 100644
--- a/Tests/FindPython/Python/CMakeLists.txt
+++ b/Tests/RunCMake/FindPython/Python.cmake
@@ -1,6 +1,4 @@
-cmake_minimum_required(VERSION 3.15)
-
-project(TestPython LANGUAGES C)
+enable_language(C)
include(CTest)
@@ -27,7 +25,7 @@
endif()
if (Python_REQUESTED_VERSION)
- Python_add_library (spam${Python_REQUESTED_VERSION} MODULE ../spam.c)
+ Python_add_library (spam${Python_REQUESTED_VERSION} MODULE spam.c)
target_compile_definitions (spam${Python_REQUESTED_VERSION} PRIVATE PYTHON${Python_REQUESTED_VERSION})
add_test (NAME python_spam${Python_REQUESTED_VERSION}
@@ -36,7 +34,7 @@
else()
add_test(NAME findpython_script
COMMAND "${CMAKE_COMMAND}" -DPYTHON_PACKAGE_NAME=Python
- -P "${CMAKE_CURRENT_LIST_DIR}/../FindPythonScript.cmake")
+ -P "${CMAKE_CURRENT_LIST_DIR}/FindPythonScript.cmake")
endif()
@@ -71,7 +69,7 @@
endif()
if (Python_REQUESTED_VERSION)
- Python_TEST_add_library (TEST_spam${Python_REQUESTED_VERSION} MODULE ../TEST_spam.c)
+ Python_TEST_add_library (TEST_spam${Python_REQUESTED_VERSION} MODULE TEST_spam.c)
target_compile_definitions (TEST_spam${Python_REQUESTED_VERSION} PRIVATE PYTHON${Python_REQUESTED_VERSION})
add_test (NAME python_TEST_spam${Python_REQUESTED_VERSION}
diff --git a/Tests/RunCMake/export/DependOnDoubleExport-result.txt b/Tests/RunCMake/FindPython/Python2-BadComponent-result.txt
similarity index 100%
copy from Tests/RunCMake/export/DependOnDoubleExport-result.txt
copy to Tests/RunCMake/FindPython/Python2-BadComponent-result.txt
diff --git a/Tests/RunCMake/FindPython/Python2-BadComponent-stderr.txt b/Tests/RunCMake/FindPython/Python2-BadComponent-stderr.txt
new file mode 100644
index 0000000..991989a
--- /dev/null
+++ b/Tests/RunCMake/FindPython/Python2-BadComponent-stderr.txt
@@ -0,0 +1,2 @@
+CMake Error at .+/FindPackageHandleStandardArgs.cmake:[0-9]+ \(message\):
+ Could NOT find Python2 \(missing: foobar\) \(found version "[0-9.]+"\)
diff --git a/Tests/RunCMake/FindPython/Python2-BadComponent.cmake b/Tests/RunCMake/FindPython/Python2-BadComponent.cmake
new file mode 100644
index 0000000..d79f4b1
--- /dev/null
+++ b/Tests/RunCMake/FindPython/Python2-BadComponent.cmake
@@ -0,0 +1,3 @@
+enable_language(C)
+
+find_package(Python2 REQUIRED COMPONENTS Interpreter Development foobar)
diff --git a/Tests/FindPython/Python2/CMakeLists.txt b/Tests/RunCMake/FindPython/Python2.cmake
similarity index 91%
rename from Tests/FindPython/Python2/CMakeLists.txt
rename to Tests/RunCMake/FindPython/Python2.cmake
index ffbb140..43cc9a8 100644
--- a/Tests/FindPython/Python2/CMakeLists.txt
+++ b/Tests/RunCMake/FindPython/Python2.cmake
@@ -1,6 +1,4 @@
-cmake_minimum_required(VERSION 3.15)
-
-project(TestPython2 LANGUAGES C)
+enable_language(C)
include(CTest)
@@ -34,7 +32,7 @@
message(SEND_ERROR "Python2::Module not found")
endif()
-Python2_add_library (spam2 MODULE ../spam.c)
+Python2_add_library (spam2 MODULE spam.c)
target_compile_definitions (spam2 PRIVATE PYTHON2)
add_test (NAME python2_spam2
@@ -44,7 +42,7 @@
add_test(NAME findpython2_script
COMMAND "${CMAKE_COMMAND}" -DPYTHON_PACKAGE_NAME=Python2
-DPython2_FIND_STRATEGY=${Python2_FIND_STRATEGY}
- -P "${CMAKE_CURRENT_LIST_DIR}/../FindPythonScript.cmake")
+ -P "${CMAKE_CURRENT_LIST_DIR}/FindPythonScript.cmake")
#
@@ -80,7 +78,7 @@
message(SEND_ERROR "Python2_TEST::Module not found")
endif()
-Python2_TEST_add_library (TEST_spam2 MODULE ../TEST_spam.c)
+Python2_TEST_add_library (TEST_spam2 MODULE TEST_spam.c)
target_compile_definitions (TEST_spam2 PRIVATE PYTHON2)
add_test (NAME python2_TEST_spam2
diff --git a/Tests/FindPython/Python2Embedded/CMakeLists.txt b/Tests/RunCMake/FindPython/Python2Embedded.cmake
similarity index 87%
rename from Tests/FindPython/Python2Embedded/CMakeLists.txt
rename to Tests/RunCMake/FindPython/Python2Embedded.cmake
index 0a04f70..de65202 100644
--- a/Tests/FindPython/Python2Embedded/CMakeLists.txt
+++ b/Tests/RunCMake/FindPython/Python2Embedded.cmake
@@ -1,6 +1,4 @@
-cmake_minimum_required(VERSION 3.15)
-
-project(TestPython2Embedded LANGUAGES C)
+enable_language(C)
include(CTest)
@@ -26,11 +24,11 @@
message(SEND_ERROR "Python2::Python not found")
endif()
-Python2_add_library (display_time2 SHARED ../display_time.c)
+Python2_add_library (display_time2 SHARED display_time.c)
set_property (TARGET display_time2 PROPERTY WINDOWS_EXPORT_ALL_SYMBOLS ON)
target_compile_definitions (display_time2 PRIVATE PYTHON2)
-add_executable (main2 ../main.c)
+add_executable (main2 main.c)
target_link_libraries (main2 PRIVATE display_time2)
if (WIN32 OR CYGWIN OR MSYS OR MINGW)
diff --git a/Tests/FindPython/Python2Module/CMakeLists.txt b/Tests/RunCMake/FindPython/Python2Module.cmake
similarity index 88%
rename from Tests/FindPython/Python2Module/CMakeLists.txt
rename to Tests/RunCMake/FindPython/Python2Module.cmake
index 6fffad4..8996aa1 100644
--- a/Tests/FindPython/Python2Module/CMakeLists.txt
+++ b/Tests/RunCMake/FindPython/Python2Module.cmake
@@ -1,6 +1,4 @@
-cmake_minimum_required(VERSION 3.15)
-
-project(TestPython2Module LANGUAGES C)
+enable_language(C)
include(CTest)
@@ -29,7 +27,7 @@
message(SEND_ERROR "Python2::Module not found")
endif()
-Python2_add_library (spam2 MODULE ../spam.c)
+Python2_add_library (spam2 MODULE spam.c)
target_compile_definitions (spam2 PRIVATE PYTHON2)
add_test (NAME python2_spam2
diff --git a/Tests/RunCMake/PackageInfo/ExperimentalGate-result.txt b/Tests/RunCMake/FindPython/Python2SABIModule-result.txt
similarity index 100%
copy from Tests/RunCMake/PackageInfo/ExperimentalGate-result.txt
copy to Tests/RunCMake/FindPython/Python2SABIModule-result.txt
diff --git a/Tests/RunCMake/FindPython/Python2SABIModule-stderr.txt b/Tests/RunCMake/FindPython/Python2SABIModule-stderr.txt
new file mode 100644
index 0000000..ae72b68
--- /dev/null
+++ b/Tests/RunCMake/FindPython/Python2SABIModule-stderr.txt
@@ -0,0 +1,2 @@
+ Reason given by package: *
+ Development: SABIModule requires version 3.2 or upper.
diff --git a/Tests/RunCMake/FindPython/Python2SABIModule.cmake b/Tests/RunCMake/FindPython/Python2SABIModule.cmake
new file mode 100644
index 0000000..a7e7378
--- /dev/null
+++ b/Tests/RunCMake/FindPython/Python2SABIModule.cmake
@@ -0,0 +1,3 @@
+enable_language(C)
+
+find_package(Python2 REQUIRED COMPONENTS Interpreter Development.Module Development.SABIModule)
diff --git a/Tests/RunCMake/export/DependOnDoubleExport-result.txt b/Tests/RunCMake/FindPython/Python3-BadComponent-result.txt
similarity index 100%
copy from Tests/RunCMake/export/DependOnDoubleExport-result.txt
copy to Tests/RunCMake/FindPython/Python3-BadComponent-result.txt
diff --git a/Tests/RunCMake/FindPython/Python3-BadComponent-stderr.txt b/Tests/RunCMake/FindPython/Python3-BadComponent-stderr.txt
new file mode 100644
index 0000000..3b1df74
--- /dev/null
+++ b/Tests/RunCMake/FindPython/Python3-BadComponent-stderr.txt
@@ -0,0 +1,2 @@
+CMake Error at .+/FindPackageHandleStandardArgs.cmake:[0-9]+ \(message\):
+ Could NOT find Python3 \(missing: foobar\) \(found version "[0-9.]+"\)
diff --git a/Tests/RunCMake/FindPython/Python3-BadComponent.cmake b/Tests/RunCMake/FindPython/Python3-BadComponent.cmake
new file mode 100644
index 0000000..e19a5c5
--- /dev/null
+++ b/Tests/RunCMake/FindPython/Python3-BadComponent.cmake
@@ -0,0 +1,3 @@
+enable_language(C)
+
+find_package(Python3 REQUIRED COMPONENTS Interpreter Development foobar)
diff --git a/Tests/RunCMake/FindPython/Python3.cmake b/Tests/RunCMake/FindPython/Python3.cmake
new file mode 100644
index 0000000..6f0eae0
--- /dev/null
+++ b/Tests/RunCMake/FindPython/Python3.cmake
@@ -0,0 +1,86 @@
+
+enable_language(C)
+
+include(CTest)
+
+find_package(Python3 2 QUIET)
+if (Python3_FOUND)
+ message (FATAL_ERROR "Wrong python version found: ${Python3_VERSION}")
+endif()
+
+find_package(Python3 REQUIRED COMPONENTS Interpreter Development)
+if (NOT Python3_FOUND)
+ message (FATAL_ERROR "Failed to find Python 3")
+endif()
+if (NOT Python3_Development_FOUND)
+ message (FATAL_ERROR "Failed to find Python 3 'Development' component")
+endif()
+if (NOT Python3_Development.Module_FOUND)
+ message (FATAL_ERROR "Failed to find Python 3 'Development.Module' component")
+endif()
+if (NOT Python3_Development.Embed_FOUND)
+ message (FATAL_ERROR "Failed to find Python 3 'Development.Embed' component")
+endif()
+
+if(NOT TARGET Python3::Interpreter)
+ message(SEND_ERROR "Python3::Interpreter not found")
+endif()
+
+if(NOT TARGET Python3::Python)
+ message(SEND_ERROR "Python3::Python not found")
+endif()
+if(NOT TARGET Python3::Module)
+ message(SEND_ERROR "Python3::Module not found")
+endif()
+
+Python3_add_library (spam3 MODULE spam.c)
+target_compile_definitions (spam3 PRIVATE PYTHON3)
+
+add_test (NAME python3_spam3
+ COMMAND "${CMAKE_COMMAND}" -E env "PYTHONPATH=$<TARGET_FILE_DIR:spam3>"
+ "${Python3_INTERPRETER}" -c "import spam3; spam3.system(\"cd\")")
+
+add_test(NAME findpython3_script
+ COMMAND "${CMAKE_COMMAND}" -DPYTHON_PACKAGE_NAME=Python3
+ -DPython3_FIND_STRATEGY=${Python3_FIND_STRATEGY}
+ -P "${CMAKE_CURRENT_LIST_DIR}/FindPythonScript.cmake")
+
+#
+# New search with user's prefix
+#
+foreach(item IN ITEMS FOUND Development_FOUND Development.Module_FOUND Development.Embed_FOUND)
+ unset(Python3_${item})
+endforeach()
+
+set(Python3_ARTIFACTS_PREFIX "_TEST")
+find_package(Python3 REQUIRED COMPONENTS Interpreter Development)
+if (NOT Python3_TEST_FOUND OR NOT Python3_FOUND)
+ message (FATAL_ERROR "Failed to find Python 3 (TEST prefix)")
+endif()
+if (NOT Python3_TEST_Development_FOUND OR NOT Python3_Development_FOUND)
+ message (FATAL_ERROR "Failed to find Python 3 'Development' component (TEST prefix)")
+endif()
+if (NOT Python3_TEST_Development.Module_FOUND OR NOT Python3_Development.Module_FOUND)
+ message (FATAL_ERROR "Failed to find Python 3 'Development.Module' component (TEST prefix)")
+endif()
+if (NOT Python3_TEST_Development.Embed_FOUND OR NOT Python3_Development.Embed_FOUND)
+ message (FATAL_ERROR "Failed to find Python 3 'Development.Embed' component (TEST prefix)")
+endif()
+
+if(NOT TARGET Python3_TEST::Interpreter)
+ message(SEND_ERROR "Python3_TEST::Interpreter not found")
+endif()
+
+if(NOT TARGET Python3_TEST::Python)
+ message(SEND_ERROR "Python3_TEST::Python not found")
+endif()
+if(NOT TARGET Python3_TEST::Module)
+ message(SEND_ERROR "Python3_TEST::Module not found")
+endif()
+
+Python3_TEST_add_library (TEST_spam3 MODULE TEST_spam.c)
+target_compile_definitions (TEST_spam3 PRIVATE PYTHON3)
+
+add_test (NAME python3_TEST_spam3
+ COMMAND "${CMAKE_COMMAND}" -E env "PYTHONPATH=$<TARGET_FILE_DIR:TEST_spam3>"
+ "${Python3_INTERPRETER}" -c "import TEST_spam3; TEST_spam3.system(\"cd\")")
diff --git a/Tests/FindPython/Python3Embedded/CMakeLists.txt b/Tests/RunCMake/FindPython/Python3Embedded.cmake
similarity index 87%
rename from Tests/FindPython/Python3Embedded/CMakeLists.txt
rename to Tests/RunCMake/FindPython/Python3Embedded.cmake
index 46f7042..9ef4e74 100644
--- a/Tests/FindPython/Python3Embedded/CMakeLists.txt
+++ b/Tests/RunCMake/FindPython/Python3Embedded.cmake
@@ -1,6 +1,4 @@
-cmake_minimum_required(VERSION 3.15)
-
-project(TestPython3Embedded LANGUAGES C)
+enable_language(C)
include(CTest)
@@ -26,11 +24,11 @@
message(SEND_ERROR "Python3::Python not found")
endif()
-Python3_add_library (display_time3 SHARED ../display_time.c)
+Python3_add_library (display_time3 SHARED display_time.c)
set_property (TARGET display_time3 PROPERTY WINDOWS_EXPORT_ALL_SYMBOLS ON)
target_compile_definitions (display_time3 PRIVATE PYTHON3)
-add_executable (main3 ../main.c)
+add_executable (main3 main.c)
target_link_libraries (main3 PRIVATE display_time3)
if (WIN32 OR CYGWIN OR MSYS OR MINGW)
diff --git a/Tests/FindPython/Python3Module/CMakeLists.txt b/Tests/RunCMake/FindPython/Python3Module.cmake
similarity index 91%
rename from Tests/FindPython/Python3Module/CMakeLists.txt
rename to Tests/RunCMake/FindPython/Python3Module.cmake
index e47a76a..2fa8bae 100644
--- a/Tests/FindPython/Python3Module/CMakeLists.txt
+++ b/Tests/RunCMake/FindPython/Python3Module.cmake
@@ -1,6 +1,4 @@
-cmake_minimum_required(VERSION 3.15)
-
-project(TestPython3Module LANGUAGES C)
+enable_language(C)
include(CTest)
@@ -38,7 +36,7 @@
message(SEND_ERROR "Python3::Module not found")
endif()
-Python3_add_library (spam3 MODULE ../spam.c)
+Python3_add_library (spam3 MODULE spam.c)
target_compile_definitions (spam3 PRIVATE PYTHON3)
add_test (NAME python3_spam3
diff --git a/Tests/FindPython/Python3SABIModule/CMakeLists.txt b/Tests/RunCMake/FindPython/Python3SABIModule.cmake
similarity index 91%
rename from Tests/FindPython/Python3SABIModule/CMakeLists.txt
rename to Tests/RunCMake/FindPython/Python3SABIModule.cmake
index 77d3abc..20cea97 100644
--- a/Tests/FindPython/Python3SABIModule/CMakeLists.txt
+++ b/Tests/RunCMake/FindPython/Python3SABIModule.cmake
@@ -1,6 +1,4 @@
-cmake_minimum_required(VERSION 3.15)
-
-project(TestPython3SABIModule LANGUAGES C)
+enable_language(C)
include(CTest)
@@ -39,7 +37,7 @@
message(FATAL_ERROR "Python3_SOSABI unexpectedly not defined")
endif()
-Python3_add_library (spam3 MODULE USE_SABI 3 WITH_SOABI ../spam.c)
+Python3_add_library (spam3 MODULE USE_SABI 3 WITH_SOABI spam.c)
target_compile_definitions (spam3 PRIVATE PYTHON3)
if (Python3_SOSABI)
diff --git a/Tests/RunCMake/FindPython/PythonArtifacts.cmake.in b/Tests/RunCMake/FindPython/PythonArtifacts.cmake.in
new file mode 100644
index 0000000..0c18aa7
--- /dev/null
+++ b/Tests/RunCMake/FindPython/PythonArtifacts.cmake.in
@@ -0,0 +1,32 @@
+set(USER_EXECUTABLE "@USER_EXECUTABLE@")
+set(USER_LIBRARY "@USER_LIBRARY@")
+set(USER_INCLUDE_DIR "@USER_INCLUDE_DIR@")
+
+if(CHECK_INTERPRETER)
+ if(INVALID_ARTIFACTS MATCHES "INTERPRETER")
+ set(Python3_EXECUTABLE "@USER_EXECUTABLE@")
+ else()
+ set(Python3_EXECUTABLE "@Python3_EXECUTABLE@")
+ endif()
+endif()
+if(CHECK_LIBRARY)
+ if(INVALID_ARTIFACTS MATCHES "LIBRARY")
+ set(Python3_LIBRARY "@USER_LIBRARY@")
+ else()
+ set(Python3_LIBRARY "@_Python3_LIBRARY_RELEASE@")
+ endif()
+endif()
+if(CHECK_INCLUDE)
+ if(INVALID_ARTIFACTS MATCHES "INCLUDE")
+ set(Python3_INCLUDE_DIR "@USER_INCLUDE_DIR@")
+ else()
+ set(Python3_INCLUDE_DIR "@Python3_INCLUDE_DIRS@")
+ endif()
+endif()
+if(CHECK_SABI_LIBRARY)
+ if(INVALID_ARTIFACTS MATCHES "SABI_LIBRARY")
+ set(Python3_SABI_LIBRARY "@USER_LIBRARY@")
+ else()
+ set(Python3_SABI_LIBRARY "@_Python3_SABI_LIBRARY_RELEASE@")
+ endif()
+endif()
diff --git a/Tests/RunCMake/FindPython/RequiredArtifacts.cmake b/Tests/RunCMake/FindPython/RequiredArtifacts.cmake
new file mode 100644
index 0000000..51895ef
--- /dev/null
+++ b/Tests/RunCMake/FindPython/RequiredArtifacts.cmake
@@ -0,0 +1,84 @@
+enable_language(C)
+
+include(CTest)
+
+if(CMake_TEST_FindPython2)
+ find_package(Python2 REQUIRED COMPONENTS Interpreter Development)
+ if (NOT Python2_FOUND)
+ message (FATAL_ERROR "Failed to find Python 2")
+ endif()
+ set(USER_EXECUTABLE "${Python2_EXECUTABLE}")
+ set(USER_LIBRARY "${Python2_LIBRARY_RELEASE}")
+ set(USER_INCLUDE_DIR "${Python2_INCLUDE_DIRS}")
+else()
+ set(USER_EXECUTABLE "/path/to/invalid-exe${CMAKE_EXECUTABLE_SUFFIX}")
+ set(USER_LIBRARY "/path/to/invalid-lib${CMAKE_C_LINK_LIBRARY_SUFFIX}")
+ set(USER_INCLUDE_DIR "/path/to/invalid/dir")
+endif()
+
+# check some combinations for modules search without interpreter
+if(CMake_TEST_FindPython3_SABIModule)
+ block(SCOPE_FOR VARIABLES)
+ find_package(Python3 REQUIRED COMPONENTS Development.SABIModule)
+ if (NOT Python3_FOUND)
+ message (FATAL_ERROR "Failed to find Python 3")
+ endif()
+ if (Python3_Development_FOUND)
+ message (FATAL_ERROR "Python 3, COMPONENT 'Development' unexpectedly found")
+ endif()
+ if (Python3_Interpreter_FOUND)
+ message (FATAL_ERROR "Python 3, COMPONENT 'Interpreter' unexpectedly found")
+ endif()
+ if (Python3_Development.Embed_FOUND)
+ message (FATAL_ERROR "Python 3, COMPONENT 'Development.Embed' unexpectedly found")
+ endif()
+ if (Python3_Development.Module_FOUND)
+ message (FATAL_ERROR "Python 3, COMPONENT 'Development.Module' unexpectedly found")
+ endif()
+ if (NOT Python3_Development.SABIModule_FOUND)
+ message (FATAL_ERROR "Python 3, COMPONENT 'Development.SABIModule' not found")
+ endif()
+ unset(_Python3_SABI_LIBRARY_RELEASE CACHE)
+ endblock()
+endif()
+
+block(SCOPE_FOR VARIABLES)
+ set(components Development.Module)
+ if (CMake_TEST_FindPython3_SABIModule)
+ list (APPEND components Development.SABIModule)
+ endif()
+ find_package(Python3 REQUIRED COMPONENTS ${components})
+ if (NOT Python3_FOUND)
+ message (FATAL_ERROR "Failed to find Python 3")
+ endif()
+ if (Python3_Development_FOUND)
+ message (FATAL_ERROR "Python 3, COMPONENT 'Development' unexpectedly found")
+ endif()
+ if (Python3_Interpreter_FOUND)
+ message (FATAL_ERROR "Python 3, COMPONENT 'Interpreter' unexpectedly found")
+ endif()
+ if (Python3_Development.Embed_FOUND)
+ message (FATAL_ERROR "Python 3, COMPONENT 'Development.Embed' unexpectedly found")
+ endif()
+ if (NOT Python3_Development.Module_FOUND)
+ message (FATAL_ERROR "Python 3, COMPONENT 'Development.Module' not found")
+ endif()
+ if (CMake_TEST_FindPython3_SABIModule AND NOT Python3_Development.SABIModule_FOUND)
+ message (FATAL_ERROR "Python 3, COMPONENT 'Development.SABIModule' not found")
+ endif()
+ unset(_Python3_LIBRARY_RELEASE CACHE)
+ unset(_Python3_SABI_LIBRARY_RELEASE CACHE)
+endblock()
+
+
+set(components Interpreter Development)
+if (CMake_TEST_FindPython3_SABIModule)
+ list (APPEND components Development.SABIModule)
+endif()
+find_package(Python3 REQUIRED COMPONENTS ${components})
+if (NOT Python3_FOUND)
+ message (FATAL_ERROR "Failed to find Python 3")
+endif()
+
+configure_file("${CMAKE_SOURCE_DIR}/PythonArtifacts.cmake.in"
+ "${CMAKE_BINARY_DIR}/PythonArtifacts.cmake" @ONLY)
diff --git a/Tests/FindPython/RequiredArtifacts/Check/CMakeLists.txt b/Tests/RunCMake/FindPython/RequiredArtifactsCheck.cmake
similarity index 93%
rename from Tests/FindPython/RequiredArtifacts/Check/CMakeLists.txt
rename to Tests/RunCMake/FindPython/RequiredArtifactsCheck.cmake
index 25bdcf3..b47f43b 100644
--- a/Tests/FindPython/RequiredArtifacts/Check/CMakeLists.txt
+++ b/Tests/RunCMake/FindPython/RequiredArtifactsCheck.cmake
@@ -1,6 +1,6 @@
-cmake_minimum_required(VERSION 3.15)
+enable_language(C)
-project(TestRequiredArtifacts.Check LANGUAGES C)
+include("${PYTHON_ARTIFACTS}")
set (components)
if (CHECK_INTERPRETER)
diff --git a/Tests/RunCMake/FindPython/RunCMakeTest.cmake b/Tests/RunCMake/FindPython/RunCMakeTest.cmake
new file mode 100644
index 0000000..f866015
--- /dev/null
+++ b/Tests/RunCMake/FindPython/RunCMakeTest.cmake
@@ -0,0 +1,367 @@
+include(RunCMake)
+
+if(RunCMake_BUILD_TYPE)
+ set(Python_BUILD_TYPE "${RunCMake_BUILD_TYPE}")
+else()
+ set(Python_BUILD_TYPE "Release")
+endif()
+
+function(run_python test)
+ set(options_args CHECK_RESULT)
+ set(one_value_args TYPE ACTION VARIANT STRATEGY)
+ set(multi_value_args OPTIONS)
+ cmake_parse_arguments(PARSE_ARGV 1 RP "${options_args}" "${one_value_args}" "${multi_value_args}")
+
+ if(RP_UNPARSED_ARGUMENTS)
+ message(FATAL_ERROR "run_python: unparsed arguments: ${RP_UNPARSED_ARGUMENTS}")
+ endif()
+
+ set(test_name "${test}")
+ if(RP_VARIANT)
+ string(APPEND test_name ".${RP_VARIANT}")
+ set(RunCMake_TEST_VARIANT_DESCRIPTION ".${RP_VARIANT}")
+ endif()
+
+ set(options ${RP_OPTIONS})
+ if(RP_STRATEGY)
+ string(APPEND test_name ".${RP_STRATEGY}")
+ string(APPEND RunCMake_TEST_VARIANT_DESCRIPTION ".${RP_STRATEGY}")
+ if (NOT RP_TYPE)
+ set(RP_TYPE ${test})
+ endif()
+ list(APPEND options -D${RP_TYPE}_FIND_STRATEGY=${RP_STRATEGY})
+ endif()
+ if(RP_TYPE)
+ list(APPEND options -DPYTHON=${RP_TYPE})
+ endif()
+ if(NOT RunCMake_GENERATOR_IS_MULTI_CONFIG)
+ list(APPEND options -DCMAKE_BUILD_TYPE=${Python_BUILD_TYPE})
+ endif()
+
+ if(RP_CHECK_RESULT)
+ set(RunCMake_TEST_EXPECT_RESULT 1)
+ file(READ "${RunCMake_SOURCE_DIR}/${test_name}-stderr.txt" RunCMake_TEST_EXPECT_stderr)
+ endif()
+
+ set(RunCMake_TEST_BINARY_DIR "${RunCMake_BINARY_DIR}/${test_name}-build")
+ if(options)
+ run_cmake_with_options(${test} ${options})
+ else()
+ run_cmake(${test})
+ endif()
+ if(NOT RP_ACTION)
+ return()
+ endif()
+
+ set(RunCMake_TEST_NO_CLEAN 1)
+ unset(RunCMake_TEST_VARIANT_DESCRIPTION)
+ run_cmake_command(${test_name}-build ${CMAKE_COMMAND} --build . --config ${Python_BUILD_TYPE})
+ if(RP_ACTION STREQUAL "BUILD")
+ return()
+ endif()
+
+ run_cmake_command(${test_name}-run ${CMAKE_CTEST_COMMAND} -C ${Python_BUILD_TYPE} -V)
+endfunction()
+
+
+function(run_python_with_virtualenv test)
+ set(RunCMake_TEST_BINARY_DIR "${RunCMake_BINARY_DIR}/${test}-build")
+ set(virtual_env "${RunCMake_TEST_BINARY_DIR}/py3venv")
+ run_cmake_with_options(${test} "-DPYTHON3_VIRTUAL_ENV=${virtual_env}")
+ set(RunCMake_TEST_NO_CLEAN 1)
+ set(tests Default Standard)
+ if(CMake_TEST_FindPython2)
+ list(APPEND tests Only)
+ endif()
+ if(test MATCHES "Conda")
+ set(RunCMake_TEST_VARIANT_DESCRIPTION ".Conda")
+ set(init_venv --unset=VIRTUAL_ENV "CONDA_PREFIX=${virtual_env}")
+ else()
+ set(RunCMake_TEST_VARIANT_DESCRIPTION ".CPython")
+ set(init_venv --unset=CONDA_PREFIX "VIRTUAL_ENV=${virtual_env}")
+ endif()
+ foreach(test IN LISTS tests)
+ run_cmake_script(VirtualEnv${test} -E env --unset=PYTHONHOME ${init_venv}
+ "${CMAKE_COMMAND}" "-DPYTHON3_VIRTUAL_ENV=${virtual_env}")
+ endforeach()
+ if(CMake_TEST_FindPython2)
+ string(APPEND RunCMake_TEST_VARIANT_DESCRIPTION ".Unset")
+ run_cmake_script(VirtualEnvOnly -E env --unset=PYTHONHOME --unset=VIRTUAL_ENV --unset=CONDA_PREFIX
+ "${CMAKE_COMMAND}")
+ endif()
+endfunction()
+
+macro(required_artifacts_check variant)
+ run_python(RequiredArtifactsCheck VARIANT ${variant}
+ OPTIONS "-DPYTHON_ARTIFACTS=${RunCMake_BINARY_DIR}/RequiredArtifacts-build/PythonArtifacts.cmake"
+ ${ARGN})
+endmacro()
+
+function(required_artifacts)
+ set(RunCMake_TEST_BINARY_DIR "${RunCMake_BINARY_DIR}/RequiredArtifacts-build")
+ run_cmake_with_options(RequiredArtifacts "-DCMake_TEST_FindPython2=${CMake_TEST_FindPython2}"
+ "-DCMake_TEST_FindPython3_SABIModule=${CMake_TEST_FindPython3_SABIModule}")
+ if(EXISTS "${RunCMake_TEST_BINARY_DIR}/PythonArtifacts.cmake")
+ required_artifacts_check("Interpreter.VALID" -DPYTHON_IS_FOUND=TRUE
+ -DCHECK_INTERPRETER=ON)
+ required_artifacts_check("Interpreter.INVALID" -DPYTHON_IS_FOUND=FALSE -DINVALID_ARTIFACTS=INTERPRETER
+ -DCHECK_INTERPRETER=ON)
+ required_artifacts_check("Library.VALID" -DPYTHON_IS_FOUND=TRUE
+ -DCHECK_LIBRARY=ON)
+ required_artifacts_check("Library.INVALID" -DPYTHON_IS_FOUND=FALSE -DINVALID_ARTIFACTS=LIBRARY
+ -DCHECK_LIBRARY=ON)
+ required_artifacts_check("Include.VALID" -DPYTHON_IS_FOUND=TRUE
+ -DCHECK_INCLUDE=ON)
+ required_artifacts_check("Include.INVALID" -DPYTHON_IS_FOUND=FALSE -DINVALID_ARTIFACTS=INCLUDE
+ -DCHECK_INCLUDE=ON)
+ required_artifacts_check("Interpreter.VALID,Library.INVALID" -DPYTHON_IS_FOUND=FALSE -DINVALID_ARTIFACTS=LIBRARY
+ -DCHECK_INTERPRETER=ON -DCHECK_LIBRARY=ON)
+ required_artifacts_check("Library.VALID,Include.INVALID" -DPYTHON_IS_FOUND=FALSE -DINVALID_ARTIFACTS=INCLUDE
+ -DCHECK_LIBRARY=ON -DCHECK_INCLUDE=ON)
+ if (CMake_TEST_FindPython3_SABIModule AND WIN32)
+ required_artifacts_check("SABILibrary.VALID" -DPYTHON_IS_FOUND=TRUE
+ -DCHECK_SABI_LIBRARY=ON)
+ required_artifacts_check("SABILibrary.INVALID" -DPYTHON_IS_FOUND=FALSE -DINVALID_ARTIFACTS=SABI_LIBRARY
+ -DCHECK_SABI_LIBRARY=ON)
+ endif()
+ endif()
+endfunction()
+
+macro(custom_failure_message_check name components)
+ run_python(CustomFailureMessage VARIANT "${name}" CHECK_RESULT OPTIONS "-DCHECK_COMPONENTS=${components}" ${ARGN})
+endmacro()
+
+
+if(CMake_TEST_FindPython2_CPython)
+ run_cmake(Python2-BadComponent)
+ run_python(Python2Module ACTION RUN)
+ run_python(Python2Embedded ACTION RUN)
+ run_python(Python2 STRATEGY LOCATION ACTION RUN)
+ run_python(Python2 STRATEGY VERSION ACTION RUN)
+ run_python(Python STRATEGY LOCATION VARIANT V2 ACTION RUN OPTIONS -DPython_REQUESTED_VERSION=2)
+ run_python(Python STRATEGY VERSION VARIANT V2 OPTIONS ACTION RUN OPTIONS -DPython_REQUESTED_VERSION=2)
+ run_python(ExactVersion TYPE Python2 STRATEGY LOCATION VARIANT Python2
+ OPTIONS -DPython_REQUESTED_VERSION=2.1.2)
+ run_python(ExactVersion TYPE Python2 STRATEGY VERSION VARIANT Python2
+ OPTIONS -DPython_REQUESTED_VERSION=2.1.2)
+ run_python(ExactVersion TYPE Python STRATEGY LOCATION VARIANT Python.V2
+ OPTIONS -DPython_REQUESTED_VERSION=2.1.2)
+ run_python(ExactVersion TYPE Python STRATEGY VERSION VARIANT Python.V2
+ OPTIONS -DPython_REQUESTED_VERSION=2.1.2)
+ run_python(VersionRange TYPE Python2 STRATEGY LOCATION VARIANT Python2
+ OPTIONS -DPython_REQUESTED_VERSION=2)
+ run_python(VersionRange TYPE Python2 STRATEGY VERSION VARIANT Python2
+ OPTIONS -DPython_REQUESTED_VERSION=2)
+ run_python(VersionRange TYPE Python STRATEGY LOCATION VARIANT Python.V2
+ OPTIONS -DPython_REQUESTED_VERSION=2)
+ run_python(VersionRange TYPE Python STRATEGY VERSION VARIANT Python.V2
+ OPTIONS -DPython_REQUESTED_VERSION=2)
+ run_python(CrossCompiling-CMP0190-OLD TYPE Python2 VARIANT Python2)
+ run_python(CrossCompiling-CMP0190-NEW TYPE Python2 VARIANT Python2 CHECK_RESULT)
+ run_python(CrossCompiling-CMP0190-OLD TYPE Python VARIANT Python.V2
+ OPTIONS -DPython_REQUESTED_VERSION=2)
+ run_python(CrossCompiling-CMP0190-NEW TYPE Python VARIANT Python.V2 CHECK_RESULT
+ OPTIONS -DPython_REQUESTED_VERSION=2)
+ run_python(CrossCompiling-HOST TYPE Python2 VARIANT Python2)
+ run_python(CrossCompiling-HOST TYPE Python VARIANT Python.V2
+ OPTIONS -DPython_REQUESTED_VERSION=2)
+ if(CMAKE_SYSTEM_NAME MATCHES "Linux|Darwin" AND NOT RunCMake_GENERATOR_IS_MULTI_CONFIG)
+ run_python(CrossCompiling-TARGET TYPE Python2 VARIANT Python2)
+ run_python(CrossCompiling-TARGET TYPE Python VARIANT Python.V2
+ OPTIONS -DPython_REQUESTED_VERSION=2)
+ run_python(CrossCompiling-BOTH TYPE Python2 VARIANT Python2)
+ run_python(CrossCompiling-BOTH TYPE Python VARIANT Python.V2
+ OPTIONS -DPython_REQUESTED_VERSION=2)
+ endif()
+endif()
+
+if(CMake_TEST_FindPython3_CPython)
+ run_cmake(Python3-BadComponent)
+ run_cmake(DifferentComponents)
+ run_python(Python3Module ACTION RUN)
+ if(NOT CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.8)
+ run_python(Python3Embedded ACTION RUN)
+ endif()
+ if(CMAKE_SYSTEM_NAME MATCHES "Linux|Darwin")
+ run_cmake(UnversionedNames)
+ endif()
+ run_python(Python3 STRATEGY LOCATION ACTION RUN)
+ run_python(Python3 STRATEGY VERSION ACTION RUN)
+ run_python(Python STRATEGY LOCATION VARIANT V3 ACTION RUN OPTIONS -DPython_REQUESTED_VERSION=3)
+ run_python(Python STRATEGY VERSION VARIANT V3 ACTION RUN OPTIONS -DPython_REQUESTED_VERSION=3)
+ run_python(ExactVersion TYPE Python3 STRATEGY LOCATION VARIANT Python3
+ OPTIONS -DPython_REQUESTED_VERSION=3.1.2)
+ run_python(ExactVersion TYPE Python3 STRATEGY VERSION VARIANT Python3
+ OPTIONS -DPython_REQUESTED_VERSION=3.1.2)
+ run_python(ExactVersion TYPE Python STRATEGY LOCATION VARIANT Python.V3
+ OPTIONS -DPython_REQUESTED_VERSION=3.1.2)
+ run_python(ExactVersion TYPE Python STRATEGY VERSION VARIANT Python.V3
+ OPTIONS -DPython_REQUESTED_VERSION=3.1.2)
+ run_python(VersionRange TYPE Python3 STRATEGY LOCATION VARIANT Python3
+ OPTIONS -DPython_REQUESTED_VERSION=3)
+ run_python(VersionRange TYPE Python3 STRATEGY VERSION VARIANT Python3
+ OPTIONS -DPython_REQUESTED_VERSION=3)
+ run_python(VersionRange TYPE Python STRATEGY LOCATION VARIANT Python.V3
+ OPTIONS -DPython_REQUESTED_VERSION=3)
+ run_python(VersionRange TYPE Python STRATEGY VERSION VARIANT Python.V3
+ OPTIONS -DPython_REQUESTED_VERSION=3)
+ custom_failure_message_check("Interpreter" "Interpreter" -DPython3_EXECUTABLE=/not/found/interpreter)
+ custom_failure_message_check("Library" "Development" -DPython3_LIBRARY=/not/found/library)
+ custom_failure_message_check("Include" "Development" -DPython3_INCLUDE_DIR=/not/found/include)
+ custom_failure_message_check("Multiple" "Interpreter:Development" -DPython3_EXECUTABLE=/not/found/interpreter
+ -DPython3_LIBRARY=/not/found/library)
+ run_python(CrossCompiling-CMP0190-OLD TYPE Python3 VARIANT Python3)
+ run_python(CrossCompiling-CMP0190-NEW TYPE Python3 VARIANT Python3 CHECK_RESULT)
+ run_python(CrossCompiling-CMP0190-OLD TYPE Python VARIANT Python.V3
+ OPTIONS -DPython_REQUESTED_VERSION=3)
+ run_python(CrossCompiling-CMP0190-NEW TYPE Python VARIANT Python.V3 CHECK_RESULT
+ OPTIONS -DPython_REQUESTED_VERSION=3)
+ run_python(CrossCompiling-HOST TYPE Python3 VARIANT Python3)
+ run_python(CrossCompiling-HOST TYPE Python VARIANT Python.V3
+ OPTIONS -DPython_REQUESTED_VERSION=3)
+ if(CMAKE_SYSTEM_NAME MATCHES "Linux|Darwin" AND NOT RunCMake_GENERATOR_IS_MULTI_CONFIG)
+ run_python(CrossCompiling-TARGET TYPE Python3 VARIANT Python3)
+ run_python(CrossCompiling-TARGET TYPE Python VARIANT Python.V3
+ OPTIONS -DPython_REQUESTED_VERSION=3)
+ run_python(CrossCompiling-BOTH TYPE Python3 VARIANT Python3)
+ run_python(CrossCompiling-BOTH TYPE Python VARIANT Python.V3
+ OPTIONS -DPython_REQUESTED_VERSION=3)
+ endif()
+endif()
+
+if(CMake_TEST_FindPython2_CPython OR CMake_TEST_FindPython3_CPython)
+ run_python(Python STRATEGY LOCATION VARIANT Python ACTION RUN)
+ run_python(Python STRATEGY VERSION VARIANT Python ACTION RUN)
+endif()
+
+if(CMake_TEST_FindPython2_IronPython)
+ run_python(IronPython TYPE Python2 STRATEGY LOCATION VARIANT IronPython2)
+ run_python(IronPython TYPE Python2 STRATEGY VERSION VARIANT IronPython2)
+ run_python(IronPython TYPE Python STRATEGY LOCATION VARIANT V2 OPTIONS -DPython_REQUESTED_VERSION=2)
+ run_python(IronPython TYPE Python STRATEGY VERSION VARIANT V2 OPTIONS -DPython_REQUESTED_VERSION=2)
+ run_python(VersionRange TYPE Python2 STRATEGY LOCATION VARIANT IronPython2
+ OPTIONS -DPython_REQUESTED_VERSION=2
+ -DPython2_FIND_IMPLEMENTATIONS=IronPython)
+ run_python(VersionRange TYPE Python2 STRATEGY VERSION VARIANT IronPython2
+ OPTIONS -DPython_REQUESTED_VERSION=2
+ -DPython2_FIND_IMPLEMENTATIONS=IronPython)
+ run_python(VersionRange TYPE Python STRATEGY LOCATION VARIANT IronPython.V2
+ OPTIONS -DPython_REQUESTED_VERSION=2
+ -DPython2_FIND_IMPLEMENTATIONS=IronPython)
+ run_python(VersionRange TYPE Python STRATEGY VERSION VARIANT IronPython.V2
+ OPTIONS -DPython_REQUESTED_VERSION=2
+ -DPython2_FIND_IMPLEMENTATIONS=IronPython)
+endif()
+
+if(CMake_TEST_FindPython3_IronPython)
+ run_python(IronPython TYPE Python3 STRATEGY LOCATION VARIANT IronPython3)
+ run_python(IronPython TYPE Python3 STRATEGY VERSION VARIANT IronPython3)
+ run_python(IronPython TYPE Python STRATEGY LOCATION VARIANT V3 OPTIONS -DPython_REQUESTED_VERSION=3)
+ run_python(IronPython TYPE Python STRATEGY VERSION VARIANT V3 OPTIONS -DPython_REQUESTED_VERSION=3)
+ run_python(VersionRange TYPE Python3 STRATEGY LOCATION VARIANT IronPython3
+ OPTIONS -DPython_REQUESTED_VERSION=3
+ -DPython2_FIND_IMPLEMENTATIONS=IronPython)
+ run_python(VersionRange TYPE Python3 STRATEGY VERSION VARIANT IronPython3
+ OPTIONS -DPython_REQUESTED_VERSION=3
+ -DPython2_FIND_IMPLEMENTATIONS=IronPython)
+ run_python(VersionRange TYPE Python STRATEGY LOCATION VARIANT IronPython.V3
+ OPTIONS -DPython_REQUESTED_VERSION=3
+ -DPython2_FIND_IMPLEMENTATIONS=IronPython)
+ run_python(VersionRange TYPE Python STRATEGY VERSION VARIANT IronPython.V3
+ OPTIONS -DPython_REQUESTED_VERSION=3
+ -DPython2_FIND_IMPLEMENTATIONS=IronPython)
+endif()
+
+if(CMake_TEST_FindPython2_IronPython OR CMake_TEST_FindPython3_IronPython)
+ run_python(IronPython TYPE Python STRATEGY LOCATION VARIANT IronPython)
+ run_python(IronPython TYPE Python STRATEGY VERSION VARIANT IronPython)
+endif()
+
+if (CMake_TEST_FindPython2 AND CMake_TEST_FindPython2_IronPython)
+ run_python(Implementation VARIANT CPython2 OPTIONS -DPython_REQUESTED_VERSION=2
+ -DPython_REQUESTED_IMPLEMENTATIONS=CPython)
+ run_python(Implementation VARIANT IronPython2 OPTIONS -DPython_REQUESTED_VERSION=2
+ -DPython_REQUESTED_IMPLEMENTATIONS=IronPython)
+endif()
+
+if (CMake_TEST_FindPython3 AND CMake_TEST_FindPython3_IronPython)
+ run_python(Implementation VARIANT CPython3 OPTIONS -DPython_REQUESTED_VERSION=3
+ -DPython_REQUESTED_IMPLEMENTATIONS=CPython)
+ run_python(Implementation VARIANT IronPython3 OPTIONS -DPython_REQUESTED_VERSION=3
+ -DPython_REQUESTED_IMPLEMENTATIONS=IronPython)
+endif()
+
+if(CMake_TEST_FindPython2_PyPy)
+ run_python(PyPy TYPE Python2 STRATEGY LOCATION VARIANT PyPy2)
+ run_python(PyPy TYPE Python2 STRATEGY VERSION VARIANT PyPy2)
+ run_python(PyPy TYPE Python STRATEGY LOCATION VARIANT V2 OPTIONS -DPython_REQUESTED_VERSION=2)
+ run_python(PyPy TYPE Python STRATEGY VERSION VARIANT V2 OPTIONS -DPython_REQUESTED_VERSION=2)
+endif()
+
+if(CMake_TEST_FindPython3_PyPy)
+ run_python(PyPy TYPE Python3 STRATEGY LOCATION VARIANT PyPy3)
+ run_python(PyPy TYPE Python3 STRATEGY VERSION VARIANT PyPy3)
+ run_python(PyPy TYPE Python STRATEGY LOCATION VARIANT V3 OPTIONS -DPython_REQUESTED_VERSION=3)
+ run_python(PyPy TYPE Python STRATEGY VERSION VARIANT V3 OPTIONS -DPython_REQUESTED_VERSION=3)
+endif()
+
+if(CMake_TEST_FindPython2_PyPy OR CMake_TEST_FindPython3_PyPy)
+ run_python(PyPy TYPE Python STRATEGY LOCATION VARIANT PyPy)
+ run_python(PyPy TYPE Python STRATEGY VERSION VARIANT PyPy)
+endif()
+
+if(CMake_TEST_FindPython_Various)
+ if(CMake_TEST_FindPython3)
+ run_python_with_virtualenv(VirtualEnv)
+ required_artifacts()
+ run_python(ArtifactsInteractive VARIANT "ON"
+ OPTIONS -DCMake_TEST_FindPython3_NumPy=${CMake_TEST_FindPython3_NumPy}
+ -DPython3_ARTIFACTS_INTERACTIVE=ON)
+ run_python(ArtifactsInteractive VARIANT "OFF"
+ OPTIONS -DCMake_TEST_FindPython3_NumPy=${CMake_TEST_FindPython3_NumPy}
+ -DPython3_ARTIFACTS_INTERACTIVE=OFF)
+ endif()
+
+ if(CMake_TEST_FindPython2 OR CMake_TEST_FindPython3)
+ if (CMAKE_SYSTEM_NAME MATCHES "Linux|Darwin")
+ run_python(SOABI VARIANT "Interpreter" ACTION BUILD
+ OPTIONS -DCMake_TEST_FindPython2=${CMake_TEST_FindPython2}
+ -DCMake_TEST_FindPython3=${CMake_TEST_FindPython3}
+ -DCMake_TEST_FindPython_COMPONENT=Interpreter)
+ run_python(SOABI VARIANT "Development" ACTION BUILD
+ OPTIONS -DCMake_TEST_FindPython2=${CMake_TEST_FindPython2}
+ -DCMake_TEST_FindPython3=${CMake_TEST_FindPython3}
+ -DCMake_TEST_FindPython_COMPONENT=Development)
+ endif()
+ run_python(MultiplePackages ACTION RUN
+ OPTIONS -DCMake_TEST_FindPython2=${CMake_TEST_FindPython2}
+ -DCMake_TEST_FindPython3=${CMake_TEST_FindPython3})
+ endif()
+
+ if(CMake_TEST_FindPython2 AND CMake_TEST_FindPython3)
+ run_cmake(ArtifactsPrefix)
+ endif()
+
+ if(CMake_TEST_FindPython2_SABIModule)
+ run_cmake(Python2SABIModule)
+ endif()
+ if(CMake_TEST_FindPython3_SABIModule)
+ run_python(Python3SABIModule)
+ endif()
+
+ if(CMake_TEST_FindPython2_NumPy OR CMake_TEST_FindPython3_NumPy)
+ run_python(NumPy ACTION RUN
+ OPTIONS -DCMake_TEST_FindPython2_NumPy=${CMake_TEST_FindPython2_NumPy}
+ -DCMake_TEST_FindPython3_NumPy=${CMake_TEST_FindPython3_NumPy})
+ run_python(NumPyOnly ACTION RUN
+ OPTIONS -DCMake_TEST_FindPython2_NumPy=${CMake_TEST_FindPython2_NumPy}
+ -DCMake_TEST_FindPython3_NumPy=${CMake_TEST_FindPython3_NumPy})
+ if(CMake_TEST_FindPython3_NumPy)
+ custom_failure_message_check("NumPy" "Interpreter:Development:NumPy" -DPython3_NumPy_INCLUDE_DIR=/not/found/numpy/include)
+ endif()
+ endif()
+
+ if(CMake_TEST_FindPython3_Conda)
+ run_python_with_virtualenv(VirtualEnvConda)
+ endif()
+endif()
diff --git a/Tests/FindPython/SOABI/CMakeLists.txt b/Tests/RunCMake/FindPython/SOABI.cmake
similarity index 85%
rename from Tests/FindPython/SOABI/CMakeLists.txt
rename to Tests/RunCMake/FindPython/SOABI.cmake
index 362df7f..2a0bc95 100644
--- a/Tests/FindPython/SOABI/CMakeLists.txt
+++ b/Tests/RunCMake/FindPython/SOABI.cmake
@@ -1,6 +1,4 @@
-cmake_minimum_required(VERSION 3.15)
-
-project(TestSOABI LANGUAGES C)
+enable_language(C)
if(CMake_TEST_FindPython3)
find_package(Python3 COMPONENTS ${CMake_TEST_FindPython_COMPONENT})
@@ -13,7 +11,7 @@
endif()
if (Python3_Development_FOUND AND Python3_SOABI)
- Python3_add_library (spam3 MODULE WITH_SOABI ../spam.c)
+ Python3_add_library (spam3 MODULE WITH_SOABI spam.c)
target_compile_definitions (spam3 PRIVATE PYTHON3)
get_property (suffix TARGET spam3 PROPERTY SUFFIX)
@@ -30,7 +28,7 @@
endif()
if (Python2_Development_FOUND AND Python2_SOABI)
- Python2_add_library (spam2 MODULE WITH_SOABI ../spam.c)
+ Python2_add_library (spam2 MODULE WITH_SOABI spam.c)
target_compile_definitions (spam2 PRIVATE PYTHON2)
get_property (suffix TARGET spam2 PROPERTY SUFFIX)
diff --git a/Tests/FindPython/TEST_spam.c b/Tests/RunCMake/FindPython/TEST_spam.c
similarity index 86%
rename from Tests/FindPython/TEST_spam.c
rename to Tests/RunCMake/FindPython/TEST_spam.c
index fc483fd..f1e6bd1 100644
--- a/Tests/FindPython/TEST_spam.c
+++ b/Tests/RunCMake/FindPython/TEST_spam.c
@@ -1,4 +1,8 @@
-#define Py_LIMITED_API 3
+#if !defined(_WIN32)
+/* Disabled for Windows to avoid to link with the wrong library specified by
+ * #pragma */
+# define Py_LIMITED_API 3
+#endif
#include <Python.h>
static PyObject* spam_system(PyObject* self, PyObject* args)
diff --git a/Tests/FindPython/UnversionedNames/CMakeLists.txt b/Tests/RunCMake/FindPython/UnversionedNames.cmake
similarity index 95%
rename from Tests/FindPython/UnversionedNames/CMakeLists.txt
rename to Tests/RunCMake/FindPython/UnversionedNames.cmake
index 597bd4e..0f9123f 100644
--- a/Tests/FindPython/UnversionedNames/CMakeLists.txt
+++ b/Tests/RunCMake/FindPython/UnversionedNames.cmake
@@ -1,6 +1,3 @@
-cmake_minimum_required(VERSION 3.19...3.20)
-
-project(UnversionedNames LANGUAGES NONE)
# check if it is possible to find python with a generic name
find_program(UNVERSIONED_Python3 NAMES python3)
@@ -24,6 +21,8 @@
# Force now to search first for generic name
set(Python3_FIND_UNVERSIONED_NAMES FIRST)
+set(Python3_FIND_FRAMEWORK NEVER)
+
find_package(Python3 REQUIRED COMPONENTS Interpreter)
if (NOT Python3_EXECUTABLE STREQUAL UNVERSIONED_Python3)
diff --git a/Tests/RunCMake/FindPython/VersionRange.cmake b/Tests/RunCMake/FindPython/VersionRange.cmake
new file mode 100644
index 0000000..34d3392
--- /dev/null
+++ b/Tests/RunCMake/FindPython/VersionRange.cmake
@@ -0,0 +1,62 @@
+enable_language(C)
+
+
+find_package (${PYTHON} ${Python_REQUESTED_VERSION} EXACT COMPONENTS Interpreter)
+if (NOT ${PYTHON}_FOUND)
+ message (FATAL_ERROR "Failed to find ${PYTHON} ${Python_REQUESTED_VERSION}")
+endif()
+
+if (Python_REQUESTED_VERSION VERSION_LESS 3.0)
+ set (IN_VERSION_RANGE 2.0...<3.0)
+ set (OUT_VERSION_RANGE 2.0...<${${PYTHON}_VERSION})
+else()
+ set (IN_VERSION_RANGE 3.0...<4.0)
+ set (OUT_VERSION_RANGE 3.0...<${${PYTHON}_VERSION})
+endif()
+
+function (FIND_PYTHON EXPECTED_VERSION RANGE)
+ macro (FIND_PYTHON_PACKAGE)
+ unset (_${PYTHON}_EXECUTABLE CACHE)
+ unset (_${PYTHON}_LIBRARY_RELEASE CACHE)
+ unset (_${PYTHON}_INCLUDE_DIR CACHE)
+ unset (${PYTHON}_FOUND)
+
+ find_package (${PYTHON} ${ARGV})
+ endmacro()
+
+ find_python_package(${RANGE} ${ARGN})
+
+ if (EXPECTED_VERSION STREQUAL "NONE")
+ while (${PYTHON}_FOUND AND ${PYTHON}_VERSION VERSION_GREATER ${Python_REQUESTED_VERSION})
+ # Possible if multiple versions are installed
+ # Try with a different range
+ find_python_package(${Python_REQUESTED_VERSION}.0...<${${PYTHON}_VERSION} ${ARGN})
+ endwhile()
+ if (${PYTHON}_FOUND)
+ message (SEND_ERROR "Unexpectedly found version: ${${PYTHON}_VERSION} for '${PYTHON} ${Python_REQUESTED_VERSION}.0...<${${PYTHON}_VERSION} ${ARGN}'")
+ endif()
+ return()
+ endif()
+
+ if (NOT ${PYTHON}_FOUND)
+ message (SEND_ERROR "Not found: ${PYTHON} ${RANGE} ${ARGN}")
+ elseif (NOT ${PYTHON}_VERSION VERSION_EQUAL EXPECTED_VERSION)
+ message (SEND_ERROR "Wrong version: ${${PYTHON}_VERSION} for '${PYTHON} ${RANGE} ${ARGN}'")
+ endif()
+endfunction()
+
+find_python (${${PYTHON}_VERSION} ${IN_VERSION_RANGE} COMPONENTS Interpreter)
+if (${PYTHON}_FIND_IMPLEMENTATIONS STREQUAL "IronPython")
+ find_python (${${PYTHON}_VERSION} ${IN_VERSION_RANGE} COMPONENTS Compiler)
+else()
+ find_python (${${PYTHON}_VERSION} ${IN_VERSION_RANGE} COMPONENTS Development)
+endif()
+
+find_python ("NONE" ${OUT_VERSION_RANGE} COMPONENTS Interpreter)
+if (${PYTHON}_FIND_IMPLEMENTATIONS STREQUAL "IronPython")
+ find_python ("NONE" ${OUT_VERSION_RANGE} COMPONENTS Compiler)
+else()
+ find_python ("NONE" ${OUT_VERSION_RANGE} COMPONENTS Development)
+endif()
+
+find_python ("NONE" 5...6 COMPONENTS Interpreter)
diff --git a/Tests/RunCMake/FindPython/VirtualEnv.cmake b/Tests/RunCMake/FindPython/VirtualEnv.cmake
new file mode 100644
index 0000000..26f8146
--- /dev/null
+++ b/Tests/RunCMake/FindPython/VirtualEnv.cmake
@@ -0,0 +1,15 @@
+
+find_package(Python3 REQUIRED COMPONENTS Interpreter)
+if (NOT Python3_FOUND)
+ message (FATAL_ERROR "Failed to find Python 3")
+endif()
+
+file (REMOVE_RECURSE "${PYTHON3_VIRTUAL_ENV}")
+
+execute_process (COMMAND "${Python3_EXECUTABLE}" -m venv "${PYTHON3_VIRTUAL_ENV}"
+ RESULT_VARIABLE result
+ OUTPUT_VARIABLE outputs
+ ERROR_VARIABLE outputs)
+if (result)
+ message (FATAL_ERROR "Fail to create virtual environment: ${outputs}")
+endif()
diff --git a/Tests/RunCMake/FindPython/VirtualEnvConda.cmake b/Tests/RunCMake/FindPython/VirtualEnvConda.cmake
new file mode 100644
index 0000000..63da931
--- /dev/null
+++ b/Tests/RunCMake/FindPython/VirtualEnvConda.cmake
@@ -0,0 +1,17 @@
+
+if(DEFINED ENV{CONDA_EXE})
+ set(CONDA_EXECUTABLE "$ENV{CONDA_EXE}")
+else()
+ find_program(CONDA_EXECUTABLE conda NO_CACHE)
+ if (NOT CONDA_EXECUTABLE)
+ message (FATAL_ERROR "Failed to find Conda")
+ endif()
+endif()
+
+execute_process (COMMAND "${CONDA_EXECUTABLE}" create --no-default-packages --prefix "${PYTHON3_VIRTUAL_ENV}" --yes python=3
+ RESULT_VARIABLE result
+ OUTPUT_VARIABLE outputs
+ ERROR_VARIABLE outputs)
+if (result)
+ message (FATAL_ERROR "Fail to create virtual environment: ${outputs}")
+endif()
diff --git a/Tests/FindPython/VirtualEnv/VirtualEnvDefault.cmake b/Tests/RunCMake/FindPython/VirtualEnvDefault.cmake
similarity index 100%
rename from Tests/FindPython/VirtualEnv/VirtualEnvDefault.cmake
rename to Tests/RunCMake/FindPython/VirtualEnvDefault.cmake
diff --git a/Tests/FindPython/VirtualEnv/VirtualEnvOnly.cmake b/Tests/RunCMake/FindPython/VirtualEnvOnly.cmake
similarity index 100%
rename from Tests/FindPython/VirtualEnv/VirtualEnvOnly.cmake
rename to Tests/RunCMake/FindPython/VirtualEnvOnly.cmake
diff --git a/Tests/FindPython/VirtualEnv/VirtualEnvStandard.cmake b/Tests/RunCMake/FindPython/VirtualEnvStandard.cmake
similarity index 100%
rename from Tests/FindPython/VirtualEnv/VirtualEnvStandard.cmake
rename to Tests/RunCMake/FindPython/VirtualEnvStandard.cmake
diff --git a/Tests/FindPython/NumPy/arraytest.c b/Tests/RunCMake/FindPython/arraytest.c
similarity index 94%
rename from Tests/FindPython/NumPy/arraytest.c
rename to Tests/RunCMake/FindPython/arraytest.c
index 51db7bc..6bead00 100644
--- a/Tests/FindPython/NumPy/arraytest.c
+++ b/Tests/RunCMake/FindPython/arraytest.c
@@ -33,7 +33,7 @@
}
#if defined(PYTHON2)
-PyMODINIT_FUNC init_C_arraytest(void)
+PyMODINIT_FUNC initarraytest2(void)
{
(void)Py_InitModule("arraytest2", arraytestMethods);
import_array();
@@ -49,7 +49,7 @@
arraytestMethods
};
-PyMODINIT_FUNC PyInit_C_arraytest(void)
+PyMODINIT_FUNC PyInit_arraytest3(void)
{
PyObject* po = PyModule_Create(&arraytestmodule);
import_array();
diff --git a/Tests/FindPython/display_time.c b/Tests/RunCMake/FindPython/display_time.c
similarity index 100%
rename from Tests/FindPython/display_time.c
rename to Tests/RunCMake/FindPython/display_time.c
diff --git a/Tests/FindPython/display_time.h b/Tests/RunCMake/FindPython/display_time.h
similarity index 100%
rename from Tests/FindPython/display_time.h
rename to Tests/RunCMake/FindPython/display_time.h
diff --git a/Tests/FindPython/main.c b/Tests/RunCMake/FindPython/main.c
similarity index 100%
rename from Tests/FindPython/main.c
rename to Tests/RunCMake/FindPython/main.c
diff --git a/Tests/RunCMake/FindPython/pseudo_emulator/CMakeLists.txt b/Tests/RunCMake/FindPython/pseudo_emulator/CMakeLists.txt
new file mode 100644
index 0000000..abc1517
--- /dev/null
+++ b/Tests/RunCMake/FindPython/pseudo_emulator/CMakeLists.txt
@@ -0,0 +1,5 @@
+cmake_minimum_required(VERSION 3.22...4.1)
+
+project(PseudoEmulator LANGUAGES C)
+
+add_executable(pseudo_emulator pseudo_emulator.c)
diff --git a/Tests/RunCMake/FindPython/pseudo_emulator/pseudo_emulator.c b/Tests/RunCMake/FindPython/pseudo_emulator/pseudo_emulator.c
new file mode 100644
index 0000000..6333c41
--- /dev/null
+++ b/Tests/RunCMake/FindPython/pseudo_emulator/pseudo_emulator.c
@@ -0,0 +1,48 @@
+
+#include <stdio.h>
+#include <time.h>
+#include <unistd.h>
+
+#include <sys/types.h>
+#include <sys/wait.h>
+
+static int execute(char* argv[])
+{
+ pid_t my_pid;
+ int status, timeout;
+ struct timespec duration;
+ duration.tv_sec = 0;
+ duration.tv_nsec = 100000000;
+
+ if (0 == (my_pid = fork())) {
+ if (-1 == execve(argv[0], (char**)argv, NULL)) {
+ perror("child process execve failed");
+ return -1;
+ }
+ }
+
+ timeout = 100;
+ while (0 == waitpid(my_pid, &status, WNOHANG)) {
+ if (--timeout < 0) {
+ perror(argv[0]);
+ return -1;
+ }
+ nanosleep(&duration, NULL);
+ }
+
+ if (1 != WIFEXITED(status) || 0 != WEXITSTATUS(status)) {
+ return -1;
+ }
+
+ return 0;
+}
+
+int main(int argc, char* argv[])
+{
+ if (argc < 2) {
+ fprintf(stderr, "%s: require at least one argument.\n", argv[0]);
+ return -1;
+ }
+
+ return execute(&argv[1]);
+}
diff --git a/Tests/RunCMake/FindPython/raise-error.cmake b/Tests/RunCMake/FindPython/raise-error.cmake
new file mode 100644
index 0000000..21c92a6
--- /dev/null
+++ b/Tests/RunCMake/FindPython/raise-error.cmake
@@ -0,0 +1,2 @@
+
+message(FATAL_ERROR "CROSSCOMPILING_EMULATOR erroneously used.")
diff --git a/Tests/FindPython/spam.c b/Tests/RunCMake/FindPython/spam.c
similarity index 86%
rename from Tests/FindPython/spam.c
rename to Tests/RunCMake/FindPython/spam.c
index 063bf35..29661f8 100644
--- a/Tests/FindPython/spam.c
+++ b/Tests/RunCMake/FindPython/spam.c
@@ -1,4 +1,8 @@
-#define Py_LIMITED_API 3
+#if !defined(_WIN32)
+/* Disabled for Windows to avoid to link with the wrong library specified by
+ * #pragma */
+# define Py_LIMITED_API 3
+#endif
#include <Python.h>
static PyObject* spam_system(PyObject* self, PyObject* args)
diff --git a/Tests/FindPython/DifferentComponents/subdir/CMakeLists.txt b/Tests/RunCMake/FindPython/subdir/CMakeLists.txt
similarity index 100%
rename from Tests/FindPython/DifferentComponents/subdir/CMakeLists.txt
rename to Tests/RunCMake/FindPython/subdir/CMakeLists.txt
diff --git a/Tests/RunCMake/GenEx-LIST/CMP0186-NEW-check.cmake b/Tests/RunCMake/GenEx-LIST/CMP0186-NEW-check.cmake
new file mode 100644
index 0000000..0a1ef60
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LIST/CMP0186-NEW-check.cmake
@@ -0,0 +1,11 @@
+set(expected "
+ 000;1001;002
+ x000;1001;x002
+ x000;x01;x002
+")
+
+file(READ "${RunCMake_TEST_BINARY_DIR}/generated.txt" generated)
+
+if(NOT generated STREQUAL expected)
+ set(RunCMake_TEST_FAILED "generated:${generated}\nexpected:${expected}")
+endif()
diff --git a/Tests/RunCMake/GenEx-LIST/CMP0186-NEW.cmake b/Tests/RunCMake/GenEx-LIST/CMP0186-NEW.cmake
new file mode 100644
index 0000000..6f97614
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LIST/CMP0186-NEW.cmake
@@ -0,0 +1,5 @@
+file(GENERATE OUTPUT "generated.txt" CONTENT "
+ $<LIST:TRANSFORM,0000;1001;0002,REPLACE,^0,>
+ $<LIST:TRANSFORM,0000;1001;0002,REPLACE,^(a|0),x>
+ $<LIST:TRANSFORM,0000;1001;0002,REPLACE,(1|^)0,x>
+")
diff --git a/Tests/RunCMake/GenEx-LIST/CMP0186-OLD-check.cmake b/Tests/RunCMake/GenEx-LIST/CMP0186-OLD-check.cmake
new file mode 100644
index 0000000..e44ab3b
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LIST/CMP0186-OLD-check.cmake
@@ -0,0 +1,11 @@
+set(expected "
+ ;1001;2
+ xxxx;1001;xxx2
+ xxxx;xx1;xxx2
+")
+
+file(READ "${RunCMake_TEST_BINARY_DIR}/generated.txt" generated)
+
+if(NOT generated STREQUAL expected)
+ set(RunCMake_TEST_FAILED "generated:${generated}\nexpected:${expected}")
+endif()
diff --git a/Tests/RunCMake/GenEx-LIST/CMP0186-OLD.cmake b/Tests/RunCMake/GenEx-LIST/CMP0186-OLD.cmake
new file mode 100644
index 0000000..845005a
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LIST/CMP0186-OLD.cmake
@@ -0,0 +1 @@
+include(CMP0186-NEW.cmake)
diff --git a/Tests/RunCMake/GenEx-LIST/RunCMakeTest.cmake b/Tests/RunCMake/GenEx-LIST/RunCMakeTest.cmake
index 1946e84..0b0177a 100644
--- a/Tests/RunCMake/GenEx-LIST/RunCMakeTest.cmake
+++ b/Tests/RunCMake/GenEx-LIST/RunCMakeTest.cmake
@@ -128,3 +128,6 @@
check_list_execution (TRANSFORM-REPLACE)
check_list_execution (REVERSE)
check_list_execution (SORT)
+
+run_cmake_with_options(CMP0186-OLD -DCMAKE_POLICY_DEFAULT_CMP0186=OLD)
+run_cmake_with_options(CMP0186-NEW -DCMAKE_POLICY_DEFAULT_CMP0186=NEW)
diff --git a/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_BASE_NAME.cmake b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_BASE_NAME.cmake
index d550431..a401745 100644
--- a/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_BASE_NAME.cmake
+++ b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_BASE_NAME.cmake
@@ -122,8 +122,8 @@
]])
if (CMAKE_C_LINKER_SUPPORTS_PDB)
string (APPEND GENERATE_CONTENT [[
-check_value ("TARGET_PDB_FILE_BASE_NAME executable PDB all properties + postfix" "$<TARGET_PDB_FILE_BASE_NAME:exec4>" "exec4_pdb_postfix")
-check_value ("TARGET_PDB_FILE_BASE_NAME shared PDB all properties + postfix" "$<TARGET_PDB_FILE_BASE_NAME:shared4>" "shared4_pdb_postfix")
+check_value ("TARGET_PDB_FILE_BASE_NAME executable PDB all properties + postfix" "$<TARGET_PDB_FILE_BASE_NAME:exec4>" "exec4_pdb")
+check_value ("TARGET_PDB_FILE_BASE_NAME shared PDB all properties + postfix" "$<TARGET_PDB_FILE_BASE_NAME:shared4>" "shared4_pdb")
]])
endif()
diff --git a/Tests/RunCMake/PackageInfo/Appendix-check.cmake b/Tests/RunCMake/InstallPackageInfo/Appendix-check.cmake
similarity index 100%
rename from Tests/RunCMake/PackageInfo/Appendix-check.cmake
rename to Tests/RunCMake/InstallPackageInfo/Appendix-check.cmake
diff --git a/Tests/RunCMake/PackageInfo/Appendix.cmake b/Tests/RunCMake/InstallPackageInfo/Appendix.cmake
similarity index 100%
rename from Tests/RunCMake/PackageInfo/Appendix.cmake
rename to Tests/RunCMake/InstallPackageInfo/Appendix.cmake
diff --git a/Tests/RunCMake/PackageInfo/Assertions.cmake b/Tests/RunCMake/InstallPackageInfo/Assertions.cmake
similarity index 100%
copy from Tests/RunCMake/PackageInfo/Assertions.cmake
copy to Tests/RunCMake/InstallPackageInfo/Assertions.cmake
diff --git a/Tests/RunCMake/PackageInfo/BadArgs1-result.txt b/Tests/RunCMake/InstallPackageInfo/BadArgs1-result.txt
similarity index 100%
copy from Tests/RunCMake/PackageInfo/BadArgs1-result.txt
copy to Tests/RunCMake/InstallPackageInfo/BadArgs1-result.txt
diff --git a/Tests/RunCMake/PackageInfo/BadArgs1-stderr.txt b/Tests/RunCMake/InstallPackageInfo/BadArgs1-stderr.txt
similarity index 100%
rename from Tests/RunCMake/PackageInfo/BadArgs1-stderr.txt
rename to Tests/RunCMake/InstallPackageInfo/BadArgs1-stderr.txt
diff --git a/Tests/RunCMake/PackageInfo/BadArgs1.cmake b/Tests/RunCMake/InstallPackageInfo/BadArgs1.cmake
similarity index 100%
rename from Tests/RunCMake/PackageInfo/BadArgs1.cmake
rename to Tests/RunCMake/InstallPackageInfo/BadArgs1.cmake
diff --git a/Tests/RunCMake/PackageInfo/BadArgs2-result.txt b/Tests/RunCMake/InstallPackageInfo/BadArgs2-result.txt
similarity index 100%
copy from Tests/RunCMake/PackageInfo/BadArgs2-result.txt
copy to Tests/RunCMake/InstallPackageInfo/BadArgs2-result.txt
diff --git a/Tests/RunCMake/PackageInfo/BadArgs2-stderr.txt b/Tests/RunCMake/InstallPackageInfo/BadArgs2-stderr.txt
similarity index 100%
rename from Tests/RunCMake/PackageInfo/BadArgs2-stderr.txt
rename to Tests/RunCMake/InstallPackageInfo/BadArgs2-stderr.txt
diff --git a/Tests/RunCMake/PackageInfo/BadArgs2.cmake b/Tests/RunCMake/InstallPackageInfo/BadArgs2.cmake
similarity index 100%
rename from Tests/RunCMake/PackageInfo/BadArgs2.cmake
rename to Tests/RunCMake/InstallPackageInfo/BadArgs2.cmake
diff --git a/Tests/RunCMake/PackageInfo/BadArgs3-result.txt b/Tests/RunCMake/InstallPackageInfo/BadArgs3-result.txt
similarity index 100%
copy from Tests/RunCMake/PackageInfo/BadArgs3-result.txt
copy to Tests/RunCMake/InstallPackageInfo/BadArgs3-result.txt
diff --git a/Tests/RunCMake/PackageInfo/BadArgs3-stderr.txt b/Tests/RunCMake/InstallPackageInfo/BadArgs3-stderr.txt
similarity index 100%
rename from Tests/RunCMake/PackageInfo/BadArgs3-stderr.txt
rename to Tests/RunCMake/InstallPackageInfo/BadArgs3-stderr.txt
diff --git a/Tests/RunCMake/PackageInfo/BadArgs3.cmake b/Tests/RunCMake/InstallPackageInfo/BadArgs3.cmake
similarity index 100%
rename from Tests/RunCMake/PackageInfo/BadArgs3.cmake
rename to Tests/RunCMake/InstallPackageInfo/BadArgs3.cmake
diff --git a/Tests/RunCMake/PackageInfo/BadArgs4-result.txt b/Tests/RunCMake/InstallPackageInfo/BadArgs4-result.txt
similarity index 100%
copy from Tests/RunCMake/PackageInfo/BadArgs4-result.txt
copy to Tests/RunCMake/InstallPackageInfo/BadArgs4-result.txt
diff --git a/Tests/RunCMake/PackageInfo/BadArgs4-stderr.txt b/Tests/RunCMake/InstallPackageInfo/BadArgs4-stderr.txt
similarity index 100%
rename from Tests/RunCMake/PackageInfo/BadArgs4-stderr.txt
rename to Tests/RunCMake/InstallPackageInfo/BadArgs4-stderr.txt
diff --git a/Tests/RunCMake/PackageInfo/BadArgs4.cmake b/Tests/RunCMake/InstallPackageInfo/BadArgs4.cmake
similarity index 100%
rename from Tests/RunCMake/PackageInfo/BadArgs4.cmake
rename to Tests/RunCMake/InstallPackageInfo/BadArgs4.cmake
diff --git a/Tests/RunCMake/PackageInfo/BadArgs5-result.txt b/Tests/RunCMake/InstallPackageInfo/BadArgs5-result.txt
similarity index 100%
rename from Tests/RunCMake/PackageInfo/BadArgs5-result.txt
rename to Tests/RunCMake/InstallPackageInfo/BadArgs5-result.txt
diff --git a/Tests/RunCMake/PackageInfo/BadArgs5-stderr.txt b/Tests/RunCMake/InstallPackageInfo/BadArgs5-stderr.txt
similarity index 100%
rename from Tests/RunCMake/PackageInfo/BadArgs5-stderr.txt
rename to Tests/RunCMake/InstallPackageInfo/BadArgs5-stderr.txt
diff --git a/Tests/RunCMake/PackageInfo/BadArgs5.cmake b/Tests/RunCMake/InstallPackageInfo/BadArgs5.cmake
similarity index 100%
rename from Tests/RunCMake/PackageInfo/BadArgs5.cmake
rename to Tests/RunCMake/InstallPackageInfo/BadArgs5.cmake
diff --git a/Tests/RunCMake/PackageInfo/BadDefaultTarget-result.txt b/Tests/RunCMake/InstallPackageInfo/BadDefaultTarget-result.txt
similarity index 100%
copy from Tests/RunCMake/PackageInfo/BadDefaultTarget-result.txt
copy to Tests/RunCMake/InstallPackageInfo/BadDefaultTarget-result.txt
diff --git a/Tests/RunCMake/PackageInfo/BadDefaultTarget-stderr.txt b/Tests/RunCMake/InstallPackageInfo/BadDefaultTarget-stderr.txt
similarity index 100%
copy from Tests/RunCMake/PackageInfo/BadDefaultTarget-stderr.txt
copy to Tests/RunCMake/InstallPackageInfo/BadDefaultTarget-stderr.txt
diff --git a/Tests/RunCMake/PackageInfo/BadDefaultTarget.cmake b/Tests/RunCMake/InstallPackageInfo/BadDefaultTarget.cmake
similarity index 100%
rename from Tests/RunCMake/PackageInfo/BadDefaultTarget.cmake
rename to Tests/RunCMake/InstallPackageInfo/BadDefaultTarget.cmake
diff --git a/Tests/RunCMake/PackageInfo/BadArgs1-result.txt b/Tests/RunCMake/InstallPackageInfo/BadName-result.txt
similarity index 100%
copy from Tests/RunCMake/PackageInfo/BadArgs1-result.txt
copy to Tests/RunCMake/InstallPackageInfo/BadName-result.txt
diff --git a/Tests/RunCMake/InstallPackageInfo/BadName-stderr.txt b/Tests/RunCMake/InstallPackageInfo/BadName-stderr.txt
new file mode 100644
index 0000000..5d43152
--- /dev/null
+++ b/Tests/RunCMake/InstallPackageInfo/BadName-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at BadName\.cmake:3 \(install\):
+ install PACKAGE_INFO given invalid package name "%foo"\.
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:3 \(include\)
diff --git a/Tests/RunCMake/InstallPackageInfo/BadName.cmake b/Tests/RunCMake/InstallPackageInfo/BadName.cmake
new file mode 100644
index 0000000..2ca878b
--- /dev/null
+++ b/Tests/RunCMake/InstallPackageInfo/BadName.cmake
@@ -0,0 +1,3 @@
+add_library(foo INTERFACE)
+install(TARGETS foo EXPORT foo DESTINATION .)
+install(PACKAGE_INFO "%foo" EXPORT foo)
diff --git a/Tests/RunCMake/PackageInfo/CMakeLists.txt b/Tests/RunCMake/InstallPackageInfo/CMakeLists.txt
similarity index 100%
rename from Tests/RunCMake/PackageInfo/CMakeLists.txt
rename to Tests/RunCMake/InstallPackageInfo/CMakeLists.txt
diff --git a/Tests/RunCMake/PackageInfo/DependsMultiple.cmake b/Tests/RunCMake/InstallPackageInfo/DependsMultiple.cmake
similarity index 100%
copy from Tests/RunCMake/PackageInfo/DependsMultiple.cmake
copy to Tests/RunCMake/InstallPackageInfo/DependsMultiple.cmake
diff --git a/Tests/RunCMake/PackageInfo/DependsMultipleCommon.cmake b/Tests/RunCMake/InstallPackageInfo/DependsMultipleCommon.cmake
similarity index 100%
rename from Tests/RunCMake/PackageInfo/DependsMultipleCommon.cmake
rename to Tests/RunCMake/InstallPackageInfo/DependsMultipleCommon.cmake
diff --git a/Tests/RunCMake/PackageInfo/DependsMultipleDifferentNamespace-result.txt b/Tests/RunCMake/InstallPackageInfo/DependsMultipleDifferentNamespace-result.txt
similarity index 100%
copy from Tests/RunCMake/PackageInfo/DependsMultipleDifferentNamespace-result.txt
copy to Tests/RunCMake/InstallPackageInfo/DependsMultipleDifferentNamespace-result.txt
diff --git a/Tests/RunCMake/PackageInfo/DependsMultipleDifferentNamespace-stderr.txt b/Tests/RunCMake/InstallPackageInfo/DependsMultipleDifferentNamespace-stderr.txt
similarity index 100%
rename from Tests/RunCMake/PackageInfo/DependsMultipleDifferentNamespace-stderr.txt
rename to Tests/RunCMake/InstallPackageInfo/DependsMultipleDifferentNamespace-stderr.txt
diff --git a/Tests/RunCMake/PackageInfo/DependsMultipleDifferentNamespace.cmake b/Tests/RunCMake/InstallPackageInfo/DependsMultipleDifferentNamespace.cmake
similarity index 100%
copy from Tests/RunCMake/PackageInfo/DependsMultipleDifferentNamespace.cmake
copy to Tests/RunCMake/InstallPackageInfo/DependsMultipleDifferentNamespace.cmake
diff --git a/Tests/RunCMake/PackageInfo/DependsMultipleDifferentSets-result.txt b/Tests/RunCMake/InstallPackageInfo/DependsMultipleDifferentSets-result.txt
similarity index 100%
copy from Tests/RunCMake/PackageInfo/DependsMultipleDifferentSets-result.txt
copy to Tests/RunCMake/InstallPackageInfo/DependsMultipleDifferentSets-result.txt
diff --git a/Tests/RunCMake/PackageInfo/DependsMultipleDifferentSets-stderr.txt b/Tests/RunCMake/InstallPackageInfo/DependsMultipleDifferentSets-stderr.txt
similarity index 100%
rename from Tests/RunCMake/PackageInfo/DependsMultipleDifferentSets-stderr.txt
rename to Tests/RunCMake/InstallPackageInfo/DependsMultipleDifferentSets-stderr.txt
diff --git a/Tests/RunCMake/PackageInfo/DependsMultipleDifferentSets.cmake b/Tests/RunCMake/InstallPackageInfo/DependsMultipleDifferentSets.cmake
similarity index 100%
rename from Tests/RunCMake/PackageInfo/DependsMultipleDifferentSets.cmake
rename to Tests/RunCMake/InstallPackageInfo/DependsMultipleDifferentSets.cmake
diff --git a/Tests/RunCMake/PackageInfo/ExperimentalGate-result.txt b/Tests/RunCMake/InstallPackageInfo/ExperimentalGate-result.txt
similarity index 100%
copy from Tests/RunCMake/PackageInfo/ExperimentalGate-result.txt
copy to Tests/RunCMake/InstallPackageInfo/ExperimentalGate-result.txt
diff --git a/Tests/RunCMake/PackageInfo/ExperimentalGate-stderr.txt b/Tests/RunCMake/InstallPackageInfo/ExperimentalGate-stderr.txt
similarity index 100%
rename from Tests/RunCMake/PackageInfo/ExperimentalGate-stderr.txt
rename to Tests/RunCMake/InstallPackageInfo/ExperimentalGate-stderr.txt
diff --git a/Tests/RunCMake/PackageInfo/ExperimentalGate.cmake b/Tests/RunCMake/InstallPackageInfo/ExperimentalGate.cmake
similarity index 100%
rename from Tests/RunCMake/PackageInfo/ExperimentalGate.cmake
rename to Tests/RunCMake/InstallPackageInfo/ExperimentalGate.cmake
diff --git a/Tests/RunCMake/PackageInfo/ExperimentalWarning-stderr.txt b/Tests/RunCMake/InstallPackageInfo/ExperimentalWarning-stderr.txt
similarity index 100%
rename from Tests/RunCMake/PackageInfo/ExperimentalWarning-stderr.txt
rename to Tests/RunCMake/InstallPackageInfo/ExperimentalWarning-stderr.txt
diff --git a/Tests/RunCMake/PackageInfo/ExperimentalWarning.cmake b/Tests/RunCMake/InstallPackageInfo/ExperimentalWarning.cmake
similarity index 100%
rename from Tests/RunCMake/PackageInfo/ExperimentalWarning.cmake
rename to Tests/RunCMake/InstallPackageInfo/ExperimentalWarning.cmake
diff --git a/Tests/RunCMake/PackageInfo/InterfaceProperties-check.cmake b/Tests/RunCMake/InstallPackageInfo/InterfaceProperties-check.cmake
similarity index 100%
rename from Tests/RunCMake/PackageInfo/InterfaceProperties-check.cmake
rename to Tests/RunCMake/InstallPackageInfo/InterfaceProperties-check.cmake
diff --git a/Tests/RunCMake/PackageInfo/InterfaceProperties.cmake b/Tests/RunCMake/InstallPackageInfo/InterfaceProperties.cmake
similarity index 100%
rename from Tests/RunCMake/PackageInfo/InterfaceProperties.cmake
rename to Tests/RunCMake/InstallPackageInfo/InterfaceProperties.cmake
diff --git a/Tests/RunCMake/PackageInfo/LowerCaseFile-check.cmake b/Tests/RunCMake/InstallPackageInfo/LowerCaseFile-check.cmake
similarity index 100%
rename from Tests/RunCMake/PackageInfo/LowerCaseFile-check.cmake
rename to Tests/RunCMake/InstallPackageInfo/LowerCaseFile-check.cmake
diff --git a/Tests/RunCMake/PackageInfo/LowerCaseFile.cmake b/Tests/RunCMake/InstallPackageInfo/LowerCaseFile.cmake
similarity index 100%
rename from Tests/RunCMake/PackageInfo/LowerCaseFile.cmake
rename to Tests/RunCMake/InstallPackageInfo/LowerCaseFile.cmake
diff --git a/Tests/RunCMake/PackageInfo/Metadata-check.cmake b/Tests/RunCMake/InstallPackageInfo/Metadata-check.cmake
similarity index 100%
rename from Tests/RunCMake/PackageInfo/Metadata-check.cmake
rename to Tests/RunCMake/InstallPackageInfo/Metadata-check.cmake
diff --git a/Tests/RunCMake/PackageInfo/Metadata.cmake b/Tests/RunCMake/InstallPackageInfo/Metadata.cmake
similarity index 100%
rename from Tests/RunCMake/PackageInfo/Metadata.cmake
rename to Tests/RunCMake/InstallPackageInfo/Metadata.cmake
diff --git a/Tests/RunCMake/PackageInfo/Minimal-check.cmake b/Tests/RunCMake/InstallPackageInfo/Minimal-check.cmake
similarity index 100%
rename from Tests/RunCMake/PackageInfo/Minimal-check.cmake
rename to Tests/RunCMake/InstallPackageInfo/Minimal-check.cmake
diff --git a/Tests/RunCMake/PackageInfo/Minimal.cmake b/Tests/RunCMake/InstallPackageInfo/Minimal.cmake
similarity index 100%
rename from Tests/RunCMake/PackageInfo/Minimal.cmake
rename to Tests/RunCMake/InstallPackageInfo/Minimal.cmake
diff --git a/Tests/RunCMake/PackageInfo/MinimalVersion-check.cmake b/Tests/RunCMake/InstallPackageInfo/MinimalVersion-check.cmake
similarity index 100%
rename from Tests/RunCMake/PackageInfo/MinimalVersion-check.cmake
rename to Tests/RunCMake/InstallPackageInfo/MinimalVersion-check.cmake
diff --git a/Tests/RunCMake/PackageInfo/MinimalVersion.cmake b/Tests/RunCMake/InstallPackageInfo/MinimalVersion.cmake
similarity index 100%
rename from Tests/RunCMake/PackageInfo/MinimalVersion.cmake
rename to Tests/RunCMake/InstallPackageInfo/MinimalVersion.cmake
diff --git a/Tests/RunCMake/PackageInfo/ReferencesNonExportedTarget-result.txt b/Tests/RunCMake/InstallPackageInfo/ReferencesNonExportedTarget-result.txt
similarity index 100%
copy from Tests/RunCMake/PackageInfo/ReferencesNonExportedTarget-result.txt
copy to Tests/RunCMake/InstallPackageInfo/ReferencesNonExportedTarget-result.txt
diff --git a/Tests/RunCMake/PackageInfo/ReferencesNonExportedTarget-stderr.txt b/Tests/RunCMake/InstallPackageInfo/ReferencesNonExportedTarget-stderr.txt
similarity index 100%
rename from Tests/RunCMake/PackageInfo/ReferencesNonExportedTarget-stderr.txt
rename to Tests/RunCMake/InstallPackageInfo/ReferencesNonExportedTarget-stderr.txt
diff --git a/Tests/RunCMake/PackageInfo/ReferencesNonExportedTarget.cmake b/Tests/RunCMake/InstallPackageInfo/ReferencesNonExportedTarget.cmake
similarity index 100%
rename from Tests/RunCMake/PackageInfo/ReferencesNonExportedTarget.cmake
rename to Tests/RunCMake/InstallPackageInfo/ReferencesNonExportedTarget.cmake
diff --git a/Tests/RunCMake/PackageInfo/ReferencesWronglyExportedTarget-result.txt b/Tests/RunCMake/InstallPackageInfo/ReferencesWronglyExportedTarget-result.txt
similarity index 100%
copy from Tests/RunCMake/PackageInfo/ReferencesWronglyExportedTarget-result.txt
copy to Tests/RunCMake/InstallPackageInfo/ReferencesWronglyExportedTarget-result.txt
diff --git a/Tests/RunCMake/PackageInfo/ReferencesWronglyExportedTarget-stderr.txt b/Tests/RunCMake/InstallPackageInfo/ReferencesWronglyExportedTarget-stderr.txt
similarity index 100%
copy from Tests/RunCMake/PackageInfo/ReferencesWronglyExportedTarget-stderr.txt
copy to Tests/RunCMake/InstallPackageInfo/ReferencesWronglyExportedTarget-stderr.txt
diff --git a/Tests/RunCMake/PackageInfo/ReferencesWronglyExportedTarget.cmake b/Tests/RunCMake/InstallPackageInfo/ReferencesWronglyExportedTarget.cmake
similarity index 100%
rename from Tests/RunCMake/PackageInfo/ReferencesWronglyExportedTarget.cmake
rename to Tests/RunCMake/InstallPackageInfo/ReferencesWronglyExportedTarget.cmake
diff --git a/Tests/RunCMake/PackageInfo/ReferencesWronglyImportedTarget-result.txt b/Tests/RunCMake/InstallPackageInfo/ReferencesWronglyImportedTarget-result.txt
similarity index 100%
copy from Tests/RunCMake/PackageInfo/ReferencesWronglyImportedTarget-result.txt
copy to Tests/RunCMake/InstallPackageInfo/ReferencesWronglyImportedTarget-result.txt
diff --git a/Tests/RunCMake/PackageInfo/ReferencesWronglyImportedTarget-stderr.txt b/Tests/RunCMake/InstallPackageInfo/ReferencesWronglyImportedTarget-stderr.txt
similarity index 100%
copy from Tests/RunCMake/PackageInfo/ReferencesWronglyImportedTarget-stderr.txt
copy to Tests/RunCMake/InstallPackageInfo/ReferencesWronglyImportedTarget-stderr.txt
diff --git a/Tests/RunCMake/PackageInfo/ReferencesWronglyImportedTarget.cmake b/Tests/RunCMake/InstallPackageInfo/ReferencesWronglyImportedTarget.cmake
similarity index 100%
rename from Tests/RunCMake/PackageInfo/ReferencesWronglyImportedTarget.cmake
rename to Tests/RunCMake/InstallPackageInfo/ReferencesWronglyImportedTarget.cmake
diff --git a/Tests/RunCMake/PackageInfo/ReferencesWronglyNamespacedTarget-result.txt b/Tests/RunCMake/InstallPackageInfo/ReferencesWronglyNamespacedTarget-result.txt
similarity index 100%
copy from Tests/RunCMake/PackageInfo/ReferencesWronglyNamespacedTarget-result.txt
copy to Tests/RunCMake/InstallPackageInfo/ReferencesWronglyNamespacedTarget-result.txt
diff --git a/Tests/RunCMake/PackageInfo/ReferencesWronglyNamespacedTarget-stderr.txt b/Tests/RunCMake/InstallPackageInfo/ReferencesWronglyNamespacedTarget-stderr.txt
similarity index 100%
copy from Tests/RunCMake/PackageInfo/ReferencesWronglyNamespacedTarget-stderr.txt
copy to Tests/RunCMake/InstallPackageInfo/ReferencesWronglyNamespacedTarget-stderr.txt
diff --git a/Tests/RunCMake/PackageInfo/ReferencesWronglyNamespacedTarget.cmake b/Tests/RunCMake/InstallPackageInfo/ReferencesWronglyNamespacedTarget.cmake
similarity index 100%
rename from Tests/RunCMake/PackageInfo/ReferencesWronglyNamespacedTarget.cmake
rename to Tests/RunCMake/InstallPackageInfo/ReferencesWronglyNamespacedTarget.cmake
diff --git a/Tests/RunCMake/PackageInfo/Requirements-check.cmake b/Tests/RunCMake/InstallPackageInfo/Requirements-check.cmake
similarity index 100%
rename from Tests/RunCMake/PackageInfo/Requirements-check.cmake
rename to Tests/RunCMake/InstallPackageInfo/Requirements-check.cmake
diff --git a/Tests/RunCMake/PackageInfo/Requirements.cmake b/Tests/RunCMake/InstallPackageInfo/Requirements.cmake
similarity index 100%
rename from Tests/RunCMake/PackageInfo/Requirements.cmake
rename to Tests/RunCMake/InstallPackageInfo/Requirements.cmake
diff --git a/Tests/RunCMake/PackageInfo/RunCMakeTest.cmake b/Tests/RunCMake/InstallPackageInfo/RunCMakeTest.cmake
similarity index 97%
rename from Tests/RunCMake/PackageInfo/RunCMakeTest.cmake
rename to Tests/RunCMake/InstallPackageInfo/RunCMakeTest.cmake
index 6618ff4..ebd3e89 100644
--- a/Tests/RunCMake/PackageInfo/RunCMakeTest.cmake
+++ b/Tests/RunCMake/InstallPackageInfo/RunCMakeTest.cmake
@@ -16,6 +16,7 @@
run_cmake(BadArgs3)
run_cmake(BadArgs4)
run_cmake(BadArgs5)
+run_cmake(BadName)
run_cmake(BadDefaultTarget)
run_cmake(ReferencesNonExportedTarget)
run_cmake(ReferencesWronglyExportedTarget)
diff --git a/Tests/RunCMake/PackageInfo/TargetTypes-check.cmake b/Tests/RunCMake/InstallPackageInfo/TargetTypes-check.cmake
similarity index 100%
rename from Tests/RunCMake/PackageInfo/TargetTypes-check.cmake
rename to Tests/RunCMake/InstallPackageInfo/TargetTypes-check.cmake
diff --git a/Tests/RunCMake/PackageInfo/TargetTypes.cmake b/Tests/RunCMake/InstallPackageInfo/TargetTypes.cmake
similarity index 100%
rename from Tests/RunCMake/PackageInfo/TargetTypes.cmake
rename to Tests/RunCMake/InstallPackageInfo/TargetTypes.cmake
diff --git a/Tests/RunCMake/PackageInfo/broken-config.cmake b/Tests/RunCMake/InstallPackageInfo/broken-config.cmake
similarity index 100%
copy from Tests/RunCMake/PackageInfo/broken-config.cmake
copy to Tests/RunCMake/InstallPackageInfo/broken-config.cmake
diff --git a/Tests/RunCMake/PackageInfo/foo.cxx b/Tests/RunCMake/InstallPackageInfo/foo.cxx
similarity index 100%
copy from Tests/RunCMake/PackageInfo/foo.cxx
copy to Tests/RunCMake/InstallPackageInfo/foo.cxx
diff --git a/Tests/RunCMake/PackageInfo/test-config.cmake b/Tests/RunCMake/InstallPackageInfo/test-config.cmake
similarity index 100%
copy from Tests/RunCMake/PackageInfo/test-config.cmake
copy to Tests/RunCMake/InstallPackageInfo/test-config.cmake
diff --git a/Tests/RunCMake/PackageInfo/test.cxx b/Tests/RunCMake/InstallPackageInfo/test.cxx
similarity index 100%
copy from Tests/RunCMake/PackageInfo/test.cxx
copy to Tests/RunCMake/InstallPackageInfo/test.cxx
diff --git a/Tests/RunCMake/MSVCDebugInformationFormat/CMP0141-OLD-stderr.txt b/Tests/RunCMake/MSVCDebugInformationFormat/CMP0141-OLD-stderr.txt
new file mode 100644
index 0000000..92ec2d4
--- /dev/null
+++ b/Tests/RunCMake/MSVCDebugInformationFormat/CMP0141-OLD-stderr.txt
@@ -0,0 +1,10 @@
+^CMake Deprecation Warning at CMP0141-OLD\.cmake:[0-9]+ \(cmake_policy\):
+ The OLD behavior for policy CMP0141 will be removed from a future version
+ of CMake\.
+
+ The cmake-policies\(7\) manual explains that the OLD behaviors of all
+ policies are deprecated and that a policy should be set to OLD only under
+ specific short-term circumstances\. Projects should be ported to the NEW
+ behavior and not rely on setting a policy to OLD\.
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/Ninja/CustomCommandTargetComments.cmake b/Tests/RunCMake/Ninja/CustomCommandTargetComments.cmake
new file mode 100644
index 0000000..cfadcb3
--- /dev/null
+++ b/Tests/RunCMake/Ninja/CustomCommandTargetComments.cmake
@@ -0,0 +1,12 @@
+enable_language(C)
+
+add_executable(hello hello.c)
+add_custom_command(TARGET hello PRE_BUILD
+ COMMENT "pre-build: $<1:genex>"
+ COMMAND "${CMAKE_COMMAND}" -E echo "$<TARGET_FILE:hello>")
+add_custom_command(TARGET hello PRE_LINK
+ COMMENT "pre-link: $<1:genex>"
+ COMMAND "${CMAKE_COMMAND}" -E echo "$<TARGET_FILE:hello>")
+add_custom_command(TARGET hello POST_BUILD
+ COMMENT "post-build: $<1:genex>"
+ COMMAND "${CMAKE_COMMAND}" -E echo "$<TARGET_FILE:hello>")
diff --git a/Tests/RunCMake/Ninja/RunCMakeTest.cmake b/Tests/RunCMake/Ninja/RunCMakeTest.cmake
index a0e59ee..cbf7f26 100644
--- a/Tests/RunCMake/Ninja/RunCMakeTest.cmake
+++ b/Tests/RunCMake/Ninja/RunCMakeTest.cmake
@@ -389,6 +389,21 @@
endfunction()
run_ChangeBuildType()
+function (run_CustomCommandTargetComments)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/CustomCommandTargetComments-build)
+ run_cmake(CustomCommandTargetComments)
+ unset(RunCMake_TEST_OPTIONS)
+ run_ninja("${RunCMake_TEST_BINARY_DIR}" ${maybe_w_dupbuild_err})
+ if (NOT ninja_stdout MATCHES [[pre-build: genex; pre-link: genex; Linking C executable hello(\.exe)?; post-build: genex]])
+ string(REPLACE "\n" "\n " ninja_stdout "${ninja_stdout}")
+ message(SEND_ERROR
+ "Custom command comments are not part of the description:\n"
+ " ${ninja_stdout}"
+ )
+ endif ()
+endfunction()
+run_CustomCommandTargetComments()
+
function(run_QtAutoMocSkipPch)
set(QtX Qt${CMake_TEST_Qt_version})
if(CMake_TEST_${QtX}Core_Version VERSION_GREATER_EQUAL 5.15.0)
diff --git a/Tests/RunCMake/NinjaMultiConfig/CompileCommands-check.cmake b/Tests/RunCMake/NinjaMultiConfig/CompileCommands-check.cmake
index e65be3b..730adf9 100644
--- a/Tests/RunCMake/NinjaMultiConfig/CompileCommands-check.cmake
+++ b/Tests/RunCMake/NinjaMultiConfig/CompileCommands-check.cmake
@@ -2,25 +2,28 @@
[==[^\[
{
"directory": "[^
-]*(/Tests/RunCMake/NinjaMultiConfig/CompileCommands-build|\\\\Tests\\\\RunCMake\\\\NinjaMultiConfig\\\\CompileCommands-build)",
+]*/Tests/RunCMake/NinjaMultiConfig/CompileCommands-build",
"command": "[^
]*Debug[^
]*",
"file": "[^
-]*(/Tests/RunCMake/NinjaMultiConfig/main\.c|\\\\Tests\\\\RunCMake\\\\NinjaMultiConfig\\\\main\.c)",
- "output": "(CMakeFiles/exe\.dir/Debug/main\.c\.o|CMakeFiles\\\\exe\.dir\\\\Debug\\\\main\.c\.(obj|o))"
+]*/Tests/RunCMake/NinjaMultiConfig/main\.c",
+ "output": "[^
+]*/CMakeFiles/exe\.dir/Debug/main\.c\.(obj|o)"
},
{
"directory": "[^
-]*(/Tests/RunCMake/NinjaMultiConfig/CompileCommands-build|\\\\Tests\\\\RunCMake\\\\NinjaMultiConfig\\\\CompileCommands-build)",
+]*/Tests/RunCMake/NinjaMultiConfig/CompileCommands-build",
"command": "[^
]*Release[^
]*",
"file": "[^
-]*(/Tests/RunCMake/NinjaMultiConfig/main\.c|\\\\Tests\\\\RunCMake\\\\NinjaMultiConfig\\\\main\.c)",
- "output": "(CMakeFiles/exe\.dir/Release/main\.c\.o|CMakeFiles\\\\exe\.dir\\\\Release\\\\main\.c\.(obj|o))"
+]*/Tests/RunCMake/NinjaMultiConfig/main\.c",
+ "output": "[^
+]*/CMakeFiles/exe\.dir/Release/main\.c\.(obj|o)"
}
-]$]==])
+]
+$]==])
file(READ "${RunCMake_TEST_BINARY_DIR}/compile_commands.json" actual_compile_commands)
if(NOT actual_compile_commands MATCHES "${expected_compile_commands}")
diff --git a/Tests/RunCMake/ParseImplicitData/craype-C-CrayClang-18.0.1-fopenmp-accel.input b/Tests/RunCMake/ParseImplicitData/craype-C-CrayClang-18.0.1-fopenmp-accel.input
new file mode 100644
index 0000000..1472468
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitData/craype-C-CrayClang-18.0.1-fopenmp-accel.input
@@ -0,0 +1,153 @@
+CMAKE_LANG=C
+CMAKE_LINKER=/opt/cray/pe/cce/18.0.1/binutils/x86_64/x86_64-pc-linux-gnu/bin/ld
+CMAKE_C_COMPILER_ABI=ELF
+CMAKE_C_COMPILER_AR=
+CMAKE_C_COMPILER_ARCHITECTURE_ID=
+CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_C_COMPILER_ID=CrayClang
+CMAKE_C_COMPILER_LAUNCHER=
+CMAKE_C_COMPILER_LOADED=1
+CMAKE_C_COMPILER_RANLIB=
+CMAKE_C_COMPILER_TARGET=
+CMAKE_C_COMPILER_VERSION=18.0.1
+CMAKE_C_COMPILER_VERSION_INTERAL=
+Change Dir: '/tmp/tmp.EJ2EzeIOpP/CMakeFiles/CMakeTmp'
+
+Run Build Command(s): /usr/bin/cmake -E env VERBOSE=1 /usr/bin/gmake -f Makefile cmTC_587f1/fast
+/usr/bin/gmake -f CMakeFiles/cmTC_587f1.dir/build.make CMakeFiles/cmTC_587f1.dir/build
+gmake[1]: Entering directory '/tmp/tmp.EJ2EzeIOpP/CMakeFiles/CMakeTmp'
+Building C object CMakeFiles/cmTC_587f1.dir/CMakeCCompilerABI.c.o
+/opt/cray/pe/craype/2.7.33/bin/cc -fopenmp -v -o CMakeFiles/cmTC_587f1.dir/CMakeCCompilerABI.c.o -c /home/generic.user/cmake/Modules/CMakeCCompilerABI.c
+Cray clang version 18.0.1 (ac9591613de6fa834bf54862b433bbc16834c13d)
+Target: x86_64-unknown-linux-gnu
+Thread model: posix
+InstalledDir: /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/share/../bin
+Found candidate GCC installation: /usr/lib64/gcc/x86_64-suse-linux/11
+Found candidate GCC installation: /usr/lib64/gcc/x86_64-suse-linux/12
+Found candidate GCC installation: /usr/lib64/gcc/x86_64-suse-linux/13
+Found candidate GCC installation: /usr/lib64/gcc/x86_64-suse-linux/14
+Found candidate GCC installation: /usr/lib64/gcc/x86_64-suse-linux/7
+Selected GCC installation: /usr/lib64/gcc/x86_64-suse-linux/14
+Candidate multilib: .@m64
+Selected multilib: .@m64
+Found HIP installation: /opt/rocm-6.3.0, version 6.3.42131
+ "/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/bin/clang-18" -cc1 -triple x86_64-unknown-linux-gnu -mllvm -cray-omp-opt-fork-call -mllvm -cray-omp-parallel-opt-call -mllvm -cray-openmp-rename-outlined -fcray-gpu -flocal-restrict -mllvm -cray-enhanced-asm=1 -fenhanced-asm=1 -mllvm -cray-enhanced-ir=1 -fenhanced-ir=1 -fomp-local-offload-table -ffortran -emit-llvm-bc -emit-llvm-uselists -disable-free -clear-ast-before-backend -main-file-name CMakeCCompilerABI.c -mrelocation-model static -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu znver2 -debugger-tuning=gdb -fdebug-compilation-dir=/tmp/tmp.EJ2EzeIOpP/CMakeFiles/CMakeTmp -v -fcoverage-compilation-dir=/tmp/tmp.EJ2EzeIOpP/CMakeFiles/CMakeTmp -resource-dir /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18 -internal-isystem /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/include/llvm_libc_wrappers -isystem /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/include -isystem /opt/cray/pe/cce/18.0.1/cce/x86_64/include/craylibs -D __CRAY_X86_ROME -D __CRAY_AMD_GFX908 -D __CRAYXT_COMPUTE_LINUX_TARGET -D __HIP_PLATFORM_AMD__ -I /opt/cray/pe/mpich/8.1.31/ofi/cray/17.0/include -I /opt/cray/pe/dsmml/0.3.0/dsmml//include -I /opt/cray/pe/libsci/24.11.0/CRAY/17.0/x86_64/include -I /opt/rocm-6.3.0/include -I /opt/rocm-6.3.0/include/rocprofiler -I /opt/rocm-6.3.0/include/roctracer -internal-isystem /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/include -internal-isystem /usr/local/include -internal-isystem /usr/lib64/gcc/x86_64-suse-linux/14/../../../../x86_64-suse-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -internal-isystem /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/include -internal-isystem /usr/local/include -internal-isystem /usr/lib64/gcc/x86_64-suse-linux/14/../../../../x86_64-suse-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -ferror-limit 19 -fcray-openmp -fcray-omp-opt-fork -fcray-omp-parallel-opt -fcray-openmp-rename-outlined-funcs -fopenmp -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -disable-llvm-passes -fopenmp-targets=amdgcn-amd-amdhsa -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /tmp/CMakeCCompilerABI-8ea4a8.bc -x c /home/generic.user/cmake/Modules/CMakeCCompilerABI.c
+clang -cc1 version 18.1.8 based upon LLVM 18.1.8 default target x86_64-unknown-linux-gnu
+ignoring nonexistent directory "/include"
+ignoring nonexistent directory "/include"
+ignoring duplicate directory "/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/include"
+ignoring duplicate directory "/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/include"
+ignoring duplicate directory "/usr/local/include"
+ignoring duplicate directory "/usr/lib64/gcc/x86_64-suse-linux/14/../../../../x86_64-suse-linux/include"
+ignoring duplicate directory "/usr/include"
+#include "..." search starts here:
+#include <...> search starts here:
+ /opt/cray/pe/mpich/8.1.31/ofi/cray/17.0/include
+ /opt/cray/pe/dsmml/0.3.0/dsmml//include
+ /opt/cray/pe/libsci/24.11.0/CRAY/17.0/x86_64/include
+ /opt/rocm-6.3.0/include
+ /opt/rocm-6.3.0/include/rocprofiler
+ /opt/rocm-6.3.0/include/roctracer
+ /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/include
+ /opt/cray/pe/cce/18.0.1/cce/x86_64/include/craylibs
+ /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/include/llvm_libc_wrappers
+ /usr/local/include
+ /usr/lib64/gcc/x86_64-suse-linux/14/../../../../x86_64-suse-linux/include
+ /usr/include
+End of search list.
+ "/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/bin/clang-18" -cc1 -triple amdgcn-amd-amdhsa -mllvm -cray-omp-opt-fork-call -mllvm -cray-omp-parallel-opt-call -mllvm -cray-openmp-rename-outlined -fcray-gpu -flocal-restrict -mllvm -cray-enhanced-asm=1 -fenhanced-asm=1 -mllvm -cray-enhanced-ir=1 -fenhanced-ir=1 -fomp-local-offload-table -ffortran -aux-triple x86_64-unknown-linux-gnu -emit-llvm-bc -emit-llvm-uselists -disable-free -clear-ast-before-backend -main-file-name CMakeCCompilerABI.c -mrelocation-model pic -pic-level 2 -fhalf-no-semantic-interposition -mframe-pointer=all -ffp-contract=on -fno-rounding-math -mconstructor-aliases -target-cpu gfx908 -fcuda-is-device -fcuda-allow-variadic-functions -target-cpu gfx908 -debugger-tuning=gdb -fdebug-compilation-dir=/tmp/tmp.EJ2EzeIOpP/CMakeFiles/CMakeTmp -v -resource-dir /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18 -internal-isystem /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/include/llvm_libc_wrappers -internal-isystem /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/include/openmp_wrappers -include __clang_openmp_device_functions.h -isystem /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/include -isystem /opt/cray/pe/cce/18.0.1/cce/x86_64/include/craylibs -D __CRAY_X86_ROME -D __CRAY_AMD_GFX908 -D __CRAYXT_COMPUTE_LINUX_TARGET -D __HIP_PLATFORM_AMD__ -I /opt/cray/pe/mpich/8.1.31/ofi/cray/17.0/include -I /opt/cray/pe/dsmml/0.3.0/dsmml//include -I /opt/cray/pe/libsci/24.11.0/CRAY/17.0/x86_64/include -I /opt/rocm-6.3.0/include -I /opt/rocm-6.3.0/include/rocprofiler -I /opt/rocm-6.3.0/include/roctracer -internal-isystem /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/include -internal-isystem /usr/local/include -internal-isystem /usr/lib64/gcc/x86_64-suse-linux/14/../../../../x86_64-suse-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -internal-isystem /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/include -internal-isystem /usr/local/include -internal-isystem /usr/lib64/gcc/x86_64-suse-linux/14/../../../../x86_64-suse-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -ferror-limit 19 -fvisibility=protected -fcray-openmp -fcray-omp-opt-fork -fcray-omp-parallel-opt -fcray-openmp-rename-outlined-funcs -fopenmp -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -fopenmp-is-target-device -mllvm -cray-gpu -mllvm -openmp-opt-disable -mllvm -cray-gpuruntime-bitcode=/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/libcrayomptarget-amdgcn-gfx908.bc/opt/rocm-6.3.0/amdgcn/bitcode/hip.bc/opt/rocm-6.3.0/amdgcn/bitcode/ockl.bc/opt/rocm-6.3.0/amdgcn/bitcode/ocml.bc/opt/rocm-6.3.0/amdgcn/bitcode/ocml.bc/opt/rocm-6.3.0/amdgcn/bitcode/oclc_isa_version_908.bc/opt/rocm-6.3.0/amdgcn/bitcode/oclc_daz_opt_off.bc/opt/rocm-6.3.0/amdgcn/bitcode/oclc_finite_only_off.bc/opt/rocm-6.3.0/amdgcn/bitcode/oclc_correctly_rounded_sqrt_on.bc/opt/rocm-6.3.0/amdgcn/bitcode/oclc_unsafe_math_off.bc -fopenmp-host-ir-file-path /tmp/CMakeCCompilerABI-8ea4a8.bc -faddrsig -o /tmp/CMakeCCompilerABI-273532.bc -x c /home/generic.user/cmake/Modules/CMakeCCompilerABI.c
+clang -cc1 version 18.1.8 based upon LLVM 18.1.8 default target x86_64-unknown-linux-gnu
+ignoring nonexistent directory "/include"
+ignoring nonexistent directory "/include"
+ignoring duplicate directory "/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/include"
+ignoring duplicate directory "/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/include"
+ignoring duplicate directory "/usr/local/include"
+ignoring duplicate directory "/usr/lib64/gcc/x86_64-suse-linux/14/../../../../x86_64-suse-linux/include"
+ignoring duplicate directory "/usr/include"
+ignoring duplicate directory "/usr/local/include"
+ignoring duplicate directory "/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/include"
+ignoring duplicate directory "/usr/include"
+#include "..." search starts here:
+#include <...> search starts here:
+ /opt/cray/pe/mpich/8.1.31/ofi/cray/17.0/include
+ /opt/cray/pe/dsmml/0.3.0/dsmml//include
+ /opt/cray/pe/libsci/24.11.0/CRAY/17.0/x86_64/include
+ /opt/rocm-6.3.0/include
+ /opt/rocm-6.3.0/include/rocprofiler
+ /opt/rocm-6.3.0/include/roctracer
+ /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/include
+ /opt/cray/pe/cce/18.0.1/cce/x86_64/include/craylibs
+ /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/include/llvm_libc_wrappers
+ /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/include/openmp_wrappers
+ /usr/local/include
+ /usr/lib64/gcc/x86_64-suse-linux/14/../../../../x86_64-suse-linux/include
+ /usr/include
+End of search list.
+ "/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/share/../bin/clang-offload-packager" -o /tmp/CMakeCCompilerABI-7730a7.out --image=file=/tmp/CMakeCCompilerABI-273532.bc,triple=amdgcn-amd-amdhsa,arch=gfx908,kind=openmp
+ "/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/bin/clang-18" -cc1 -triple x86_64-unknown-linux-gnu -mllvm -cray-omp-opt-fork-call -mllvm -cray-omp-parallel-opt-call -mllvm -cray-openmp-rename-outlined -fcray-gpu -flocal-restrict -mllvm -cray-enhanced-asm=1 -fenhanced-asm=1 -mllvm -cray-enhanced-ir=1 -fenhanced-ir=1 -fomp-local-offload-table -ffortran -emit-obj -mrelax-all -disable-free -clear-ast-before-backend -main-file-name CMakeCCompilerABI.c -mrelocation-model static -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu znver2 -debugger-tuning=gdb -fdebug-compilation-dir=/tmp/tmp.EJ2EzeIOpP/CMakeFiles/CMakeTmp -v -fcoverage-compilation-dir=/tmp/tmp.EJ2EzeIOpP/CMakeFiles/CMakeTmp -resource-dir /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18 -ferror-limit 19 -fcray-openmp -fcray-omp-opt-fork -fcray-omp-parallel-opt -fcray-openmp-rename-outlined-funcs -fopenmp -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -fembed-offload-object=/tmp/CMakeCCompilerABI-7730a7.out -fopenmp-targets=amdgcn-amd-amdhsa -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o CMakeFiles/cmTC_587f1.dir/CMakeCCompilerABI.c.o -x ir /tmp/CMakeCCompilerABI-8ea4a8.bc
+clang -cc1 version 18.1.8 based upon LLVM 18.1.8 default target x86_64-unknown-linux-gnu
+Linking C executable cmTC_587f1
+/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_587f1.dir/link.txt --verbose=1
+Cray clang version 18.0.0.x (bbb3d6951c0329c4d902e7dcd9d677009b67b19a)
+Target: x86_64-unknown-linux-gnu
+Thread model: posix
+InstalledDir: /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/share/../bin
+Found candidate GCC installation: /usr/lib64/gcc/x86_64-suse-linux/11
+Found candidate GCC installation: /usr/lib64/gcc/x86_64-suse-linux/12
+Found candidate GCC installation: /usr/lib64/gcc/x86_64-suse-linux/13
+Found candidate GCC installation: /usr/lib64/gcc/x86_64-suse-linux/14
+Found candidate GCC installation: /usr/lib64/gcc/x86_64-suse-linux/7
+Selected GCC installation: /usr/lib64/gcc/x86_64-suse-linux/14
+Candidate multilib: .@m64
+Selected multilib: .@m64
+Found HIP installation: /opt/rocm-6.3.0, version 6.3.42131
+ "/opt/cray/pe/cce/18.0.1/cce/x86_64/bin/cce_omp_offload_linker" -O0 -mcode-object-version=5 --rocm-path /opt/rocm-6.3.0 --rocm-device-lib-path /opt/rocm-6.3.0/amdgcn/bitcode --verbose --arch gfx908 -- /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/bin/ld.lld --hash-style=gnu --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o cmTC_587f1 /usr/lib64/gcc/x86_64-suse-linux/14/../../../../lib64/crt1.o /usr/lib64/gcc/x86_64-suse-linux/14/../../../../lib64/crti.o /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/lib/linux/clang_rt.crtbegin-x86_64.o -L/opt/cray/pe/mpich/8.1.31/ofi/cray/17.0/lib -L/opt/cray/pe/mpich/8.1.31/gtl/lib -L/opt/cray/pe/dsmml/0.3.0/dsmml//lib -L/opt/cray/pe/libsci/24.11.0/CRAY/17.0/x86_64/lib -L/opt/rocm-6.3.0/lib -L/opt/rocm-6.3.0/lib/rocprofiler -L/opt/rocm-6.3.0/lib/roctracer -L/opt/cray/pe/cce/18.0.1/cce/x86_64/lib/pkgconfig/../ -L/usr/lib64/gcc/x86_64-suse-linux/14 -L/usr/lib64/gcc/x86_64-suse-linux/14/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib64/gcc/x86_64-suse-linux/14/../../../../x86_64-suse-linux/lib -L/lib -L/usr/lib -plugin-opt=mcpu=znver2 -plugin-opt=lto=0 -plugin-opt=defaults=cray -plugin-opt=mllvm=-cray-math-precision=none -rpath=/opt/cray/pe/cce/18.0.1/cce/x86_64/lib CMakeFiles/cmTC_587f1.dir/CMakeCCompilerABI.c.o -lamdhip64 --as-needed -lsci_cray_mpi_mp --no-as-needed --as-needed -lsci_cray_mp --no-as-needed -ldl --as-needed -lmpi_cray --no-as-needed -lmpi_gtl_hsa --as-needed -ldsmml --no-as-needed -lstdc++ --as-needed -lpgas-shmem --no-as-needed -lquadmath -lmodules -lfi -lcraymath -lf -lu -lcsup --as-needed -lpthread -latomic --no-as-needed --as-needed -lm --no-as-needed --disable-new-dtags /opt/cray/pe/cce/18.0.1/cce/x86_64/lib/no_mmap.o -lcraymp -lcrayacc_amdgpu -L/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/lib/linux/libclang_rt.builtins-x86_64.a --as-needed -L/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib -rpath=/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/libunwind.so -lunwind --no-as-needed -lpthread -lc /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/lib/linux/libclang_rt.builtins-x86_64.a --as-needed -L/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib -rpath=/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/libunwind.so -lunwind --no-as-needed /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/lib/linux/clang_rt.crtend-x86_64.o /usr/lib64/gcc/x86_64-suse-linux/14/../../../../lib64/crtn.o
+Offload Version : 1
+Image Kind : bc
+Offload Kind : openmp
+Arch name : gfx908
+Binary Size : 3288
+Target Triple : amdgcn-amd-amdhsa
+Image Size : 3144
+Unbundling: CMakeFiles/cmTC_587f1.dir/CMakeCCompilerABI.c.o -> CMakeCCompilerABI.c-cce-openmp-amdgcn-amd-amdhsa.amdgpu, CMakeFiles/cmTC_587f1.dir/CMakeCCompilerABI.c.o
+Skipping unbundling of /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/lib/linux/libclang_rt.builtins-x86_64.a (already processed)
+Skipping unbundling of /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/libunwind.so (already processed)
+Skipping unbundling of /usr/lib64/gcc/x86_64-suse-linux/14/../../../../lib64/libpthread.a (already processed)
+Skipping unbundling of /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/libunwind.a (already processed)
+/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/bin/llvm-link /tmp/cooltmpdir-a1mGM5/CMakeCCompilerABI.c-cce-openmp-amdgcn-amd-amdhsa.amdgpu -o /tmp/cooltmpdir-a1mGM5/cmTC_587f1-cce-openmp__ll_app.amdgpu
+/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/bin/llvm-link /tmp/cooltmpdir-a1mGM5/cmTC_587f1-cce-openmp__ll_app.amdgpu /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/libcrayomptarget-amdgcn-gfx908.bc --only-needed /opt/rocm-6.3.0/amdgcn/bitcode/hip.bc /opt/rocm-6.3.0/amdgcn/bitcode/ocml.bc /opt/rocm-6.3.0/amdgcn/bitcode/ockl.bc /opt/rocm-6.3.0/amdgcn/bitcode/oclc_finite_only_off.bc /opt/rocm-6.3.0/amdgcn/bitcode/oclc_daz_opt_off.bc /opt/rocm-6.3.0/amdgcn/bitcode/oclc_correctly_rounded_sqrt_on.bc /opt/rocm-6.3.0/amdgcn/bitcode/oclc_unsafe_math_off.bc /opt/rocm-6.3.0/amdgcn/bitcode/oclc_isa_version_908.bc /opt/rocm-6.3.0/amdgcn/bitcode/oclc_wavefrontsize64_on.bc /opt/rocm-6.3.0/amdgcn/bitcode/oclc_abi_version_500.bc -o /tmp/cooltmpdir-a1mGM5/cmTC_587f1-cce-openmp__ll.amdgpu
+/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/bin/opt -mtriple=amdgcn-amd-amdhsa -mcpu=gfx908 -passes=cray-gpu-linkage-munger,always-inline -amdgpu-internalize-symbols /tmp/cooltmpdir-a1mGM5/cmTC_587f1-cce-openmp__ll.amdgpu -o /tmp/cooltmpdir-a1mGM5/cmTC_587f1-cce-openmppost-opt.bc
+/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/bin/llvm-link --only-needed /tmp/cooltmpdir-a1mGM5/cmTC_587f1-cce-openmppost-opt.bc /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/libcrayomptarget-states-amdgcn-gfx908.bc -o /tmp/cooltmpdir-a1mGM5/cmTC_587f1-cce-openmp-pre-llc.bc
+/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/bin/llc -O0 -mtriple=amdgcn-amd-amdhsa -disable-promote-alloca-to-lds -mcpu=gfx908 -amdgpu-dump-hsa-metadata /tmp/cooltmpdir-a1mGM5/cmTC_587f1-cce-openmp-pre-llc.bc -filetype=obj -o /tmp/cooltmpdir-a1mGM5/cmTC_587f1-cce-openmp__llc.amdgpu
+AMDGPU HSA Metadata:
+---
+amdhsa.kernels: []
+amdhsa.target: amdgcn-amd-amdhsa--gfx908
+amdhsa.version:
+ - 1
+ - 2
+...
+
+/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/bin/lld -flavor gnu --no-undefined -shared -o /tmp/cooltmpdir-a1mGM5/cmTC_587f1-cce-openmppost_lld.amdgpu /tmp/cooltmpdir-a1mGM5/cmTC_587f1-cce-openmp__llc.amdgpu
+as /tmp/cooltmpdir-a1mGM5/cmTC_587f1-cce-openmp-amdgcn-amd-amdhsa.app.s -o /tmp/cooltmpdir-a1mGM5/cmTC_587f1-cce-openmp-host.o
+as /tmp/cooltmpdir-a1mGM5/tmp_offload_linker-cce-openmpacc-targetbegin.s -o /tmp/cooltmpdir-a1mGM5/acc-targetbegin-cce-openmp.o
+as /tmp/cooltmpdir-a1mGM5/tmp_offload_linker-cce-openmpacc-targetend.s -o /tmp/cooltmpdir-a1mGM5/acc-targetend-tmp-cce-openmp.o
+/opt/cray/pe/cce/18.0.1/binutils/x86_64/bin/ld --relocatable /tmp/cooltmpdir-a1mGM5/cmTC_587f1-cce-openmp-host.o /tmp/cooltmpdir-a1mGM5/acc-targetend-tmp-cce-openmp.o --whole-archive /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/lib/linux/libclang_rt.cray_device_wrapper-x86_64.a --no-whole-archive -o /tmp/cooltmpdir-a1mGM5/acc-targetend-cce-openmp.o
+/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/bin/ld.lld /tmp/cooltmpdir-a1mGM5/acc-targetbegin-cce-openmp.o --hash-style=gnu --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o cmTC_587f1 /usr/lib64/gcc/x86_64-suse-linux/14/../../../../lib64/crt1.o /usr/lib64/gcc/x86_64-suse-linux/14/../../../../lib64/crti.o /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/lib/linux/clang_rt.crtbegin-x86_64.o -L/opt/cray/pe/mpich/8.1.31/ofi/cray/17.0/lib -L/opt/cray/pe/mpich/8.1.31/gtl/lib -L/opt/cray/pe/dsmml/0.3.0/dsmml//lib -L/opt/cray/pe/libsci/24.11.0/CRAY/17.0/x86_64/lib -L/opt/rocm-6.3.0/lib -L/opt/rocm-6.3.0/lib/rocprofiler -L/opt/rocm-6.3.0/lib/roctracer -L/opt/cray/pe/cce/18.0.1/cce/x86_64/lib/pkgconfig/../ -L/usr/lib64/gcc/x86_64-suse-linux/14 -L/usr/lib64/gcc/x86_64-suse-linux/14/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib64/gcc/x86_64-suse-linux/14/../../../../x86_64-suse-linux/lib -L/lib -L/usr/lib -plugin-opt=mcpu=znver2 -plugin-opt=lto=0 -plugin-opt=defaults=cray -plugin-opt=mllvm=-cray-math-precision=none -rpath=/opt/cray/pe/cce/18.0.1/cce/x86_64/lib CMakeFiles/cmTC_587f1.dir/CMakeCCompilerABI.c.o -lamdhip64 --as-needed -lsci_cray_mpi_mp --no-as-needed --as-needed -lsci_cray_mp --no-as-needed -ldl --as-needed -lmpi_cray --no-as-needed -lmpi_gtl_hsa --as-needed -ldsmml --no-as-needed -lstdc++ --as-needed -lpgas-shmem --no-as-needed -lquadmath -lmodules -lfi -lcraymath -lf -lu -lcsup --as-needed -lpthread -latomic --no-as-needed --as-needed -lm --no-as-needed --disable-new-dtags /opt/cray/pe/cce/18.0.1/cce/x86_64/lib/no_mmap.o -lcraymp -lcrayacc_amdgpu -L/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/lib/linux/libclang_rt.builtins-x86_64.a --as-needed -L/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib -rpath=/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/libunwind.so -lunwind --no-as-needed -lpthread -lc /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/lib/linux/libclang_rt.builtins-x86_64.a --as-needed -L/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib -rpath=/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/libunwind.so -lunwind --no-as-needed /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/lib/linux/clang_rt.crtend-x86_64.o /usr/lib64/gcc/x86_64-suse-linux/14/../../../../lib64/crtn.o /tmp/cooltmpdir-a1mGM5/acc-targetend-cce-openmp.o
+rm '/tmp/cooltmpdir-a1mGM5/tmp_offload_linker-cce-openmpacc-targetend.s'
+rm '/tmp/cooltmpdir-a1mGM5/tmp_offload_linker-cce-openmpacc-targetbegin.s'
+rm '/tmp/cooltmpdir-a1mGM5/acc-targetend-cce-openmp.o'
+rm '/tmp/cooltmpdir-a1mGM5/acc-targetend-tmp-cce-openmp.o'
+rm '/tmp/cooltmpdir-a1mGM5/acc-targetbegin-cce-openmp.o'
+rm '/tmp/cooltmpdir-a1mGM5/cmTC_587f1-cce-openmp-amdgcn-amd-amdhsa.app.s'
+rm '/tmp/cooltmpdir-a1mGM5/cmTC_587f1-cce-openmp-host.o'
+rm '/tmp/cooltmpdir-a1mGM5/cmTC_587f1-cce-openmppost_lld.amdgpu'
+rm '/tmp/cooltmpdir-a1mGM5/cmTC_587f1-cce-openmp__llc.amdgpu'
+rm '/tmp/cooltmpdir-a1mGM5/cmTC_587f1-cce-openmp-pre-llc.bc'
+rm '/tmp/cooltmpdir-a1mGM5/cmTC_587f1-cce-openmppost-opt.bc'
+rm '/tmp/cooltmpdir-a1mGM5/cmTC_587f1-cce-openmp__ll_app.amdgpu'
+rm '/tmp/cooltmpdir-a1mGM5/cmTC_587f1-cce-openmp__ll.amdgpu'
+rm '/tmp/cooltmpdir-a1mGM5/CMakeCCompilerABI.c-cce-openmp-amdgcn-amd-amdhsa.amdgpu'
+rm '/tmp/cooltmpdir-a1mGM5/'
+/opt/cray/pe/craype/2.7.33/bin/cc -fopenmp -v CMakeFiles/cmTC_587f1.dir/CMakeCCompilerABI.c.o -o cmTC_587f1
+gmake[1]: Leaving directory '/tmp/tmp.EJ2EzeIOpP/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitData/craype-C-CrayClang-18.0.1-fopenmp.input b/Tests/RunCMake/ParseImplicitData/craype-C-CrayClang-18.0.1-fopenmp.input
new file mode 100644
index 0000000..cc51e2e
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitData/craype-C-CrayClang-18.0.1-fopenmp.input
@@ -0,0 +1,67 @@
+CMAKE_LANG=C
+CMAKE_LINKER=/opt/cray/pe/cce/18.0.1/binutils/x86_64/x86_64-pc-linux-gnu/bin/ld
+CMAKE_C_COMPILER_ABI=ELF
+CMAKE_C_COMPILER_AR=
+CMAKE_C_COMPILER_ARCHITECTURE_ID=
+CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_C_COMPILER_ID=CrayClang
+CMAKE_C_COMPILER_LAUNCHER=
+CMAKE_C_COMPILER_LOADED=1
+CMAKE_C_COMPILER_RANLIB=
+CMAKE_C_COMPILER_TARGET=
+CMAKE_C_COMPILER_VERSION=18.0.1
+CMAKE_C_COMPILER_VERSION_INTERAL=
+Change Dir: '/tmp/tmp.5plUaGoUlt/CMakeFiles/CMakeTmp'
+
+Run Build Command(s): /usr/bin/cmake -E env VERBOSE=1 /usr/bin/gmake -f Makefile cmTC_1d6c4/fast
+/usr/bin/gmake -f CMakeFiles/cmTC_1d6c4.dir/build.make CMakeFiles/cmTC_1d6c4.dir/build
+gmake[1]: Entering directory '/tmp/tmp.5plUaGoUlt/CMakeFiles/CMakeTmp'
+Building C object CMakeFiles/cmTC_1d6c4.dir/CMakeCCompilerABI.c.o
+/opt/cray/pe/craype/2.7.33/bin/cc -fopenmp -v -o CMakeFiles/cmTC_1d6c4.dir/CMakeCCompilerABI.c.o -c /home/generic.user/cmake/Modules/CMakeCCompilerABI.c
+Cray clang version 18.0.1 (ac9591613de6fa834bf54862b433bbc16834c13d)
+Target: x86_64-unknown-linux-gnu
+Thread model: posix
+InstalledDir: /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/share/../bin
+Found candidate GCC installation: /usr/lib64/gcc/x86_64-suse-linux/11
+Found candidate GCC installation: /usr/lib64/gcc/x86_64-suse-linux/12
+Found candidate GCC installation: /usr/lib64/gcc/x86_64-suse-linux/13
+Found candidate GCC installation: /usr/lib64/gcc/x86_64-suse-linux/14
+Found candidate GCC installation: /usr/lib64/gcc/x86_64-suse-linux/7
+Selected GCC installation: /usr/lib64/gcc/x86_64-suse-linux/14
+Candidate multilib: .@m64
+Selected multilib: .@m64
+Found HIP installation: /opt/rocm, version 6.3.42131
+ (in-process)
+ "/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/bin/clang-18" -cc1 -triple x86_64-unknown-linux-gnu -mllvm -cray-omp-opt-fork-call -mllvm -cray-omp-parallel-opt-call -mllvm -cray-openmp-rename-outlined -fcray-gpu -flocal-restrict -mllvm -cray-enhanced-asm=1 -fenhanced-asm=1 -mllvm -cray-enhanced-ir=1 -fenhanced-ir=1 -fomp-local-offload-table -ffortran -emit-obj -mrelax-all -disable-free -clear-ast-before-backend -main-file-name CMakeCCompilerABI.c -mrelocation-model static -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu znver2 -debugger-tuning=gdb -fdebug-compilation-dir=/tmp/tmp.5plUaGoUlt/CMakeFiles/CMakeTmp -v -fcoverage-compilation-dir=/tmp/tmp.5plUaGoUlt/CMakeFiles/CMakeTmp -resource-dir /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18 -isystem /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/include -isystem /opt/cray/pe/cce/18.0.1/cce/x86_64/include/craylibs -D __CRAY_X86_ROME -D __CRAYXT_COMPUTE_LINUX_TARGET -I /opt/cray/pe/mpich/8.1.31/ofi/cray/17.0/include -I /opt/cray/pe/dsmml/0.3.0/dsmml//include -I /opt/cray/pe/libsci/24.11.0/CRAY/17.0/x86_64/include -internal-isystem /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/include -internal-isystem /usr/local/include -internal-isystem /usr/lib64/gcc/x86_64-suse-linux/14/../../../../x86_64-suse-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -ferror-limit 19 -fcray-openmp -fcray-omp-opt-fork -fcray-omp-parallel-opt -fcray-openmp-rename-outlined-funcs -fopenmp -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o CMakeFiles/cmTC_1d6c4.dir/CMakeCCompilerABI.c.o -x c /home/generic.user/cmake/Modules/CMakeCCompilerABI.c
+clang -cc1 version 18.1.8 based upon LLVM 18.1.8 default target x86_64-unknown-linux-gnu
+ignoring nonexistent directory "/include"
+ignoring duplicate directory "/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/include"
+#include "..." search starts here:
+#include <...> search starts here:
+ /opt/cray/pe/mpich/8.1.31/ofi/cray/17.0/include
+ /opt/cray/pe/dsmml/0.3.0/dsmml//include
+ /opt/cray/pe/libsci/24.11.0/CRAY/17.0/x86_64/include
+ /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/include
+ /opt/cray/pe/cce/18.0.1/cce/x86_64/include/craylibs
+ /usr/local/include
+ /usr/lib64/gcc/x86_64-suse-linux/14/../../../../x86_64-suse-linux/include
+ /usr/include
+End of search list.
+Linking C executable cmTC_1d6c4
+/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_1d6c4.dir/link.txt --verbose=1
+Cray clang version 18.0.0.x (bbb3d6951c0329c4d902e7dcd9d677009b67b19a)
+Target: x86_64-unknown-linux-gnu
+Thread model: posix
+InstalledDir: /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/share/../bin
+Found candidate GCC installation: /usr/lib64/gcc/x86_64-suse-linux/11
+Found candidate GCC installation: /usr/lib64/gcc/x86_64-suse-linux/12
+Found candidate GCC installation: /usr/lib64/gcc/x86_64-suse-linux/13
+Found candidate GCC installation: /usr/lib64/gcc/x86_64-suse-linux/14
+Found candidate GCC installation: /usr/lib64/gcc/x86_64-suse-linux/7
+Selected GCC installation: /usr/lib64/gcc/x86_64-suse-linux/14
+Candidate multilib: .@m64
+Selected multilib: .@m64
+Found HIP installation: /opt/rocm, version 6.3.42131
+ "/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/bin/ld.lld" --hash-style=gnu --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o cmTC_1d6c4 /usr/lib64/gcc/x86_64-suse-linux/14/../../../../lib64/crt1.o /usr/lib64/gcc/x86_64-suse-linux/14/../../../../lib64/crti.o /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/lib/linux/clang_rt.crtbegin-x86_64.o -L/opt/cray/pe/mpich/8.1.31/ofi/cray/17.0/lib -L/opt/cray/pe/dsmml/0.3.0/dsmml//lib -L/opt/cray/pe/libsci/24.11.0/CRAY/17.0/x86_64/lib -L/opt/cray/pe/cce/18.0.1/cce/x86_64/lib/pkgconfig/../ -L/usr/lib64/gcc/x86_64-suse-linux/14 -L/usr/lib64/gcc/x86_64-suse-linux/14/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib64/gcc/x86_64-suse-linux/14/../../../../x86_64-suse-linux/lib -L/lib -L/usr/lib -plugin-opt=mcpu=znver2 -plugin-opt=lto=0 -plugin-opt=defaults=cray -plugin-opt=mllvm=-cray-math-precision=none -rpath=/opt/cray/pe/cce/18.0.1/cce/x86_64/lib CMakeFiles/cmTC_1d6c4.dir/CMakeCCompilerABI.c.o --as-needed -lsci_cray_mpi_mp --no-as-needed --as-needed -lsci_cray_mp --no-as-needed -ldl --as-needed -lmpi_cray --no-as-needed --as-needed -ldsmml --no-as-needed -lstdc++ --as-needed -lpgas-shmem --no-as-needed -lquadmath -lmodules -lfi -lcraymath -lf -lu -lcsup --as-needed -lpthread -latomic --no-as-needed --as-needed -lm --no-as-needed --disable-new-dtags /opt/cray/pe/cce/18.0.1/cce/x86_64/lib/no_mmap.o -lcraymp -L/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/lib/linux/libclang_rt.builtins-x86_64.a --as-needed -L/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib -rpath=/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/libunwind.so -lunwind --no-as-needed -lpthread -lc /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/lib/linux/libclang_rt.builtins-x86_64.a --as-needed -L/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib -rpath=/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/libunwind.so -lunwind --no-as-needed /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/lib/linux/clang_rt.crtend-x86_64.o /usr/lib64/gcc/x86_64-suse-linux/14/../../../../lib64/crtn.o
+/opt/cray/pe/craype/2.7.33/bin/cc -fopenmp -v CMakeFiles/cmTC_1d6c4.dir/CMakeCCompilerABI.c.o -o cmTC_1d6c4
+gmake[1]: Leaving directory '/tmp/tmp.5plUaGoUlt/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitData/craype-C-CrayClang-18.0.1.input b/Tests/RunCMake/ParseImplicitData/craype-C-CrayClang-18.0.1.input
new file mode 100644
index 0000000..28ecf1c
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitData/craype-C-CrayClang-18.0.1.input
@@ -0,0 +1,67 @@
+CMAKE_LANG=C
+CMAKE_LINKER=/opt/cray/pe/cce/18.0.1/binutils/x86_64/x86_64-pc-linux-gnu/bin/ld
+CMAKE_C_COMPILER_ABI=ELF
+CMAKE_C_COMPILER_AR=
+CMAKE_C_COMPILER_ARCHITECTURE_ID=
+CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_C_COMPILER_ID=CrayClang
+CMAKE_C_COMPILER_LAUNCHER=
+CMAKE_C_COMPILER_LOADED=1
+CMAKE_C_COMPILER_RANLIB=
+CMAKE_C_COMPILER_TARGET=
+CMAKE_C_COMPILER_VERSION=18.0.1
+CMAKE_C_COMPILER_VERSION_INTERAL=
+Change Dir: '/tmp/tmp.AZ7ST0Eub7/CMakeFiles/CMakeTmp'
+
+Run Build Command(s): /usr/bin/cmake -E env VERBOSE=1 /usr/bin/gmake -f Makefile cmTC_4a483/fast
+/usr/bin/gmake -f CMakeFiles/cmTC_4a483.dir/build.make CMakeFiles/cmTC_4a483.dir/build
+gmake[1]: Entering directory '/tmp/tmp.AZ7ST0Eub7/CMakeFiles/CMakeTmp'
+Building C object CMakeFiles/cmTC_4a483.dir/CMakeCCompilerABI.c.o
+/opt/cray/pe/craype/2.7.33/bin/cc -v -o CMakeFiles/cmTC_4a483.dir/CMakeCCompilerABI.c.o -c /home/generic.user/cmake/Modules/CMakeCCompilerABI.c
+Cray clang version 18.0.1 (ac9591613de6fa834bf54862b433bbc16834c13d)
+Target: x86_64-unknown-linux-gnu
+Thread model: posix
+InstalledDir: /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/share/../bin
+Found candidate GCC installation: /usr/lib64/gcc/x86_64-suse-linux/11
+Found candidate GCC installation: /usr/lib64/gcc/x86_64-suse-linux/12
+Found candidate GCC installation: /usr/lib64/gcc/x86_64-suse-linux/13
+Found candidate GCC installation: /usr/lib64/gcc/x86_64-suse-linux/14
+Found candidate GCC installation: /usr/lib64/gcc/x86_64-suse-linux/7
+Selected GCC installation: /usr/lib64/gcc/x86_64-suse-linux/14
+Candidate multilib: .@m64
+Selected multilib: .@m64
+Found HIP installation: /opt/rocm, version 6.3.42131
+ (in-process)
+ "/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/bin/clang-18" -cc1 -triple x86_64-unknown-linux-gnu -mllvm -cray-omp-opt-fork-call -mllvm -cray-omp-parallel-opt-call -mllvm -cray-openmp-rename-outlined -fcray-gpu -flocal-restrict -mllvm -cray-enhanced-asm=1 -fenhanced-asm=1 -mllvm -cray-enhanced-ir=1 -fenhanced-ir=1 -fomp-local-offload-table -ffortran -emit-obj -mrelax-all -disable-free -clear-ast-before-backend -main-file-name CMakeCCompilerABI.c -mrelocation-model static -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu znver2 -debugger-tuning=gdb -fdebug-compilation-dir=/tmp/tmp.AZ7ST0Eub7/CMakeFiles/CMakeTmp -v -fcoverage-compilation-dir=/tmp/tmp.AZ7ST0Eub7/CMakeFiles/CMakeTmp -resource-dir /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18 -isystem /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/include -isystem /opt/cray/pe/cce/18.0.1/cce/x86_64/include/craylibs -D __CRAY_X86_ROME -D __CRAYXT_COMPUTE_LINUX_TARGET -I /opt/cray/pe/mpich/8.1.31/ofi/cray/17.0/include -I /opt/cray/pe/dsmml/0.3.0/dsmml//include -I /opt/cray/pe/libsci/24.11.0/CRAY/17.0/x86_64/include -internal-isystem /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/include -internal-isystem /usr/local/include -internal-isystem /usr/lib64/gcc/x86_64-suse-linux/14/../../../../x86_64-suse-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -ferror-limit 19 -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o CMakeFiles/cmTC_4a483.dir/CMakeCCompilerABI.c.o -x c /home/generic.user/cmake/Modules/CMakeCCompilerABI.c
+clang -cc1 version 18.1.8 based upon LLVM 18.1.8 default target x86_64-unknown-linux-gnu
+ignoring nonexistent directory "/include"
+ignoring duplicate directory "/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/include"
+#include "..." search starts here:
+#include <...> search starts here:
+ /opt/cray/pe/mpich/8.1.31/ofi/cray/17.0/include
+ /opt/cray/pe/dsmml/0.3.0/dsmml//include
+ /opt/cray/pe/libsci/24.11.0/CRAY/17.0/x86_64/include
+ /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/include
+ /opt/cray/pe/cce/18.0.1/cce/x86_64/include/craylibs
+ /usr/local/include
+ /usr/lib64/gcc/x86_64-suse-linux/14/../../../../x86_64-suse-linux/include
+ /usr/include
+End of search list.
+Linking C executable cmTC_4a483
+/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_4a483.dir/link.txt --verbose=1
+Cray clang version 18.0.0.x (bbb3d6951c0329c4d902e7dcd9d677009b67b19a)
+Target: x86_64-unknown-linux-gnu
+Thread model: posix
+InstalledDir: /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/share/../bin
+Found candidate GCC installation: /usr/lib64/gcc/x86_64-suse-linux/11
+Found candidate GCC installation: /usr/lib64/gcc/x86_64-suse-linux/12
+Found candidate GCC installation: /usr/lib64/gcc/x86_64-suse-linux/13
+Found candidate GCC installation: /usr/lib64/gcc/x86_64-suse-linux/14
+Found candidate GCC installation: /usr/lib64/gcc/x86_64-suse-linux/7
+Selected GCC installation: /usr/lib64/gcc/x86_64-suse-linux/14
+Candidate multilib: .@m64
+Selected multilib: .@m64
+Found HIP installation: /opt/rocm, version 6.3.42131
+ "/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/bin/ld.lld" --hash-style=gnu --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o cmTC_4a483 /usr/lib64/gcc/x86_64-suse-linux/14/../../../../lib64/crt1.o /usr/lib64/gcc/x86_64-suse-linux/14/../../../../lib64/crti.o /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/lib/linux/clang_rt.crtbegin-x86_64.o -L/opt/cray/pe/mpich/8.1.31/ofi/cray/17.0/lib -L/opt/cray/pe/dsmml/0.3.0/dsmml//lib -L/opt/cray/pe/libsci/24.11.0/CRAY/17.0/x86_64/lib -L/opt/cray/pe/cce/18.0.1/cce/x86_64/lib/pkgconfig/../ -L/usr/lib64/gcc/x86_64-suse-linux/14 -L/usr/lib64/gcc/x86_64-suse-linux/14/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib64/gcc/x86_64-suse-linux/14/../../../../x86_64-suse-linux/lib -L/lib -L/usr/lib -plugin-opt=mcpu=znver2 -plugin-opt=lto=0 -plugin-opt=defaults=cray -plugin-opt=mllvm=-cray-math-precision=none -rpath=/opt/cray/pe/cce/18.0.1/cce/x86_64/lib CMakeFiles/cmTC_4a483.dir/CMakeCCompilerABI.c.o --as-needed -lsci_cray_mpi --no-as-needed --as-needed -lsci_cray --no-as-needed -ldl --as-needed -lmpi_cray --no-as-needed --as-needed -ldsmml --no-as-needed -lstdc++ --as-needed -lpgas-shmem --no-as-needed -lquadmath -lmodules -lfi -lcraymath -lf -lu -lcsup --as-needed -lpthread -latomic --no-as-needed --as-needed -lm --no-as-needed --disable-new-dtags /opt/cray/pe/cce/18.0.1/cce/x86_64/lib/no_mmap.o /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/lib/linux/libclang_rt.builtins-x86_64.a --as-needed -L/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib -rpath=/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/libunwind.so -lunwind --no-as-needed -lc /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/lib/linux/libclang_rt.builtins-x86_64.a --as-needed -L/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib -rpath=/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/libunwind.so -lunwind --no-as-needed /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/lib/linux/clang_rt.crtend-x86_64.o /usr/lib64/gcc/x86_64-suse-linux/14/../../../../lib64/crtn.o
+/opt/cray/pe/craype/2.7.33/bin/cc -v CMakeFiles/cmTC_4a483.dir/CMakeCCompilerABI.c.o -o cmTC_4a483
+gmake[1]: Leaving directory '/tmp/tmp.AZ7ST0Eub7/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitData/craype-CXX-CrayClang-18.0.1-fopenmp-accel.input b/Tests/RunCMake/ParseImplicitData/craype-CXX-CrayClang-18.0.1-fopenmp-accel.input
new file mode 100644
index 0000000..bae1abf
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitData/craype-CXX-CrayClang-18.0.1-fopenmp-accel.input
@@ -0,0 +1,167 @@
+CMAKE_LANG=CXX
+CMAKE_LINKER=/opt/cray/pe/cce/18.0.1/binutils/x86_64/x86_64-pc-linux-gnu/bin/ld
+CMAKE_CXX_COMPILER_ABI=ELF
+CMAKE_CXX_COMPILER_AR=
+CMAKE_CXX_COMPILER_ARCHITECTURE_ID=
+CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_CXX_COMPILER_ID=CrayClang
+CMAKE_CXX_COMPILER_LAUNCHER=
+CMAKE_CXX_COMPILER_LOADED=1
+CMAKE_CXX_COMPILER_RANLIB=
+CMAKE_CXX_COMPILER_TARGET=
+CMAKE_CXX_COMPILER_VERSION=18.0.0
+CMAKE_CXX_COMPILER_VERSION_INTERAL=
+Change Dir: '/tmp/tmp.EJ2EzeIOpP/CMakeFiles/CMakeTmp'
+
+Run Build Command(s): /usr/bin/cmake -E env VERBOSE=1 /usr/bin/gmake -f Makefile cmTC_8fca6/fast
+/usr/bin/gmake -f CMakeFiles/cmTC_8fca6.dir/build.make CMakeFiles/cmTC_8fca6.dir/build
+gmake[1]: Entering directory '/tmp/tmp.EJ2EzeIOpP/CMakeFiles/CMakeTmp'
+Building CXX object CMakeFiles/cmTC_8fca6.dir/CMakeCXXCompilerABI.cpp.o
+/opt/cray/pe/craype/2.7.33/bin/CC -fopenmp -v -o CMakeFiles/cmTC_8fca6.dir/CMakeCXXCompilerABI.cpp.o -c /home/generic.user/cmake/Modules/CMakeCXXCompilerABI.cpp
+Cray clang version 18.0.1 (ac9591613de6fa834bf54862b433bbc16834c13d)
+Target: x86_64-unknown-linux-gnu
+Thread model: posix
+InstalledDir: /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/share/../bin
+Found candidate GCC installation: /usr/lib64/gcc/x86_64-suse-linux/11
+Found candidate GCC installation: /usr/lib64/gcc/x86_64-suse-linux/12
+Found candidate GCC installation: /usr/lib64/gcc/x86_64-suse-linux/13
+Found candidate GCC installation: /usr/lib64/gcc/x86_64-suse-linux/14
+Found candidate GCC installation: /usr/lib64/gcc/x86_64-suse-linux/7
+Selected GCC installation: /usr/lib64/gcc/x86_64-suse-linux/14
+Candidate multilib: .@m64
+Selected multilib: .@m64
+Found HIP installation: /opt/rocm-6.3.0, version 6.3.42131
+ "/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/bin/clang-18" -cc1 -triple x86_64-unknown-linux-gnu -mllvm -cray-omp-opt-fork-call -mllvm -cray-omp-parallel-opt-call -mllvm -cray-openmp-rename-outlined -fcray-gpu -flocal-restrict -mllvm -cray-enhanced-asm=1 -fenhanced-asm=1 -mllvm -cray-enhanced-ir=1 -fenhanced-ir=1 -fomp-local-offload-table -ffortran -emit-llvm-bc -emit-llvm-uselists -disable-free -clear-ast-before-backend -main-file-name CMakeCXXCompilerABI.cpp -mrelocation-model static -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu znver2 -debugger-tuning=gdb -fdebug-compilation-dir=/tmp/tmp.EJ2EzeIOpP/CMakeFiles/CMakeTmp -v -fcoverage-compilation-dir=/tmp/tmp.EJ2EzeIOpP/CMakeFiles/CMakeTmp -resource-dir /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18 -internal-isystem /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/include/llvm_libc_wrappers -isystem /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/include -isystem /opt/cray/pe/cce/18.0.1/cce/x86_64/include/craylibs -D __CRAY_X86_ROME -D __CRAY_AMD_GFX908 -D __CRAYXT_COMPUTE_LINUX_TARGET -D __HIP_PLATFORM_AMD__ -I /opt/cray/pe/mpich/8.1.31/ofi/cray/17.0/include -I /opt/cray/pe/dsmml/0.3.0/dsmml//include -I /opt/cray/pe/libsci/24.11.0/CRAY/17.0/x86_64/include -I /opt/rocm-6.3.0/include -I /opt/rocm-6.3.0/include/rocprofiler -I /opt/rocm-6.3.0/include/roctracer -internal-isystem /usr/lib64/gcc/x86_64-suse-linux/14/../../../../include/c++/14 -internal-isystem /usr/lib64/gcc/x86_64-suse-linux/14/../../../../include/c++/14/x86_64-suse-linux -internal-isystem /usr/lib64/gcc/x86_64-suse-linux/14/../../../../include/c++/14/backward -internal-isystem /usr/lib64/gcc/x86_64-suse-linux/14/../../../../include/c++/14 -internal-isystem /usr/lib64/gcc/x86_64-suse-linux/14/../../../../include/c++/14/x86_64-suse-linux -internal-isystem /usr/lib64/gcc/x86_64-suse-linux/14/../../../../include/c++/14/backward -internal-isystem /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/include -internal-isystem /usr/local/include -internal-isystem /usr/lib64/gcc/x86_64-suse-linux/14/../../../../x86_64-suse-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -internal-isystem /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/include -internal-isystem /usr/local/include -internal-isystem /usr/lib64/gcc/x86_64-suse-linux/14/../../../../x86_64-suse-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -fdeprecated-macro -ferror-limit 19 -fcray-openmp -fcray-omp-opt-fork -fcray-omp-parallel-opt -fcray-openmp-rename-outlined-funcs -fopenmp -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -fcxx-exceptions -fexceptions -disable-llvm-passes -fopenmp-targets=amdgcn-amd-amdhsa -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /tmp/CMakeCXXCompilerABI-5443ab.bc -x c++ /home/generic.user/cmake/Modules/CMakeCXXCompilerABI.cpp
+clang -cc1 version 18.1.8 based upon LLVM 18.1.8 default target x86_64-unknown-linux-gnu
+ignoring nonexistent directory "/include"
+ignoring nonexistent directory "/include"
+ignoring duplicate directory "/usr/lib64/gcc/x86_64-suse-linux/14/../../../../include/c++/14"
+ignoring duplicate directory "/usr/lib64/gcc/x86_64-suse-linux/14/../../../../include/c++/14/x86_64-suse-linux"
+ignoring duplicate directory "/usr/lib64/gcc/x86_64-suse-linux/14/../../../../include/c++/14/backward"
+ignoring duplicate directory "/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/include"
+ignoring duplicate directory "/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/include"
+ignoring duplicate directory "/usr/local/include"
+ignoring duplicate directory "/usr/lib64/gcc/x86_64-suse-linux/14/../../../../x86_64-suse-linux/include"
+ignoring duplicate directory "/usr/include"
+#include "..." search starts here:
+#include <...> search starts here:
+ /opt/cray/pe/mpich/8.1.31/ofi/cray/17.0/include
+ /opt/cray/pe/dsmml/0.3.0/dsmml//include
+ /opt/cray/pe/libsci/24.11.0/CRAY/17.0/x86_64/include
+ /opt/rocm-6.3.0/include
+ /opt/rocm-6.3.0/include/rocprofiler
+ /opt/rocm-6.3.0/include/roctracer
+ /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/include
+ /opt/cray/pe/cce/18.0.1/cce/x86_64/include/craylibs
+ /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/include/llvm_libc_wrappers
+ /usr/lib64/gcc/x86_64-suse-linux/14/../../../../include/c++/14
+ /usr/lib64/gcc/x86_64-suse-linux/14/../../../../include/c++/14/x86_64-suse-linux
+ /usr/lib64/gcc/x86_64-suse-linux/14/../../../../include/c++/14/backward
+ /usr/local/include
+ /usr/lib64/gcc/x86_64-suse-linux/14/../../../../x86_64-suse-linux/include
+ /usr/include
+End of search list.
+ "/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/bin/clang-18" -cc1 -triple amdgcn-amd-amdhsa -mllvm -cray-omp-opt-fork-call -mllvm -cray-omp-parallel-opt-call -mllvm -cray-openmp-rename-outlined -fcray-gpu -flocal-restrict -mllvm -cray-enhanced-asm=1 -fenhanced-asm=1 -mllvm -cray-enhanced-ir=1 -fenhanced-ir=1 -fomp-local-offload-table -ffortran -aux-triple x86_64-unknown-linux-gnu -emit-llvm-bc -emit-llvm-uselists -disable-free -clear-ast-before-backend -main-file-name CMakeCXXCompilerABI.cpp -mrelocation-model pic -pic-level 2 -fhalf-no-semantic-interposition -mframe-pointer=all -ffp-contract=on -fno-rounding-math -mconstructor-aliases -target-cpu gfx908 -fcuda-is-device -fcuda-allow-variadic-functions -target-cpu gfx908 -debugger-tuning=gdb -fdebug-compilation-dir=/tmp/tmp.EJ2EzeIOpP/CMakeFiles/CMakeTmp -v -resource-dir /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18 -internal-isystem /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/include/llvm_libc_wrappers -internal-isystem /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/include/openmp_wrappers -include __clang_openmp_device_functions.h -isystem /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/include -isystem /opt/cray/pe/cce/18.0.1/cce/x86_64/include/craylibs -D __CRAY_X86_ROME -D __CRAY_AMD_GFX908 -D __CRAYXT_COMPUTE_LINUX_TARGET -D __HIP_PLATFORM_AMD__ -I /opt/cray/pe/mpich/8.1.31/ofi/cray/17.0/include -I /opt/cray/pe/dsmml/0.3.0/dsmml//include -I /opt/cray/pe/libsci/24.11.0/CRAY/17.0/x86_64/include -I /opt/rocm-6.3.0/include -I /opt/rocm-6.3.0/include/rocprofiler -I /opt/rocm-6.3.0/include/roctracer -internal-isystem /usr/lib64/gcc/x86_64-suse-linux/14/../../../../include/c++/14 -internal-isystem /usr/lib64/gcc/x86_64-suse-linux/14/../../../../include/c++/14/x86_64-suse-linux -internal-isystem /usr/lib64/gcc/x86_64-suse-linux/14/../../../../include/c++/14/backward -internal-isystem /usr/lib64/gcc/x86_64-suse-linux/14/../../../../include/c++/14 -internal-isystem /usr/lib64/gcc/x86_64-suse-linux/14/../../../../include/c++/14/x86_64-suse-linux -internal-isystem /usr/lib64/gcc/x86_64-suse-linux/14/../../../../include/c++/14/backward -internal-isystem /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/include -internal-isystem /usr/local/include -internal-isystem /usr/lib64/gcc/x86_64-suse-linux/14/../../../../x86_64-suse-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -internal-isystem /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/include -internal-isystem /usr/local/include -internal-isystem /usr/lib64/gcc/x86_64-suse-linux/14/../../../../x86_64-suse-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -fdeprecated-macro -ferror-limit 19 -fvisibility=protected -fcray-openmp -fcray-omp-opt-fork -fcray-omp-parallel-opt -fcray-openmp-rename-outlined-funcs -fopenmp -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -fcxx-exceptions -fexceptions -fopenmp-is-target-device -mllvm -cray-gpu -mllvm -openmp-opt-disable -mllvm -cray-gpuruntime-bitcode=/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/libcrayomptarget-amdgcn-gfx908.bc/opt/rocm-6.3.0/amdgcn/bitcode/hip.bc/opt/rocm-6.3.0/amdgcn/bitcode/ockl.bc/opt/rocm-6.3.0/amdgcn/bitcode/ocml.bc/opt/rocm-6.3.0/amdgcn/bitcode/ocml.bc/opt/rocm-6.3.0/amdgcn/bitcode/oclc_isa_version_908.bc/opt/rocm-6.3.0/amdgcn/bitcode/oclc_daz_opt_off.bc/opt/rocm-6.3.0/amdgcn/bitcode/oclc_finite_only_off.bc/opt/rocm-6.3.0/amdgcn/bitcode/oclc_correctly_rounded_sqrt_on.bc/opt/rocm-6.3.0/amdgcn/bitcode/oclc_unsafe_math_off.bc -fopenmp-host-ir-file-path /tmp/CMakeCXXCompilerABI-5443ab.bc -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /tmp/CMakeCXXCompilerABI-0ade57.bc -x c++ /home/generic.user/cmake/Modules/CMakeCXXCompilerABI.cpp
+clang -cc1 version 18.1.8 based upon LLVM 18.1.8 default target x86_64-unknown-linux-gnu
+ignoring nonexistent directory "/include"
+ignoring nonexistent directory "/include"
+ignoring duplicate directory "/usr/lib64/gcc/x86_64-suse-linux/14/../../../../include/c++/14"
+ignoring duplicate directory "/usr/lib64/gcc/x86_64-suse-linux/14/../../../../include/c++/14/x86_64-suse-linux"
+ignoring duplicate directory "/usr/lib64/gcc/x86_64-suse-linux/14/../../../../include/c++/14/backward"
+ignoring duplicate directory "/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/include"
+ignoring duplicate directory "/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/include"
+ignoring duplicate directory "/usr/local/include"
+ignoring duplicate directory "/usr/lib64/gcc/x86_64-suse-linux/14/../../../../x86_64-suse-linux/include"
+ignoring duplicate directory "/usr/include"
+ignoring duplicate directory "/usr/local/include"
+ignoring duplicate directory "/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/include"
+ignoring duplicate directory "/usr/include"
+#include "..." search starts here:
+#include <...> search starts here:
+ /opt/cray/pe/mpich/8.1.31/ofi/cray/17.0/include
+ /opt/cray/pe/dsmml/0.3.0/dsmml//include
+ /opt/cray/pe/libsci/24.11.0/CRAY/17.0/x86_64/include
+ /opt/rocm-6.3.0/include
+ /opt/rocm-6.3.0/include/rocprofiler
+ /opt/rocm-6.3.0/include/roctracer
+ /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/include
+ /opt/cray/pe/cce/18.0.1/cce/x86_64/include/craylibs
+ /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/include/llvm_libc_wrappers
+ /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/include/openmp_wrappers
+ /usr/lib64/gcc/x86_64-suse-linux/14/../../../../include/c++/14
+ /usr/lib64/gcc/x86_64-suse-linux/14/../../../../include/c++/14/x86_64-suse-linux
+ /usr/lib64/gcc/x86_64-suse-linux/14/../../../../include/c++/14/backward
+ /usr/local/include
+ /usr/lib64/gcc/x86_64-suse-linux/14/../../../../x86_64-suse-linux/include
+ /usr/include
+End of search list.
+ "/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/share/../bin/clang-offload-packager" -o /tmp/CMakeCXXCompilerABI-de1f29.out --image=file=/tmp/CMakeCXXCompilerABI-0ade57.bc,triple=amdgcn-amd-amdhsa,arch=gfx908,kind=openmp
+ "/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/bin/clang-18" -cc1 -triple x86_64-unknown-linux-gnu -mllvm -cray-omp-opt-fork-call -mllvm -cray-omp-parallel-opt-call -mllvm -cray-openmp-rename-outlined -fcray-gpu -flocal-restrict -mllvm -cray-enhanced-asm=1 -fenhanced-asm=1 -mllvm -cray-enhanced-ir=1 -fenhanced-ir=1 -fomp-local-offload-table -ffortran -emit-obj -mrelax-all -disable-free -clear-ast-before-backend -main-file-name CMakeCXXCompilerABI.cpp -mrelocation-model static -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu znver2 -debugger-tuning=gdb -fdebug-compilation-dir=/tmp/tmp.EJ2EzeIOpP/CMakeFiles/CMakeTmp -v -fcoverage-compilation-dir=/tmp/tmp.EJ2EzeIOpP/CMakeFiles/CMakeTmp -resource-dir /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18 -ferror-limit 19 -fcray-openmp -fcray-omp-opt-fork -fcray-omp-parallel-opt -fcray-openmp-rename-outlined-funcs -fopenmp -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -fembed-offload-object=/tmp/CMakeCXXCompilerABI-de1f29.out -fopenmp-targets=amdgcn-amd-amdhsa -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o CMakeFiles/cmTC_8fca6.dir/CMakeCXXCompilerABI.cpp.o -x ir /tmp/CMakeCXXCompilerABI-5443ab.bc
+clang -cc1 version 18.1.8 based upon LLVM 18.1.8 default target x86_64-unknown-linux-gnu
+Linking CXX executable cmTC_8fca6
+/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_8fca6.dir/link.txt --verbose=1
+Cray clang version 18.0.0.x (bbb3d6951c0329c4d902e7dcd9d677009b67b19a)
+Target: x86_64-unknown-linux-gnu
+Thread model: posix
+InstalledDir: /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/share/../bin
+Found candidate GCC installation: /usr/lib64/gcc/x86_64-suse-linux/11
+Found candidate GCC installation: /usr/lib64/gcc/x86_64-suse-linux/12
+Found candidate GCC installation: /usr/lib64/gcc/x86_64-suse-linux/13
+Found candidate GCC installation: /usr/lib64/gcc/x86_64-suse-linux/14
+Found candidate GCC installation: /usr/lib64/gcc/x86_64-suse-linux/7
+Selected GCC installation: /usr/lib64/gcc/x86_64-suse-linux/14
+Candidate multilib: .@m64
+Selected multilib: .@m64
+Found HIP installation: /opt/rocm-6.3.0, version 6.3.42131
+ "/opt/cray/pe/cce/18.0.1/cce/x86_64/bin/cce_omp_offload_linker" -O0 -mcode-object-version=5 --rocm-path /opt/rocm-6.3.0 --rocm-device-lib-path /opt/rocm-6.3.0/amdgcn/bitcode --verbose --arch gfx908 -- /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/bin/ld.lld --hash-style=gnu --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o cmTC_8fca6 /usr/lib64/gcc/x86_64-suse-linux/14/../../../../lib64/crt1.o /usr/lib64/gcc/x86_64-suse-linux/14/../../../../lib64/crti.o /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/lib/linux/clang_rt.crtbegin-x86_64.o -L/opt/cray/pe/mpich/8.1.31/ofi/cray/17.0/lib -L/opt/cray/pe/mpich/8.1.31/gtl/lib -L/opt/cray/pe/dsmml/0.3.0/dsmml//lib -L/opt/cray/pe/libsci/24.11.0/CRAY/17.0/x86_64/lib -L/opt/rocm-6.3.0/lib -L/opt/rocm-6.3.0/lib/rocprofiler -L/opt/rocm-6.3.0/lib/roctracer -L/opt/cray/pe/cce/18.0.1/cce/x86_64/lib/pkgconfig/../ -L/usr/lib64/gcc/x86_64-suse-linux/14 -L/usr/lib64/gcc/x86_64-suse-linux/14/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib64/gcc/x86_64-suse-linux/14/../../../../x86_64-suse-linux/lib -L/lib -L/usr/lib -plugin-opt=mcpu=znver2 -plugin-opt=lto=0 -plugin-opt=defaults=cray -plugin-opt=mllvm=-cray-math-precision=none -rpath=/opt/cray/pe/cce/18.0.1/cce/x86_64/lib CMakeFiles/cmTC_8fca6.dir/CMakeCXXCompilerABI.cpp.o -lamdhip64 --as-needed -lsci_cray_mpi_mp --no-as-needed --as-needed -lsci_cray_mp --no-as-needed -ldl --as-needed -lmpi_cray --no-as-needed -lmpi_gtl_hsa --as-needed -ldsmml --no-as-needed -lstdc++ --as-needed -lpgas-shmem --no-as-needed -lquadmath -lmodules -lfi -lcraymath -lf -lu -lcsup --as-needed -lpthread -latomic --no-as-needed --as-needed -lm --no-as-needed --disable-new-dtags /opt/cray/pe/cce/18.0.1/cce/x86_64/lib/no_mmap.o -lstdc++ -lm -lcraymp -lcrayacc_amdgpu -L/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/lib/linux/libclang_rt.builtins-x86_64.a --as-needed -L/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib -rpath=/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/libunwind.so -lunwind --no-as-needed -lpthread -lc /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/lib/linux/libclang_rt.builtins-x86_64.a --as-needed -L/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib -rpath=/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/libunwind.so -lunwind --no-as-needed /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/lib/linux/clang_rt.crtend-x86_64.o /usr/lib64/gcc/x86_64-suse-linux/14/../../../../lib64/crtn.o
+Offload Version : 1
+Image Kind : bc
+Offload Kind : openmp
+Arch name : gfx908
+Binary Size : 3304
+Target Triple : amdgcn-amd-amdhsa
+Image Size : 3160
+Unbundling: CMakeFiles/cmTC_8fca6.dir/CMakeCXXCompilerABI.cpp.o -> CMakeCXXCompilerABI.cpp-cce-openmp-amdgcn-amd-amdhsa.amdgpu, CMakeFiles/cmTC_8fca6.dir/CMakeCXXCompilerABI.cpp.o
+Skipping unbundling of /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/lib/linux/libclang_rt.builtins-x86_64.a (already processed)
+Skipping unbundling of /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/libunwind.so (already processed)
+Skipping unbundling of /usr/lib64/gcc/x86_64-suse-linux/14/libstdc++.a (already processed)
+Skipping unbundling of /usr/lib64/gcc/x86_64-suse-linux/14/../../../../lib64/libm.a (already processed)
+Skipping unbundling of /usr/lib64/gcc/x86_64-suse-linux/14/../../../../lib64/libpthread.a (already processed)
+Skipping unbundling of /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/libunwind.a (already processed)
+/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/bin/llvm-link /tmp/cooltmpdir-232WmJ/CMakeCXXCompilerABI.cpp-cce-openmp-amdgcn-amd-amdhsa.amdgpu -o /tmp/cooltmpdir-232WmJ/cmTC_8fca6-cce-openmp__ll_app.amdgpu
+/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/bin/llvm-link /tmp/cooltmpdir-232WmJ/cmTC_8fca6-cce-openmp__ll_app.amdgpu /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/libcrayomptarget-amdgcn-gfx908.bc --only-needed /opt/rocm-6.3.0/amdgcn/bitcode/hip.bc /opt/rocm-6.3.0/amdgcn/bitcode/ocml.bc /opt/rocm-6.3.0/amdgcn/bitcode/ockl.bc /opt/rocm-6.3.0/amdgcn/bitcode/oclc_finite_only_off.bc /opt/rocm-6.3.0/amdgcn/bitcode/oclc_daz_opt_off.bc /opt/rocm-6.3.0/amdgcn/bitcode/oclc_correctly_rounded_sqrt_on.bc /opt/rocm-6.3.0/amdgcn/bitcode/oclc_unsafe_math_off.bc /opt/rocm-6.3.0/amdgcn/bitcode/oclc_isa_version_908.bc /opt/rocm-6.3.0/amdgcn/bitcode/oclc_wavefrontsize64_on.bc /opt/rocm-6.3.0/amdgcn/bitcode/oclc_abi_version_500.bc -o /tmp/cooltmpdir-232WmJ/cmTC_8fca6-cce-openmp__ll.amdgpu
+/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/bin/opt -mtriple=amdgcn-amd-amdhsa -mcpu=gfx908 -passes=cray-gpu-linkage-munger,always-inline -amdgpu-internalize-symbols /tmp/cooltmpdir-232WmJ/cmTC_8fca6-cce-openmp__ll.amdgpu -o /tmp/cooltmpdir-232WmJ/cmTC_8fca6-cce-openmppost-opt.bc
+/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/bin/llvm-link --only-needed /tmp/cooltmpdir-232WmJ/cmTC_8fca6-cce-openmppost-opt.bc /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/libcrayomptarget-states-amdgcn-gfx908.bc -o /tmp/cooltmpdir-232WmJ/cmTC_8fca6-cce-openmp-pre-llc.bc
+/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/bin/llc -O0 -mtriple=amdgcn-amd-amdhsa -disable-promote-alloca-to-lds -mcpu=gfx908 -amdgpu-dump-hsa-metadata /tmp/cooltmpdir-232WmJ/cmTC_8fca6-cce-openmp-pre-llc.bc -filetype=obj -o /tmp/cooltmpdir-232WmJ/cmTC_8fca6-cce-openmp__llc.amdgpu
+AMDGPU HSA Metadata:
+---
+amdhsa.kernels: []
+amdhsa.target: amdgcn-amd-amdhsa--gfx908
+amdhsa.version:
+ - 1
+ - 2
+...
+
+/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/bin/lld -flavor gnu --no-undefined -shared -o /tmp/cooltmpdir-232WmJ/cmTC_8fca6-cce-openmppost_lld.amdgpu /tmp/cooltmpdir-232WmJ/cmTC_8fca6-cce-openmp__llc.amdgpu
+as /tmp/cooltmpdir-232WmJ/cmTC_8fca6-cce-openmp-amdgcn-amd-amdhsa.app.s -o /tmp/cooltmpdir-232WmJ/cmTC_8fca6-cce-openmp-host.o
+as /tmp/cooltmpdir-232WmJ/tmp_offload_linker-cce-openmpacc-targetbegin.s -o /tmp/cooltmpdir-232WmJ/acc-targetbegin-cce-openmp.o
+as /tmp/cooltmpdir-232WmJ/tmp_offload_linker-cce-openmpacc-targetend.s -o /tmp/cooltmpdir-232WmJ/acc-targetend-tmp-cce-openmp.o
+/opt/cray/pe/cce/18.0.1/binutils/x86_64/bin/ld --relocatable /tmp/cooltmpdir-232WmJ/cmTC_8fca6-cce-openmp-host.o /tmp/cooltmpdir-232WmJ/acc-targetend-tmp-cce-openmp.o --whole-archive /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/lib/linux/libclang_rt.cray_device_wrapper-x86_64.a --no-whole-archive -o /tmp/cooltmpdir-232WmJ/acc-targetend-cce-openmp.o
+/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/bin/ld.lld /tmp/cooltmpdir-232WmJ/acc-targetbegin-cce-openmp.o --hash-style=gnu --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o cmTC_8fca6 /usr/lib64/gcc/x86_64-suse-linux/14/../../../../lib64/crt1.o /usr/lib64/gcc/x86_64-suse-linux/14/../../../../lib64/crti.o /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/lib/linux/clang_rt.crtbegin-x86_64.o -L/opt/cray/pe/mpich/8.1.31/ofi/cray/17.0/lib -L/opt/cray/pe/mpich/8.1.31/gtl/lib -L/opt/cray/pe/dsmml/0.3.0/dsmml//lib -L/opt/cray/pe/libsci/24.11.0/CRAY/17.0/x86_64/lib -L/opt/rocm-6.3.0/lib -L/opt/rocm-6.3.0/lib/rocprofiler -L/opt/rocm-6.3.0/lib/roctracer -L/opt/cray/pe/cce/18.0.1/cce/x86_64/lib/pkgconfig/../ -L/usr/lib64/gcc/x86_64-suse-linux/14 -L/usr/lib64/gcc/x86_64-suse-linux/14/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib64/gcc/x86_64-suse-linux/14/../../../../x86_64-suse-linux/lib -L/lib -L/usr/lib -plugin-opt=mcpu=znver2 -plugin-opt=lto=0 -plugin-opt=defaults=cray -plugin-opt=mllvm=-cray-math-precision=none -rpath=/opt/cray/pe/cce/18.0.1/cce/x86_64/lib CMakeFiles/cmTC_8fca6.dir/CMakeCXXCompilerABI.cpp.o -lamdhip64 --as-needed -lsci_cray_mpi_mp --no-as-needed --as-needed -lsci_cray_mp --no-as-needed -ldl --as-needed -lmpi_cray --no-as-needed -lmpi_gtl_hsa --as-needed -ldsmml --no-as-needed -lstdc++ --as-needed -lpgas-shmem --no-as-needed -lquadmath -lmodules -lfi -lcraymath -lf -lu -lcsup --as-needed -lpthread -latomic --no-as-needed --as-needed -lm --no-as-needed --disable-new-dtags /opt/cray/pe/cce/18.0.1/cce/x86_64/lib/no_mmap.o -lstdc++ -lm -lcraymp -lcrayacc_amdgpu -L/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/lib/linux/libclang_rt.builtins-x86_64.a --as-needed -L/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib -rpath=/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/libunwind.so -lunwind --no-as-needed -lpthread -lc /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/lib/linux/libclang_rt.builtins-x86_64.a --as-needed -L/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib -rpath=/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/libunwind.so -lunwind --no-as-needed /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/lib/linux/clang_rt.crtend-x86_64.o /usr/lib64/gcc/x86_64-suse-linux/14/../../../../lib64/crtn.o /tmp/cooltmpdir-232WmJ/acc-targetend-cce-openmp.o
+rm '/tmp/cooltmpdir-232WmJ/tmp_offload_linker-cce-openmpacc-targetend.s'
+rm '/tmp/cooltmpdir-232WmJ/tmp_offload_linker-cce-openmpacc-targetbegin.s'
+rm '/tmp/cooltmpdir-232WmJ/acc-targetend-cce-openmp.o'
+rm '/tmp/cooltmpdir-232WmJ/acc-targetend-tmp-cce-openmp.o'
+rm '/tmp/cooltmpdir-232WmJ/acc-targetbegin-cce-openmp.o'
+rm '/tmp/cooltmpdir-232WmJ/cmTC_8fca6-cce-openmp-amdgcn-amd-amdhsa.app.s'
+rm '/tmp/cooltmpdir-232WmJ/cmTC_8fca6-cce-openmp-host.o'
+rm '/tmp/cooltmpdir-232WmJ/cmTC_8fca6-cce-openmppost_lld.amdgpu'
+rm '/tmp/cooltmpdir-232WmJ/cmTC_8fca6-cce-openmp__llc.amdgpu'
+rm '/tmp/cooltmpdir-232WmJ/cmTC_8fca6-cce-openmp-pre-llc.bc'
+rm '/tmp/cooltmpdir-232WmJ/cmTC_8fca6-cce-openmppost-opt.bc'
+rm '/tmp/cooltmpdir-232WmJ/cmTC_8fca6-cce-openmp__ll_app.amdgpu'
+rm '/tmp/cooltmpdir-232WmJ/cmTC_8fca6-cce-openmp__ll.amdgpu'
+rm '/tmp/cooltmpdir-232WmJ/CMakeCXXCompilerABI.cpp-cce-openmp-amdgcn-amd-amdhsa.amdgpu'
+rm '/tmp/cooltmpdir-232WmJ/'
+/opt/cray/pe/craype/2.7.33/bin/CC -fopenmp -v CMakeFiles/cmTC_8fca6.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_8fca6
+gmake[1]: Leaving directory '/tmp/tmp.EJ2EzeIOpP/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitData/craype-CXX-CrayClang-18.0.1-fopenmp.input b/Tests/RunCMake/ParseImplicitData/craype-CXX-CrayClang-18.0.1-fopenmp.input
new file mode 100644
index 0000000..8d814ca
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitData/craype-CXX-CrayClang-18.0.1-fopenmp.input
@@ -0,0 +1,70 @@
+CMAKE_LANG=CXX
+CMAKE_LINKER=/opt/cray/pe/cce/18.0.1/binutils/x86_64/x86_64-pc-linux-gnu/bin/ld
+CMAKE_CXX_COMPILER_ABI=ELF
+CMAKE_CXX_COMPILER_AR=
+CMAKE_CXX_COMPILER_ARCHITECTURE_ID=
+CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_CXX_COMPILER_ID=CrayClang
+CMAKE_CXX_COMPILER_LAUNCHER=
+CMAKE_CXX_COMPILER_LOADED=1
+CMAKE_CXX_COMPILER_RANLIB=
+CMAKE_CXX_COMPILER_TARGET=
+CMAKE_CXX_COMPILER_VERSION=18.0.0
+CMAKE_CXX_COMPILER_VERSION_INTERAL=
+Change Dir: '/tmp/tmp.5plUaGoUlt/CMakeFiles/CMakeTmp'
+
+Run Build Command(s): /usr/bin/cmake -E env VERBOSE=1 /usr/bin/gmake -f Makefile cmTC_b3093/fast
+/usr/bin/gmake -f CMakeFiles/cmTC_b3093.dir/build.make CMakeFiles/cmTC_b3093.dir/build
+gmake[1]: Entering directory '/tmp/tmp.5plUaGoUlt/CMakeFiles/CMakeTmp'
+Building CXX object CMakeFiles/cmTC_b3093.dir/CMakeCXXCompilerABI.cpp.o
+/opt/cray/pe/craype/2.7.33/bin/CC -fopenmp -v -o CMakeFiles/cmTC_b3093.dir/CMakeCXXCompilerABI.cpp.o -c /home/generic.user/cmake/Modules/CMakeCXXCompilerABI.cpp
+Cray clang version 18.0.1 (ac9591613de6fa834bf54862b433bbc16834c13d)
+Target: x86_64-unknown-linux-gnu
+Thread model: posix
+InstalledDir: /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/share/../bin
+Found candidate GCC installation: /usr/lib64/gcc/x86_64-suse-linux/11
+Found candidate GCC installation: /usr/lib64/gcc/x86_64-suse-linux/12
+Found candidate GCC installation: /usr/lib64/gcc/x86_64-suse-linux/13
+Found candidate GCC installation: /usr/lib64/gcc/x86_64-suse-linux/14
+Found candidate GCC installation: /usr/lib64/gcc/x86_64-suse-linux/7
+Selected GCC installation: /usr/lib64/gcc/x86_64-suse-linux/14
+Candidate multilib: .@m64
+Selected multilib: .@m64
+Found HIP installation: /opt/rocm, version 6.3.42131
+ (in-process)
+ "/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/bin/clang-18" -cc1 -triple x86_64-unknown-linux-gnu -mllvm -cray-omp-opt-fork-call -mllvm -cray-omp-parallel-opt-call -mllvm -cray-openmp-rename-outlined -fcray-gpu -flocal-restrict -mllvm -cray-enhanced-asm=1 -fenhanced-asm=1 -mllvm -cray-enhanced-ir=1 -fenhanced-ir=1 -fomp-local-offload-table -ffortran -emit-obj -mrelax-all -disable-free -clear-ast-before-backend -main-file-name CMakeCXXCompilerABI.cpp -mrelocation-model static -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu znver2 -debugger-tuning=gdb -fdebug-compilation-dir=/tmp/tmp.5plUaGoUlt/CMakeFiles/CMakeTmp -v -fcoverage-compilation-dir=/tmp/tmp.5plUaGoUlt/CMakeFiles/CMakeTmp -resource-dir /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18 -isystem /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/include -isystem /opt/cray/pe/cce/18.0.1/cce/x86_64/include/craylibs -D __CRAY_X86_ROME -D __CRAYXT_COMPUTE_LINUX_TARGET -I /opt/cray/pe/mpich/8.1.31/ofi/cray/17.0/include -I /opt/cray/pe/dsmml/0.3.0/dsmml//include -I /opt/cray/pe/libsci/24.11.0/CRAY/17.0/x86_64/include -internal-isystem /usr/lib64/gcc/x86_64-suse-linux/14/../../../../include/c++/14 -internal-isystem /usr/lib64/gcc/x86_64-suse-linux/14/../../../../include/c++/14/x86_64-suse-linux -internal-isystem /usr/lib64/gcc/x86_64-suse-linux/14/../../../../include/c++/14/backward -internal-isystem /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/include -internal-isystem /usr/local/include -internal-isystem /usr/lib64/gcc/x86_64-suse-linux/14/../../../../x86_64-suse-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -fdeprecated-macro -ferror-limit 19 -fcray-openmp -fcray-omp-opt-fork -fcray-omp-parallel-opt -fcray-openmp-rename-outlined-funcs -fopenmp -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -fcxx-exceptions -fexceptions -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o CMakeFiles/cmTC_b3093.dir/CMakeCXXCompilerABI.cpp.o -x c++ /home/generic.user/cmake/Modules/CMakeCXXCompilerABI.cpp
+clang -cc1 version 18.1.8 based upon LLVM 18.1.8 default target x86_64-unknown-linux-gnu
+ignoring nonexistent directory "/include"
+ignoring duplicate directory "/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/include"
+#include "..." search starts here:
+#include <...> search starts here:
+ /opt/cray/pe/mpich/8.1.31/ofi/cray/17.0/include
+ /opt/cray/pe/dsmml/0.3.0/dsmml//include
+ /opt/cray/pe/libsci/24.11.0/CRAY/17.0/x86_64/include
+ /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/include
+ /opt/cray/pe/cce/18.0.1/cce/x86_64/include/craylibs
+ /usr/lib64/gcc/x86_64-suse-linux/14/../../../../include/c++/14
+ /usr/lib64/gcc/x86_64-suse-linux/14/../../../../include/c++/14/x86_64-suse-linux
+ /usr/lib64/gcc/x86_64-suse-linux/14/../../../../include/c++/14/backward
+ /usr/local/include
+ /usr/lib64/gcc/x86_64-suse-linux/14/../../../../x86_64-suse-linux/include
+ /usr/include
+End of search list.
+Linking CXX executable cmTC_b3093
+/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_b3093.dir/link.txt --verbose=1
+Cray clang version 18.0.0.x (bbb3d6951c0329c4d902e7dcd9d677009b67b19a)
+Target: x86_64-unknown-linux-gnu
+Thread model: posix
+InstalledDir: /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/share/../bin
+Found candidate GCC installation: /usr/lib64/gcc/x86_64-suse-linux/11
+Found candidate GCC installation: /usr/lib64/gcc/x86_64-suse-linux/12
+Found candidate GCC installation: /usr/lib64/gcc/x86_64-suse-linux/13
+Found candidate GCC installation: /usr/lib64/gcc/x86_64-suse-linux/14
+Found candidate GCC installation: /usr/lib64/gcc/x86_64-suse-linux/7
+Selected GCC installation: /usr/lib64/gcc/x86_64-suse-linux/14
+Candidate multilib: .@m64
+Selected multilib: .@m64
+Found HIP installation: /opt/rocm, version 6.3.42131
+ "/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/bin/ld.lld" --hash-style=gnu --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o cmTC_b3093 /usr/lib64/gcc/x86_64-suse-linux/14/../../../../lib64/crt1.o /usr/lib64/gcc/x86_64-suse-linux/14/../../../../lib64/crti.o /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/lib/linux/clang_rt.crtbegin-x86_64.o -L/opt/cray/pe/mpich/8.1.31/ofi/cray/17.0/lib -L/opt/cray/pe/dsmml/0.3.0/dsmml//lib -L/opt/cray/pe/libsci/24.11.0/CRAY/17.0/x86_64/lib -L/opt/cray/pe/cce/18.0.1/cce/x86_64/lib/pkgconfig/../ -L/usr/lib64/gcc/x86_64-suse-linux/14 -L/usr/lib64/gcc/x86_64-suse-linux/14/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib64/gcc/x86_64-suse-linux/14/../../../../x86_64-suse-linux/lib -L/lib -L/usr/lib -plugin-opt=mcpu=znver2 -plugin-opt=lto=0 -plugin-opt=defaults=cray -plugin-opt=mllvm=-cray-math-precision=none -rpath=/opt/cray/pe/cce/18.0.1/cce/x86_64/lib CMakeFiles/cmTC_b3093.dir/CMakeCXXCompilerABI.cpp.o --as-needed -lsci_cray_mpi_mp --no-as-needed --as-needed -lsci_cray_mp --no-as-needed -ldl --as-needed -lmpi_cray --no-as-needed --as-needed -ldsmml --no-as-needed -lstdc++ --as-needed -lpgas-shmem --no-as-needed -lquadmath -lmodules -lfi -lcraymath -lf -lu -lcsup --as-needed -lpthread -latomic --no-as-needed --as-needed -lm --no-as-needed --disable-new-dtags /opt/cray/pe/cce/18.0.1/cce/x86_64/lib/no_mmap.o -lstdc++ -lm -lcraymp -L/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/lib/linux/libclang_rt.builtins-x86_64.a --as-needed -L/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib -rpath=/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/libunwind.so -lunwind --no-as-needed -lpthread -lc /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/lib/linux/libclang_rt.builtins-x86_64.a --as-needed -L/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib -rpath=/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/libunwind.so -lunwind --no-as-needed /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/lib/linux/clang_rt.crtend-x86_64.o /usr/lib64/gcc/x86_64-suse-linux/14/../../../../lib64/crtn.o
+/opt/cray/pe/craype/2.7.33/bin/CC -fopenmp -v CMakeFiles/cmTC_b3093.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_b3093
+gmake[1]: Leaving directory '/tmp/tmp.5plUaGoUlt/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitData/craype-CXX-CrayClang-18.0.1.input b/Tests/RunCMake/ParseImplicitData/craype-CXX-CrayClang-18.0.1.input
new file mode 100644
index 0000000..2265c75
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitData/craype-CXX-CrayClang-18.0.1.input
@@ -0,0 +1,70 @@
+CMAKE_LANG=CXX
+CMAKE_LINKER=/opt/cray/pe/cce/18.0.1/binutils/x86_64/x86_64-pc-linux-gnu/bin/ld
+CMAKE_CXX_COMPILER_ABI=ELF
+CMAKE_CXX_COMPILER_AR=
+CMAKE_CXX_COMPILER_ARCHITECTURE_ID=
+CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_CXX_COMPILER_ID=CrayClang
+CMAKE_CXX_COMPILER_LAUNCHER=
+CMAKE_CXX_COMPILER_LOADED=1
+CMAKE_CXX_COMPILER_RANLIB=
+CMAKE_CXX_COMPILER_TARGET=
+CMAKE_CXX_COMPILER_VERSION=18.0.0
+CMAKE_CXX_COMPILER_VERSION_INTERAL=
+Change Dir: '/tmp/tmp.AZ7ST0Eub7/CMakeFiles/CMakeTmp'
+
+Run Build Command(s): /usr/bin/cmake -E env VERBOSE=1 /usr/bin/gmake -f Makefile cmTC_b403d/fast
+/usr/bin/gmake -f CMakeFiles/cmTC_b403d.dir/build.make CMakeFiles/cmTC_b403d.dir/build
+gmake[1]: Entering directory '/tmp/tmp.AZ7ST0Eub7/CMakeFiles/CMakeTmp'
+Building CXX object CMakeFiles/cmTC_b403d.dir/CMakeCXXCompilerABI.cpp.o
+/opt/cray/pe/craype/2.7.33/bin/CC -v -o CMakeFiles/cmTC_b403d.dir/CMakeCXXCompilerABI.cpp.o -c /home/generic.user/cmake/Modules/CMakeCXXCompilerABI.cpp
+Cray clang version 18.0.1 (ac9591613de6fa834bf54862b433bbc16834c13d)
+Target: x86_64-unknown-linux-gnu
+Thread model: posix
+InstalledDir: /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/share/../bin
+Found candidate GCC installation: /usr/lib64/gcc/x86_64-suse-linux/11
+Found candidate GCC installation: /usr/lib64/gcc/x86_64-suse-linux/12
+Found candidate GCC installation: /usr/lib64/gcc/x86_64-suse-linux/13
+Found candidate GCC installation: /usr/lib64/gcc/x86_64-suse-linux/14
+Found candidate GCC installation: /usr/lib64/gcc/x86_64-suse-linux/7
+Selected GCC installation: /usr/lib64/gcc/x86_64-suse-linux/14
+Candidate multilib: .@m64
+Selected multilib: .@m64
+Found HIP installation: /opt/rocm, version 6.3.42131
+ (in-process)
+ "/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/bin/clang-18" -cc1 -triple x86_64-unknown-linux-gnu -mllvm -cray-omp-opt-fork-call -mllvm -cray-omp-parallel-opt-call -mllvm -cray-openmp-rename-outlined -fcray-gpu -flocal-restrict -mllvm -cray-enhanced-asm=1 -fenhanced-asm=1 -mllvm -cray-enhanced-ir=1 -fenhanced-ir=1 -fomp-local-offload-table -ffortran -emit-obj -mrelax-all -disable-free -clear-ast-before-backend -main-file-name CMakeCXXCompilerABI.cpp -mrelocation-model static -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu znver2 -debugger-tuning=gdb -fdebug-compilation-dir=/tmp/tmp.AZ7ST0Eub7/CMakeFiles/CMakeTmp -v -fcoverage-compilation-dir=/tmp/tmp.AZ7ST0Eub7/CMakeFiles/CMakeTmp -resource-dir /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18 -isystem /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/include -isystem /opt/cray/pe/cce/18.0.1/cce/x86_64/include/craylibs -D __CRAY_X86_ROME -D __CRAYXT_COMPUTE_LINUX_TARGET -I /opt/cray/pe/mpich/8.1.31/ofi/cray/17.0/include -I /opt/cray/pe/dsmml/0.3.0/dsmml//include -I /opt/cray/pe/libsci/24.11.0/CRAY/17.0/x86_64/include -internal-isystem /usr/lib64/gcc/x86_64-suse-linux/14/../../../../include/c++/14 -internal-isystem /usr/lib64/gcc/x86_64-suse-linux/14/../../../../include/c++/14/x86_64-suse-linux -internal-isystem /usr/lib64/gcc/x86_64-suse-linux/14/../../../../include/c++/14/backward -internal-isystem /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/include -internal-isystem /usr/local/include -internal-isystem /usr/lib64/gcc/x86_64-suse-linux/14/../../../../x86_64-suse-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -fdeprecated-macro -ferror-limit 19 -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -fcxx-exceptions -fexceptions -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o CMakeFiles/cmTC_b403d.dir/CMakeCXXCompilerABI.cpp.o -x c++ /home/generic.user/cmake/Modules/CMakeCXXCompilerABI.cpp
+clang -cc1 version 18.1.8 based upon LLVM 18.1.8 default target x86_64-unknown-linux-gnu
+ignoring nonexistent directory "/include"
+ignoring duplicate directory "/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/include"
+#include "..." search starts here:
+#include <...> search starts here:
+ /opt/cray/pe/mpich/8.1.31/ofi/cray/17.0/include
+ /opt/cray/pe/dsmml/0.3.0/dsmml//include
+ /opt/cray/pe/libsci/24.11.0/CRAY/17.0/x86_64/include
+ /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/include
+ /opt/cray/pe/cce/18.0.1/cce/x86_64/include/craylibs
+ /usr/lib64/gcc/x86_64-suse-linux/14/../../../../include/c++/14
+ /usr/lib64/gcc/x86_64-suse-linux/14/../../../../include/c++/14/x86_64-suse-linux
+ /usr/lib64/gcc/x86_64-suse-linux/14/../../../../include/c++/14/backward
+ /usr/local/include
+ /usr/lib64/gcc/x86_64-suse-linux/14/../../../../x86_64-suse-linux/include
+ /usr/include
+End of search list.
+Linking CXX executable cmTC_b403d
+/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_b403d.dir/link.txt --verbose=1
+Cray clang version 18.0.0.x (bbb3d6951c0329c4d902e7dcd9d677009b67b19a)
+Target: x86_64-unknown-linux-gnu
+Thread model: posix
+InstalledDir: /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/share/../bin
+Found candidate GCC installation: /usr/lib64/gcc/x86_64-suse-linux/11
+Found candidate GCC installation: /usr/lib64/gcc/x86_64-suse-linux/12
+Found candidate GCC installation: /usr/lib64/gcc/x86_64-suse-linux/13
+Found candidate GCC installation: /usr/lib64/gcc/x86_64-suse-linux/14
+Found candidate GCC installation: /usr/lib64/gcc/x86_64-suse-linux/7
+Selected GCC installation: /usr/lib64/gcc/x86_64-suse-linux/14
+Candidate multilib: .@m64
+Selected multilib: .@m64
+Found HIP installation: /opt/rocm, version 6.3.42131
+ "/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/bin/ld.lld" --hash-style=gnu --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o cmTC_b403d /usr/lib64/gcc/x86_64-suse-linux/14/../../../../lib64/crt1.o /usr/lib64/gcc/x86_64-suse-linux/14/../../../../lib64/crti.o /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/lib/linux/clang_rt.crtbegin-x86_64.o -L/opt/cray/pe/mpich/8.1.31/ofi/cray/17.0/lib -L/opt/cray/pe/dsmml/0.3.0/dsmml//lib -L/opt/cray/pe/libsci/24.11.0/CRAY/17.0/x86_64/lib -L/opt/cray/pe/cce/18.0.1/cce/x86_64/lib/pkgconfig/../ -L/usr/lib64/gcc/x86_64-suse-linux/14 -L/usr/lib64/gcc/x86_64-suse-linux/14/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib64/gcc/x86_64-suse-linux/14/../../../../x86_64-suse-linux/lib -L/lib -L/usr/lib -plugin-opt=mcpu=znver2 -plugin-opt=lto=0 -plugin-opt=defaults=cray -plugin-opt=mllvm=-cray-math-precision=none -rpath=/opt/cray/pe/cce/18.0.1/cce/x86_64/lib CMakeFiles/cmTC_b403d.dir/CMakeCXXCompilerABI.cpp.o --as-needed -lsci_cray_mpi --no-as-needed --as-needed -lsci_cray --no-as-needed -ldl --as-needed -lmpi_cray --no-as-needed --as-needed -ldsmml --no-as-needed -lstdc++ --as-needed -lpgas-shmem --no-as-needed -lquadmath -lmodules -lfi -lcraymath -lf -lu -lcsup --as-needed -lpthread -latomic --no-as-needed --as-needed -lm --no-as-needed --disable-new-dtags /opt/cray/pe/cce/18.0.1/cce/x86_64/lib/no_mmap.o -lstdc++ -lm /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/lib/linux/libclang_rt.builtins-x86_64.a --as-needed -L/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib -rpath=/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/libunwind.so -lunwind --no-as-needed -lc /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/lib/linux/libclang_rt.builtins-x86_64.a --as-needed -L/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib -rpath=/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/libunwind.so -lunwind --no-as-needed /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/lib/linux/clang_rt.crtend-x86_64.o /usr/lib64/gcc/x86_64-suse-linux/14/../../../../lib64/crtn.o
+/opt/cray/pe/craype/2.7.33/bin/CC -v CMakeFiles/cmTC_b403d.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_b403d
+gmake[1]: Leaving directory '/tmp/tmp.AZ7ST0Eub7/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitData/craype-Fortran-Cray-18.0.1-homp-accel.input b/Tests/RunCMake/ParseImplicitData/craype-Fortran-Cray-18.0.1-homp-accel.input
new file mode 100644
index 0000000..cd95df7
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitData/craype-Fortran-Cray-18.0.1-homp-accel.input
@@ -0,0 +1,66 @@
+CMAKE_LANG=Fortran
+CMAKE_LINKER=/opt/cray/pe/cce/18.0.1/binutils/x86_64/x86_64-pc-linux-gnu/bin/ld
+CMAKE_Fortran_COMPILER_ABI=ELF
+CMAKE_Fortran_COMPILER_AR=
+CMAKE_Fortran_COMPILER_ARCHITECTURE_ID=
+CMAKE_Fortran_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_Fortran_COMPILER_ID=Cray
+CMAKE_Fortran_COMPILER_LAUNCHER=
+CMAKE_Fortran_COMPILER_LOADED=1
+CMAKE_Fortran_COMPILER_RANLIB=
+CMAKE_Fortran_COMPILER_TARGET=
+CMAKE_Fortran_COMPILER_VERSION=18.0.0
+CMAKE_Fortran_COMPILER_VERSION_INTERAL=
+Change Dir: '/tmp/tmp.WfKXPauSNI/CMakeFiles/CMakeTmp'
+
+Run Build Command(s): /usr/bin/cmake -E env VERBOSE=1 /usr/bin/gmake -f Makefile cmTC_d1f2e/fast
+/usr/bin/gmake -f CMakeFiles/cmTC_d1f2e.dir/build.make CMakeFiles/cmTC_d1f2e.dir/build
+gmake[1]: Entering directory '/tmp/tmp.WfKXPauSNI/CMakeFiles/CMakeTmp'
+Building Fortran object CMakeFiles/cmTC_d1f2e.dir/CMakeFortranCompilerABI.F.o
+/opt/cray/pe/craype/2.7.33/bin/ftn -homp -em -J. -v -c /home/generic.user/cmake/Modules/CMakeFortranCompilerABI.F -o CMakeFiles/cmTC_d1f2e.dir/CMakeFortranCompilerABI.F.o
+
+/opt/cray/pe/cce/18.0.1/cce/x86_64/bin/ftnfe -h cpu=x86-rome -h accel=amdgcn-gfx908 -h network=ofi -D__CRAY_X86_ROME -D__CRAY_AMD_GFX908 -D__CRAYXT_COMPUTE_LINUX_TARGET -h omp -em -J. -I/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/include -I/opt/cray/pe/cce/18.0.1/cce/x86_64/include/craylibs -I/usr/include -D__HIP_PLATFORM_AMD__ -I/opt/cray/pe/mpich/8.1.31/ofi/cray/17.0/include -I/opt/cray/pe/dsmml/0.3.0/dsmml//include -I/opt/cray/pe/libsci/24.11.0/CRAY/17.0/x86_64/include -I/opt/rocm-6.3.0/include -I/opt/rocm-6.3.0/include/rocprofiler -I/opt/rocm-6.3.0/include/roctracer -I/usr/include -hpl=/tmp/pe_202574//pldir -usystem_mod=/opt/cray/pe/cce/18.0.1/cce/x86_64/lib/libmodules.a -usystem_mod=/opt/cray/pe/cce/18.0.1/cce/x86_64/lib/libomp.a -usystem_mod=/opt/cray/pe/cce/18.0.1/cce/x86_64/lib/omp_lib.a -usystem_mod=/opt/cray/pe/cce/18.0.1/cce/x86_64/lib/libopenacc.a -usystem_mod=/opt/cray/pe/mpich/8.1.31/ofi/cray/17.0/include -usystem_mod=/opt/cray/pe/dsmml/0.3.0/dsmml//include -usystem_mod=/opt/cray/pe/libsci/24.11.0/CRAY/17.0/x86_64/include -usystem_mod=/opt/rocm-6.3.0/include -usystem_mod=/opt/rocm-6.3.0/include/rocprofiler -usystem_mod=/opt/rocm-6.3.0/include/roctracer -usystem_mod=/opt/cray/pe/cce/18.0.1/cce/x86_64/lib/libcraymp.a -ffixed -CZ/tmp/pe_202574/CMakeFortranCompilerABI.T -Cx -CX/tmp/pe_202574/CMakeFortranCompilerABI.xml -hdecompile=/tmp/tmp.WfKXPauSNI/CMakeFiles/CMakeTmp/CMakeFiles/cmTC_d1f2e.dir/CMakeFortranCompilerABI. -S /tmp/pe_202574/CMakeFortranCompilerABI_1.s -Oipa3 -ufile_id=1 /home/generic.user/cmake/Modules/CMakeFortranCompilerABI.F
+
+/opt/cray/pe/cce/18.0.1/cce/x86_64/bin/optcg /tmp/pe_202574//pldir 1
+
+/opt/cray/pe/cce/18.0.1/binutils/x86_64/x86_64-pc-linux-gnu/bin/as -o CMakeFiles/cmTC_d1f2e.dir/CMakeFortranCompilerABI.F.o --64 /tmp/pe_202574/CMakeFortranCompilerABI_1.s
+rm /tmp/pe_202574/CMakeFortranCompilerABI_1.s
+rm /tmp/pe_202574//pldir/PL_global_data
+rm /tmp/pe_202574//pldir/PL_module_list
+rm /tmp/pe_202574//pldir/PL_path
+rm /tmp/pe_202574//pldir/CMakeFortranCompilerABI_1.inl
+rm /tmp/pe_202574//pldir/gline_1
+rm /tmp/pe_202574//pldir/iline_1
+rmdir /tmp/pe_202574//pldir
+rm /tmp/pe_202574//CMakeFortranCompilerABI.xml
+rm /tmp/pe_202574//CMakeFortranCompilerABI.T
+rm /tmp/pe_202574//CMakeFortranCompilerABI.Tfe
+rm /tmp/pe_202574//CMakeFortranCompilerABI_1.cif.Ttmp
+rm /tmp/pe_202574//CMakeFortranCompilerABI_1.xml.Ttmp
+rmdir /tmp/pe_202574/
+Linking Fortran executable cmTC_d1f2e
+/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_d1f2e.dir/link.txt --verbose=1
+
+/opt/cray/pe/cce/18.0.1/cce/x86_64/bin/cce_omp_offload_linker -O2 --arch gfx908 --verbose -mcode-object-version=5 -- /opt/cray/pe/cce/18.0.1/binutils/x86_64/x86_64-pc-linux-gnu/bin/ld --eh-frame-hdr -m elf_x86_64 --enable-new-dtags --dynamic-linker /lib64/ld-linux-x86-64.so.2 /usr/lib64//crt1.o /usr/lib64//crti.o /usr/lib64/gcc/x86_64-suse-linux/14//crtbegin.o /usr/lib64/gcc/x86_64-suse-linux/14//crtfastmath.o /opt/cray/pe/cce/18.0.1/cce/x86_64/lib/no_mmap.o /opt/cray/pe/cce/18.0.1/cce/x86_64/lib/cce_floatingpt_au.o CMakeFiles/cmTC_d1f2e.dir/CMakeFortranCompilerABI.F.o -Bdynamic -rpath=/opt/cray/pe/cce/18.0.1/cce/x86_64/lib -L/opt/cray/pe/mpich/8.1.31/ofi/cray/17.0/lib -L/opt/cray/pe/mpich/8.1.31/gtl/lib -L/opt/cray/pe/dsmml/0.3.0/dsmml//lib -L/opt/cray/pe/libsci/24.11.0/CRAY/17.0/x86_64/lib -L/opt/rocm-6.3.0/lib -L/opt/rocm-6.3.0/lib/rocprofiler -L/opt/rocm-6.3.0/lib/roctracer -L/opt/cray/pe/cce/18.0.1/cce/x86_64/lib/pkgconfig/../ -lamdhip64 --as-needed -lsci_cray_mpi_mp --no-as-needed --as-needed -lsci_cray_mp --no-as-needed -ldl --as-needed -lmpifort_cray --no-as-needed --as-needed -lmpi_cray --no-as-needed -lmpi_gtl_hsa --as-needed -ldsmml --no-as-needed -lstdc++ --as-needed -lpgas-shmem --no-as-needed -lquadmath -lcraymp -lcrayacc_amdgpu -lopenacc -lmodules -lfi -lcraymath -lf -lu -lcsup --as-needed -latomic --no-as-needed --as-needed -lgfortran --no-as-needed -lpthread -L/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/lib/linux -L/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/lib/linux/../../../.. -lcsup -lm -lclang_rt.craypgo-x86_64 -lclang_rt.builtins-x86_64 --as-needed -lunwind --no-as-needed -lc -lclang_rt.builtins-x86_64 --as-needed -lunwind --no-as-needed --disable-new-dtags -L/usr/lib64/gcc/x86_64-suse-linux/14 -L/opt/cray/pe/cce/18.0.1/binutils/x86_64/x86_64-pc-linux-gnu/..//x86_64-unknown-linux-gnu/lib -EL -o cmTC_d1f2e /usr/lib64/gcc/x86_64-suse-linux/14//crtend.o /usr/lib64//crtn.o
+Skipping unbundling of /opt/cray/pe/cce/18.0.1/cce/x86_64/lib/pkgconfig/..//libcsup.a (already processed)
+Skipping unbundling of /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/lib/linux/libclang_rt.builtins-x86_64.a (already processed)
+Skipping unbundling of /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/lib/linux/../../../../libunwind.a (already processed)
+as /tmp/cooltmpdir-NBqoL7/tmp_offload_linker-cce-openmpacc-targetbegin.s -o /tmp/cooltmpdir-NBqoL7/acc-targetbegin-cce-openmp.o
+as /tmp/cooltmpdir-NBqoL7/tmp_offload_linker-cce-openmpacc-targetend.s -o /tmp/cooltmpdir-NBqoL7/acc-targetend-tmp-cce-openmp.o
+/opt/cray/pe/cce/18.0.1/binutils/x86_64/bin/ld --relocatable /tmp/cooltmpdir-NBqoL7/acc-targetend-tmp-cce-openmp.o -o /tmp/cooltmpdir-NBqoL7/acc-targetend-cce-openmp.o
+/opt/cray/pe/cce/18.0.1/binutils/x86_64/x86_64-pc-linux-gnu/bin/ld /tmp/cooltmpdir-NBqoL7/acc-targetbegin-cce-openmp.o --eh-frame-hdr -m elf_x86_64 --enable-new-dtags --dynamic-linker /lib64/ld-linux-x86-64.so.2 /usr/lib64//crt1.o /usr/lib64//crti.o /usr/lib64/gcc/x86_64-suse-linux/14//crtbegin.o /usr/lib64/gcc/x86_64-suse-linux/14//crtfastmath.o /opt/cray/pe/cce/18.0.1/cce/x86_64/lib/no_mmap.o /opt/cray/pe/cce/18.0.1/cce/x86_64/lib/cce_floatingpt_au.o CMakeFiles/cmTC_d1f2e.dir/CMakeFortranCompilerABI.F.o -Bdynamic -rpath=/opt/cray/pe/cce/18.0.1/cce/x86_64/lib -L/opt/cray/pe/mpich/8.1.31/ofi/cray/17.0/lib -L/opt/cray/pe/mpich/8.1.31/gtl/lib -L/opt/cray/pe/dsmml/0.3.0/dsmml//lib -L/opt/cray/pe/libsci/24.11.0/CRAY/17.0/x86_64/lib -L/opt/rocm-6.3.0/lib -L/opt/rocm-6.3.0/lib/rocprofiler -L/opt/rocm-6.3.0/lib/roctracer -L/opt/cray/pe/cce/18.0.1/cce/x86_64/lib/pkgconfig/../ -lamdhip64 --as-needed -lsci_cray_mpi_mp --no-as-needed --as-needed -lsci_cray_mp --no-as-needed -ldl --as-needed -lmpifort_cray --no-as-needed --as-needed -lmpi_cray --no-as-needed -lmpi_gtl_hsa --as-needed -ldsmml --no-as-needed -lstdc++ --as-needed -lpgas-shmem --no-as-needed -lquadmath -lcraymp -lcrayacc_amdgpu -lopenacc -lmodules -lfi -lcraymath -lf -lu -lcsup --as-needed -latomic --no-as-needed --as-needed -lgfortran --no-as-needed -lpthread -L/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/lib/linux -L/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/lib/linux/../../../.. -lcsup -lm -lclang_rt.craypgo-x86_64 -lclang_rt.builtins-x86_64 --as-needed -lunwind --no-as-needed -lc -lclang_rt.builtins-x86_64 --as-needed -lunwind --no-as-needed --disable-new-dtags -L /usr/lib64/gcc/x86_64-suse-linux/14 -L /opt/cray/pe/cce/18.0.1/binutils/x86_64/x86_64-pc-linux-gnu/..//x86_64-unknown-linux-gnu/lib -EL -o cmTC_d1f2e /usr/lib64/gcc/x86_64-suse-linux/14//crtend.o /usr/lib64//crtn.o /tmp/cooltmpdir-NBqoL7/acc-targetend-cce-openmp.o
+rm '/tmp/cooltmpdir-NBqoL7/tmp_offload_linker-cce-openmpacc-targetend.s'
+rm '/tmp/cooltmpdir-NBqoL7/tmp_offload_linker-cce-openmpacc-targetbegin.s'
+rm '/tmp/cooltmpdir-NBqoL7/acc-targetend-cce-openmp.o'
+rm '/tmp/cooltmpdir-NBqoL7/acc-targetend-tmp-cce-openmp.o'
+rm '/tmp/cooltmpdir-NBqoL7/acc-targetbegin-cce-openmp.o'
+rm '/tmp/cooltmpdir-NBqoL7/'
+
+/opt/cray/pe/cce/18.0.1/binutils/x86_64/bin/objcopy --remove-section=.note.ftn_module_data cmTC_d1f2e
+rm /tmp/pe_202587//pldir/PL_global_data
+rm /tmp/pe_202587//pldir/PL_module_list
+rm /tmp/pe_202587//pldir/PL_path
+rmdir /tmp/pe_202587//pldir
+rmdir /tmp/pe_202587/
+/opt/cray/pe/craype/2.7.33/bin/ftn -v -homp CMakeFiles/cmTC_d1f2e.dir/CMakeFortranCompilerABI.F.o -o cmTC_d1f2e
+gmake[1]: Leaving directory '/tmp/tmp.WfKXPauSNI/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitData/craype-Fortran-Cray-18.0.1-homp.input b/Tests/RunCMake/ParseImplicitData/craype-Fortran-Cray-18.0.1-homp.input
new file mode 100644
index 0000000..c2ba7c9
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitData/craype-Fortran-Cray-18.0.1-homp.input
@@ -0,0 +1,66 @@
+CMAKE_LANG=Fortran
+CMAKE_LINKER=/opt/cray/pe/cce/18.0.1/binutils/x86_64/x86_64-pc-linux-gnu/bin/ld
+CMAKE_Fortran_COMPILER_ABI=ELF
+CMAKE_Fortran_COMPILER_AR=
+CMAKE_Fortran_COMPILER_ARCHITECTURE_ID=
+CMAKE_Fortran_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_Fortran_COMPILER_ID=Cray
+CMAKE_Fortran_COMPILER_LAUNCHER=
+CMAKE_Fortran_COMPILER_LOADED=1
+CMAKE_Fortran_COMPILER_RANLIB=
+CMAKE_Fortran_COMPILER_TARGET=
+CMAKE_Fortran_COMPILER_VERSION=18.0.0
+CMAKE_Fortran_COMPILER_VERSION_INTERAL=
+Change Dir: '/tmp/tmp.vY8KAMA9PX/CMakeFiles/CMakeTmp'
+
+Run Build Command(s): /usr/bin/cmake -E env VERBOSE=1 /usr/bin/gmake -f Makefile cmTC_bc4c9/fast
+/usr/bin/gmake -f CMakeFiles/cmTC_bc4c9.dir/build.make CMakeFiles/cmTC_bc4c9.dir/build
+gmake[1]: Entering directory '/tmp/tmp.vY8KAMA9PX/CMakeFiles/CMakeTmp'
+Building Fortran object CMakeFiles/cmTC_bc4c9.dir/CMakeFortranCompilerABI.F.o
+/opt/cray/pe/craype/2.7.33/bin/ftn -homp -em -J. -v -c /home/generic.user/cmake/Modules/CMakeFortranCompilerABI.F -o CMakeFiles/cmTC_bc4c9.dir/CMakeFortranCompilerABI.F.o
+
+/opt/cray/pe/cce/18.0.1/cce/x86_64/bin/ftnfe -h cpu=x86-rome -h network=ofi -D__CRAY_X86_ROME -D__CRAYXT_COMPUTE_LINUX_TARGET -h omp -em -J. -I/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/include -I/opt/cray/pe/cce/18.0.1/cce/x86_64/include/craylibs -I/usr/include -I/opt/cray/pe/mpich/8.1.31/ofi/cray/17.0/include -I/opt/cray/pe/dsmml/0.3.0/dsmml//include -I/opt/cray/pe/libsci/24.11.0/CRAY/17.0/x86_64/include -I/usr/include -hpl=/tmp/pe_201719//pldir -usystem_mod=/opt/cray/pe/cce/18.0.1/cce/x86_64/lib/libmodules.a -usystem_mod=/opt/cray/pe/cce/18.0.1/cce/x86_64/lib/libomp.a -usystem_mod=/opt/cray/pe/cce/18.0.1/cce/x86_64/lib/omp_lib.a -usystem_mod=/opt/cray/pe/cce/18.0.1/cce/x86_64/lib/libopenacc.a -usystem_mod=/opt/cray/pe/mpich/8.1.31/ofi/cray/17.0/include -usystem_mod=/opt/cray/pe/dsmml/0.3.0/dsmml//include -usystem_mod=/opt/cray/pe/libsci/24.11.0/CRAY/17.0/x86_64/include -usystem_mod=/opt/cray/pe/cce/18.0.1/cce/x86_64/lib/libcraymp.a -ffixed -CZ/tmp/pe_201719/CMakeFortranCompilerABI.T -Cx -CX/tmp/pe_201719/CMakeFortranCompilerABI.xml -hdecompile=/tmp/tmp.vY8KAMA9PX/CMakeFiles/CMakeTmp/CMakeFiles/cmTC_bc4c9.dir/CMakeFortranCompilerABI. -S /tmp/pe_201719/CMakeFortranCompilerABI_1.s -Oipa3 -ufile_id=1 /home/generic.user/cmake/Modules/CMakeFortranCompilerABI.F
+
+/opt/cray/pe/cce/18.0.1/cce/x86_64/bin/optcg /tmp/pe_201719//pldir 1
+
+/opt/cray/pe/cce/18.0.1/binutils/x86_64/x86_64-pc-linux-gnu/bin/as -o CMakeFiles/cmTC_bc4c9.dir/CMakeFortranCompilerABI.F.o --64 /tmp/pe_201719/CMakeFortranCompilerABI_1.s
+rm /tmp/pe_201719/CMakeFortranCompilerABI_1.s
+rm /tmp/pe_201719//pldir/PL_global_data
+rm /tmp/pe_201719//pldir/PL_module_list
+rm /tmp/pe_201719//pldir/PL_path
+rm /tmp/pe_201719//pldir/CMakeFortranCompilerABI_1.inl
+rm /tmp/pe_201719//pldir/gline_1
+rm /tmp/pe_201719//pldir/iline_1
+rmdir /tmp/pe_201719//pldir
+rm /tmp/pe_201719//CMakeFortranCompilerABI.xml
+rm /tmp/pe_201719//CMakeFortranCompilerABI.T
+rm /tmp/pe_201719//CMakeFortranCompilerABI.Tfe
+rm /tmp/pe_201719//CMakeFortranCompilerABI_1.cif.Ttmp
+rm /tmp/pe_201719//CMakeFortranCompilerABI_1.xml.Ttmp
+rmdir /tmp/pe_201719/
+Linking Fortran executable cmTC_bc4c9
+/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_bc4c9.dir/link.txt --verbose=1
+
+/opt/cray/pe/cce/18.0.1/cce/x86_64/bin/cce_omp_offload_linker -O2 --verbose -mcode-object-version=5 -- /opt/cray/pe/cce/18.0.1/binutils/x86_64/x86_64-pc-linux-gnu/bin/ld --eh-frame-hdr -m elf_x86_64 --enable-new-dtags --dynamic-linker /lib64/ld-linux-x86-64.so.2 /usr/lib64//crt1.o /usr/lib64//crti.o /usr/lib64/gcc/x86_64-suse-linux/14//crtbegin.o /usr/lib64/gcc/x86_64-suse-linux/14//crtfastmath.o /opt/cray/pe/cce/18.0.1/cce/x86_64/lib/no_mmap.o /opt/cray/pe/cce/18.0.1/cce/x86_64/lib/cce_floatingpt_au.o CMakeFiles/cmTC_bc4c9.dir/CMakeFortranCompilerABI.F.o -Bdynamic -rpath=/opt/cray/pe/cce/18.0.1/cce/x86_64/lib -L/opt/cray/pe/mpich/8.1.31/ofi/cray/17.0/lib -L/opt/cray/pe/dsmml/0.3.0/dsmml//lib -L/opt/cray/pe/libsci/24.11.0/CRAY/17.0/x86_64/lib -L/opt/cray/pe/cce/18.0.1/cce/x86_64/lib/pkgconfig/../ --as-needed -lsci_cray_mpi_mp --no-as-needed --as-needed -lsci_cray_mp --no-as-needed -ldl --as-needed -lmpifort_cray --no-as-needed --as-needed -lmpi_cray --no-as-needed --as-needed -ldsmml --no-as-needed -lstdc++ --as-needed -lpgas-shmem --no-as-needed -lquadmath -lcraymp -lmodules -lfi -lcraymath -lf -lu -lcsup --as-needed -latomic --no-as-needed --as-needed -lgfortran --no-as-needed -lpthread -L/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/lib/linux -L/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/lib/linux/../../../.. -lcsup -lm -lclang_rt.craypgo-x86_64 -lclang_rt.builtins-x86_64 --as-needed -lunwind --no-as-needed -lc -lclang_rt.builtins-x86_64 --as-needed -lunwind --no-as-needed --disable-new-dtags -L/usr/lib64/gcc/x86_64-suse-linux/14 -L/opt/cray/pe/cce/18.0.1/binutils/x86_64/x86_64-pc-linux-gnu/..//x86_64-unknown-linux-gnu/lib -EL -o cmTC_bc4c9 /usr/lib64/gcc/x86_64-suse-linux/14//crtend.o /usr/lib64//crtn.o
+Skipping unbundling of /opt/cray/pe/cce/18.0.1/cce/x86_64/lib/pkgconfig/..//libcsup.a (already processed)
+Skipping unbundling of /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/lib/linux/libclang_rt.builtins-x86_64.a (already processed)
+Skipping unbundling of /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/lib/linux/../../../../libunwind.a (already processed)
+as /tmp/cooltmpdir-B0IiNo/tmp_offload_linker-cce-openmpacc-targetbegin.s -o /tmp/cooltmpdir-B0IiNo/acc-targetbegin-cce-openmp.o
+as /tmp/cooltmpdir-B0IiNo/tmp_offload_linker-cce-openmpacc-targetend.s -o /tmp/cooltmpdir-B0IiNo/acc-targetend-tmp-cce-openmp.o
+/opt/cray/pe/cce/18.0.1/binutils/x86_64/bin/ld --relocatable /tmp/cooltmpdir-B0IiNo/acc-targetend-tmp-cce-openmp.o -o /tmp/cooltmpdir-B0IiNo/acc-targetend-cce-openmp.o
+/opt/cray/pe/cce/18.0.1/binutils/x86_64/x86_64-pc-linux-gnu/bin/ld /tmp/cooltmpdir-B0IiNo/acc-targetbegin-cce-openmp.o --eh-frame-hdr -m elf_x86_64 --enable-new-dtags --dynamic-linker /lib64/ld-linux-x86-64.so.2 /usr/lib64//crt1.o /usr/lib64//crti.o /usr/lib64/gcc/x86_64-suse-linux/14//crtbegin.o /usr/lib64/gcc/x86_64-suse-linux/14//crtfastmath.o /opt/cray/pe/cce/18.0.1/cce/x86_64/lib/no_mmap.o /opt/cray/pe/cce/18.0.1/cce/x86_64/lib/cce_floatingpt_au.o CMakeFiles/cmTC_bc4c9.dir/CMakeFortranCompilerABI.F.o -Bdynamic -rpath=/opt/cray/pe/cce/18.0.1/cce/x86_64/lib -L/opt/cray/pe/mpich/8.1.31/ofi/cray/17.0/lib -L/opt/cray/pe/dsmml/0.3.0/dsmml//lib -L/opt/cray/pe/libsci/24.11.0/CRAY/17.0/x86_64/lib -L/opt/cray/pe/cce/18.0.1/cce/x86_64/lib/pkgconfig/../ --as-needed -lsci_cray_mpi_mp --no-as-needed --as-needed -lsci_cray_mp --no-as-needed -ldl --as-needed -lmpifort_cray --no-as-needed --as-needed -lmpi_cray --no-as-needed --as-needed -ldsmml --no-as-needed -lstdc++ --as-needed -lpgas-shmem --no-as-needed -lquadmath -lcraymp -lmodules -lfi -lcraymath -lf -lu -lcsup --as-needed -latomic --no-as-needed --as-needed -lgfortran --no-as-needed -lpthread -L/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/lib/linux -L/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/lib/linux/../../../.. -lcsup -lm -lclang_rt.craypgo-x86_64 -lclang_rt.builtins-x86_64 --as-needed -lunwind --no-as-needed -lc -lclang_rt.builtins-x86_64 --as-needed -lunwind --no-as-needed --disable-new-dtags -L /usr/lib64/gcc/x86_64-suse-linux/14 -L /opt/cray/pe/cce/18.0.1/binutils/x86_64/x86_64-pc-linux-gnu/..//x86_64-unknown-linux-gnu/lib -EL -o cmTC_bc4c9 /usr/lib64/gcc/x86_64-suse-linux/14//crtend.o /usr/lib64//crtn.o /tmp/cooltmpdir-B0IiNo/acc-targetend-cce-openmp.o
+rm '/tmp/cooltmpdir-B0IiNo/tmp_offload_linker-cce-openmpacc-targetend.s'
+rm '/tmp/cooltmpdir-B0IiNo/tmp_offload_linker-cce-openmpacc-targetbegin.s'
+rm '/tmp/cooltmpdir-B0IiNo/acc-targetend-cce-openmp.o'
+rm '/tmp/cooltmpdir-B0IiNo/acc-targetend-tmp-cce-openmp.o'
+rm '/tmp/cooltmpdir-B0IiNo/acc-targetbegin-cce-openmp.o'
+rm '/tmp/cooltmpdir-B0IiNo/'
+
+/opt/cray/pe/cce/18.0.1/binutils/x86_64/bin/objcopy --remove-section=.note.ftn_module_data cmTC_bc4c9
+rm /tmp/pe_201731//pldir/PL_global_data
+rm /tmp/pe_201731//pldir/PL_module_list
+rm /tmp/pe_201731//pldir/PL_path
+rmdir /tmp/pe_201731//pldir
+rmdir /tmp/pe_201731/
+/opt/cray/pe/craype/2.7.33/bin/ftn -v -homp CMakeFiles/cmTC_bc4c9.dir/CMakeFortranCompilerABI.F.o -o cmTC_bc4c9
+gmake[1]: Leaving directory '/tmp/tmp.vY8KAMA9PX/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitData/craype-Fortran-Cray-18.0.1.input b/Tests/RunCMake/ParseImplicitData/craype-Fortran-Cray-18.0.1.input
new file mode 100644
index 0000000..cf86e2c
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitData/craype-Fortran-Cray-18.0.1.input
@@ -0,0 +1,66 @@
+CMAKE_LANG=Fortran
+CMAKE_LINKER=/opt/cray/pe/cce/18.0.1/binutils/x86_64/x86_64-pc-linux-gnu/bin/ld
+CMAKE_Fortran_COMPILER_ABI=ELF
+CMAKE_Fortran_COMPILER_AR=
+CMAKE_Fortran_COMPILER_ARCHITECTURE_ID=
+CMAKE_Fortran_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_Fortran_COMPILER_ID=Cray
+CMAKE_Fortran_COMPILER_LAUNCHER=
+CMAKE_Fortran_COMPILER_LOADED=1
+CMAKE_Fortran_COMPILER_RANLIB=
+CMAKE_Fortran_COMPILER_TARGET=
+CMAKE_Fortran_COMPILER_VERSION=18.0.0
+CMAKE_Fortran_COMPILER_VERSION_INTERAL=
+Change Dir: '/tmp/tmp.UlxRQ1xHLx/CMakeFiles/CMakeTmp'
+
+Run Build Command(s): /usr/bin/cmake -E env VERBOSE=1 /usr/bin/gmake -f Makefile cmTC_deb67/fast
+/usr/bin/gmake -f CMakeFiles/cmTC_deb67.dir/build.make CMakeFiles/cmTC_deb67.dir/build
+gmake[1]: Entering directory '/tmp/tmp.UlxRQ1xHLx/CMakeFiles/CMakeTmp'
+Building Fortran object CMakeFiles/cmTC_deb67.dir/CMakeFortranCompilerABI.F.o
+/opt/cray/pe/craype/2.7.33/bin/ftn -em -J. -v -c /home/generic.user/cmake/Modules/CMakeFortranCompilerABI.F -o CMakeFiles/cmTC_deb67.dir/CMakeFortranCompilerABI.F.o
+
+/opt/cray/pe/cce/18.0.1/cce/x86_64/bin/ftnfe -h cpu=x86-rome -h network=ofi -D__CRAY_X86_ROME -D__CRAYXT_COMPUTE_LINUX_TARGET -em -J. -I/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/include -I/opt/cray/pe/cce/18.0.1/cce/x86_64/include/craylibs -I/usr/include -I/opt/cray/pe/mpich/8.1.31/ofi/cray/17.0/include -I/opt/cray/pe/dsmml/0.3.0/dsmml//include -I/opt/cray/pe/libsci/24.11.0/CRAY/17.0/x86_64/include -I/usr/include -hpl=/tmp/pe_201523//pldir -usystem_mod=/opt/cray/pe/cce/18.0.1/cce/x86_64/lib/libmodules.a -usystem_mod=/opt/cray/pe/cce/18.0.1/cce/x86_64/lib/libomp.a -usystem_mod=/opt/cray/pe/cce/18.0.1/cce/x86_64/lib/omp_lib.a -usystem_mod=/opt/cray/pe/cce/18.0.1/cce/x86_64/lib/libopenacc.a -usystem_mod=/opt/cray/pe/mpich/8.1.31/ofi/cray/17.0/include -usystem_mod=/opt/cray/pe/dsmml/0.3.0/dsmml//include -usystem_mod=/opt/cray/pe/libsci/24.11.0/CRAY/17.0/x86_64/include -usystem_mod=/opt/cray/pe/cce/18.0.1/cce/x86_64/lib/libcraymp.a -ffixed -CZ/tmp/pe_201523/CMakeFortranCompilerABI.T -Cx -CX/tmp/pe_201523/CMakeFortranCompilerABI.xml -hdecompile=/tmp/tmp.UlxRQ1xHLx/CMakeFiles/CMakeTmp/CMakeFiles/cmTC_deb67.dir/CMakeFortranCompilerABI. -S /tmp/pe_201523/CMakeFortranCompilerABI_1.s -Oipa3 -ufile_id=1 /home/generic.user/cmake/Modules/CMakeFortranCompilerABI.F
+
+/opt/cray/pe/cce/18.0.1/cce/x86_64/bin/optcg /tmp/pe_201523//pldir 1
+
+/opt/cray/pe/cce/18.0.1/binutils/x86_64/x86_64-pc-linux-gnu/bin/as -o CMakeFiles/cmTC_deb67.dir/CMakeFortranCompilerABI.F.o --64 /tmp/pe_201523/CMakeFortranCompilerABI_1.s
+rm /tmp/pe_201523/CMakeFortranCompilerABI_1.s
+rm /tmp/pe_201523//pldir/PL_global_data
+rm /tmp/pe_201523//pldir/PL_module_list
+rm /tmp/pe_201523//pldir/PL_path
+rm /tmp/pe_201523//pldir/CMakeFortranCompilerABI_1.inl
+rm /tmp/pe_201523//pldir/gline_1
+rm /tmp/pe_201523//pldir/iline_1
+rmdir /tmp/pe_201523//pldir
+rm /tmp/pe_201523//CMakeFortranCompilerABI.xml
+rm /tmp/pe_201523//CMakeFortranCompilerABI.T
+rm /tmp/pe_201523//CMakeFortranCompilerABI.Tfe
+rm /tmp/pe_201523//CMakeFortranCompilerABI_1.cif.Ttmp
+rm /tmp/pe_201523//CMakeFortranCompilerABI_1.xml.Ttmp
+rmdir /tmp/pe_201523/
+Linking Fortran executable cmTC_deb67
+/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_deb67.dir/link.txt --verbose=1
+
+/opt/cray/pe/cce/18.0.1/cce/x86_64/bin/cce_omp_offload_linker -O2 --verbose -mcode-object-version=5 -- /opt/cray/pe/cce/18.0.1/binutils/x86_64/x86_64-pc-linux-gnu/bin/ld --eh-frame-hdr -m elf_x86_64 --enable-new-dtags --dynamic-linker /lib64/ld-linux-x86-64.so.2 /usr/lib64//crt1.o /usr/lib64//crti.o /usr/lib64/gcc/x86_64-suse-linux/14//crtbegin.o /usr/lib64/gcc/x86_64-suse-linux/14//crtfastmath.o /opt/cray/pe/cce/18.0.1/cce/x86_64/lib/no_mmap.o /opt/cray/pe/cce/18.0.1/cce/x86_64/lib/cce_floatingpt_au.o CMakeFiles/cmTC_deb67.dir/CMakeFortranCompilerABI.F.o -Bdynamic -rpath=/opt/cray/pe/cce/18.0.1/cce/x86_64/lib -L/opt/cray/pe/mpich/8.1.31/ofi/cray/17.0/lib -L/opt/cray/pe/dsmml/0.3.0/dsmml//lib -L/opt/cray/pe/libsci/24.11.0/CRAY/17.0/x86_64/lib -L/opt/cray/pe/cce/18.0.1/cce/x86_64/lib/pkgconfig/../ --as-needed -lsci_cray_mpi --no-as-needed --as-needed -lsci_cray --no-as-needed -ldl --as-needed -lmpifort_cray --no-as-needed --as-needed -lmpi_cray --no-as-needed --as-needed -ldsmml --no-as-needed -lstdc++ --as-needed -lpgas-shmem --no-as-needed -lquadmath -lmodules -lfi -lcraymath -lf -lu -lcsup --as-needed -lgfortran --no-as-needed -lpthread -L/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/lib/linux -L/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/lib/linux/../../../.. -lcsup -lm -lclang_rt.craypgo-x86_64 -lclang_rt.builtins-x86_64 --as-needed -lunwind --no-as-needed -lc -lclang_rt.builtins-x86_64 --as-needed -lunwind --no-as-needed --disable-new-dtags -L/usr/lib64/gcc/x86_64-suse-linux/14 -L/opt/cray/pe/cce/18.0.1/binutils/x86_64/x86_64-pc-linux-gnu/..//x86_64-unknown-linux-gnu/lib -EL -o cmTC_deb67 /usr/lib64/gcc/x86_64-suse-linux/14//crtend.o /usr/lib64//crtn.o
+Skipping unbundling of /opt/cray/pe/cce/18.0.1/cce/x86_64/lib/pkgconfig/..//libcsup.a (already processed)
+Skipping unbundling of /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/lib/linux/libclang_rt.builtins-x86_64.a (already processed)
+Skipping unbundling of /opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/lib/linux/../../../../libunwind.a (already processed)
+as /tmp/cooltmpdir-XMz91r/tmp_offload_linker-cce-openmpacc-targetbegin.s -o /tmp/cooltmpdir-XMz91r/acc-targetbegin-cce-openmp.o
+as /tmp/cooltmpdir-XMz91r/tmp_offload_linker-cce-openmpacc-targetend.s -o /tmp/cooltmpdir-XMz91r/acc-targetend-tmp-cce-openmp.o
+/opt/cray/pe/cce/18.0.1/binutils/x86_64/bin/ld --relocatable /tmp/cooltmpdir-XMz91r/acc-targetend-tmp-cce-openmp.o -o /tmp/cooltmpdir-XMz91r/acc-targetend-cce-openmp.o
+/opt/cray/pe/cce/18.0.1/binutils/x86_64/x86_64-pc-linux-gnu/bin/ld /tmp/cooltmpdir-XMz91r/acc-targetbegin-cce-openmp.o --eh-frame-hdr -m elf_x86_64 --enable-new-dtags --dynamic-linker /lib64/ld-linux-x86-64.so.2 /usr/lib64//crt1.o /usr/lib64//crti.o /usr/lib64/gcc/x86_64-suse-linux/14//crtbegin.o /usr/lib64/gcc/x86_64-suse-linux/14//crtfastmath.o /opt/cray/pe/cce/18.0.1/cce/x86_64/lib/no_mmap.o /opt/cray/pe/cce/18.0.1/cce/x86_64/lib/cce_floatingpt_au.o CMakeFiles/cmTC_deb67.dir/CMakeFortranCompilerABI.F.o -Bdynamic -rpath=/opt/cray/pe/cce/18.0.1/cce/x86_64/lib -L/opt/cray/pe/mpich/8.1.31/ofi/cray/17.0/lib -L/opt/cray/pe/dsmml/0.3.0/dsmml//lib -L/opt/cray/pe/libsci/24.11.0/CRAY/17.0/x86_64/lib -L/opt/cray/pe/cce/18.0.1/cce/x86_64/lib/pkgconfig/../ --as-needed -lsci_cray_mpi --no-as-needed --as-needed -lsci_cray --no-as-needed -ldl --as-needed -lmpifort_cray --no-as-needed --as-needed -lmpi_cray --no-as-needed --as-needed -ldsmml --no-as-needed -lstdc++ --as-needed -lpgas-shmem --no-as-needed -lquadmath -lmodules -lfi -lcraymath -lf -lu -lcsup --as-needed -lgfortran --no-as-needed -lpthread -L/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/lib/linux -L/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/lib/linux/../../../.. -lcsup -lm -lclang_rt.craypgo-x86_64 -lclang_rt.builtins-x86_64 --as-needed -lunwind --no-as-needed -lc -lclang_rt.builtins-x86_64 --as-needed -lunwind --no-as-needed --disable-new-dtags -L /usr/lib64/gcc/x86_64-suse-linux/14 -L /opt/cray/pe/cce/18.0.1/binutils/x86_64/x86_64-pc-linux-gnu/..//x86_64-unknown-linux-gnu/lib -EL -o cmTC_deb67 /usr/lib64/gcc/x86_64-suse-linux/14//crtend.o /usr/lib64//crtn.o /tmp/cooltmpdir-XMz91r/acc-targetend-cce-openmp.o
+rm '/tmp/cooltmpdir-XMz91r/tmp_offload_linker-cce-openmpacc-targetend.s'
+rm '/tmp/cooltmpdir-XMz91r/tmp_offload_linker-cce-openmpacc-targetbegin.s'
+rm '/tmp/cooltmpdir-XMz91r/acc-targetend-cce-openmp.o'
+rm '/tmp/cooltmpdir-XMz91r/acc-targetend-tmp-cce-openmp.o'
+rm '/tmp/cooltmpdir-XMz91r/acc-targetbegin-cce-openmp.o'
+rm '/tmp/cooltmpdir-XMz91r/'
+
+/opt/cray/pe/cce/18.0.1/binutils/x86_64/bin/objcopy --remove-section=.note.ftn_module_data cmTC_deb67
+rm /tmp/pe_201573//pldir/PL_global_data
+rm /tmp/pe_201573//pldir/PL_module_list
+rm /tmp/pe_201573//pldir/PL_path
+rmdir /tmp/pe_201573//pldir
+rmdir /tmp/pe_201573/
+/opt/cray/pe/craype/2.7.33/bin/ftn -v CMakeFiles/cmTC_deb67.dir/CMakeFortranCompilerABI.F.o -o cmTC_deb67
+gmake[1]: Leaving directory '/tmp/tmp.UlxRQ1xHLx/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/ParseImplicitIncludeInfo.cmake b/Tests/RunCMake/ParseImplicitIncludeInfo/ParseImplicitIncludeInfo.cmake
index c58722d..d0dcb1b 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/ParseImplicitIncludeInfo.cmake
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/ParseImplicitIncludeInfo.cmake
@@ -11,6 +11,9 @@
aix-C-IBMClang-17.1.1.2 aix-CXX-IBMClang-17.1.1.2
craype-C-Cray-8.7 craype-CXX-Cray-8.7 craype-Fortran-Cray-8.7
craype-C-Cray-9.0-hlist-ad craype-CXX-Cray-9.0-hlist-ad craype-Fortran-Cray-9.0-hlist-ad
+ craype-C-CrayClang-18.0.1 craype-CXX-CrayClang-18.0.1 craype-Fortran-Cray-18.0.1
+ craype-C-CrayClang-18.0.1-fopenmp craype-CXX-CrayClang-18.0.1-fopenmp craype-Fortran-Cray-18.0.1-homp
+ craype-C-CrayClang-18.0.1-fopenmp-accel craype-CXX-CrayClang-18.0.1-fopenmp-accel craype-Fortran-Cray-18.0.1-homp-accel
craype-C-GNU-7.3.0 craype-CXX-GNU-7.3.0 craype-Fortran-GNU-7.3.0
craype-C-Intel-18.0.2.20180210 craype-CXX-Intel-18.0.2.20180210
craype-Fortran-Intel-18.0.2.20180210
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/results/craype-C-CrayClang-18.0.1-fopenmp-accel.output b/Tests/RunCMake/ParseImplicitIncludeInfo/results/craype-C-CrayClang-18.0.1-fopenmp-accel.output
new file mode 100644
index 0000000..840f79c
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/results/craype-C-CrayClang-18.0.1-fopenmp-accel.output
@@ -0,0 +1 @@
+/opt/cray/pe/mpich/8.1.31/ofi/cray/17.0/include;/opt/cray/pe/dsmml/0.3.0/dsmml/include;/opt/cray/pe/libsci/24.11.0/CRAY/17.0/x86_64/include;/opt/rocm-6.3.0/include;/opt/rocm-6.3.0/include/rocprofiler;/opt/rocm-6.3.0/include/roctracer;/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/include;/opt/cray/pe/cce/18.0.1/cce/x86_64/include/craylibs;/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/include/llvm_libc_wrappers;/usr/local/include;/usr/x86_64-suse-linux/include;/usr/include
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/results/craype-C-CrayClang-18.0.1-fopenmp.output b/Tests/RunCMake/ParseImplicitIncludeInfo/results/craype-C-CrayClang-18.0.1-fopenmp.output
new file mode 100644
index 0000000..30e4980
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/results/craype-C-CrayClang-18.0.1-fopenmp.output
@@ -0,0 +1 @@
+/opt/cray/pe/mpich/8.1.31/ofi/cray/17.0/include;/opt/cray/pe/dsmml/0.3.0/dsmml/include;/opt/cray/pe/libsci/24.11.0/CRAY/17.0/x86_64/include;/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/include;/opt/cray/pe/cce/18.0.1/cce/x86_64/include/craylibs;/usr/local/include;/usr/x86_64-suse-linux/include;/usr/include
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/results/craype-C-CrayClang-18.0.1.output b/Tests/RunCMake/ParseImplicitIncludeInfo/results/craype-C-CrayClang-18.0.1.output
new file mode 100644
index 0000000..30e4980
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/results/craype-C-CrayClang-18.0.1.output
@@ -0,0 +1 @@
+/opt/cray/pe/mpich/8.1.31/ofi/cray/17.0/include;/opt/cray/pe/dsmml/0.3.0/dsmml/include;/opt/cray/pe/libsci/24.11.0/CRAY/17.0/x86_64/include;/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/include;/opt/cray/pe/cce/18.0.1/cce/x86_64/include/craylibs;/usr/local/include;/usr/x86_64-suse-linux/include;/usr/include
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/results/craype-CXX-CrayClang-18.0.1-fopenmp-accel.output b/Tests/RunCMake/ParseImplicitIncludeInfo/results/craype-CXX-CrayClang-18.0.1-fopenmp-accel.output
new file mode 100644
index 0000000..84b4d22
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/results/craype-CXX-CrayClang-18.0.1-fopenmp-accel.output
@@ -0,0 +1 @@
+/opt/cray/pe/mpich/8.1.31/ofi/cray/17.0/include;/opt/cray/pe/dsmml/0.3.0/dsmml/include;/opt/cray/pe/libsci/24.11.0/CRAY/17.0/x86_64/include;/opt/rocm-6.3.0/include;/opt/rocm-6.3.0/include/rocprofiler;/opt/rocm-6.3.0/include/roctracer;/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/include;/opt/cray/pe/cce/18.0.1/cce/x86_64/include/craylibs;/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/include/llvm_libc_wrappers;/usr/include/c\+\+/14;/usr/include/c\+\+/14/x86_64-suse-linux;/usr/include/c\+\+/14/backward;/usr/local/include;/usr/x86_64-suse-linux/include;/usr/include
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/results/craype-CXX-CrayClang-18.0.1-fopenmp.output b/Tests/RunCMake/ParseImplicitIncludeInfo/results/craype-CXX-CrayClang-18.0.1-fopenmp.output
new file mode 100644
index 0000000..82ff460
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/results/craype-CXX-CrayClang-18.0.1-fopenmp.output
@@ -0,0 +1 @@
+/opt/cray/pe/mpich/8.1.31/ofi/cray/17.0/include;/opt/cray/pe/dsmml/0.3.0/dsmml/include;/opt/cray/pe/libsci/24.11.0/CRAY/17.0/x86_64/include;/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/include;/opt/cray/pe/cce/18.0.1/cce/x86_64/include/craylibs;/usr/include/c\+\+/14;/usr/include/c\+\+/14/x86_64-suse-linux;/usr/include/c\+\+/14/backward;/usr/local/include;/usr/x86_64-suse-linux/include;/usr/include
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/results/craype-CXX-CrayClang-18.0.1.output b/Tests/RunCMake/ParseImplicitIncludeInfo/results/craype-CXX-CrayClang-18.0.1.output
new file mode 100644
index 0000000..82ff460
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/results/craype-CXX-CrayClang-18.0.1.output
@@ -0,0 +1 @@
+/opt/cray/pe/mpich/8.1.31/ofi/cray/17.0/include;/opt/cray/pe/dsmml/0.3.0/dsmml/include;/opt/cray/pe/libsci/24.11.0/CRAY/17.0/x86_64/include;/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/include;/opt/cray/pe/cce/18.0.1/cce/x86_64/include/craylibs;/usr/include/c\+\+/14;/usr/include/c\+\+/14/x86_64-suse-linux;/usr/include/c\+\+/14/backward;/usr/local/include;/usr/x86_64-suse-linux/include;/usr/include
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/results/craype-Fortran-Cray-18.0.1-homp-accel.output b/Tests/RunCMake/ParseImplicitIncludeInfo/results/craype-Fortran-Cray-18.0.1-homp-accel.output
new file mode 100644
index 0000000..728c7fa
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/results/craype-Fortran-Cray-18.0.1-homp-accel.output
@@ -0,0 +1 @@
+/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/include;/opt/cray/pe/cce/18.0.1/cce/x86_64/include/craylibs;/usr/include;/opt/cray/pe/mpich/8.1.31/ofi/cray/17.0/include;/opt/cray/pe/dsmml/0.3.0/dsmml/include;/opt/cray/pe/libsci/24.11.0/CRAY/17.0/x86_64/include;/opt/rocm-6.3.0/include;/opt/rocm-6.3.0/include/rocprofiler;/opt/rocm-6.3.0/include/roctracer
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/results/craype-Fortran-Cray-18.0.1-homp.output b/Tests/RunCMake/ParseImplicitIncludeInfo/results/craype-Fortran-Cray-18.0.1-homp.output
new file mode 100644
index 0000000..aad123e
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/results/craype-Fortran-Cray-18.0.1-homp.output
@@ -0,0 +1 @@
+/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/include;/opt/cray/pe/cce/18.0.1/cce/x86_64/include/craylibs;/usr/include;/opt/cray/pe/mpich/8.1.31/ofi/cray/17.0/include;/opt/cray/pe/dsmml/0.3.0/dsmml/include;/opt/cray/pe/libsci/24.11.0/CRAY/17.0/x86_64/include
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/results/craype-Fortran-Cray-18.0.1.output b/Tests/RunCMake/ParseImplicitIncludeInfo/results/craype-Fortran-Cray-18.0.1.output
new file mode 100644
index 0000000..aad123e
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/results/craype-Fortran-Cray-18.0.1.output
@@ -0,0 +1 @@
+/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/include;/opt/cray/pe/cce/18.0.1/cce/x86_64/include/craylibs;/usr/include;/opt/cray/pe/mpich/8.1.31/ofi/cray/17.0/include;/opt/cray/pe/dsmml/0.3.0/dsmml/include;/opt/cray/pe/libsci/24.11.0/CRAY/17.0/x86_64/include
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake b/Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake
index 5b4b8d8..fef216d 100644
--- a/Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake
@@ -11,6 +11,9 @@
aix-C-IBMClang-17.1.1.2 aix-CXX-IBMClang-17.1.1.2
craype-C-Cray-8.7 craype-CXX-Cray-8.7 craype-Fortran-Cray-8.7
craype-C-Cray-9.0-hlist-ad craype-CXX-Cray-9.0-hlist-ad craype-Fortran-Cray-9.0-hlist-ad
+ craype-C-CrayClang-18.0.1 craype-CXX-CrayClang-18.0.1 craype-Fortran-Cray-18.0.1
+ craype-C-CrayClang-18.0.1-fopenmp craype-CXX-CrayClang-18.0.1-fopenmp craype-Fortran-Cray-18.0.1-homp
+ craype-C-CrayClang-18.0.1-fopenmp-accel craype-CXX-CrayClang-18.0.1-fopenmp-accel craype-Fortran-Cray-18.0.1-homp-accel
craype-C-GNU-7.3.0 craype-CXX-GNU-7.3.0 craype-Fortran-GNU-7.3.0
craype-C-Intel-18.0.2.20180210 craype-CXX-Intel-18.0.2.20180210
craype-Fortran-Intel-18.0.2.20180210
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/craype-C-CrayClang-18.0.1-fopenmp-accel.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/craype-C-CrayClang-18.0.1-fopenmp-accel.output
new file mode 100644
index 0000000..d5e3cdc
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/craype-C-CrayClang-18.0.1-fopenmp-accel.output
@@ -0,0 +1,3 @@
+libs=amdhip64;sci_cray_mpi_mp;sci_cray_mp;dl;mpi_cray;mpi_gtl_hsa;dsmml;stdc\+\+;pgas-shmem;quadmath;modules;fi;craymath;f;u;csup;pthread;atomic;m;craymp;crayacc_amdgpu;unwind;pthread;c;unwind
+dirs=/opt/cray/pe/mpich/8.1.31/ofi/cray/17.0/lib;/opt/cray/pe/mpich/8.1.31/gtl/lib;/opt/cray/pe/dsmml/0.3.0/dsmml/lib;/opt/cray/pe/libsci/24.11.0/CRAY/17.0/x86_64/lib;/opt/rocm-6.3.0/lib;/opt/rocm-6.3.0/lib/rocprofiler;/opt/rocm-6.3.0/lib/roctracer;/opt/cray/pe/cce/18.0.1/cce/x86_64/lib;/usr/lib64/gcc/x86_64-suse-linux/14;/usr/lib64;/lib64;/usr/x86_64-suse-linux/lib;/lib;/usr/lib;/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib
+linker_tool=/opt/cray/pe/cce/18.0.1/cce/x86_64/bin/cce_omp_offload_linker
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/craype-C-CrayClang-18.0.1-fopenmp.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/craype-C-CrayClang-18.0.1-fopenmp.output
new file mode 100644
index 0000000..2bc7e3b
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/craype-C-CrayClang-18.0.1-fopenmp.output
@@ -0,0 +1,3 @@
+libs=sci_cray_mpi_mp;sci_cray_mp;dl;mpi_cray;dsmml;stdc\+\+;pgas-shmem;quadmath;modules;fi;craymath;f;u;csup;pthread;atomic;m;craymp;unwind;pthread;c;unwind
+dirs=/opt/cray/pe/mpich/8.1.31/ofi/cray/17.0/lib;/opt/cray/pe/dsmml/0.3.0/dsmml/lib;/opt/cray/pe/libsci/24.11.0/CRAY/17.0/x86_64/lib;/opt/cray/pe/cce/18.0.1/cce/x86_64/lib;/usr/lib64/gcc/x86_64-suse-linux/14;/usr/lib64;/lib64;/usr/x86_64-suse-linux/lib;/lib;/usr/lib;/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib
+linker_tool=/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/bin/ld.lld
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/craype-C-CrayClang-18.0.1.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/craype-C-CrayClang-18.0.1.output
new file mode 100644
index 0000000..ac78b47
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/craype-C-CrayClang-18.0.1.output
@@ -0,0 +1,3 @@
+libs=sci_cray_mpi;sci_cray;dl;mpi_cray;dsmml;stdc\+\+;pgas-shmem;quadmath;modules;fi;craymath;f;u;csup;pthread;atomic;m;unwind;c;unwind
+dirs=/opt/cray/pe/mpich/8.1.31/ofi/cray/17.0/lib;/opt/cray/pe/dsmml/0.3.0/dsmml/lib;/opt/cray/pe/libsci/24.11.0/CRAY/17.0/x86_64/lib;/opt/cray/pe/cce/18.0.1/cce/x86_64/lib;/usr/lib64/gcc/x86_64-suse-linux/14;/usr/lib64;/lib64;/usr/x86_64-suse-linux/lib;/lib;/usr/lib;/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib
+linker_tool=/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/bin/ld.lld
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/craype-CXX-CrayClang-18.0.1-fopenmp-accel.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/craype-CXX-CrayClang-18.0.1-fopenmp-accel.output
new file mode 100644
index 0000000..3900419
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/craype-CXX-CrayClang-18.0.1-fopenmp-accel.output
@@ -0,0 +1,3 @@
+libs=amdhip64;sci_cray_mpi_mp;sci_cray_mp;dl;mpi_cray;mpi_gtl_hsa;dsmml;stdc\+\+;pgas-shmem;quadmath;modules;fi;craymath;f;u;csup;pthread;atomic;m;stdc\+\+;m;craymp;crayacc_amdgpu;unwind;pthread;c;unwind
+dirs=/opt/cray/pe/mpich/8.1.31/ofi/cray/17.0/lib;/opt/cray/pe/mpich/8.1.31/gtl/lib;/opt/cray/pe/dsmml/0.3.0/dsmml/lib;/opt/cray/pe/libsci/24.11.0/CRAY/17.0/x86_64/lib;/opt/rocm-6.3.0/lib;/opt/rocm-6.3.0/lib/rocprofiler;/opt/rocm-6.3.0/lib/roctracer;/opt/cray/pe/cce/18.0.1/cce/x86_64/lib;/usr/lib64/gcc/x86_64-suse-linux/14;/usr/lib64;/lib64;/usr/x86_64-suse-linux/lib;/lib;/usr/lib;/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib
+linker_tool=/opt/cray/pe/cce/18.0.1/cce/x86_64/bin/cce_omp_offload_linker
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/craype-CXX-CrayClang-18.0.1-fopenmp.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/craype-CXX-CrayClang-18.0.1-fopenmp.output
new file mode 100644
index 0000000..963eff9
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/craype-CXX-CrayClang-18.0.1-fopenmp.output
@@ -0,0 +1,3 @@
+libs=sci_cray_mpi_mp;sci_cray_mp;dl;mpi_cray;dsmml;stdc\+\+;pgas-shmem;quadmath;modules;fi;craymath;f;u;csup;pthread;atomic;m;stdc\+\+;m;craymp;unwind;pthread;c;unwind
+dirs=/opt/cray/pe/mpich/8.1.31/ofi/cray/17.0/lib;/opt/cray/pe/dsmml/0.3.0/dsmml/lib;/opt/cray/pe/libsci/24.11.0/CRAY/17.0/x86_64/lib;/opt/cray/pe/cce/18.0.1/cce/x86_64/lib;/usr/lib64/gcc/x86_64-suse-linux/14;/usr/lib64;/lib64;/usr/x86_64-suse-linux/lib;/lib;/usr/lib;/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib
+linker_tool=/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/bin/ld.lld
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/craype-CXX-CrayClang-18.0.1.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/craype-CXX-CrayClang-18.0.1.output
new file mode 100644
index 0000000..d24e130
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/craype-CXX-CrayClang-18.0.1.output
@@ -0,0 +1,3 @@
+libs=sci_cray_mpi;sci_cray;dl;mpi_cray;dsmml;stdc\+\+;pgas-shmem;quadmath;modules;fi;craymath;f;u;csup;pthread;atomic;m;stdc\+\+;m;unwind;c;unwind
+dirs=/opt/cray/pe/mpich/8.1.31/ofi/cray/17.0/lib;/opt/cray/pe/dsmml/0.3.0/dsmml/lib;/opt/cray/pe/libsci/24.11.0/CRAY/17.0/x86_64/lib;/opt/cray/pe/cce/18.0.1/cce/x86_64/lib;/usr/lib64/gcc/x86_64-suse-linux/14;/usr/lib64;/lib64;/usr/x86_64-suse-linux/lib;/lib;/usr/lib;/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib
+linker_tool=/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/bin/ld.lld
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/craype-Fortran-Cray-18.0.1-homp-accel.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/craype-Fortran-Cray-18.0.1-homp-accel.output
new file mode 100644
index 0000000..32a0180
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/craype-Fortran-Cray-18.0.1-homp-accel.output
@@ -0,0 +1,3 @@
+libs=amdhip64;sci_cray_mpi_mp;sci_cray_mp;dl;mpifort_cray;mpi_cray;mpi_gtl_hsa;dsmml;stdc\+\+;pgas-shmem;quadmath;craymp;crayacc_amdgpu;openacc;modules;fi;craymath;f;u;csup;atomic;gfortran;pthread;csup;m;clang_rt.craypgo-x86_64;clang_rt.builtins-x86_64;unwind;c;clang_rt.builtins-x86_64;unwind
+dirs=/opt/cray/pe/mpich/8.1.31/ofi/cray/17.0/lib;/opt/cray/pe/mpich/8.1.31/gtl/lib;/opt/cray/pe/dsmml/0.3.0/dsmml/lib;/opt/cray/pe/libsci/24.11.0/CRAY/17.0/x86_64/lib;/opt/rocm-6.3.0/lib;/opt/rocm-6.3.0/lib/rocprofiler;/opt/rocm-6.3.0/lib/roctracer;/opt/cray/pe/cce/18.0.1/cce/x86_64/lib;/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/lib/linux;/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib;/usr/lib64/gcc/x86_64-suse-linux/14;/opt/cray/pe/cce/18.0.1/binutils/x86_64/x86_64-unknown-linux-gnu/lib
+linker_tool=/opt/cray/pe/cce/18.0.1/cce/x86_64/bin/cce_omp_offload_linker -O2 --arch gfx908 --verbose -mcode-object-version=5 -- /opt/cray/pe/cce/18.0.1/binutils/x86_64/x86_64-pc-linux-gnu/bin/ld
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/craype-Fortran-Cray-18.0.1-homp.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/craype-Fortran-Cray-18.0.1-homp.output
new file mode 100644
index 0000000..d63dfbf
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/craype-Fortran-Cray-18.0.1-homp.output
@@ -0,0 +1,3 @@
+libs=sci_cray_mpi_mp;sci_cray_mp;dl;mpifort_cray;mpi_cray;dsmml;stdc\+\+;pgas-shmem;quadmath;craymp;modules;fi;craymath;f;u;csup;atomic;gfortran;pthread;csup;m;clang_rt.craypgo-x86_64;clang_rt.builtins-x86_64;unwind;c;clang_rt.builtins-x86_64;unwind
+dirs=/opt/cray/pe/mpich/8.1.31/ofi/cray/17.0/lib;/opt/cray/pe/dsmml/0.3.0/dsmml/lib;/opt/cray/pe/libsci/24.11.0/CRAY/17.0/x86_64/lib;/opt/cray/pe/cce/18.0.1/cce/x86_64/lib;/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/lib/linux;/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib;/usr/lib64/gcc/x86_64-suse-linux/14;/opt/cray/pe/cce/18.0.1/binutils/x86_64/x86_64-unknown-linux-gnu/lib
+linker_tool=/opt/cray/pe/cce/18.0.1/cce/x86_64/bin/cce_omp_offload_linker -O2 --verbose -mcode-object-version=5 -- /opt/cray/pe/cce/18.0.1/binutils/x86_64/x86_64-pc-linux-gnu/bin/ld
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/craype-Fortran-Cray-18.0.1.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/craype-Fortran-Cray-18.0.1.output
new file mode 100644
index 0000000..2584d72
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/craype-Fortran-Cray-18.0.1.output
@@ -0,0 +1,3 @@
+libs=sci_cray_mpi;sci_cray;dl;mpifort_cray;mpi_cray;dsmml;stdc\+\+;pgas-shmem;quadmath;modules;fi;craymath;f;u;csup;gfortran;pthread;csup;m;clang_rt.craypgo-x86_64;clang_rt.builtins-x86_64;unwind;c;clang_rt.builtins-x86_64;unwind
+dirs=/opt/cray/pe/mpich/8.1.31/ofi/cray/17.0/lib;/opt/cray/pe/dsmml/0.3.0/dsmml/lib;/opt/cray/pe/libsci/24.11.0/CRAY/17.0/x86_64/lib;/opt/cray/pe/cce/18.0.1/cce/x86_64/lib;/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib/clang/18/lib/linux;/opt/cray/pe/cce/18.0.1/cce-clang/x86_64/lib;/usr/lib64/gcc/x86_64-suse-linux/14;/opt/cray/pe/cce/18.0.1/binutils/x86_64/x86_64-unknown-linux-gnu/lib
+linker_tool=/opt/cray/pe/cce/18.0.1/cce/x86_64/bin/cce_omp_offload_linker -O2 --verbose -mcode-object-version=5 -- /opt/cray/pe/cce/18.0.1/binutils/x86_64/x86_64-pc-linux-gnu/bin/ld
diff --git a/Tests/RunCMake/PrecompileHeaders/PchReuseFrom-CMP0141-OLD-stderr.txt b/Tests/RunCMake/PrecompileHeaders/PchReuseFrom-CMP0141-OLD-stderr.txt
new file mode 100644
index 0000000..ae26054
--- /dev/null
+++ b/Tests/RunCMake/PrecompileHeaders/PchReuseFrom-CMP0141-OLD-stderr.txt
@@ -0,0 +1,10 @@
+^CMake Deprecation Warning at PchReuseFrom-CMP0141-OLD\.cmake:[0-9]+ \(cmake_policy\):
+ The OLD behavior for policy CMP0141 will be removed from a future version
+ of CMake\.
+
+ The cmake-policies\(7\) manual explains that the OLD behaviors of all
+ policies are deprecated and that a policy should be set to OLD only under
+ specific short-term circumstances\. Projects should be ported to the NEW
+ behavior and not rely on setting a policy to OLD\.
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/Swift/CompileCommands-check.cmake b/Tests/RunCMake/Swift/CompileCommands-check.cmake
index b277c5c..0ce347a 100644
--- a/Tests/RunCMake/Swift/CompileCommands-check.cmake
+++ b/Tests/RunCMake/Swift/CompileCommands-check.cmake
@@ -8,18 +8,31 @@
set(expected_compile_commands
[==[^\[
{
- "directory": ".*(/Tests/RunCMake/Swift/CompileCommands-build|\\\\Tests\\\\RunCMake\\\\Swift\\\\CompileCommands-build)",
- "command": ".*swiftc .* (\\")?.*(/Tests/RunCMake/Swift/E.swift|\\\\Tests\\\\RunCMake\\\\Swift\\\\E.swift)(\\")? (\\")?.*(/Tests/RunCMake/Swift/L.swift|\\\\Tests\\\\RunCMake\\\\Swift\\\\L.swift)(\\")?",
- "file": ".*(/Tests/RunCMake/Swift/E.swift|\\\\Tests\\\\RunCMake\\\\Swift\\\\E.swift)",
- "output": "CMakeFiles/CompileCommandLib.dir/(Debug(/|\\))?E.swift.o|CMakeFiles\\\\CompileCommandLib.dir\\\\(Debug\\\\|Release\\\\)?E.swift.obj"
+ "directory": "[^
+]*/Tests/RunCMake/Swift/CompileCommands-build",
+ "command": "[^
+]*swiftc[^
+]* (\\")?[^
+]*(/Tests/RunCMake/Swift/E.swift|\\\\Tests\\\\RunCMake\\\\Swift\\\\E.swift)(\\")? (\\")?[^
+]*(/Tests/RunCMake/Swift/L.swift|\\\\Tests\\\\RunCMake\\\\Swift\\\\L.swift)(\\")?",
+ "file": "[^
+]*/Tests/RunCMake/Swift/E.swift",
+ "output": "[^
+]*/CMakeFiles/CompileCommandLib.dir/(Debug/)?E.swift.(o|obj)"
},
{
- "directory": ".*(/Tests/RunCMake/Swift/CompileCommands-build|\\\\Tests\\\\RunCMake\\\\Swift\\\\CompileCommands-build)",
- "command": ".*swiftc .* (\\")?.*(/Tests/RunCMake/Swift/E.swift|\\\\Tests\\\\RunCMake\\\\Swift\\\\E.swift)(\\")? (\\")?.*(/Tests/RunCMake/Swift/L.swift|\\\\Tests\\\\RunCMake\\\\Swift\\\\L.swift)(\\")?",
- "file": ".*/Tests/RunCMake/Swift/L.swift",
- "output": "CMakeFiles/CompileCommandLib.dir/(Debug(/|\\))?L.swift.o|CMakeFiles\\\\CompileCommandLib.dir\\\\(Debug\\\\|Release\\\\)?L.swift.obj"
-}
-]$]==]
+ "directory": "[^
+]*/Tests/RunCMake/Swift/CompileCommands-build",
+ "command": "[^
+]*swiftc[^
+]* (\\")?[^
+]*(/Tests/RunCMake/Swift/E.swift|\\\\Tests\\\\RunCMake\\\\Swift\\\\E.swift)(\\")? (\\")?[^
+]*(/Tests/RunCMake/Swift/L.swift|\\\\Tests\\\\RunCMake\\\\Swift\\\\L.swift)(\\")?",
+ "file": "[^
+]*/Tests/RunCMake/Swift/L.swift",
+ "output": "[^
+]*/CMakeFiles/CompileCommandLib.dir/(Debug/)?L.swift.(o|obj)"
+}]==]
)
file(READ "${RunCMake_TEST_BINARY_DIR}/compile_commands.json" compile_commands)
diff --git a/Tests/RunCMake/VS10Project/RunCMakeTest.cmake b/Tests/RunCMake/VS10Project/RunCMakeTest.cmake
index 37f780c..232e637 100644
--- a/Tests/RunCMake/VS10Project/RunCMakeTest.cmake
+++ b/Tests/RunCMake/VS10Project/RunCMakeTest.cmake
@@ -49,12 +49,14 @@
run_cmake(VsPlatformToolset)
run_cmake(VsControlFlowGuardLinkSetting)
run_cmake(VsToolOverride)
+run_cmake(VsImageVersion)
run_cmake(VsWinRTByDefault)
-set(RunCMake_GENERATOR_TOOLSET "VCTargetsPath=$(VCTargetsPath)")
-run_cmake(VsVCTargetsPath)
-unset(RunCMake_GENERATOR_TOOLSET)
+block()
+ set(RunCMake_GENERATOR_TOOLSET "VCTargetsPath=$(VCTargetsPath)")
+ run_cmake(VsVCTargetsPath)
+endblock()
if(CMAKE_C_COMPILER_ID STREQUAL "MSVC" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 19.05)
run_cmake(VsJustMyCode)
@@ -65,9 +67,8 @@
endif()
# Visual Studio 2017 has toolset version 141
-string(REPLACE "v" "" generator_toolset "${RunCMake_GENERATOR_TOOLSET}")
if (RunCMake_GENERATOR MATCHES "Visual Studio 1[0-4] 201[0-5]" OR
- (RunCMake_GENERATOR_TOOLSET AND generator_toolset VERSION_LESS "141"))
+ (RunCMake_GENERATOR_TOOLSET MATCHES "^v([0-9]+)" AND CMAKE_MATCH_1 LESS 141))
run_cmake(UnityBuildPre2017)
else()
run_cmake(UnityBuildNative)
diff --git a/Tests/RunCMake/VS10Project/VsImageVersion-check.cmake b/Tests/RunCMake/VS10Project/VsImageVersion-check.cmake
new file mode 100644
index 0000000..f0eeecd
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/VsImageVersion-check.cmake
@@ -0,0 +1,28 @@
+macro(ensure_link_version projectFile expected)
+ if(NOT EXISTS "${projectFile}")
+ set(RunCMake_TEST_FAILED "Project file ${projectFile} does not exist.")
+ return()
+ endif()
+
+ file(STRINGS "${projectFile}" lines)
+ set(version "")
+ foreach(line IN LISTS lines)
+ if(line MATCHES "<Link>")
+ set(in_link TRUE)
+ elseif(line MATCHES "</Link>")
+ if(NOT version STREQUAL "${expected}")
+ set(RunCMake_TEST_FAILED "<Version> not found or incorrect: ${version} vs ${expected}")
+ return()
+ endif()
+ set(in_link FALSE)
+ set(version "")
+ elseif(in_link AND line MATCHES "<Version>([^<]+)</Version>")
+ set(version ${CMAKE_MATCH_1})
+ endif()
+ endforeach()
+endmacro()
+
+ensure_link_version("${RunCMake_TEST_BINARY_DIR}/app-C.vcxproj" 0.1)
+ensure_link_version("${RunCMake_TEST_BINARY_DIR}/app-CXX.vcxproj" 1.0)
+ensure_link_version("${RunCMake_TEST_BINARY_DIR}/lib-C.vcxproj" 65535.65535)
+ensure_link_version("${RunCMake_TEST_BINARY_DIR}/lib-CXX.vcxproj" "")
diff --git a/Tests/RunCMake/VS10Project/VsImageVersion.cmake b/Tests/RunCMake/VS10Project/VsImageVersion.cmake
new file mode 100644
index 0000000..80e49a6
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/VsImageVersion.cmake
@@ -0,0 +1,11 @@
+enable_language(C CXX)
+
+add_executable(app-C empty.c)
+add_executable(app-CXX empty.cxx)
+add_library(lib-C SHARED empty.c)
+add_library(lib-CXX SHARED empty.cxx)
+
+set_property(TARGET app-C PROPERTY VERSION 0.1)
+set_property(TARGET app-CXX PROPERTY VERSION 1.0)
+set_property(TARGET lib-C PROPERTY VERSION 65535.65535)
+set_property(TARGET lib-CXX PROPERTY VERSION "")
diff --git a/Tests/RunCMake/XcodeProject/BundlePostBuild.cmake b/Tests/RunCMake/XcodeProject/BundlePostBuild.cmake
new file mode 100644
index 0000000..fb5c48b
--- /dev/null
+++ b/Tests/RunCMake/XcodeProject/BundlePostBuild.cmake
@@ -0,0 +1,15 @@
+enable_language(CXX)
+add_executable(app MACOSX_BUNDLE app.cxx)
+add_library(fw SHARED fw.cxx)
+set_property(TARGET fw PROPERTY FRAMEWORK 1)
+foreach(target IN ITEMS app fw)
+ set_property(TARGET ${target} PROPERTY XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT dwarf-with-dsym)
+ add_custom_command(
+ TARGET ${target} POST_BUILD
+ COMMAND ${CMAKE_COMMAND} -E sha256sum
+ [["$DWARF_DSYM_FOLDER_PATH/$DWARF_DSYM_FILE_NAME/Contents/Resources/DWARF/$PRODUCT_NAME"]]
+ [["$DWARF_DSYM_FOLDER_PATH/$DWARF_DSYM_FILE_NAME/Contents/Info.plist"]]
+ [["$TARGET_BUILD_DIR/$EXECUTABLE_PATH"]]
+ [["$TARGET_BUILD_DIR/$INFOPLIST_PATH"]]
+ )
+endforeach()
diff --git a/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake b/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake
index 5e22666..0515ec3 100644
--- a/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake
+++ b/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake
@@ -91,6 +91,13 @@
XcodeObjectLibsInTwoProjectsMacOS()
+ block()
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/BundlePostBuild-build)
+ run_cmake(BundlePostBuild)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ run_cmake_command(BundlePostBuild-build ${CMAKE_COMMAND} --build . --config Debug)
+ endblock()
+
endif()
function(XcodeSchemaGeneration)
diff --git a/Tests/RunCMake/XcodeProject/SearchPaths-stderr.txt b/Tests/RunCMake/XcodeProject/SearchPaths-stderr.txt
new file mode 100644
index 0000000..74abd7d
--- /dev/null
+++ b/Tests/RunCMake/XcodeProject/SearchPaths-stderr.txt
@@ -0,0 +1,10 @@
+^CMake Deprecation Warning at SearchPaths\.cmake:[0-9]+ \(cmake_policy\):
+ The OLD behavior for policy CMP0142 will be removed from a future version
+ of CMake\.
+
+ The cmake-policies\(7\) manual explains that the OLD behaviors of all
+ policies are deprecated and that a policy should be set to OLD only under
+ specific short-term circumstances\. Projects should be ported to the NEW
+ behavior and not rely on setting a policy to OLD\.
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/PackageInfo/test.cxx b/Tests/RunCMake/XcodeProject/app.cxx
similarity index 100%
copy from Tests/RunCMake/PackageInfo/test.cxx
copy to Tests/RunCMake/XcodeProject/app.cxx
diff --git a/Tests/RunCMake/XcodeProject/fw.cxx b/Tests/RunCMake/XcodeProject/fw.cxx
new file mode 100644
index 0000000..e08ce02
--- /dev/null
+++ b/Tests/RunCMake/XcodeProject/fw.cxx
@@ -0,0 +1,4 @@
+int fw()
+{
+ return 0;
+}
diff --git a/Tests/RunCMake/PackageInfo/BadArgs1-result.txt b/Tests/RunCMake/add_dependencies/NoArgs-result.txt
similarity index 100%
copy from Tests/RunCMake/PackageInfo/BadArgs1-result.txt
copy to Tests/RunCMake/add_dependencies/NoArgs-result.txt
diff --git a/Tests/RunCMake/add_dependencies/NoArgs-stderr.txt b/Tests/RunCMake/add_dependencies/NoArgs-stderr.txt
new file mode 100644
index 0000000..8af39ab
--- /dev/null
+++ b/Tests/RunCMake/add_dependencies/NoArgs-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at NoArgs.cmake:[0-9]+ \(add_dependencies\):
+ add_dependencies called with incorrect number of arguments
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/add_dependencies/NoArgs.cmake b/Tests/RunCMake/add_dependencies/NoArgs.cmake
new file mode 100644
index 0000000..6c6da2b
--- /dev/null
+++ b/Tests/RunCMake/add_dependencies/NoArgs.cmake
@@ -0,0 +1 @@
+add_dependencies()
diff --git a/Tests/RunCMake/add_dependencies/NoDependencies.cmake b/Tests/RunCMake/add_dependencies/NoDependencies.cmake
new file mode 100644
index 0000000..21e0b89
--- /dev/null
+++ b/Tests/RunCMake/add_dependencies/NoDependencies.cmake
@@ -0,0 +1,3 @@
+enable_language(C)
+add_library(a a.c)
+add_dependencies(a ${noDependencies})
diff --git a/Tests/RunCMake/add_dependencies/RunCMakeTest.cmake b/Tests/RunCMake/add_dependencies/RunCMakeTest.cmake
index 507d43f..502aa7c 100644
--- a/Tests/RunCMake/add_dependencies/RunCMakeTest.cmake
+++ b/Tests/RunCMake/add_dependencies/RunCMakeTest.cmake
@@ -1,5 +1,7 @@
include(RunCMake)
+run_cmake(NoArgs)
run_cmake(NoTarget)
+run_cmake(NoDependencies)
run_cmake(ReadOnlyProperty)
run_cmake(RetrieveDependencies)
diff --git a/Tests/RunCMake/export/DependOnDoubleExport-result.txt b/Tests/RunCMake/export/DependOnDifferentNamespaceExport-result.txt
similarity index 100%
copy from Tests/RunCMake/export/DependOnDoubleExport-result.txt
copy to Tests/RunCMake/export/DependOnDifferentNamespaceExport-result.txt
diff --git a/Tests/RunCMake/export/DependOnDifferentNamespaceExport-stderr.txt b/Tests/RunCMake/export/DependOnDifferentNamespaceExport-stderr.txt
new file mode 100644
index 0000000..b116088
--- /dev/null
+++ b/Tests/RunCMake/export/DependOnDifferentNamespaceExport-stderr.txt
@@ -0,0 +1,13 @@
+CMake Error in CMakeLists.txt:
+ export called with target "exported" which requires target "doubleexported"
+ that is not in this export set, but in another export set which is exported
+ multiple times with different namespaces:.*
+ .*/Tests/RunCMake/export/DependOnDifferentNamespaceExport-build/export1.cmake,.*
+ .*/Tests/RunCMake/export/DependOnDifferentNamespaceExport-build/export2.cmake.
++
+ An exported target cannot depend upon another target which is exported in
+ more than one export set or with more than one namespace. Consider
+ consolidating the exports of the "doubleexported" target to a single
+ export.
++
+CMake Generate step failed. Build files cannot be regenerated correctly.
diff --git a/Tests/RunCMake/export/DependOnDifferentNamespaceExport.cmake b/Tests/RunCMake/export/DependOnDifferentNamespaceExport.cmake
new file mode 100644
index 0000000..5f9cb69
--- /dev/null
+++ b/Tests/RunCMake/export/DependOnDifferentNamespaceExport.cmake
@@ -0,0 +1,9 @@
+add_library(doubleexported INTERFACE)
+install(TARGETS doubleexported EXPORT exportset)
+export(EXPORT exportset
+ FILE "${CMAKE_CURRENT_BINARY_DIR}/export1.cmake")
+export(EXPORT exportset NAMESPACE test::
+ FILE "${CMAKE_CURRENT_BINARY_DIR}/export2.cmake")
+add_library(exported INTERFACE)
+target_link_libraries(exported INTERFACE doubleexported)
+export(TARGETS exported FILE "${CMAKE_CURRENT_BINARY_DIR}/exports.cmake")
diff --git a/Tests/RunCMake/export/DependOnDoubleExport-result.txt b/Tests/RunCMake/export/DependOnDifferentSetExport-result.txt
similarity index 100%
rename from Tests/RunCMake/export/DependOnDoubleExport-result.txt
rename to Tests/RunCMake/export/DependOnDifferentSetExport-result.txt
diff --git a/Tests/RunCMake/export/DependOnDoubleExport-stderr.txt b/Tests/RunCMake/export/DependOnDifferentSetExport-stderr.txt
similarity index 75%
rename from Tests/RunCMake/export/DependOnDoubleExport-stderr.txt
rename to Tests/RunCMake/export/DependOnDifferentSetExport-stderr.txt
index c79b74e..499ffa9 100644
--- a/Tests/RunCMake/export/DependOnDoubleExport-stderr.txt
+++ b/Tests/RunCMake/export/DependOnDifferentSetExport-stderr.txt
@@ -1,13 +1,12 @@
CMake Error in CMakeLists.txt:
export called with target "exported" which requires target "doubleexported"
that is not in this export set, but in multiple other export sets:.*
- .*/Tests/RunCMake/export/DependOnDoubleExport-build/exportset.cmake,.*
- .*/Tests/RunCMake/export/DependOnDoubleExport-build/manual.cmake.
+ .*/Tests/RunCMake/export/DependOnDifferentSetExport-build/exportset.cmake,.*
+ .*/Tests/RunCMake/export/DependOnDifferentSetExport-build/manual.cmake.
+
An exported target cannot depend upon another target which is exported in
more than one export set or with more than one namespace. Consider
consolidating the exports of the "doubleexported" target to a single
export.
-
-
++
CMake Generate step failed. Build files cannot be regenerated correctly.
diff --git a/Tests/RunCMake/export/DependOnDifferentSetExport.cmake b/Tests/RunCMake/export/DependOnDifferentSetExport.cmake
new file mode 100644
index 0000000..8d108d7
--- /dev/null
+++ b/Tests/RunCMake/export/DependOnDifferentSetExport.cmake
@@ -0,0 +1,7 @@
+add_library(doubleexported INTERFACE)
+install(TARGETS doubleexported EXPORT exportset)
+export(TARGETS doubleexported FILE "${CMAKE_CURRENT_BINARY_DIR}/manual.cmake")
+export(EXPORT exportset FILE "${CMAKE_CURRENT_BINARY_DIR}/exportset.cmake")
+add_library(exported INTERFACE)
+target_link_libraries(exported INTERFACE doubleexported)
+export(TARGETS exported FILE "${CMAKE_CURRENT_BINARY_DIR}/exports.cmake")
diff --git a/Tests/RunCMake/export/DependOnDoubleExport.cmake b/Tests/RunCMake/export/DependOnDoubleExport.cmake
index 8d108d7..e126b3a 100644
--- a/Tests/RunCMake/export/DependOnDoubleExport.cmake
+++ b/Tests/RunCMake/export/DependOnDoubleExport.cmake
@@ -1,7 +1,7 @@
add_library(doubleexported INTERFACE)
install(TARGETS doubleexported EXPORT exportset)
-export(TARGETS doubleexported FILE "${CMAKE_CURRENT_BINARY_DIR}/manual.cmake")
-export(EXPORT exportset FILE "${CMAKE_CURRENT_BINARY_DIR}/exportset.cmake")
+export(EXPORT exportset FILE "${CMAKE_CURRENT_BINARY_DIR}/export1.cmake")
+export(EXPORT exportset FILE "${CMAKE_CURRENT_BINARY_DIR}/export2.cmake")
add_library(exported INTERFACE)
target_link_libraries(exported INTERFACE doubleexported)
export(TARGETS exported FILE "${CMAKE_CURRENT_BINARY_DIR}/exports.cmake")
diff --git a/Tests/RunCMake/export/RunCMakeTest.cmake b/Tests/RunCMake/export/RunCMakeTest.cmake
index 2dcd146..8dcea7f 100644
--- a/Tests/RunCMake/export/RunCMakeTest.cmake
+++ b/Tests/RunCMake/export/RunCMakeTest.cmake
@@ -15,6 +15,8 @@
run_cmake(ExportPropertiesUndefined)
run_cmake(DependOnNotExport)
run_cmake(DependOnDoubleExport)
+run_cmake(DependOnDifferentSetExport)
+run_cmake(DependOnDifferentNamespaceExport)
run_cmake(UnknownExport)
run_cmake(NamelinkOnlyExport)
run_cmake(SeparateNamelinkExport)
diff --git a/Tests/RunCMake/PackageInfo/BadArgs1-result.txt b/Tests/RunCMake/find_file/Optional-result.txt
similarity index 100%
copy from Tests/RunCMake/PackageInfo/BadArgs1-result.txt
copy to Tests/RunCMake/find_file/Optional-result.txt
diff --git a/Tests/RunCMake/find_file/Optional-stderr.txt b/Tests/RunCMake/find_file/Optional-stderr.txt
new file mode 100644
index 0000000..beb8a66
--- /dev/null
+++ b/Tests/RunCMake/find_file/Optional-stderr.txt
@@ -0,0 +1,10 @@
+CMake Error at Optional.cmake:[0-9]+ \(find_file\):
+ find_file cannot be both REQUIRED and OPTIONAL
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
+
+
+CMake Error at Optional\.cmake:[0-9]+ \(find_file\):
+ Could not find FILE_doNotExists using the following files: doNotExists.h
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/find_file/Optional.cmake b/Tests/RunCMake/find_file/Optional.cmake
new file mode 100644
index 0000000..dbc8de9
--- /dev/null
+++ b/Tests/RunCMake/find_file/Optional.cmake
@@ -0,0 +1,14 @@
+set(CMAKE_FIND_REQUIRED ON)
+find_file(FILE_doNotExists_Optional
+ NAMES doNotExists.h
+ OPTIONAL
+)
+find_file(FILE_doNotExists_OptionalRequired
+ NAMES doNotExists.h
+ OPTIONAL
+ REQUIRED
+)
+find_file(FILE_doNotExists
+ NAMES doNotExists.h
+ REQUIRED
+)
diff --git a/Tests/RunCMake/find_file/RunCMakeTest.cmake b/Tests/RunCMake/find_file/RunCMakeTest.cmake
index 2d59e38..54840d1 100644
--- a/Tests/RunCMake/find_file/RunCMakeTest.cmake
+++ b/Tests/RunCMake/find_file/RunCMakeTest.cmake
@@ -4,6 +4,7 @@
run_cmake(FromPrefixPath)
run_cmake(PrefixInPATH)
run_cmake(Required)
+run_cmake(Optional)
run_cmake(NO_CACHE)
run_cmake(REGISTRY_VIEW-no-view)
run_cmake(REGISTRY_VIEW-wrong-view)
diff --git a/Tests/RunCMake/PackageInfo/BadArgs1-result.txt b/Tests/RunCMake/find_library/Optional-result.txt
similarity index 100%
copy from Tests/RunCMake/PackageInfo/BadArgs1-result.txt
copy to Tests/RunCMake/find_library/Optional-result.txt
diff --git a/Tests/RunCMake/find_library/Optional-stderr.txt b/Tests/RunCMake/find_library/Optional-stderr.txt
new file mode 100644
index 0000000..d751438
--- /dev/null
+++ b/Tests/RunCMake/find_library/Optional-stderr.txt
@@ -0,0 +1,10 @@
+CMake Error at Optional.cmake:[0-9]+ \(find_library\):
+ find_library cannot be both REQUIRED and OPTIONAL
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
+
+
+CMake Error at Optional\.cmake:[0-9]+ \(find_library\):
+ Could not find LIB_doNotExists using the following names: doNotExists
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/find_library/Optional.cmake b/Tests/RunCMake/find_library/Optional.cmake
new file mode 100644
index 0000000..05cc8d0
--- /dev/null
+++ b/Tests/RunCMake/find_library/Optional.cmake
@@ -0,0 +1,13 @@
+set(CMAKE_FIND_REQUIRED ON)
+find_library(LIB_doNotExists_Optional
+ NAMES doNotExists
+ OPTIONAL
+)
+find_library(LIB_doNotExists_OptionalRequired
+ NAMES doNotExists
+ OPTIONAL
+ REQUIRED
+)
+find_library(LIB_doNotExists
+ NAMES doNotExists
+)
diff --git a/Tests/RunCMake/find_library/RunCMakeTest.cmake b/Tests/RunCMake/find_library/RunCMakeTest.cmake
index f9c8528..3f2b10b 100644
--- a/Tests/RunCMake/find_library/RunCMakeTest.cmake
+++ b/Tests/RunCMake/find_library/RunCMakeTest.cmake
@@ -12,6 +12,7 @@
endif()
run_cmake(PrefixInPATH)
run_cmake(Required)
+run_cmake(Optional)
run_cmake(NO_CACHE)
run_cmake(REGISTRY_VIEW-no-view)
run_cmake(REGISTRY_VIEW-wrong-view)
diff --git a/Tests/RunCMake/find_package/CMP0188-NEW-stderr.txt b/Tests/RunCMake/find_package/CMP0188-NEW-stderr.txt
new file mode 100644
index 0000000..bf62647
--- /dev/null
+++ b/Tests/RunCMake/find_package/CMP0188-NEW-stderr.txt
@@ -0,0 +1,4 @@
+^CMake Warning at CMP0188-NEW\.cmake:[0-9]+ \(find_package\):
+ No "FindGCCXML\.cmake" found in CMAKE_MODULE_PATH\.
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/find_package/CMP0188-NEW.cmake b/Tests/RunCMake/find_package/CMP0188-NEW.cmake
new file mode 100644
index 0000000..940169d
--- /dev/null
+++ b/Tests/RunCMake/find_package/CMP0188-NEW.cmake
@@ -0,0 +1,7 @@
+cmake_policy(SET CMP0188 NEW)
+set(_FindGCCXML_testing TRUE)
+find_package(GCCXML MODULE)
+
+if(_FindGCCXML_included)
+ message(FATAL_ERROR "FindGCCXML.cmake erroneously included")
+endif()
diff --git a/Tests/RunCMake/find_package/CMP0188-OLD.cmake b/Tests/RunCMake/find_package/CMP0188-OLD.cmake
new file mode 100644
index 0000000..dc48c43
--- /dev/null
+++ b/Tests/RunCMake/find_package/CMP0188-OLD.cmake
@@ -0,0 +1,7 @@
+cmake_policy(SET CMP0188 OLD)
+set(_FindGCCXML_testing TRUE)
+find_package(GCCXML MODULE)
+
+if(NOT _FindGCCXML_included)
+ message(FATAL_ERROR "FindGCCXML.cmake not included")
+endif()
diff --git a/Tests/RunCMake/find_package/CMP0188-WARN-stderr.txt b/Tests/RunCMake/find_package/CMP0188-WARN-stderr.txt
new file mode 100644
index 0000000..de3b9f8
--- /dev/null
+++ b/Tests/RunCMake/find_package/CMP0188-WARN-stderr.txt
@@ -0,0 +1,8 @@
+CMake Warning \(dev\) at CMP0188-WARN\.cmake:[0-9]+ \(find_package\):
+ Policy CMP0188 is not set: The FindGCCXML module is removed\. Run "cmake
+ --help-policy CMP0188" for policy details\. Use the cmake_policy command to
+ set the policy and suppress this warning\.
+
+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/find_package/CMP0188-WARN.cmake b/Tests/RunCMake/find_package/CMP0188-WARN.cmake
new file mode 100644
index 0000000..5931da5
--- /dev/null
+++ b/Tests/RunCMake/find_package/CMP0188-WARN.cmake
@@ -0,0 +1,6 @@
+set(_FindGCCXML_testing TRUE)
+find_package(GCCXML MODULE)
+
+if(NOT _FindGCCXML_included)
+ message(FATAL_ERROR "FindGCCXML.cmake not included")
+endif()
diff --git a/Tests/RunCMake/find_package/MissingNormalForceRequired-stderr.txt b/Tests/RunCMake/find_package/MissingNormalForceRequired-stderr.txt
index f6c0b44..02a8e0a 100644
--- a/Tests/RunCMake/find_package/MissingNormalForceRequired-stderr.txt
+++ b/Tests/RunCMake/find_package/MissingNormalForceRequired-stderr.txt
@@ -1,5 +1,9 @@
CMake Error at MissingNormalForceRequired.cmake:2 \(find_package\):
No "FindNotHere.cmake" found in CMAKE_MODULE_PATH\.
+
+ This package is considered required because the
+ CMAKE_REQUIRE_FIND_PACKAGE_NotHere variable has been enabled.
+
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
+
diff --git a/Tests/RunCMake/PackageInfo/BadArgs1-result.txt b/Tests/RunCMake/find_package/PackageVarOverridesOptional-result.txt
similarity index 100%
copy from Tests/RunCMake/PackageInfo/BadArgs1-result.txt
copy to Tests/RunCMake/find_package/PackageVarOverridesOptional-result.txt
diff --git a/Tests/RunCMake/find_package/PackageVarOverridesOptional-stderr.txt b/Tests/RunCMake/find_package/PackageVarOverridesOptional-stderr.txt
new file mode 100644
index 0000000..4f3d181
--- /dev/null
+++ b/Tests/RunCMake/find_package/PackageVarOverridesOptional-stderr.txt
@@ -0,0 +1,20 @@
+CMake Error at PackageVarOverridesOptional.cmake:[0-9]+ \(find_package\):
+ By not providing "FindFoo.cmake" in CMAKE_MODULE_PATH this project has
+ asked CMake to find a package configuration file provided by "Foo", but
+ CMake did not find one.
+
+ Could not find a package configuration file provided by "Foo" with any of
+ the following names:
+
+ FooConfig.cmake
+ foo-config.cmake
+
+ Add the installation prefix of "Foo" to CMAKE_PREFIX_PATH or set "Foo_DIR"
+ to a directory containing one of the above files. If "Foo" provides a
+ separate development package or SDK, be sure it has been installed.
+
+ This package is considered required because the
+ CMAKE_REQUIRE_FIND_PACKAGE_Foo variable has been enabled.
+
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/find_package/PackageVarOverridesOptional.cmake b/Tests/RunCMake/find_package/PackageVarOverridesOptional.cmake
new file mode 100644
index 0000000..8362a4d
--- /dev/null
+++ b/Tests/RunCMake/find_package/PackageVarOverridesOptional.cmake
@@ -0,0 +1,2 @@
+set(CMAKE_REQUIRE_FIND_PACKAGE_Foo ON)
+find_package(Foo OPTIONAL)
diff --git a/Tests/RunCMake/PackageInfo/BadArgs1-result.txt b/Tests/RunCMake/find_package/RequiredOptionalKeywordsClash-result.txt
similarity index 100%
copy from Tests/RunCMake/PackageInfo/BadArgs1-result.txt
copy to Tests/RunCMake/find_package/RequiredOptionalKeywordsClash-result.txt
diff --git a/Tests/RunCMake/find_package/RequiredOptionalKeywordsClash-stderr.txt b/Tests/RunCMake/find_package/RequiredOptionalKeywordsClash-stderr.txt
new file mode 100644
index 0000000..6bf3a8c
--- /dev/null
+++ b/Tests/RunCMake/find_package/RequiredOptionalKeywordsClash-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at RequiredOptionalKeywordsClash.cmake:[0-9]+ \(find_package\):
+ find_package cannot be both REQUIRED and OPTIONAL
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/find_package/RequiredOptionalKeywordsClash.cmake b/Tests/RunCMake/find_package/RequiredOptionalKeywordsClash.cmake
new file mode 100644
index 0000000..964d659
--- /dev/null
+++ b/Tests/RunCMake/find_package/RequiredOptionalKeywordsClash.cmake
@@ -0,0 +1 @@
+find_package(Foo OPTIONAL REQUIRED)
diff --git a/Tests/RunCMake/find_package/RequiredVarNested-stderr.txt b/Tests/RunCMake/find_package/RequiredVarNested-stderr.txt
new file mode 100644
index 0000000..367149f
--- /dev/null
+++ b/Tests/RunCMake/find_package/RequiredVarNested-stderr.txt
@@ -0,0 +1,18 @@
+CMake Warning at RequiredVarNestedConfig\.cmake:[0-9]+ \(find_package\):
+ By not providing "FindDoesNotExist\.cmake" in CMAKE_MODULE_PATH this project
+ has asked CMake to find a package configuration file provided by
+ "DoesNotExist", but CMake did not find one\.
+
+ Could not find a package configuration file provided by "DoesNotExist" with
+ any of the following names:
+
+ DoesNotExistConfig.cmake
+ doesnotexist-config.cmake
+
+ Add the installation prefix of "DoesNotExist" to CMAKE_PREFIX_PATH or set
+ "DoesNotExist_DIR" to a directory containing one of the above files\. If
+ "DoesNotExist" provides a separate development package or SDK, be sure it
+ has been installed\.
+Call Stack \(most recent call first\):
+ RequiredVarNested.cmake:[0-9]+ \(find_package\)
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/find_package/RequiredVarNested.cmake b/Tests/RunCMake/find_package/RequiredVarNested.cmake
new file mode 100644
index 0000000..58caed0
--- /dev/null
+++ b/Tests/RunCMake/find_package/RequiredVarNested.cmake
@@ -0,0 +1,3 @@
+set(CMAKE_FIND_REQUIRED ON CACHE BOOL "") # The cache entry must be shadowed by a nested definition.
+set(RequiredVarNested_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
+find_package(RequiredVarNested CONFIG)
diff --git a/Tests/RunCMake/find_package/RequiredVarNestedConfig.cmake b/Tests/RunCMake/find_package/RequiredVarNestedConfig.cmake
new file mode 100644
index 0000000..c3c9973
--- /dev/null
+++ b/Tests/RunCMake/find_package/RequiredVarNestedConfig.cmake
@@ -0,0 +1,8 @@
+if (CMAKE_FIND_REQUIRED)
+ message(FATAL_ERROR "CMAKE_FIND_REQUIRED enabled in Config.cmake")
+endif()
+find_package(DoesNotExist)
+find_library(library DoesNotExist)
+find_program(program DoesNotExist)
+find_path(path DoesNotExist)
+find_file(file DoesNotExist)
diff --git a/Tests/RunCMake/PackageInfo/BadArgs1-result.txt b/Tests/RunCMake/find_package/RequiredVarOptional-result.txt
similarity index 100%
copy from Tests/RunCMake/PackageInfo/BadArgs1-result.txt
copy to Tests/RunCMake/find_package/RequiredVarOptional-result.txt
diff --git a/Tests/RunCMake/find_package/RequiredVarOptional-stderr.txt b/Tests/RunCMake/find_package/RequiredVarOptional-stderr.txt
new file mode 100644
index 0000000..40dc5ef
--- /dev/null
+++ b/Tests/RunCMake/find_package/RequiredVarOptional-stderr.txt
@@ -0,0 +1,21 @@
+CMake Error at RequiredVarOptional.cmake:[0-9]+ \(find_package\):
+ By not providing "FindDoesNotExist.cmake" in CMAKE_MODULE_PATH this project
+ has asked CMake to find a package configuration file provided by
+ "DoesNotExist", but CMake did not find one.
+
+ Could not find a package configuration file provided by "DoesNotExist" with
+ any of the following names:
+
+ DoesNotExistConfig.cmake
+ doesnotexist-config.cmake
+
+ Add the installation prefix of "DoesNotExist" to CMAKE_PREFIX_PATH or set
+ "DoesNotExist_DIR" to a directory containing one of the above files. If
+ "DoesNotExist" provides a separate development package or SDK, be sure it
+ has been installed.
+
+ This package is considered required because the CMAKE_FIND_REQUIRED
+ variable has been enabled.
+
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/find_package/RequiredVarOptional.cmake b/Tests/RunCMake/find_package/RequiredVarOptional.cmake
new file mode 100644
index 0000000..8653440
--- /dev/null
+++ b/Tests/RunCMake/find_package/RequiredVarOptional.cmake
@@ -0,0 +1,4 @@
+set(CMAKE_FIND_REQUIRED ON)
+find_package(DoesNotExist-Optional OPTIONAL CompA CompB CompC)
+find_package(DoesNotExist)
+message(FATAL_ERROR "This error must not be reachable.")
diff --git a/Tests/RunCMake/find_package/RunCMakeTest.cmake b/Tests/RunCMake/find_package/RunCMakeTest.cmake
index 0552535..0c05d2d 100644
--- a/Tests/RunCMake/find_package/RunCMakeTest.cmake
+++ b/Tests/RunCMake/find_package/RunCMakeTest.cmake
@@ -27,9 +27,13 @@
run_cmake(PackageRoot)
run_cmake(PackageRootNestedConfig)
run_cmake(PackageRootNestedModule)
+run_cmake(PackageVarOverridesOptional)
run_cmake(PolicyPush)
run_cmake(PolicyPop)
run_cmake(RequiredOptionValuesClash)
+run_cmake(RequiredOptionalKeywordsClash)
+run_cmake(RequiredVarOptional)
+run_cmake(RequiredVarNested)
run_cmake(FindRootPathAndPrefixPathAreEqual)
run_cmake(SetFoundFALSE)
run_cmake(WrongVersion)
@@ -57,6 +61,9 @@
run_cmake(CMP0167-OLD)
run_cmake(CMP0167-WARN)
run_cmake(CMP0167-NEW)
+run_cmake(CMP0188-OLD)
+run_cmake(CMP0188-WARN)
+run_cmake(CMP0188-NEW)
run_cmake(WrongVersionRange)
run_cmake(EmptyVersionRange)
run_cmake(VersionRangeWithEXACT)
diff --git a/Tests/RunCMake/PackageInfo/BadArgs1-result.txt b/Tests/RunCMake/find_path/Optional-result.txt
similarity index 100%
copy from Tests/RunCMake/PackageInfo/BadArgs1-result.txt
copy to Tests/RunCMake/find_path/Optional-result.txt
diff --git a/Tests/RunCMake/find_path/Optional-stderr.txt b/Tests/RunCMake/find_path/Optional-stderr.txt
new file mode 100644
index 0000000..45c4bc0
--- /dev/null
+++ b/Tests/RunCMake/find_path/Optional-stderr.txt
@@ -0,0 +1,10 @@
+CMake Error at Optional.cmake:[0-9]+ \(find_path\):
+ find_path cannot be both REQUIRED and OPTIONAL
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
+
+
+CMake Error at Optional\.cmake:[0-9]+ \(find_path\):
+ Could not find PATH_doNotExists using the following files: doNotExists.h
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/find_path/Optional.cmake b/Tests/RunCMake/find_path/Optional.cmake
new file mode 100644
index 0000000..0fff241
--- /dev/null
+++ b/Tests/RunCMake/find_path/Optional.cmake
@@ -0,0 +1,13 @@
+set(CMAKE_FIND_REQUIRED ON)
+find_path(PATH_doNotExists_Optional
+ NAMES doNotExists.h
+ OPTIONAL
+)
+find_path(PATH_doNotExists_OptionalRequired
+ NAMES doNotExists.h
+ OPTIONAL
+ REQUIRED
+)
+find_path(PATH_doNotExists
+ NAMES doNotExists.h
+)
diff --git a/Tests/RunCMake/find_path/RunCMakeTest.cmake b/Tests/RunCMake/find_path/RunCMakeTest.cmake
index 2ed4d7d..dc4b692 100644
--- a/Tests/RunCMake/find_path/RunCMakeTest.cmake
+++ b/Tests/RunCMake/find_path/RunCMakeTest.cmake
@@ -4,6 +4,7 @@
run_cmake(FromPATHEnv)
run_cmake(PrefixInPATH)
run_cmake(Required)
+run_cmake(Optional)
run_cmake(NO_CACHE)
run_cmake(REGISTRY_VIEW-no-view)
run_cmake(REGISTRY_VIEW-wrong-view)
diff --git a/Tests/RunCMake/PackageInfo/BadArgs1-result.txt b/Tests/RunCMake/find_program/Optional-result.txt
similarity index 100%
copy from Tests/RunCMake/PackageInfo/BadArgs1-result.txt
copy to Tests/RunCMake/find_program/Optional-result.txt
diff --git a/Tests/RunCMake/find_program/Optional-stderr.txt b/Tests/RunCMake/find_program/Optional-stderr.txt
new file mode 100644
index 0000000..06b836e
--- /dev/null
+++ b/Tests/RunCMake/find_program/Optional-stderr.txt
@@ -0,0 +1,10 @@
+CMake Error at Optional.cmake:[0-9]+ \(find_program\):
+ find_program cannot be both REQUIRED and OPTIONAL
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
+
+
+CMake Error at Optional\.cmake:[0-9]+ \(find_program\):
+ Could not find PROG_AandB using the following names: testAandB
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/find_program/Optional.cmake b/Tests/RunCMake/find_program/Optional.cmake
new file mode 100644
index 0000000..7ef995d
--- /dev/null
+++ b/Tests/RunCMake/find_program/Optional.cmake
@@ -0,0 +1,13 @@
+set(CMAKE_FIND_REQUIRED ON)
+find_program(PROG_AandB_Optional
+ NAMES testAandB
+ OPTIONAL
+)
+find_program(PROG_AandB_OptionalRequired
+ NAMES testAandB
+ OPTIONAL
+ REQUIRED
+)
+find_program(PROG_AandB
+ NAMES testAandB
+)
diff --git a/Tests/RunCMake/find_program/RunCMakeTest.cmake b/Tests/RunCMake/find_program/RunCMakeTest.cmake
index f8ecb8f..c7a10bb 100644
--- a/Tests/RunCMake/find_program/RunCMakeTest.cmake
+++ b/Tests/RunCMake/find_program/RunCMakeTest.cmake
@@ -5,6 +5,7 @@
run_cmake(NamesPerDir)
run_cmake(RelAndAbsPath)
run_cmake(Required)
+run_cmake(Optional)
run_cmake(NO_CACHE)
run_cmake(IgnorePrefixPath)
run_cmake(REGISTRY_VIEW-no-view)
diff --git a/Tests/RunCMake/PackageInfo/ExperimentalGate-result.txt b/Tests/RunCMake/include/CMP0188-NEW-name-result.txt
similarity index 100%
copy from Tests/RunCMake/PackageInfo/ExperimentalGate-result.txt
copy to Tests/RunCMake/include/CMP0188-NEW-name-result.txt
diff --git a/Tests/RunCMake/include/CMP0188-NEW-name-stderr.txt b/Tests/RunCMake/include/CMP0188-NEW-name-stderr.txt
new file mode 100644
index 0000000..0a86d22
--- /dev/null
+++ b/Tests/RunCMake/include/CMP0188-NEW-name-stderr.txt
@@ -0,0 +1,6 @@
+^CMake Error at CMP0188-NEW-name\.cmake:[0-9]+ \(include\):
+ include could not find requested file:
+
+ FindGCCXML
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/include/CMP0188-NEW-name.cmake b/Tests/RunCMake/include/CMP0188-NEW-name.cmake
new file mode 100644
index 0000000..3cce95c
--- /dev/null
+++ b/Tests/RunCMake/include/CMP0188-NEW-name.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0188 NEW)
+include(FindGCCXML)
diff --git a/Tests/RunCMake/PackageInfo/BadArgs1-result.txt b/Tests/RunCMake/include/CMP0188-NEW-path-result.txt
similarity index 100%
copy from Tests/RunCMake/PackageInfo/BadArgs1-result.txt
copy to Tests/RunCMake/include/CMP0188-NEW-path-result.txt
diff --git a/Tests/RunCMake/include/CMP0188-NEW-path-stderr.txt b/Tests/RunCMake/include/CMP0188-NEW-path-stderr.txt
new file mode 100644
index 0000000..f030d7c
--- /dev/null
+++ b/Tests/RunCMake/include/CMP0188-NEW-path-stderr.txt
@@ -0,0 +1,6 @@
+^CMake Error at [^
+]*/Modules/FindGCCXML.cmake:[0-9]+ \(message\):
+ The FindGCCXML module has been removed by policy CMP0188\.
+Call Stack \(most recent call first\):
+ CMP0188-NEW-path\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/include/CMP0188-NEW-path.cmake b/Tests/RunCMake/include/CMP0188-NEW-path.cmake
new file mode 100644
index 0000000..efc195a
--- /dev/null
+++ b/Tests/RunCMake/include/CMP0188-NEW-path.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0188 NEW)
+include(${CMAKE_ROOT}/Modules/FindGCCXML.cmake)
diff --git a/Tests/RunCMake/include/CMP0188-OLD.cmake b/Tests/RunCMake/include/CMP0188-OLD.cmake
new file mode 100644
index 0000000..34d5ad4
--- /dev/null
+++ b/Tests/RunCMake/include/CMP0188-OLD.cmake
@@ -0,0 +1,7 @@
+cmake_policy(SET CMP0188 OLD)
+set(_FindGCCXML_testing 1)
+include(FindGCCXML)
+
+if(NOT _FindGCCXML_included)
+ message(FATAL_ERROR "FindGCCXML.cmake not included")
+endif()
diff --git a/Tests/RunCMake/include/CMP0188-WARN-stderr.txt b/Tests/RunCMake/include/CMP0188-WARN-stderr.txt
new file mode 100644
index 0000000..c07bb89
--- /dev/null
+++ b/Tests/RunCMake/include/CMP0188-WARN-stderr.txt
@@ -0,0 +1,8 @@
+^CMake Warning \(dev\) at CMP0188-WARN\.cmake:[0-9]+ \(include\):
+ Policy CMP0188 is not set: The FindGCCXML module is removed\. Run "cmake
+ --help-policy CMP0188" for policy details\. Use the cmake_policy command to
+ set the policy and suppress this warning\.
+
+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/include/CMP0188-WARN.cmake b/Tests/RunCMake/include/CMP0188-WARN.cmake
new file mode 100644
index 0000000..99d3557
--- /dev/null
+++ b/Tests/RunCMake/include/CMP0188-WARN.cmake
@@ -0,0 +1,7 @@
+# Do not set CMP0188.
+set(_FindGCCXML_testing 1)
+include(FindGCCXML)
+
+if(NOT _FindGCCXML_included)
+ message(FATAL_ERROR "FindGCCXML.cmake not included")
+endif()
diff --git a/Tests/RunCMake/include/RunCMakeTest.cmake b/Tests/RunCMake/include/RunCMakeTest.cmake
index 68a08bb..994f2a5 100644
--- a/Tests/RunCMake/include/RunCMakeTest.cmake
+++ b/Tests/RunCMake/include/RunCMakeTest.cmake
@@ -25,3 +25,8 @@
run_cmake(CMP0167-WARN)
run_cmake(CMP0167-NEW-name)
run_cmake(CMP0167-NEW-path)
+
+run_cmake(CMP0188-OLD)
+run_cmake(CMP0188-WARN)
+run_cmake(CMP0188-NEW-name)
+run_cmake(CMP0188-NEW-path)
diff --git a/Tests/RunCMake/list/CMP0186.cmake b/Tests/RunCMake/list/CMP0186.cmake
new file mode 100644
index 0000000..088b03e
--- /dev/null
+++ b/Tests/RunCMake/list/CMP0186.cmake
@@ -0,0 +1,43 @@
+set(mylist 0000 1001 0002)
+
+# OLD
+cmake_policy(SET CMP0186 OLD)
+
+unset(output)
+list(TRANSFORM mylist REPLACE "^0" "" OUTPUT_VARIABLE output)
+if (NOT output STREQUAL ";1001;2")
+ message(FATAL_ERROR "TRANSFORM(REPLACE) is \"${output}\", expected is \";1001;2\"")
+endif()
+
+unset(output)
+list(TRANSFORM mylist REPLACE "^(a|0)" "x" OUTPUT_VARIABLE output)
+if (NOT output STREQUAL "xxxx;1001;xxx2")
+ message(FATAL_ERROR "TRANSFORM(REPLACE) is \"${output}\", expected is \"xxxx;1001;xxx2\"")
+endif()
+
+unset(output)
+list(TRANSFORM mylist REPLACE "(1|^)0" "x" OUTPUT_VARIABLE output)
+if (NOT output STREQUAL "xxxx;xx1;xxx2")
+ message(FATAL_ERROR "TRANSFORM(REPLACE) is \"${output}\", expected is \"xxxx;xx1;xxx2\"")
+endif()
+
+# NEW, same cases as above
+cmake_policy(SET CMP0186 NEW)
+
+unset(output)
+list(TRANSFORM mylist REPLACE "^0" "" OUTPUT_VARIABLE output)
+if (NOT output STREQUAL "000;1001;002")
+ message(FATAL_ERROR "TRANSFORM(REPLACE) is \"${output}\", expected is \"000;1001;002\"")
+endif()
+
+unset(output)
+list(TRANSFORM mylist REPLACE "^(a|0)" "x" OUTPUT_VARIABLE output)
+if (NOT output STREQUAL "x000;1001;x002")
+ message(FATAL_ERROR "TRANSFORM(REPLACE) is \"${output}\", expected is \"x000;1001;x002\"")
+endif()
+
+unset(output)
+list(TRANSFORM mylist REPLACE "(1|^)0" "x" OUTPUT_VARIABLE output)
+if (NOT output STREQUAL "x000;x01;x002")
+ message(FATAL_ERROR "TRANSFORM(REPLACE) is \"${output}\", expected is \"x000;xx1;x002\"")
+endif()
diff --git a/Tests/RunCMake/list/RunCMakeTest.cmake b/Tests/RunCMake/list/RunCMakeTest.cmake
index 1b67635..e428cd0 100644
--- a/Tests/RunCMake/list/RunCMakeTest.cmake
+++ b/Tests/RunCMake/list/RunCMakeTest.cmake
@@ -90,6 +90,7 @@
run_cmake(TRANSFORM-APPEND)
run_cmake(TRANSFORM-PREPEND)
run_cmake(TRANSFORM-REPLACE)
+run_cmake(CMP0186)
# argument tests
run_cmake(SORT-WrongOption)
diff --git a/Tests/RunCMake/return/CMP0140-OLD-stderr.txt b/Tests/RunCMake/return/CMP0140-OLD-stderr.txt
new file mode 100644
index 0000000..bcd37c2
--- /dev/null
+++ b/Tests/RunCMake/return/CMP0140-OLD-stderr.txt
@@ -0,0 +1,10 @@
+^CMake Deprecation Warning at CMP0140-OLD\.cmake:[0-9]+ \(cmake_policy\):
+ The OLD behavior for policy CMP0140 will be removed from a future version
+ of CMake\.
+
+ The cmake-policies\(7\) manual explains that the OLD behaviors of all
+ policies are deprecated and that a policy should be set to OLD only under
+ specific short-term circumstances\. Projects should be ported to the NEW
+ behavior and not rely on setting a policy to OLD\.
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/string/CMP0186.cmake b/Tests/RunCMake/string/CMP0186.cmake
new file mode 100644
index 0000000..bc9dcf8
--- /dev/null
+++ b/Tests/RunCMake/string/CMP0186.cmake
@@ -0,0 +1,90 @@
+function(check_output name expected)
+ set(output "${${name}}")
+ if(NOT output STREQUAL expected)
+ message(FATAL_ERROR "\"string(REGEX)\" set ${name} to \"${output}\", expected \"${expected}\"")
+ endif()
+endfunction()
+
+# OLD
+cmake_policy(SET CMP0186 OLD)
+
+string(REGEX MATCHALL "^0" out "0000")
+check_output(out "0;0;0;0")
+
+string(REGEX MATCHALL "^0+" out "0000")
+check_output(out "0000")
+
+string(REGEX MATCHALL "^(0|a)" out "0000" )
+check_output(out "0;0;0;0")
+
+string(REGEX MATCHALL "^(0|a)" out "aaaa")
+check_output(out "a;a;a;a")
+
+string(REGEX MATCHALL "^(0|a)" out "a0a0")
+check_output(out "a;0;a;0")
+
+string(REGEX MATCHALL "(^|a)0" out "00a0")
+check_output(out "0;0;a0")
+
+string(REGEX REPLACE "^0" "" out "0000")
+check_output(out "")
+
+string(REGEX REPLACE "^0" "x" out "0000")
+check_output(out "xxxx")
+
+string(REGEX REPLACE "^0+" "x" out "0000")
+check_output(out "x")
+
+string(REGEX REPLACE "^(0|a)" "x" out "0000")
+check_output(out "xxxx")
+
+string(REGEX REPLACE "^(0|a)" "x" out "aaaa")
+check_output(out "xxxx")
+
+string(REGEX REPLACE "^(0|a)" "x" out "a0a0")
+check_output(out "xxxx")
+
+string(REGEX REPLACE "(^|a)0" "x" out "00a0")
+check_output(out "xxx")
+
+# NEW, same cases as above
+cmake_policy(SET CMP0186 NEW)
+
+string(REGEX MATCHALL "^0" out "0000")
+check_output(out "0")
+
+string(REGEX MATCHALL "^0+" out "0000")
+check_output(out "0000")
+
+string(REGEX MATCHALL "^(0|a)" out "0000")
+check_output(out "0")
+
+string(REGEX MATCHALL "^(0|a)" out "aaaa")
+check_output(out "a")
+
+string(REGEX MATCHALL "^(0|a)" out "a0a0")
+check_output(out "a")
+
+string(REGEX MATCHALL "(^|a)0" out "00a0")
+check_output(out "0;a0")
+
+string(REGEX REPLACE "^0" "" out "0000")
+check_output(out "000")
+
+string(REGEX REPLACE "^0" "x" out "0000")
+check_output(out "x000")
+
+string(REGEX REPLACE "^0+" "x" out "0000")
+check_output(out "x")
+
+string(REGEX REPLACE "^(0|a)" "x" out "0000")
+check_output(out "x000")
+
+string(REGEX REPLACE "^(0|a)" "x" out "aaaa")
+check_output(out "xaaa")
+
+string(REGEX REPLACE "^(0|a)" "x" out "a0a0")
+check_output(out "x0a0")
+
+string(REGEX REPLACE "(^|a)0" "x" out "00a0")
+check_output(out "x0x")
diff --git a/Tests/RunCMake/string/RegexEmptyMatch.cmake b/Tests/RunCMake/string/RegexEmptyMatch.cmake
new file mode 100644
index 0000000..1510137
--- /dev/null
+++ b/Tests/RunCMake/string/RegexEmptyMatch.cmake
@@ -0,0 +1,143 @@
+cmake_policy(SET CMP0186 NEW)
+
+function(check_output name expected)
+ set(output "${${name}}")
+ if(NOT output STREQUAL expected)
+ message(FATAL_ERROR "\"string(REGEX)\" set ${name} to \"${output}\", expected \"${expected}\"")
+ endif()
+endfunction()
+
+# Zero-length matches in REGEX MATCH
+
+string(REGEX MATCH "" out "")
+check_output(out "")
+
+string(REGEX MATCH "" out "a")
+check_output(out "")
+
+string(REGEX MATCH "a*" out "")
+check_output(out "")
+
+string(REGEX MATCH "a*" out "a")
+check_output(out "a")
+
+string(REGEX MATCH "a*" out "b")
+check_output(out "")
+
+string(REGEX MATCH "a*" out "ba")
+check_output(out "")
+
+# Zero-length matches in REGEX MATCHALL
+
+string(REGEX MATCHALL "" out "")
+check_output(out "")
+
+string(REGEX MATCHALL "" out "ab")
+check_output(out ";;")
+
+string(REGEX MATCHALL "^" out "ab")
+check_output(out "")
+
+string(REGEX MATCHALL "(^|,)" out "a,b")
+check_output(out ";,")
+
+string(REGEX MATCHALL "(,|^)" out "a,b")
+check_output(out ";,")
+
+string(REGEX MATCHALL "(^|)" out "")
+check_output(out "")
+
+string(REGEX MATCHALL "(^|)" out "ab")
+check_output(out ";;")
+
+string(REGEX MATCHALL "a|^" out "ab")
+check_output(out "a")
+
+string(REGEX MATCHALL "$" out "ab")
+check_output(out "")
+
+string(REGEX MATCHALL "($|,)" out "a,b")
+check_output(out ",;")
+
+string(REGEX MATCHALL "(,|$)" out "a,b")
+check_output(out ",;")
+
+string(REGEX MATCHALL "(|$)" out "")
+check_output(out "")
+
+string(REGEX MATCHALL "(|$)" out "ab")
+check_output(out ";;")
+
+string(REGEX MATCHALL "(b|)" out "abc")
+check_output(out ";b;;")
+
+string(REGEX MATCHALL "(|b)" out "abc")
+check_output(out ";;b;;")
+
+string(REGEX MATCHALL "a*" out "aaa")
+check_output(out "aaa;")
+
+string(REGEX MATCHALL "(a)?(b)?" out "")
+check_output(out "")
+
+string(REGEX MATCHALL "(a)?(b)?" out "abba")
+check_output(out "ab;b;a;")
+
+# Zero-length matches in REGEX REPLACE
+
+string(REGEX REPLACE "" "" out "")
+check_output(out "")
+
+string(REGEX REPLACE "" "x" out "")
+check_output(out "x")
+
+string(REGEX REPLACE "" "x" out "ab")
+check_output(out "xaxbx")
+
+string(REGEX REPLACE "^" "x" out "ab")
+check_output(out "xab")
+
+string(REGEX REPLACE "(^|,)" "x" out "a,b")
+check_output(out "xaxb")
+
+string(REGEX REPLACE "(,|^)" "x" out "a,b")
+check_output(out "xaxb")
+
+string(REGEX REPLACE "(^|)" "x" out "")
+check_output(out "x")
+
+string(REGEX REPLACE "(^|)" "x" out "ab")
+check_output(out "xaxbx")
+
+string(REGEX REPLACE "a|^" "x" out "ab")
+check_output(out "xb")
+
+string(REGEX REPLACE "$" "x" out "ab")
+check_output(out "abx")
+
+string(REGEX REPLACE "($|,)" "x" out "a,b")
+check_output(out "axbx")
+
+string(REGEX REPLACE "(,|$)" "x" out "a,b")
+check_output(out "axbx")
+
+string(REGEX REPLACE "(|$)" "x" out "")
+check_output(out "x")
+
+string(REGEX REPLACE "(|$)" "x" out "ab")
+check_output(out "xaxbx")
+
+string(REGEX REPLACE "(b|)" "x" out "abc")
+check_output(out "xaxxcx")
+
+string(REGEX REPLACE "(|b)" "x" out "abc")
+check_output(out "xaxxxcx")
+
+string(REGEX REPLACE "a*" "x" out "aaa")
+check_output(out "xx")
+
+string(REGEX REPLACE "(a)?(b)?" "x" out "")
+check_output(out "x")
+
+string(REGEX REPLACE "(a)?(b)?" "x" out "abba")
+check_output(out "xxxx")
diff --git a/Tests/RunCMake/string/RegexMultiMatchClear-stderr.txt b/Tests/RunCMake/string/RegexMultiMatchClear-stderr.txt
index 4360d79..9ebf49b 100644
--- a/Tests/RunCMake/string/RegexMultiMatchClear-stderr.txt
+++ b/Tests/RunCMake/string/RegexMultiMatchClear-stderr.txt
@@ -1,12 +1,12 @@
-^matches: Some::;Scope
+^matches: Some::
results from: string\(REGEX MATCHALL\)
-CMAKE_MATCH_0: -->Scope<--
-CMAKE_MATCH_1: -->Scope<--
-CMAKE_MATCH_2: --><--
-CMAKE_MATCH_COUNT: -->1<--
-replace: \[Some\]\[Scope\]
+CMAKE_MATCH_0: -->Some::<--
+CMAKE_MATCH_1: -->Some<--
+CMAKE_MATCH_2: -->::<--
+CMAKE_MATCH_COUNT: -->2<--
+replace: \[Some\]Scope
results from: string\(REGEX REPLACE\)
-CMAKE_MATCH_0: -->Scope<--
-CMAKE_MATCH_1: -->Scope<--
-CMAKE_MATCH_2: --><--
-CMAKE_MATCH_COUNT: -->1<--$
+CMAKE_MATCH_0: -->Some::<--
+CMAKE_MATCH_1: -->Some<--
+CMAKE_MATCH_2: -->::<--
+CMAKE_MATCH_COUNT: -->2<--$
diff --git a/Tests/RunCMake/string/RegexMultiMatchClear.cmake b/Tests/RunCMake/string/RegexMultiMatchClear.cmake
index 788ba5e..99d4646 100644
--- a/Tests/RunCMake/string/RegexMultiMatchClear.cmake
+++ b/Tests/RunCMake/string/RegexMultiMatchClear.cmake
@@ -1,3 +1,5 @@
+cmake_policy(SET CMP0186 NEW)
+
function (output_results msg)
message("results from: ${msg}")
message("CMAKE_MATCH_0: -->${CMAKE_MATCH_0}<--")
diff --git a/Tests/RunCMake/string/RunCMakeTest.cmake b/Tests/RunCMake/string/RunCMakeTest.cmake
index ff0bb51..f7bebef 100644
--- a/Tests/RunCMake/string/RunCMakeTest.cmake
+++ b/Tests/RunCMake/string/RunCMakeTest.cmake
@@ -21,6 +21,14 @@
run_cmake(JoinNoVar)
run_cmake(Timestamp)
+if(NOT CMAKE_SYSTEM_NAME STREQUAL "AIX" # FIXME: Needs 64-bit build
+ AND NOT CMAKE_SYSTEM_NAME STREQUAL "SunOS" # FIXME: Needs 64-bit build
+ AND NOT (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND
+ CMAKE_SYSTEM_PROCESSOR MATCHES "^(hppa|parisc|parisc64|sparc|sparc64)$" # FIXME: 32-bit time_t?
+ )
+ )
+ run_cmake(Timestamp2038)
+endif()
run_cmake(TimestampEmpty)
run_cmake(TimestampInvalid)
run_cmake(TimestampInvalid2)
@@ -35,6 +43,8 @@
run_cmake(RegexClear)
run_cmake(RegexMultiMatchClear)
+run_cmake(RegexEmptyMatch)
+run_cmake(CMP0186)
run_cmake(UTF-16BE)
run_cmake(UTF-16LE)
diff --git a/Tests/RunCMake/string/Timestamp2038-stderr.txt b/Tests/RunCMake/string/Timestamp2038-stderr.txt
new file mode 100644
index 0000000..4a2eb50
--- /dev/null
+++ b/Tests/RunCMake/string/Timestamp2038-stderr.txt
@@ -0,0 +1 @@
+^RESULT=2038-01-20 05:00:00.000000 Wednesday=Wed January=Jan 38 day=020 wd=3 week=03 w_iso=03 %I=05 epoch=2147576400 TZ=GMT tz=\+0000$
diff --git a/Tests/RunCMake/string/Timestamp2038.cmake b/Tests/RunCMake/string/Timestamp2038.cmake
new file mode 100644
index 0000000..adbc910
--- /dev/null
+++ b/Tests/RunCMake/string/Timestamp2038.cmake
@@ -0,0 +1,3 @@
+set(ENV{SOURCE_DATE_EPOCH} "2147576400")
+string(TIMESTAMP RESULT "%Y-%m-%d %H:%M:%S.%f %A=%a %B=%b %y day=%j wd=%w week=%U w_iso=%V %%I=%I epoch=%s TZ=%Z tz=%z" UTC)
+message("RESULT=${RESULT}")
diff --git a/Utilities/Doxygen/CMakeLists.txt b/Utilities/Doxygen/CMakeLists.txt
index a9f07db..68918f1 100644
--- a/Utilities/Doxygen/CMakeLists.txt
+++ b/Utilities/Doxygen/CMakeLists.txt
@@ -3,7 +3,7 @@
if(NOT CMake_SOURCE_DIR)
set(CMakeDeveloperReference_STANDALONE 1)
- cmake_minimum_required(VERSION 3.13...3.30 FATAL_ERROR)
+ cmake_minimum_required(VERSION 3.13...3.31 FATAL_ERROR)
get_filename_component(tmp "${CMAKE_CURRENT_SOURCE_DIR}" PATH)
get_filename_component(CMake_SOURCE_DIR "${tmp}" PATH)
include(${CMake_SOURCE_DIR}/Modules/CTestUseLaunchers.cmake)
diff --git a/Utilities/Scripts/update-jsoncpp.bash b/Utilities/Scripts/update-jsoncpp.bash
index a05dcb8..5e97f9e 100755
--- a/Utilities/Scripts/update-jsoncpp.bash
+++ b/Utilities/Scripts/update-jsoncpp.bash
@@ -8,7 +8,7 @@
readonly ownership="JsonCpp Upstream <kwrobot@kitware.com>"
readonly subtree="Utilities/cmjsoncpp"
readonly repo="https://github.com/open-source-parsers/jsoncpp.git"
-readonly tag="42e892d96e47b1f6e29844cc705e148ec4856448"
+readonly tag="1.9.6"
readonly shortlog=false
readonly paths="
LICENSE
diff --git a/Utilities/Sphinx/CMakeLists.txt b/Utilities/Sphinx/CMakeLists.txt
index 1e60c10..c89d412 100644
--- a/Utilities/Sphinx/CMakeLists.txt
+++ b/Utilities/Sphinx/CMakeLists.txt
@@ -3,7 +3,7 @@
if(NOT CMake_SOURCE_DIR)
set(CMakeHelp_STANDALONE 1)
- cmake_minimum_required(VERSION 3.13...3.30 FATAL_ERROR)
+ cmake_minimum_required(VERSION 3.13...3.31 FATAL_ERROR)
get_filename_component(tmp "${CMAKE_CURRENT_SOURCE_DIR}" PATH)
get_filename_component(CMake_SOURCE_DIR "${tmp}" PATH)
include(${CMake_SOURCE_DIR}/Modules/CTestUseLaunchers.cmake)
diff --git a/Utilities/Sphinx/conf.py.in b/Utilities/Sphinx/conf.py.in
index be33bf1..2c29042 100644
--- a/Utilities/Sphinx/conf.py.in
+++ b/Utilities/Sphinx/conf.py.in
@@ -100,6 +100,7 @@
r'https://cdash\.org': r'https://www\.cdash\.org/',
r'https://cmake.org/get-involved/': r'https://cmake.org/documentation/',
r'https://docs\.nvidia\.com/cuda/': r'https://docs\.nvidia\.com/cuda/index\.html',
+ r'https://learn\.microsoft\.com/en-us/cpp/build/reference/export-exports-a-function': r'https://learn\.microsoft\.com/en-us/cpp/build/reference/export-exports-a-function\?.*',
r'https://learn\.microsoft\.com/en-us/cpp/build/reference/openmp-enable-openmp-2-0-support': r'https://learn\.microsoft\.com/en-us/cpp/build/reference/openmp-enable-openmp-2-0-support\?.*',
r'https://learn\.microsoft\.com/en-us/cpp/c-language/parsing-c-command-line-arguments': r'https://learn\.microsoft\.com/en-us/cpp/c-language/parsing-c-command-line-arguments\?.*',
r'https://openjdk\.java\.net/jeps/313': r'https://openjdk\.org:443/jeps/313',
diff --git a/Utilities/Sphinx/update_versions.py b/Utilities/Sphinx/update_versions.py
index 893e7a7..d210ab0 100755
--- a/Utilities/Sphinx/update_versions.py
+++ b/Utilities/Sphinx/update_versions.py
@@ -1,38 +1,63 @@
#!/usr/bin/env python3
"""
-This script inserts "versionadded" directive into every .rst document
-and every .cmake module with .rst documentation comment.
+This script inserts "versionadded" directives into .rst documents found in the
+Help/ directory and module documentation comments found in the Modules/
+directory. It can be run from any directory within the CMake repository.
+
+Each file is assigned a CMake version in which it first appears,
+according to the git version tags.
+
+Options:
+
+ --overwrite Replace existing "versionadded" directives.
+ Default: existing directives are left unchanged.
+
+ --baseline Files present in this tag don't need a version directive.
+ Default: v3.0.0
+
+ --since Files present in this tag will be ignored.
+ Only newer files will be operated on.
+ Default: v3.0.0
+
+ --next-version The next CMake version, which hasn't been tagged yet.
+ Default: extracted from Source/CMakeVersion.cmake
"""
import re
import pathlib
import subprocess
import argparse
-tag_re = re.compile(r'^v3\.(\d+)\.(\d+)(?:-rc(\d+))?$')
+tag_re = re.compile(r'^v[34]\.(\d+)\.(\d+)(?:-rc(\d+))?$')
path_re = re.compile(r'Help/(?!dev|guide|manual|cpack_|release).*\.rst|Modules/[^/]*\.cmake$')
def git_root():
+ """Return the root of the .git repository from the current directory."""
result = subprocess.run(
['git', 'rev-parse', '--show-toplevel'], check=True, universal_newlines=True, capture_output=True)
return pathlib.Path(result.stdout.strip())
def git_tags():
+ """Return a list of CMake version tags from the repository."""
result = subprocess.run(['git', 'tag'], check=True, universal_newlines=True, capture_output=True)
return [tag for tag in result.stdout.splitlines() if tag_re.match(tag)]
def git_list_tree(ref):
+ """Return a list of help and module files in a given git reference."""
result = subprocess.run(
['git', 'ls-tree', '-r', '--full-name', '--name-only', ref, ':/'],
check=True, universal_newlines=True, capture_output=True)
return [path for path in result.stdout.splitlines() if path_re.match(path)]
def tag_version(tag):
+ """Extract a clean CMake version from a git version tag."""
return re.sub(r'^v|\.0(-rc\d+)?$', '', tag)
def tag_sortkey(tag):
+ """Sorting key for a git version tag."""
return tuple(int(part or '1000') for part in tag_re.match(tag).groups())
def make_version_map(baseline, since, next_version):
+ """Map repository file paths to CMake versions in which they first appear."""
versions = {}
if next_version:
for path in git_list_tree('HEAD'):
@@ -53,9 +78,10 @@
rb'set\(CMake_VERSION_MAJOR\s+(\d+)\)\s+set\(CMake_VERSION_MINOR\s+(\d+)\)\s+set\(CMake_VERSION_PATCH\s+(\d+)\)', re.S)
def cmake_version(path):
+ """Extract the current MAJOR.MINOR CMake version from CMakeVersion.cmake found at `path`."""
match = cmake_version_re.search(path.read_bytes())
major, minor, patch = map(int, match.groups())
- minor += patch > 20000000
+ minor += patch > 20000000 # nightly version will become the next minor
return f'{major}.{minor}'
stamp_re = re.compile(
@@ -96,7 +122,7 @@
parser = argparse.ArgumentParser(allow_abbrev=False)
parser.add_argument('--overwrite', action='store_true', help="overwrite existing version tags")
parser.add_argument('--baseline', metavar='TAG', default='v3.0.0',
- help="files present in this tag won't be stamped (default: v3.0.0)")
+ help="files present in this tag don't need a version directive (default: v3.0.0)")
parser.add_argument('--since', metavar='TAG',
help="apply changes only to files added after this tag")
parser.add_argument('--next-version', metavar='VER',
diff --git a/Utilities/cmcurl/lib/CMakeLists.txt b/Utilities/cmcurl/lib/CMakeLists.txt
index ae5fa5a..d61d398 100644
--- a/Utilities/cmcurl/lib/CMakeLists.txt
+++ b/Utilities/cmcurl/lib/CMakeLists.txt
@@ -236,10 +236,6 @@
CMAKE_SYSTEM_NAME STREQUAL "Linux" OR
CMAKE_SYSTEM_NAME STREQUAL "SunOS" OR
CMAKE_SYSTEM_NAME STREQUAL "Haiku" OR
- CMAKE_SYSTEM_NAME STREQUAL "GNU/kFreeBSD" OR
- # FreeBSD comes with the a.out and ELF flavours but a.out was supported
- # up to v3.x and ELF from v3.x. I cannot imagine someone running CMake
- # on those ancient systems.
CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
set(_soversion_default TRUE)
else()
diff --git a/Utilities/cmjsoncpp/include/json/allocator.h b/Utilities/cmjsoncpp/include/json/allocator.h
index 3718df1..eda2677 100644
--- a/Utilities/cmjsoncpp/include/json/allocator.h
+++ b/Utilities/cmjsoncpp/include/json/allocator.h
@@ -71,7 +71,9 @@
// Boilerplate
SecureAllocator() {}
template <typename U> SecureAllocator(const SecureAllocator<U>&) {}
- template <typename U> struct rebind { using other = SecureAllocator<U>; };
+ template <typename U> struct rebind {
+ using other = SecureAllocator<U>;
+ };
};
template <typename T, typename U>
diff --git a/Utilities/cmjsoncpp/include/json/reader.h b/Utilities/cmjsoncpp/include/json/reader.h
index 0d444ad..a79d0ea 100644
--- a/Utilities/cmjsoncpp/include/json/reader.h
+++ b/Utilities/cmjsoncpp/include/json/reader.h
@@ -53,12 +53,12 @@
};
/** \brief Constructs a Reader allowing all features for parsing.
- * deprecated Use CharReader and CharReaderBuilder.
+ * deprecated Use CharReader and CharReaderBuilder.
*/
Reader();
/** \brief Constructs a Reader allowing the specified feature set for parsing.
- * deprecated Use CharReader and CharReaderBuilder.
+ * deprecated Use CharReader and CharReaderBuilder.
*/
Reader(const Features& features);
@@ -192,6 +192,7 @@
using Errors = std::deque<ErrorInfo>;
bool readToken(Token& token);
+ bool readTokenSkippingComments(Token& token);
void skipSpaces();
bool match(const Char* pattern, int patternLength);
bool readComment();
@@ -223,7 +224,6 @@
int& column) const;
String getLocationLineAndColumn(Location location) const;
void addComment(Location begin, Location end, CommentPlacement placement);
- void skipCommentTokens(Token& token);
static bool containsNewLine(Location begin, Location end);
static String normalizeEOL(Location begin, Location end);
@@ -246,6 +246,12 @@
*/
class JSON_API CharReader {
public:
+ struct JSON_API StructuredError {
+ ptrdiff_t offset_start;
+ ptrdiff_t offset_limit;
+ String message;
+ };
+
virtual ~CharReader() = default;
/** \brief Read a Value from a <a HREF="http://www.json.org">JSON</a>
* document. The document must be a UTF-8 encoded string containing the
@@ -264,7 +270,12 @@
* error occurred.
*/
virtual bool parse(char const* beginDoc, char const* endDoc, Value* root,
- String* errs) = 0;
+ String* errs);
+
+ /** \brief Returns a vector of structured errors encountered while parsing.
+ * Each parse call resets the stored list of errors.
+ */
+ std::vector<StructuredError> getStructuredErrors() const;
class JSON_API Factory {
public:
@@ -274,7 +285,21 @@
*/
virtual CharReader* newCharReader() const = 0;
}; // Factory
-}; // CharReader
+
+protected:
+ class Impl {
+ public:
+ virtual ~Impl() = default;
+ virtual bool parse(char const* beginDoc, char const* endDoc, Value* root,
+ String* errs) = 0;
+ virtual std::vector<StructuredError> getStructuredErrors() const = 0;
+ };
+
+ explicit CharReader(std::unique_ptr<Impl> impl) : _impl(std::move(impl)) {}
+
+private:
+ std::unique_ptr<Impl> _impl;
+}; // CharReader
/** \brief Build a CharReader implementation.
*
@@ -362,6 +387,12 @@
* snippet src/lib_json/json_reader.cpp CharReaderBuilderStrictMode
*/
static void strictMode(Json::Value* settings);
+ /** ECMA-404 mode.
+ * \pre 'settings' != NULL (but Json::null is fine)
+ * \remark Defaults:
+ * \snippet src/lib_json/json_reader.cpp CharReaderBuilderECMA404Mode
+ */
+ static void ecma404Mode(Json::Value* settings);
};
/** Consume entire stream and use its begin/end.
diff --git a/Utilities/cmjsoncpp/include/json/value.h b/Utilities/cmjsoncpp/include/json/value.h
index 421fef8..da78869 100644
--- a/Utilities/cmjsoncpp/include/json/value.h
+++ b/Utilities/cmjsoncpp/include/json/value.h
@@ -3,8 +3,8 @@
// recognized in your jurisdiction.
// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
-#ifndef JSON_H_INCLUDED
-#define JSON_H_INCLUDED
+#ifndef JSON_VALUE_H_INCLUDED
+#define JSON_VALUE_H_INCLUDED
#if !defined(JSON_IS_AMALGAMATION)
#include "forwards.h"
@@ -443,7 +443,7 @@
/// \post type() is arrayValue
void resize(ArrayIndex newSize);
- //@{
+ ///@{
/// Access an array element (zero based index). If the array contains less
/// than index element, then null value are inserted in the array so that
/// its size is index+1.
@@ -451,15 +451,15 @@
/// this from the operator[] which takes a string.)
Value& operator[](ArrayIndex index);
Value& operator[](int index);
- //@}
+ ///@}
- //@{
+ ///@{
/// Access an array element (zero based index).
/// (You may need to say 'value[0u]' to get your compiler to distinguish
/// this from the operator[] which takes a string.)
const Value& operator[](ArrayIndex index) const;
const Value& operator[](int index) const;
- //@}
+ ///@}
/// If the array contains at least index+1 elements, returns the element
/// value, otherwise returns defaultValue.
@@ -519,6 +519,9 @@
/// and operator[]const
/// \note As stated elsewhere, behavior is undefined if (end-begin) >= 2^30
Value const* find(char const* begin, char const* end) const;
+ /// Most general and efficient version of isMember()const, get()const,
+ /// and operator[]const
+ Value const* find(const String& key) const;
/// Most general and efficient version of object-mutators.
/// \note As stated elsewhere, behavior is undefined if (end-begin) >= 2^30
/// \return non-zero, but JSON_ASSERT if this is neither object nor nullValue.
@@ -591,6 +594,26 @@
iterator begin();
iterator end();
+ /// \brief Returns a reference to the first element in the `Value`.
+ /// Requires that this value holds an array or json object, with at least one
+ /// element.
+ const Value& front() const;
+
+ /// \brief Returns a reference to the first element in the `Value`.
+ /// Requires that this value holds an array or json object, with at least one
+ /// element.
+ Value& front();
+
+ /// \brief Returns a reference to the last element in the `Value`.
+ /// Requires that value holds an array or json object, with at least one
+ /// element.
+ const Value& back() const;
+
+ /// \brief Returns a reference to the last element in the `Value`.
+ /// Requires that this value holds an array or json object, with at least one
+ /// element.
+ Value& back();
+
// Accessors for the [start, limit) range of bytes within the JSON text from
// which this value was parsed, if any.
void setOffsetStart(ptrdiff_t start);
@@ -931,6 +954,14 @@
inline void swap(Value& a, Value& b) { a.swap(b); }
+inline const Value& Value::front() const { return *begin(); }
+
+inline Value& Value::front() { return *begin(); }
+
+inline const Value& Value::back() const { return *(--end()); }
+
+inline Value& Value::back() { return *(--end()); }
+
} // namespace Json
#if !defined(__SUNPRO_CC)
diff --git a/Utilities/cmjsoncpp/include/json/version.h b/Utilities/cmjsoncpp/include/json/version.h
index e931d03..38faedf 100644
--- a/Utilities/cmjsoncpp/include/json/version.h
+++ b/Utilities/cmjsoncpp/include/json/version.h
@@ -9,19 +9,18 @@
// 3. /CMakeLists.txt
// IMPORTANT: also update the SOVERSION!!
-#define JSONCPP_VERSION_STRING "1.9.5"
+#define JSONCPP_VERSION_STRING "1.9.6"
#define JSONCPP_VERSION_MAJOR 1
#define JSONCPP_VERSION_MINOR 9
-#define JSONCPP_VERSION_PATCH 5
+#define JSONCPP_VERSION_PATCH 6
#define JSONCPP_VERSION_QUALIFIER
#define JSONCPP_VERSION_HEXA \
((JSONCPP_VERSION_MAJOR << 24) | (JSONCPP_VERSION_MINOR << 16) | \
(JSONCPP_VERSION_PATCH << 8))
-#ifdef JSONCPP_USING_SECURE_MEMORY
-#undef JSONCPP_USING_SECURE_MEMORY
-#endif
+#if !defined(JSONCPP_USE_SECURE_MEMORY)
#define JSONCPP_USING_SECURE_MEMORY 0
+#endif
// If non-zero, the library zeroes any memory that it has allocated before
// it frees its memory.
diff --git a/Utilities/cmjsoncpp/include/json/writer.h b/Utilities/cmjsoncpp/include/json/writer.h
index 2a47d5e..fac86c7 100644
--- a/Utilities/cmjsoncpp/include/json/writer.h
+++ b/Utilities/cmjsoncpp/include/json/writer.h
@@ -66,7 +66,7 @@
*/
virtual StreamWriter* newStreamWriter() const = 0;
}; // Factory
-}; // StreamWriter
+}; // StreamWriter
/** \brief Write into stringstream, then return string, for convenience.
* A StreamWriter will be created from the factory, used, and then deleted.
@@ -170,8 +170,7 @@
#pragma warning(push)
#pragma warning(disable : 4996) // Deriving from deprecated class
#endif
-class JSON_API FastWriter
- : public Writer {
+class JSON_API FastWriter : public Writer {
public:
FastWriter();
~FastWriter() override = default;
@@ -230,8 +229,7 @@
#pragma warning(push)
#pragma warning(disable : 4996) // Deriving from deprecated class
#endif
-class JSON_API
- StyledWriter : public Writer {
+class JSON_API StyledWriter : public Writer {
public:
StyledWriter();
~StyledWriter() override = default;
@@ -299,8 +297,7 @@
#pragma warning(push)
#pragma warning(disable : 4996) // Deriving from deprecated class
#endif
-class JSON_API
- StyledStreamWriter {
+class JSON_API StyledStreamWriter {
public:
/**
* \param indentation Each level will be indented by this amount extra.
@@ -356,6 +353,7 @@
PrecisionType precisionType = PrecisionType::significantDigits);
String JSON_API valueToString(bool value);
String JSON_API valueToQuotedString(const char* value);
+String JSON_API valueToQuotedString(const char* value, size_t length);
/// \brief Output using the StyledStreamWriter.
/// \see Json::operator>>()
diff --git a/Utilities/cmjsoncpp/src/lib_json/json_reader.cpp b/Utilities/cmjsoncpp/src/lib_json/json_reader.cpp
index 5cc718d..c504bfb 100644
--- a/Utilities/cmjsoncpp/src/lib_json/json_reader.cpp
+++ b/Utilities/cmjsoncpp/src/lib_json/json_reader.cpp
@@ -129,7 +129,7 @@
bool successful = readValue();
Token token;
- skipCommentTokens(token);
+ readTokenSkippingComments(token);
if (collectComments_ && !commentsBefore_.empty())
root.setComment(commentsBefore_, commentAfter);
if (features_.strictRoot_) {
@@ -157,7 +157,7 @@
throwRuntimeError("Exceeded stackLimit in readValue().");
Token token;
- skipCommentTokens(token);
+ readTokenSkippingComments(token);
bool successful = true;
if (collectComments_ && !commentsBefore_.empty()) {
@@ -225,14 +225,14 @@
return successful;
}
-void Reader::skipCommentTokens(Token& token) {
+bool Reader::readTokenSkippingComments(Token& token) {
+ bool success = readToken(token);
if (features_.allowComments_) {
- do {
- readToken(token);
- } while (token.type_ == tokenComment);
- } else {
- readToken(token);
+ while (success && token.type_ == tokenComment) {
+ success = readToken(token);
+ }
}
+ return success;
}
bool Reader::readToken(Token& token) {
@@ -446,12 +446,7 @@
Value init(objectValue);
currentValue().swapPayload(init);
currentValue().setOffsetStart(token.start_ - begin_);
- while (readToken(tokenName)) {
- bool initialTokenOk = true;
- while (tokenName.type_ == tokenComment && initialTokenOk)
- initialTokenOk = readToken(tokenName);
- if (!initialTokenOk)
- break;
+ while (readTokenSkippingComments(tokenName)) {
if (tokenName.type_ == tokenObjectEnd && name.empty()) // empty object
return true;
name.clear();
@@ -480,15 +475,11 @@
return recoverFromError(tokenObjectEnd);
Token comma;
- if (!readToken(comma) ||
- (comma.type_ != tokenObjectEnd && comma.type_ != tokenArraySeparator &&
- comma.type_ != tokenComment)) {
+ if (!readTokenSkippingComments(comma) ||
+ (comma.type_ != tokenObjectEnd && comma.type_ != tokenArraySeparator)) {
return addErrorAndRecover("Missing ',' or '}' in object declaration",
comma, tokenObjectEnd);
}
- bool finalizeTokenOk = true;
- while (comma.type_ == tokenComment && finalizeTokenOk)
- finalizeTokenOk = readToken(comma);
if (comma.type_ == tokenObjectEnd)
return true;
}
@@ -518,10 +509,7 @@
Token currentToken;
// Accept Comment after last item in the array.
- ok = readToken(currentToken);
- while (currentToken.type_ == tokenComment && ok) {
- ok = readToken(currentToken);
- }
+ ok = readTokenSkippingComments(currentToken);
bool badTokenType = (currentToken.type_ != tokenArraySeparator &&
currentToken.type_ != tokenArrayEnd);
if (!ok || badTokenType) {
@@ -599,8 +587,7 @@
bool Reader::decodeDouble(Token& token, Value& decoded) {
double value = 0;
- String buffer(token.start_, token.end_);
- IStringStream is(buffer);
+ IStringStream is(String(token.start_, token.end_));
if (!(is >> value)) {
if (value == std::numeric_limits<double>::max())
value = std::numeric_limits<double>::infinity();
@@ -608,7 +595,7 @@
value = -std::numeric_limits<double>::infinity();
else if (!std::isinf(value))
return addError(
- "'" + String(token.start_, token.end_) + "' is not a number.", token);
+ "'" + String(token.start_, token.end_) + "' is not a number.", token);
}
decoded = value;
return true;
@@ -773,7 +760,7 @@
while (current < location && current != end_) {
Char c = *current++;
if (c == '\r') {
- if (*current == '\n')
+ if (current != end_ && *current == '\n')
++current;
lastLineStart = current;
++line;
@@ -890,17 +877,12 @@
public:
using Char = char;
using Location = const Char*;
- struct StructuredError {
- ptrdiff_t offset_start;
- ptrdiff_t offset_limit;
- String message;
- };
explicit OurReader(OurFeatures const& features);
bool parse(const char* beginDoc, const char* endDoc, Value& root,
bool collectComments = true);
String getFormattedErrorMessages() const;
- std::vector<StructuredError> getStructuredErrors() const;
+ std::vector<CharReader::StructuredError> getStructuredErrors() const;
private:
OurReader(OurReader const&); // no impl
@@ -943,6 +925,7 @@
using Errors = std::deque<ErrorInfo>;
bool readToken(Token& token);
+ bool readTokenSkippingComments(Token& token);
void skipSpaces();
void skipBom(bool skipBom);
bool match(const Char* pattern, int patternLength);
@@ -976,7 +959,6 @@
int& column) const;
String getLocationLineAndColumn(Location location) const;
void addComment(Location begin, Location end, CommentPlacement placement);
- void skipCommentTokens(Token& token);
static String normalizeEOL(Location begin, Location end);
static bool containsNewLine(Location begin, Location end);
@@ -1030,7 +1012,7 @@
bool successful = readValue();
nodes_.pop();
Token token;
- skipCommentTokens(token);
+ readTokenSkippingComments(token);
if (features_.failIfExtra_ && (token.type_ != tokenEndOfStream)) {
addError("Extra non-whitespace after JSON value.", token);
return false;
@@ -1058,7 +1040,7 @@
if (nodes_.size() > features_.stackLimit_)
throwRuntimeError("Exceeded stackLimit in readValue().");
Token token;
- skipCommentTokens(token);
+ readTokenSkippingComments(token);
bool successful = true;
if (collectComments_ && !commentsBefore_.empty()) {
@@ -1145,14 +1127,14 @@
return successful;
}
-void OurReader::skipCommentTokens(Token& token) {
+bool OurReader::readTokenSkippingComments(Token& token) {
+ bool success = readToken(token);
if (features_.allowComments_) {
- do {
- readToken(token);
- } while (token.type_ == tokenComment);
- } else {
- readToken(token);
+ while (success && token.type_ == tokenComment) {
+ success = readToken(token);
+ }
}
+ return success;
}
bool OurReader::readToken(Token& token) {
@@ -1449,12 +1431,7 @@
Value init(objectValue);
currentValue().swapPayload(init);
currentValue().setOffsetStart(token.start_ - begin_);
- while (readToken(tokenName)) {
- bool initialTokenOk = true;
- while (tokenName.type_ == tokenComment && initialTokenOk)
- initialTokenOk = readToken(tokenName);
- if (!initialTokenOk)
- break;
+ while (readTokenSkippingComments(tokenName)) {
if (tokenName.type_ == tokenObjectEnd &&
(name.empty() ||
features_.allowTrailingCommas_)) // empty object or trailing comma
@@ -1491,15 +1468,11 @@
return recoverFromError(tokenObjectEnd);
Token comma;
- if (!readToken(comma) ||
- (comma.type_ != tokenObjectEnd && comma.type_ != tokenArraySeparator &&
- comma.type_ != tokenComment)) {
+ if (!readTokenSkippingComments(comma) ||
+ (comma.type_ != tokenObjectEnd && comma.type_ != tokenArraySeparator)) {
return addErrorAndRecover("Missing ',' or '}' in object declaration",
comma, tokenObjectEnd);
}
- bool finalizeTokenOk = true;
- while (comma.type_ == tokenComment && finalizeTokenOk)
- finalizeTokenOk = readToken(comma);
if (comma.type_ == tokenObjectEnd)
return true;
}
@@ -1533,10 +1506,7 @@
Token currentToken;
// Accept Comment after last item in the array.
- ok = readToken(currentToken);
- while (currentToken.type_ == tokenComment && ok) {
- ok = readToken(currentToken);
- }
+ ok = readTokenSkippingComments(currentToken);
bool badTokenType = (currentToken.type_ != tokenArraySeparator &&
currentToken.type_ != tokenArrayEnd);
if (!ok || badTokenType) {
@@ -1651,8 +1621,7 @@
bool OurReader::decodeDouble(Token& token, Value& decoded) {
double value = 0;
- const String buffer(token.start_, token.end_);
- IStringStream is(buffer);
+ IStringStream is(String(token.start_, token.end_));
if (!(is >> value)) {
if (value == std::numeric_limits<double>::max())
value = std::numeric_limits<double>::infinity();
@@ -1660,7 +1629,7 @@
value = -std::numeric_limits<double>::infinity();
else if (!std::isinf(value))
return addError(
- "'" + String(token.start_, token.end_) + "' is not a number.", token);
+ "'" + String(token.start_, token.end_) + "' is not a number.", token);
}
decoded = value;
return true;
@@ -1826,7 +1795,7 @@
while (current < location && current != end_) {
Char c = *current++;
if (c == '\r') {
- if (*current == '\n')
+ if (current != end_ && *current == '\n')
++current;
lastLineStart = current;
++line;
@@ -1861,10 +1830,11 @@
return formattedMessage;
}
-std::vector<OurReader::StructuredError> OurReader::getStructuredErrors() const {
- std::vector<OurReader::StructuredError> allErrors;
+std::vector<CharReader::StructuredError>
+OurReader::getStructuredErrors() const {
+ std::vector<CharReader::StructuredError> allErrors;
for (const auto& error : errors_) {
- OurReader::StructuredError structured;
+ CharReader::StructuredError structured;
structured.offset_start = error.token_.start_ - begin_;
structured.offset_limit = error.token_.end_ - begin_;
structured.message = error.message_;
@@ -1874,20 +1844,36 @@
}
class OurCharReader : public CharReader {
- bool const collectComments_;
- OurReader reader_;
public:
OurCharReader(bool collectComments, OurFeatures const& features)
- : collectComments_(collectComments), reader_(features) {}
- bool parse(char const* beginDoc, char const* endDoc, Value* root,
- String* errs) override {
- bool ok = reader_.parse(beginDoc, endDoc, *root, collectComments_);
- if (errs) {
- *errs = reader_.getFormattedErrorMessages();
+ : CharReader(
+ std::unique_ptr<OurImpl>(new OurImpl(collectComments, features))) {}
+
+protected:
+ class OurImpl : public Impl {
+ public:
+ OurImpl(bool collectComments, OurFeatures const& features)
+ : collectComments_(collectComments), reader_(features) {}
+
+ bool parse(char const* beginDoc, char const* endDoc, Value* root,
+ String* errs) override {
+ bool ok = reader_.parse(beginDoc, endDoc, *root, collectComments_);
+ if (errs) {
+ *errs = reader_.getFormattedErrorMessages();
+ }
+ return ok;
}
- return ok;
- }
+
+ std::vector<CharReader::StructuredError>
+ getStructuredErrors() const override {
+ return reader_.getStructuredErrors();
+ }
+
+ private:
+ bool const collectComments_;
+ OurReader reader_;
+ };
};
CharReaderBuilder::CharReaderBuilder() { setDefaults(&settings_); }
@@ -1976,6 +1962,32 @@
(*settings)["skipBom"] = true;
//! [CharReaderBuilderDefaults]
}
+// static
+void CharReaderBuilder::ecma404Mode(Json::Value* settings) {
+ //! [CharReaderBuilderECMA404Mode]
+ (*settings)["allowComments"] = false;
+ (*settings)["allowTrailingCommas"] = false;
+ (*settings)["strictRoot"] = false;
+ (*settings)["allowDroppedNullPlaceholders"] = false;
+ (*settings)["allowNumericKeys"] = false;
+ (*settings)["allowSingleQuotes"] = false;
+ (*settings)["stackLimit"] = 1000;
+ (*settings)["failIfExtra"] = true;
+ (*settings)["rejectDupKeys"] = false;
+ (*settings)["allowSpecialFloats"] = false;
+ (*settings)["skipBom"] = false;
+ //! [CharReaderBuilderECMA404Mode]
+}
+
+std::vector<CharReader::StructuredError>
+CharReader::getStructuredErrors() const {
+ return _impl->getStructuredErrors();
+}
+
+bool CharReader::parse(char const* beginDoc, char const* endDoc, Value* root,
+ String* errs) {
+ return _impl->parse(beginDoc, endDoc, root, errs);
+}
//////////////////////////////////
// global functions
@@ -1984,7 +1996,7 @@
String* errs) {
OStringStream ssin;
ssin << sin.rdbuf();
- String doc = ssin.str();
+ String doc = std::move(ssin).str();
char const* begin = doc.data();
char const* end = begin + doc.size();
// Note that we do not actually need a null-terminator.
diff --git a/Utilities/cmjsoncpp/src/lib_json/json_value.cpp b/Utilities/cmjsoncpp/src/lib_json/json_value.cpp
index b496ddf..ec7ae70 100644
--- a/Utilities/cmjsoncpp/src/lib_json/json_value.cpp
+++ b/Utilities/cmjsoncpp/src/lib_json/json_value.cpp
@@ -1092,6 +1092,9 @@
return nullptr;
return &(*it).second;
}
+Value const* Value::find(const String& key) const {
+ return find(key.data(), key.data() + key.length());
+}
Value* Value::demand(char const* begin, char const* end) {
JSON_ASSERT_MESSAGE(type() == nullValue || type() == objectValue,
"in Json::Value::demand(begin, end): requires "
@@ -1105,7 +1108,7 @@
return *found;
}
Value const& Value::operator[](const String& key) const {
- Value const* found = find(key.data(), key.data() + key.length());
+ Value const* found = find(key);
if (!found)
return nullSingleton();
return *found;
@@ -1205,7 +1208,7 @@
return false;
}
if (removed)
- *removed = it->second;
+ *removed = std::move(it->second);
ArrayIndex oldSize = size();
// shift left all items left, into the place of the "removed"
for (ArrayIndex i = index; i < (oldSize - 1); ++i) {
@@ -1410,9 +1413,8 @@
// Always discard trailing newline, to aid indentation.
comment.pop_back();
}
- JSON_ASSERT(!comment.empty());
JSON_ASSERT_MESSAGE(
- comment[0] == '\0' || comment[0] == '/',
+ comment.empty() || comment[0] == '/',
"in Json::Value::setComment(): Comments must start with /");
comments_.set(placement, std::move(comment));
}
diff --git a/Utilities/cmjsoncpp/src/lib_json/json_writer.cpp b/Utilities/cmjsoncpp/src/lib_json/json_writer.cpp
index 0dd160e..ee45c43 100644
--- a/Utilities/cmjsoncpp/src/lib_json/json_writer.cpp
+++ b/Utilities/cmjsoncpp/src/lib_json/json_writer.cpp
@@ -132,8 +132,9 @@
if (!isfinite(value)) {
static const char* const reps[2][3] = {{"NaN", "-Infinity", "Infinity"},
{"null", "-1e+9999", "1e+9999"}};
- return reps[useSpecialFloats ? 0 : 1]
- [isnan(value) ? 0 : (value < 0) ? 1 : 2];
+ return reps[useSpecialFloats ? 0 : 1][isnan(value) ? 0
+ : (value < 0) ? 1
+ : 2];
}
String buffer(size_t(36), '\0');
@@ -353,6 +354,10 @@
return valueToQuotedStringN(value, strlen(value));
}
+String valueToQuotedString(const char* value, size_t length) {
+ return valueToQuotedStringN(value, length);
+}
+
// Class Writer
// //////////////////////////////////////////////////////////////////
Writer::~Writer() = default;
@@ -490,7 +495,7 @@
const String& name = *it;
const Value& childValue = value[name];
writeCommentBeforeValue(childValue);
- writeWithIndent(valueToQuotedString(name.c_str()));
+ writeWithIndent(valueToQuotedString(name.c_str(), name.size()));
document_ += " : ";
writeValue(childValue);
if (++it == members.end()) {
@@ -708,7 +713,7 @@
const String& name = *it;
const Value& childValue = value[name];
writeCommentBeforeValue(childValue);
- writeWithIndent(valueToQuotedString(name.c_str()));
+ writeWithIndent(valueToQuotedString(name.c_str(), name.size()));
*document_ << " : ";
writeValue(childValue);
if (++it == members.end()) {
@@ -1246,7 +1251,7 @@
OStringStream sout;
StreamWriterPtr const writer(factory.newStreamWriter());
writer->write(root, &sout);
- return sout.str();
+ return std::move(sout).str();
}
OStream& operator<<(OStream& sout, Value const& root) {
diff --git a/Utilities/cmlibuv/CMakeLists.txt b/Utilities/cmlibuv/CMakeLists.txt
index c00145e..495b5ed 100644
--- a/Utilities/cmlibuv/CMakeLists.txt
+++ b/Utilities/cmlibuv/CMakeLists.txt
@@ -232,22 +232,6 @@
)
endif()
-if(CMAKE_SYSTEM_NAME STREQUAL "kFreeBSD")
- list(APPEND uv_libraries
- freebsd-glue
- )
- list(APPEND uv_headers
- include/uv/bsd.h
- )
- list(APPEND uv_sources
- src/unix/bsd-ifaddrs.c
- src/unix/bsd-proctitle.c
- src/unix/freebsd.c
- src/unix/kqueue.c
- src/unix/posix-hrtime.c
- )
-endif()
-
if(CMAKE_SYSTEM_NAME STREQUAL "NetBSD")
list(APPEND uv_libraries
kvm
diff --git a/Utilities/std/cmext/enum_set b/Utilities/std/cmext/enum_set
index ca53a36..24d2e6a 100644
--- a/Utilities/std/cmext/enum_set
+++ b/Utilities/std/cmext/enum_set
@@ -561,21 +561,79 @@
} // namespace cm
//
-// WARNING: the following two functions rely on an enum_set without
-// explicit size.
+// WARNING: the following two operators rely on the enum_set_traits<Enum>
+// struct definition.
+// The macro CM_ENUM_SET_TRAITS(EnumSet) can be used to define this structure.
//
-// TODO: ensure compatibility with any enum_set definitions.
+// Notes:
+// When CM_ENUM_SET_TRAITS is used, the following restrictions applies:
+// * Due to language constraints, the enum_set_traits specialization must
+// occur outside of any namespace or function definition.
+// * Only one enum_set instantiation is supported per enum class type.
//
-template <typename Enum,
- typename cm::enable_if_t<cm::is_scoped_enum<Enum>::value, int> = 0>
-inline cm::enum_set<Enum> operator+(Enum lhs, Enum rhs)
+
+template <typename Enum>
+struct cm_enum_set_traits
{
- return cm::enum_set<Enum>{ lhs, rhs };
+};
+
+namespace cm {
+template <typename Enum, typename = cm::void_t<>>
+struct is_enum_set : std::false_type
+{
+};
+template <typename Enum>
+struct is_enum_set<Enum, cm::void_t<typename cm_enum_set_traits<Enum>::type>>
+ : std::true_type
+{
+};
+}
+
+#if defined(__SUNPRO_CC) && defined(__sparc)
+// Oracle DeveloperStudio C++ compiler on Solaris/Sparc crash on the following
+// template declarations, so declare explicitly the operators.
+
+// Helper macro to define the enum_set_traits struct specialization.
+# define CM_ENUM_SET_TRAITS(E) \
+ template <> \
+ struct cm_enum_set_traits<E::value_type> \
+ { \
+ using type = E; \
+ using value_type = E::value_type; \
+ }; \
+ \
+ inline E operator+(E::value_type lhs, E::value_type rhs) \
+ { \
+ return { lhs, rhs }; \
+ } \
+ \
+ inline E operator|(E::value_type lhs, E::value_type rhs) \
+ { \
+ return { lhs, rhs }; \
+ }
+
+#else
+
+// Helper macro to define the enum_set_traits struct specialization.
+# define CM_ENUM_SET_TRAITS(E) \
+ template <> \
+ struct cm_enum_set_traits<E::value_type> \
+ { \
+ using type = E; \
+ using value_type = E::value_type; \
+ };
+
+template <typename Enum,
+ typename cm::enable_if_t<cm::is_enum_set<Enum>::value, int> = 0>
+inline typename cm_enum_set_traits<Enum>::type operator+(Enum lhs, Enum rhs)
+{
+ return { lhs, rhs };
}
// Alternate syntax
template <typename Enum,
- typename cm::enable_if_t<cm::is_scoped_enum<Enum>::value, int> = 0>
-inline cm::enum_set<Enum> operator|(Enum lhs, Enum rhs)
+ typename cm::enable_if_t<cm::is_enum_set<Enum>::value, int> = 0>
+inline typename cm_enum_set_traits<Enum>::type operator|(Enum lhs, Enum rhs)
{
- return cm::enum_set<Enum>{ lhs, rhs };
+ return { lhs, rhs };
}
+#endif
diff --git a/bootstrap b/bootstrap
index eb8a0ac..1e87e04 100755
--- a/bootstrap
+++ b/bootstrap
@@ -1783,9 +1783,6 @@
uv_c_flags="${uv_c_flags} -D_GNU_SOURCE"
libs="${libs} -ldl -lrt"
;;
- *kFreeBSD*)
- libs="${libs} -lfreebsd-glue"
- ;;
*NetBSD*)
libs="${libs} -lkvm"
;;