Merge branch 'release-4.0'
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index ebe939d..a473e7d 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -16,6 +16,7 @@
- build
- test
- test-ext
+ - package
- upload
variables:
@@ -40,6 +41,7 @@
# Job prefixes:
# - `b:` build
+# - `k:` package
# - `l:` lint
# - `p:` prep
# - `t:` test
@@ -1436,12 +1438,24 @@
extends:
- .windows_x86_64_package
- .cmake_build_windows
- - .cmake_release_artifacts
+ - .cmake_build_package_artifacts
- .windows_x86_64_tags_nonconcurrent_vs2022
- .run_only_for_package
needs:
- p:doc-package
variables:
+ CMAKE_CI_ARTIFACTS_NAME: "artifacts-windows-x86_64-build"
+
+k:windows-x86_64-package:
+ extends:
+ - .windows_x86_64_package
+ - .cmake_package_windows
+ - .cmake_release_artifacts
+ - .windows_x86_64_tags_nonconcurrent_sign
+ - .run_only_for_package
+ needs:
+ - b:windows-x86_64-package
+ variables:
CMAKE_CI_ARTIFACTS_NAME: "artifacts-windows-x86_64"
u:windows-x86_64-package:
@@ -1449,18 +1463,30 @@
- .rsync_upload_package
- .run_only_for_package
needs:
- - b:windows-x86_64-package
+ - k:windows-x86_64-package
b:windows-i386-package:
extends:
- .windows_i386_package
- .cmake_build_windows
- - .cmake_release_artifacts
+ - .cmake_build_package_artifacts
- .windows_x86_64_tags_nonconcurrent_vs2022
- .run_only_for_package
needs:
- p:doc-package
variables:
+ CMAKE_CI_ARTIFACTS_NAME: "artifacts-windows-i386-build"
+
+k:windows-i386-package:
+ extends:
+ - .windows_i386_package
+ - .cmake_package_windows
+ - .cmake_release_artifacts
+ - .windows_x86_64_tags_nonconcurrent_sign
+ - .run_only_for_package
+ needs:
+ - b:windows-i386-package
+ variables:
CMAKE_CI_ARTIFACTS_NAME: "artifacts-windows-i386"
u:windows-i386-package:
@@ -1468,18 +1494,30 @@
- .rsync_upload_package
- .run_only_for_package
needs:
- - b:windows-i386-package
+ - k:windows-i386-package
b:windows-arm64-package:
extends:
- .windows_arm64_package
- .cmake_build_windows
- - .cmake_release_artifacts
+ - .cmake_build_package_artifacts
- .windows_x86_64_tags_nonconcurrent_vs2022_arm64
- .run_only_for_package
needs:
- p:doc-package
variables:
+ CMAKE_CI_ARTIFACTS_NAME: "artifacts-windows-arm64-build"
+
+k:windows-arm64-package:
+ extends:
+ - .windows_arm64_package
+ - .cmake_package_windows
+ - .cmake_release_artifacts
+ - .windows_x86_64_tags_nonconcurrent_sign
+ - .run_only_for_package
+ needs:
+ - b:windows-arm64-package
+ variables:
CMAKE_CI_ARTIFACTS_NAME: "artifacts-windows-arm64"
u:windows-arm64-package:
@@ -1487,4 +1525,4 @@
- .rsync_upload_package
- .run_only_for_package
needs:
- - b:windows-arm64-package
+ - k:windows-arm64-package
diff --git a/.gitlab/artifacts.yml b/.gitlab/artifacts.yml
index 97b8f38..0072525 100644
--- a/.gitlab/artifacts.yml
+++ b/.gitlab/artifacts.yml
@@ -67,6 +67,36 @@
annotations:
- ${CMAKE_CI_BUILD_DIR}/annotations.json
+.cmake_build_package_artifacts:
+ artifacts:
+ expire_in: 1d
+ name: "$CMAKE_CI_ARTIFACTS_NAME"
+ paths:
+ # Allow CPack to find CMAKE_ROOT and license text.
+ - build/CMakeFiles/CMakeSourceDir.txt
+ - build/CMakeFiles/LICENSE.txt
+
+ # Install rules.
+ - build/**/cmake_install.cmake
+
+ # We need the main binaries.
+ - build/bin/
+
+ # Pass through the documentation.
+ - build/install-doc/
+
+ # CPack configuration.
+ - build/CPackConfig.cmake
+ - build/CMakeCPackOptions.cmake
+ - build/Source/QtDialog/QtDialogCPack.cmake
+
+ # CPack/IFW packaging files.
+ - build/CMake*.qs
+
+ # CPack/WIX packaging files.
+ - build/Utilities/Release/WiX/custom_action_dll*.wxs
+ - build/Utilities/Release/WiX/CustomAction/CMakeWiXCustomActions.*
+
.cmake_release_artifacts:
artifacts:
expire_in: 5d
diff --git a/.gitlab/ci/CMakeCPack.cmake b/.gitlab/ci/CMakeCPack.cmake
deleted file mode 100644
index 971fe54..0000000
--- a/.gitlab/ci/CMakeCPack.cmake
+++ /dev/null
@@ -1,3 +0,0 @@
-if(NOT "$ENV{CMAKE_CI_PACKAGE}" MATCHES "^(dev)?$")
- configure_file(${CMAKE_CURRENT_LIST_DIR}/package_info.cmake.in ${CMake_BINARY_DIR}/ci_package_info.cmake @ONLY)
-endif()
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/configure_windows_package_common.cmake b/.gitlab/ci/configure_windows_package_common.cmake
index 11bfad5..70fca72 100644
--- a/.gitlab/ci/configure_windows_package_common.cmake
+++ b/.gitlab/ci/configure_windows_package_common.cmake
@@ -21,6 +21,4 @@
set(CMake_BUILD_WIX_CUSTOM_ACTION ON CACHE BOOL "")
-set(CMake_CPACK_CUSTOM_SCRIPT "${CMAKE_CURRENT_LIST_DIR}/CMakeCPack.cmake" CACHE FILEPATH "")
-
include("${CMAKE_CURRENT_LIST_DIR}/configure_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/ci/env_windows_arm64_package.ps1 b/.gitlab/ci/env_windows_arm64_package.ps1
deleted file mode 100644
index 74c9c2b..0000000
--- a/.gitlab/ci/env_windows_arm64_package.ps1
+++ /dev/null
@@ -1 +0,0 @@
-. .gitlab/ci/wix4-env.ps1
diff --git a/.gitlab/ci/env_windows_i386_package.ps1 b/.gitlab/ci/env_windows_i386_package.ps1
deleted file mode 100644
index 74c9c2b..0000000
--- a/.gitlab/ci/env_windows_i386_package.ps1
+++ /dev/null
@@ -1 +0,0 @@
-. .gitlab/ci/wix4-env.ps1
diff --git a/.gitlab/ci/env_windows_x86_64_package.ps1 b/.gitlab/ci/env_windows_x86_64_package.ps1
deleted file mode 100644
index 74c9c2b..0000000
--- a/.gitlab/ci/env_windows_x86_64_package.ps1
+++ /dev/null
@@ -1 +0,0 @@
-. .gitlab/ci/wix4-env.ps1
diff --git a/.gitlab/ci/package_info.cmake.in b/.gitlab/ci/package_info.cmake.in
deleted file mode 100644
index f9a5bb7..0000000
--- a/.gitlab/ci/package_info.cmake.in
+++ /dev/null
@@ -1 +0,0 @@
-set(CPACK_PACKAGE_FILE_NAME "@CPACK_PACKAGE_FILE_NAME@")
diff --git a/.gitlab/ci/package_windows.ps1 b/.gitlab/ci/package_windows.ps1
index 9ec2942..5b787f4 100644
--- a/.gitlab/ci/package_windows.ps1
+++ b/.gitlab/ci/package_windows.ps1
@@ -1,7 +1,3 @@
-if (Test-Path -Path "build/ci_package_info.cmake" -PathType Leaf) {
- cmake -P .gitlab/ci/package_windows_build.cmake
-} else {
- cd build
- cpack -G ZIP
- cpack -G WIX
-}
+cd build
+. ../Utilities/Release/win/sign-package.ps1 -cpack cpack
+if (-not $?) { Exit $LastExitCode }
diff --git a/.gitlab/ci/package_windows_build.cmake b/.gitlab/ci/package_windows_build.cmake
deleted file mode 100644
index a2b7ed4..0000000
--- a/.gitlab/ci/package_windows_build.cmake
+++ /dev/null
@@ -1,42 +0,0 @@
-cmake_minimum_required(VERSION 3.29)
-include(build/ci_package_info.cmake)
-
-set(build "${CMAKE_CURRENT_BINARY_DIR}/build")
-
-file(GLOB paths RELATIVE "${CMAKE_CURRENT_BINARY_DIR}"
- # Allow CPack to find CMAKE_ROOT and license text.
- "${build}/CMakeFiles/CMakeSourceDir.txt"
- "${build}/CMakeFiles/LICENSE.txt"
-
- # We need the main binaries.
- "${build}/bin"
-
- # Pass through the documentation.
- "${build}/install-doc"
-
- # CPack configuration.
- "${build}/CPackConfig.cmake"
- "${build}/CMakeCPackOptions.cmake"
- "${build}/Source/QtDialog/QtDialogCPack.cmake"
-
- # CPack/IFW packaging files.
- "${build}/CMake*.qs"
-
- # CPack/WIX packaging files.
- "${build}/Utilities/Release/WiX/custom_action_dll*.wxs"
- "${build}/Utilities/Release/WiX/CustomAction/CMakeWiXCustomActions.*"
- )
-
-file(GLOB_RECURSE paths_recurse RELATIVE "${CMAKE_CURRENT_BINARY_DIR}"
- # Install rules.
- "${build}/cmake_install.cmake"
- "${build}/*/cmake_install.cmake"
- )
-
-# Create a "package" containing the build-tree files needed to build a package.
-file(MAKE_DIRECTORY build/unsigned)
-file(ARCHIVE_CREATE
- OUTPUT build/unsigned/${CPACK_PACKAGE_FILE_NAME}.build.zip
- PATHS ${paths} ${paths_recurse}
- FORMAT zip
- )
diff --git a/.gitlab/ci/post_build_windows_arm64_package.ps1 b/.gitlab/ci/post_build_windows_arm64_package.ps1
deleted file mode 100644
index f98d995..0000000
--- a/.gitlab/ci/post_build_windows_arm64_package.ps1
+++ /dev/null
@@ -1 +0,0 @@
-. .gitlab/ci/package_windows.ps1
diff --git a/.gitlab/ci/post_build_windows_i386_package.ps1 b/.gitlab/ci/post_build_windows_i386_package.ps1
deleted file mode 100644
index f98d995..0000000
--- a/.gitlab/ci/post_build_windows_i386_package.ps1
+++ /dev/null
@@ -1 +0,0 @@
-. .gitlab/ci/package_windows.ps1
diff --git a/.gitlab/ci/post_build_windows_x86_64_package.ps1 b/.gitlab/ci/post_build_windows_x86_64_package.ps1
deleted file mode 100644
index f98d995..0000000
--- a/.gitlab/ci/post_build_windows_x86_64_package.ps1
+++ /dev/null
@@ -1 +0,0 @@
-. .gitlab/ci/package_windows.ps1
diff --git a/.gitlab/ci/signtool-env.ps1 b/.gitlab/ci/signtool-env.ps1
new file mode 100644
index 0000000..5467b98
--- /dev/null
+++ b/.gitlab/ci/signtool-env.ps1
@@ -0,0 +1,22 @@
+if ("$env:PROCESSOR_ARCHITECTURE" -eq "AMD64") {
+ $arch = "x64"
+} elseif ("$env:PROCESSOR_ARCHITECTURE" -eq "ARM64") {
+ $arch = "arm64"
+} else {
+ throw ('unknown PROCESSOR_ARCHITECTURE: ' + "$env:PROCESSOR_ARCHITECTURE")
+}
+
+$regKey = 'HKLM:\SOFTWARE\WOW6432Node\Microsoft\Microsoft SDKs\Windows\v10.0'
+$signtoolPath = $null
+if ($sdkDir = Get-ItemPropertyValue -Path $regKey -Name "InstallationFolder") {
+ if ($sdkBin = Get-ChildItem -Path "$sdkDir/bin" -Recurse -Name "$arch" |
+ Where-Object { Test-Path -Path "$sdkDir/bin/$_/signtool.exe" -PathType Leaf } |
+ Select-Object -Last 1) {
+ $signtoolPath = "$sdkDir/bin/$sdkBin"
+ }
+}
+if ($signtoolPath) {
+ Set-Item -Force -Path "env:PATH" -Value "$env:PATH;$signtoolPath"
+} else {
+ throw ('No signtool.exe found in Windows SDK')
+}
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/.gitlab/os-windows.yml b/.gitlab/os-windows.yml
index d024f41..2881edc 100644
--- a/.gitlab/os-windows.yml
+++ b/.gitlab/os-windows.yml
@@ -310,6 +310,14 @@
## Tags
+.windows_x86_64_tags_nonconcurrent_sign:
+ tags:
+ - cmake # Since this is a bare runner, pin to a project.
+ - windows-x86_64
+ - shell
+ - sign-windows-v1
+ - nonconcurrent
+
.windows_x86_64_tags_nonconcurrent_vs2022:
tags:
- cmake # Since this is a bare runner, pin to a project.
@@ -413,6 +421,18 @@
interruptible: true
+.cmake_package_windows:
+ stage: package
+ environment:
+ name: sign-windows
+ script:
+ - . .gitlab/ci/env.ps1
+ - . .gitlab/ci/signtool-env.ps1
+ - . .gitlab/ci/cmake-env.ps1
+ - . .gitlab/ci/wix4-env.ps1
+ - . .gitlab/ci/package_windows.ps1
+ interruptible: true
+
.cmake_test_windows:
stage: test
diff --git a/.gitlab/rules.yml b/.gitlab/rules.yml
index c7102f9..efb7290 100644
--- a/.gitlab/rules.yml
+++ b/.gitlab/rules.yml
@@ -70,7 +70,9 @@
.run_only_for_package:
rules:
- - if: '$CMAKE_CI_PACKAGE == "dev"'
+ - if: '$CMAKE_CI_PACKAGE == "dev" && $CI_JOB_STAGE != "upload"'
+ when: on_success
+ - if: '$CMAKE_CI_PACKAGE == "dev" && $CI_JOB_STAGE == "upload"'
variables:
RSYNC_DESTINATION: "kitware@cmake.org:dev/"
when: on_success
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..5ad2245 100644
--- a/.typos.toml
+++ b/.typos.toml
@@ -9,6 +9,9 @@
"(?s)(#|/(/|\\*)|\\.\\.)\\s*(NOQA|noqa):? spellcheck(: *|=| +)off.*?\\n\\s*(#|/(/|\\*)|\\.\\.)\\s*(NOQA|noqa):? spellcheck(: *|=| +)on"
# NOTE Allow to mark a line to exclude from spellchecking
, "(?Rm)^.*(#|/(/|\\*)|\\.\\.)\\s*(NOQA|noqa):? spellcheck(: *|=| +)disable-line$"
+ # NOTE Stop checking from this line to the end of file
+ # This line is a marker added by Git to the `COMMIT_EDITMSG`.
+ , "(?sm)^# ------------------------ >8 ------------------------$.*"
]
locale = "en-us"
# ATTENTION If, for any reason, you want to add the
@@ -35,6 +38,7 @@
[type.cmake.extend-identifiers]
COMMANDs = "COMMANDs"
xCOMMANDx = "xCOMMANDx"
+TYPEs = "TYPEs"
[type.cmake.extend-words]
# Some compiler's options trigger false-positives
@@ -53,6 +57,9 @@
Ot = "Ot"
SEH = "SEH"
+[type.py.extend-identifiers]
+typ = "typ"
+
[files]
ignore-hidden = false
ignore-dot = false
diff --git a/Auxiliary/cmake.m4 b/Auxiliary/cmake.m4
index 205b0e4..19ead8f 100644
--- a/Auxiliary/cmake.m4
+++ b/Auxiliary/cmake.m4
@@ -1,6 +1,10 @@
dnl Distributed under the OSI-approved BSD 3-Clause License. See accompanying
dnl file LICENSE.rst or https://cmake.org/licensing for details.
+# CMAKE_FIND_BINARY
+# -----------------
+# Finds the cmake command-line binary and sets its absolute path in the
+# CMAKE_BINARY variable.
AC_DEFUN([CMAKE_FIND_BINARY],
[AC_ARG_VAR([CMAKE_BINARY], [path to the cmake binary])dnl
@@ -9,13 +13,33 @@
fi
])dnl
-# $1: package name
-# $2: language (e.g. C/CXX/Fortran)
-# $3: The compiler ID, defaults to GNU.
-# Possible values are: GNU, Intel, Clang, SunPro, HP, XL, VisualAge, PGI,
-# PathScale, Cray, SCO, MSVC, LCC
-# $4: optional extra arguments to cmake, e.g. "-DCMAKE_SIZEOF_VOID_P=8"
-# $5: optional path to cmake binary
+# CMAKE_FIND_PACKAGE(package, lang, [compiler-id], [cmake-args],
+# [action-if-found], [action-if-not-found])
+# --------------------------------------------------------------
+# Finds a package with CMake.
+#
+# package:
+# The name of the package as called in CMake with find_package(package).
+#
+# lang:
+# The programming language to use (e.g., C, CXX, Fortran).
+# See https://cmake.org/cmake/help/latest/command/enable_language.html
+# for a complete list of supported languages.
+#
+# compiler-id:
+# (Optional) The compiler ID to use. Defaults to GNU.
+# See https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_COMPILER_ID.html
+# for possible values.
+#
+# cmake-args:
+# (Optional) Additional arguments to pass to cmake command, e.g.,
+# -DCMAKE_SIZEOF_VOID_P=8.
+#
+# action-if-found:
+# (Optional) Commands to execute if the package is found.
+#
+# action-if-not-found:
+# (Optional) Commands to execute if the package is not found.
AC_DEFUN([CMAKE_FIND_PACKAGE], [
AC_REQUIRE([CMAKE_FIND_BINARY])dnl
diff --git a/CMakeCPack.cmake b/CMakeCPack.cmake
index 97668d3..3ac6030 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
@@ -265,9 +259,5 @@
"~$"
)
-if(CMake_CPACK_CUSTOM_SCRIPT)
- include(${CMake_CPACK_CUSTOM_SCRIPT})
-endif()
-
# include CPack model once all variables are set
include(CPack)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 907c344..4c041d5 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)
@@ -392,8 +392,8 @@
include(CTest)
# Set up test-time configuration.
-set_directory_properties(PROPERTIES
- TEST_INCLUDE_FILE "${CMake_BINARY_DIR}/Tests/EnforceConfig.cmake")
+set_property(DIRECTORY APPEND PROPERTY
+ TEST_INCLUDE_FILES "${CMake_BINARY_DIR}/Tests/EnforceConfig.cmake")
if(NOT CMake_TEST_EXTERNAL_CMAKE)
# where to write the resulting executables and libraries
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/cmake_pkg_config.rst b/Help/command/cmake_pkg_config.rst
index 3744d93..32ffed3 100644
--- a/Help/command/cmake_pkg_config.rst
+++ b/Help/command/cmake_pkg_config.rst
@@ -12,9 +12,11 @@
Synopsis
^^^^^^^^
-.. code-block:: cmake
+.. parsed-literal::
- cmake_pkg_config(EXTRACT <package> [<version>] [...])
+ cmake_pkg_config(`EXTRACT`_ <package> [<version>] [...])
+ cmake_pkg_config(`POPULATE`_ <package> [<version>] [...])
+ cmake_pkg_config(`IMPORT`_ <package> [<version>] [...])
Introduction
^^^^^^^^^^^^
@@ -27,7 +29,31 @@
semantics as a pkg-config style version specifier, with the exception that if
no comparison operator is specified ``=`` is assumed.
-.. _`common options`:
+PkgConfig Targets
+^^^^^^^^^^^^^^^^^
+
+``cmake_pkg_config`` may recursively generate target-like names in the global
+scope in order to resolve a package ``IMPORT`` or ``POPULATE`` command. These
+names take the form of ``@foreign_pkgcfg::[<prefix>_]<package>`` and are exposed
+via the :prop_tgt:`INTERFACE_LINK_LIBRARIES` target property of an
+``IMPORT``-generated target.
+
+It is not possible to modify or address these pkg-config native targets via
+normal target-based commands. Limited control over their generation is possible
+via the ``POPULATE`` command, but modification should generally be performed
+inside the corresponding package file, not downstream in CMake.
+
+Pkg-config targets are reused across commands. Once a given package name has
+been resolved via ``POPULATE`` or ``IMPORT`` (but not ``EXTRACT``), all future
+requests for the corresponding package name by those commands will resolve to
+the previously generated pkg-config target.
+
+``EXTRACT`` always performs the complete package name lookup in order to allow
+searches for multiple installations of the same package in custom dependency
+management schemes.
+
+Common Options
+^^^^^^^^^^^^^^
There are multiple signatures for this command, and some of the options are
common between them. They are:
@@ -143,7 +169,7 @@
library directory paths and ``pc_sysrootdir`` will be set to ``/``
``TOP_BUILD_DIR <path>``
- Overrides the top build directory path used to derived the ``pc_top_builddir``
+ Overrides the top build directory path used to derive the ``pc_top_builddir``
package variable.
When this option is not provided, the default top build directory path is
@@ -154,29 +180,48 @@
#. If no top build directory path is available, the ``pc_top_builddir``
package variable is not set
+``PREFIX <name>``
+ Specifying a prefix creates an independent collection of pkg-config targets
+ separate from previously populated targets. This enables multiple version of
+ a given package to co-exist, for example packages from different sysroots.
+
+ The default prefix is an empty string.
+
+``BIND_PC_REQUIRES <<name>=<target>>...``
+ A list of ``<name>=<target>`` pairs, the ``name`` is a package name as it
+ appears in the ``Requires`` list of a pkg-config file and the ``target`` is a
+ CMake-native target name (not a pkg-config target).
+
+ When a given package name appears in the ``Requires`` list of a package, it
+ will be fulfilled with the associated CMake target. This behavior applies to
+ all dependencies in the pkg-config graph that have not been previously
+ populated.
+
Signatures
^^^^^^^^^^
.. signature::
cmake_pkg_config(EXTRACT <package> [<version>] [...])
+ .. versionadded:: 3.31
+
Extract the contents of the package into variables.
.. code-block:: cmake
cmake_pkg_config(EXTRACT <package> [<version>]
[REQUIRED] [EXACT] [QUIET]
+ [SYSTEM_INCLUDE_DIRS <path>...]
+ [SYSTEM_LIBRARY_DIRS <path>...]
+ [ALLOW_SYSTEM_INCLUDES <bool>]
+ [ALLOW_SYSTEM_LIBS <bool>]
[STRICTNESS <mode>]
[ENV_MODE <mode>]
[PC_LIBDIR <path>...]
[PC_PATH <path>...]
[DISABLE_UNINSTALLED <bool>]
[PC_SYSROOT_DIR <path>]
- [TOP_BUILD_DIR <path>]
- [SYSTEM_INCLUDE_DIRS <path>...]
- [SYSTEM_LIBRARY_DIRS <path>...]
- [ALLOW_SYSTEM_INCLUDES <bool>]
- [ALLOW_SYSTEM_LIBS <bool>])
+ [TOP_BUILD_DIR <path>])
The following variables will be populated from the contents of package file:
@@ -261,3 +306,65 @@
#. ``CMAKE_PKG_CONFIG_ALLOW_SYS_LIBS``
#. If the ``PKG_CONFIG_ALLOW_SYSTEM_LIBS`` environment variable is defined
the flags are preserved, otherwise they are filtered during flag mangling.
+
+.. signature::
+ cmake_pkg_config(POPULATE <package> [<version>] [...])
+
+ .. versionadded:: 4.1
+
+ Populate a package in the pkg-config target namespace
+
+ .. code-block:: cmake
+
+ cmake_pkg_config(POPULATE <package> [<version>]
+ [REQUIRED] [EXACT] [QUIET]
+ [PREFIX <prefix>]
+ [BIND_PC_REQUIRES <<name>=<target>>...]
+ [STRICTNESS <mode>]
+ [ENV_MODE <mode>]
+ [PC_LIBDIR <path>...]
+ [PC_PATH <path>...]
+ [DISABLE_UNINSTALLED <bool>]
+ [PC_SYSROOT_DIR <path>]
+ [TOP_BUILD_DIR <path>])
+
+``POPULATE`` enables manual control of resolution of a given package's
+``Requires`` list without importing onto a native CMake target. Once populated,
+a package and its dependencies will be used for resolution of all future
+``POPULATE`` and ``IMPORT`` commands.
+
+A ``PKGCONFIG_<package>_FOUND`` variable will be set to indicate whether the
+package was found.
+
+.. signature::
+ cmake_pkg_config(IMPORT <package> [<version>] [...])
+
+ .. versionadded:: 4.1
+
+ Import a pkg-config target as a CMake :prop_tgt:`IMPORTED` target
+
+ .. code-block:: cmake
+
+ cmake_pkg_config(IMPORT <package> [<version>]
+ [REQUIRED] [EXACT] [QUIET]
+ [NAME <name>]
+ [PREFIX <prefix>]
+ [BIND_PC_REQUIRES <<name>=<target>>...]
+ [STRICTNESS <mode>]
+ [ENV_MODE <mode>]
+ [PC_LIBDIR <path>...]
+ [PC_PATH <path>...]
+ [DISABLE_UNINSTALLED <bool>]
+ [PC_SYSROOT_DIR <path>]
+ [TOP_BUILD_DIR <path>])
+
+Creates a native CMake ``IMPORTED`` target that can be linked to via
+:command:`target_link_libraries`. This new target is named
+``PkgConfig::<package>`` by default.
+
+A ``PKGCONFIG_<package>_FOUND`` variable will be set to indicate whether the
+package was found.
+
+``NAME``
+ Overrides the name of the created CMake target to ``PkgConfig::<name>``. This
+ *does not* affect the ``PKGCONFIG_<package>_FOUND`` variable.
diff --git a/Help/command/ctest_start.rst b/Help/command/ctest_start.rst
index 2d68a37..9c4e3dc 100644
--- a/Help/command/ctest_start.rst
+++ b/Help/command/ctest_start.rst
@@ -80,8 +80,8 @@
However, for the sake of readability, it is recommended that you order your
parameters in the order listed at the top of this page.
-If the :variable:`CTEST_CHECKOUT_COMMAND` variable (or the
-:variable:`CTEST_CVS_CHECKOUT` variable) is set, its content is treated as
+If the :variable:`CTEST_CHECKOUT_COMMAND` variable is set, its content is
+treated as
command-line. The command is invoked with the current working directory set
to the parent of the source directory, even if the source directory already
exists. This can be used to create the source tree from a version control
diff --git a/Help/command/execute_process.rst b/Help/command/execute_process.rst
index c2c7fe3..a2f9036 100644
--- a/Help/command/execute_process.rst
+++ b/Help/command/execute_process.rst
@@ -121,6 +121,10 @@
and standard error pipes, respectively. If the same variable is named
for both pipes their output will be merged in the order produced.
+``OUTPUT_STRIP_TRAILING_WHITESPACE``, ``ERROR_STRIP_TRAILING_WHITESPACE``
+ Removes whitespace characters from the end of the values stored in the
+ corresponding ``OUTPUT_VARIABLE`` and ``ERROR_VARIABLE`` variables.
+
``ECHO_OUTPUT_VARIABLE``, ``ECHO_ERROR_VARIABLE``
.. versionadded:: 3.18
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/install.rst b/Help/command/install.rst
index f3262a0..59b3b96 100644
--- a/Help/command/install.rst
+++ b/Help/command/install.rst
@@ -46,7 +46,8 @@
and the order that install rules added in different subdirectories will run is
not guaranteed.
-.. _`common options`:
+Common Options
+""""""""""""""
There are multiple signatures for this command. Some of them define
installation options for files and targets. Options common to
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/command/target_link_libraries.rst b/Help/command/target_link_libraries.rst
index ab01307..4a1140b 100644
--- a/Help/command/target_link_libraries.rst
+++ b/Help/command/target_link_libraries.rst
@@ -127,11 +127,15 @@
in the :prop_gbl:`DEBUG_CONFIGURATIONS` global property if it is set).
The ``optimized`` keyword corresponds to all other configurations. The
``general`` keyword corresponds to all configurations, and is purely
- optional. Higher granularity may be achieved for per-configuration
- rules by creating and linking to
- :ref:`IMPORTED library targets <Imported Targets>`.
- These keywords are interpreted immediately by this command and therefore
- have no special meaning when produced by a generator expression.
+ optional. These keywords are interpreted immediately by this command and
+ therefore have no special meaning when produced by a generator expression.
+
+ Alternatively, generator expressions like :genex:`$<CONFIG>` provide finer
+ per-configuration linking of ``<item>``. For a more structured approach,
+ higher granularity can be achieved by creating and linking to
+ :ref:`IMPORTED library targets <Imported Targets>` with the
+ :prop_tgt:`IMPORTED_CONFIGURATIONS` property set, particularly in find
+ modules.
Items containing ``::``, such as ``Foo::Bar``, are assumed to be
:ref:`IMPORTED <Imported Targets>` or :ref:`ALIAS <Alias Targets>` library
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-file-api.7.rst b/Help/manual/cmake-file-api.7.rst
index 561791c..808ad55 100644
--- a/Help/manual/cmake-file-api.7.rst
+++ b/Help/manual/cmake-file-api.7.rst
@@ -1058,6 +1058,13 @@
* ``libraryPath``: library search path flags.
* ``frameworkPath``: macOS framework search path flags.
+ ``backtrace``
+ Optional member that is present when a CMake language backtrace to
+ the :command:`target_link_libraries`, :command:`target_link_options`,
+ or other command invocation that added this link fragment is available.
+ The value is an unsigned integer 0-based index into the ``backtraceGraph``
+ member's ``nodes`` array.
+
``lto``
Optional member that is present with boolean value ``true``
when link-time optimization (a.k.a. interprocedural optimization
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-modules.7.rst b/Help/manual/cmake-modules.7.rst
index e758637..b5d04ea 100644
--- a/Help/manual/cmake-modules.7.rst
+++ b/Help/manual/cmake-modules.7.rst
@@ -8,7 +8,7 @@
can be specified in the :variable:`CMAKE_MODULE_PATH` variable.
Utility Modules
-^^^^^^^^^^^^^^^
+===============
These modules are loaded using the :command:`include` command.
@@ -95,7 +95,7 @@
/module/UsewxWidgets
Find Modules
-^^^^^^^^^^^^
+============
These modules search for third-party software.
They are normally called through the :command:`find_package` command.
@@ -255,10 +255,10 @@
/module/FindZLIB
Deprecated Modules
-^^^^^^^^^^^^^^^^^^^
+==================
Deprecated Utility Modules
-==========================
+--------------------------
.. toctree::
:maxdepth: 1
@@ -284,7 +284,7 @@
/module/WriteCompilerDetectionHeader
Deprecated Find Modules
-=======================
+-----------------------
.. toctree::
:maxdepth: 1
@@ -302,7 +302,7 @@
/module/FindwxWindows
Legacy CPack Modules
-====================
+--------------------
These modules used to be mistakenly exposed to the user, and have been moved
out of user visibility. They are for CPack internal use, and should never be
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 07f3cf2..809bf1a 100644
--- a/Help/manual/cmake-variables.7.rst
+++ b/Help/manual/cmake-variables.7.rst
@@ -31,7 +31,6 @@
/variable/CMAKE_CACHE_MINOR_VERSION
/variable/CMAKE_CACHE_PATCH_VERSION
/variable/CMAKE_CACHEFILE_DIR
- /variable/CMAKE_CFG_INTDIR
/variable/CMAKE_COMMAND
/variable/CMAKE_CPACK_COMMAND
/variable/CMAKE_CROSSCOMPILING
@@ -61,6 +60,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
@@ -72,6 +72,7 @@
/variable/CMAKE_JOB_POOL_PRECOMPILE_HEADER
/variable/CMAKE_JOB_POOLS
/variable/CMAKE_LANG_COMPILER_AR
+ /variable/CMAKE_LANG_COMPILER_ARCHITECTURE_ID
/variable/CMAKE_LANG_COMPILER_FRONTEND_VARIANT
/variable/CMAKE_LANG_COMPILER_LINKER
/variable/CMAKE_LANG_COMPILER_LINKER_FRONTEND_VARIANT
@@ -814,7 +815,6 @@
/variable/CMAKE_HOME_DIRECTORY
/variable/CMAKE_INTERNAL_PLATFORM_ABI
/variable/CMAKE_LANG_COMPILER_ABI
- /variable/CMAKE_LANG_COMPILER_ARCHITECTURE_ID
/variable/CMAKE_LANG_COMPILER_VERSION_INTERNAL
/variable/CMAKE_LANG_LINKER_PREFERENCE
/variable/CMAKE_LANG_LINKER_PREFERENCE_PROPAGATES
@@ -828,6 +828,7 @@
.. toctree::
:maxdepth: 1
+ /variable/CMAKE_CFG_INTDIR
/variable/CMAKE_EXTRA_GENERATOR
Deprecated Variables that Change Behavior
diff --git a/Help/manual/ctest.1.rst b/Help/manual/ctest.1.rst
index 132dc80..379e00d 100644
--- a/Help/manual/ctest.1.rst
+++ b/Help/manual/ctest.1.rst
@@ -445,6 +445,15 @@
This option will run the tests in a random order. It is commonly
used to detect implicit dependencies in a test suite.
+.. option:: --schedule-random-seed
+
+ .. versionadded:: 4.1
+
+ Override the random order seed
+
+ This option is used to allow recreating failures owing to
+ random order of execution by ``--schedule-random``.
+
.. option:: --submit-index
Legacy option for old Dart2 dashboard server feature.
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_dir/TEST_INCLUDE_FILE.rst b/Help/prop_dir/TEST_INCLUDE_FILE.rst
index 31b2382..883b124 100644
--- a/Help/prop_dir/TEST_INCLUDE_FILE.rst
+++ b/Help/prop_dir/TEST_INCLUDE_FILE.rst
@@ -1,9 +1,14 @@
TEST_INCLUDE_FILE
-----------------
-Deprecated. Use :prop_dir:`TEST_INCLUDE_FILES` instead.
+.. deprecated:: 3.10
-A cmake file that will be included when ctest is run.
+ Use the :prop_dir:`TEST_INCLUDE_FILES` directory property instead, which
+ supports specifying multiple files.
-If you specify ``TEST_INCLUDE_FILE``, that file will be included and
-processed when ctest is run on the directory.
+The ``TEST_INCLUDE_FILE`` directory property specifies a CMake script that is
+included and processed when ``ctest`` is run on the directory.
+
+If both the ``TEST_INCLUDE_FILE`` and :prop_dir:`TEST_INCLUDE_FILES` directory
+properties are set, the script specified in ``TEST_INCLUDE_FILE`` is included
+first, followed by the scripts listed in ``TEST_INCLUDE_FILES``.
diff --git a/Help/prop_dir/TEST_INCLUDE_FILES.rst b/Help/prop_dir/TEST_INCLUDE_FILES.rst
index f9a66f4..f1c583f 100644
--- a/Help/prop_dir/TEST_INCLUDE_FILES.rst
+++ b/Help/prop_dir/TEST_INCLUDE_FILES.rst
@@ -3,7 +3,38 @@
.. versionadded:: 3.10
-A list of cmake files that will be included when ctest is run.
+This directory property specifies a list of CMake scripts to be included and
+processed when ``ctest`` runs on the directory. Use absolute paths, to avoid
+ambiguity. Script files are included in the specified order.
-If you specify ``TEST_INCLUDE_FILES``, those files will be included and
-processed when ctest is run on the directory.
+``TEST_INCLUDE_FILES`` scripts are processed when running ``ctest``, not during
+the ``cmake`` configuration phase. These scripts should be written as if they
+were CTest dashboard scripts. It is common to generate such scripts dynamically
+since many variables and commands available during configuration are not
+accessible at test phase.
+
+Examples
+^^^^^^^^
+
+Setting this directory property to append one or more CMake scripts:
+
+.. code-block:: cmake
+ :caption: CMakeLists.txt
+
+ configure_file(script.cmake.in script.cmake)
+
+ set_property(
+ DIRECTORY
+ APPEND
+ PROPERTY TEST_INCLUDE_FILES
+ ${CMAKE_CURRENT_BINARY_DIR}/script.cmake
+ ${CMAKE_CURRENT_SOURCE_DIR}/foo.cmake
+ ${dir}/bar.cmake
+ )
+
+.. code-block:: cmake
+ :caption: script.cmake.in
+
+ execute_process(
+ COMMAND "@CMAKE_COMMAND@" -E echo "script.cmake executed during CTest"
+ )
diff --git a/Help/prop_gbl/DEBUG_CONFIGURATIONS.rst b/Help/prop_gbl/DEBUG_CONFIGURATIONS.rst
index fec6fda..6ce6da7 100644
--- a/Help/prop_gbl/DEBUG_CONFIGURATIONS.rst
+++ b/Help/prop_gbl/DEBUG_CONFIGURATIONS.rst
@@ -1,13 +1,34 @@
DEBUG_CONFIGURATIONS
--------------------
-Specify which configurations are for debugging.
+This property specifies which :ref:`Build Configurations` are for debugging.
-The value must be a semi-colon separated list of configuration names.
+The value must be a :ref:`semicolon-separated list <CMake Language Lists>` of
+build configuration names.
Currently this property is used only by the :command:`target_link_libraries`
command. Additional uses may be defined in the future.
This property must be set at the top level of the project and before
the first :command:`target_link_libraries` command invocation. If any entry in
-the list does not match a valid configuration for the project the
+the list does not match a valid configuration for the project, the
behavior is undefined.
+
+By default, this property is **not set**.
+
+Examples
+^^^^^^^^
+
+The following example adds a custom configuration to non-optimized debug
+configurations while preserving any existing ones. If the project uses the
+default ``Debug`` configuration, it should be included as well.
+
+.. code-block:: cmake
+
+ set_property(GLOBAL APPEND PROPERTY DEBUG_CONFIGURATIONS Debug CustomBuild)
+
+See Also
+^^^^^^^^
+
+* The :prop_tgt:`MAP_IMPORTED_CONFIG_<CONFIG>` target property, which maps build
+ configurations when linking to :ref:`Imported Targets` that have the
+ :prop_tgt:`IMPORTED_CONFIGURATIONS` property set.
diff --git a/Help/prop_sf/MACOSX_PACKAGE_LOCATION.rst b/Help/prop_sf/MACOSX_PACKAGE_LOCATION.rst
index d185d91..ee5624a 100644
--- a/Help/prop_sf/MACOSX_PACKAGE_LOCATION.rst
+++ b/Help/prop_sf/MACOSX_PACKAGE_LOCATION.rst
@@ -28,3 +28,8 @@
into the respective sub-folder. Note: For iOS Apple uses a flat bundle layout
where no ``Resources`` folder exist. Therefore CMake strips the ``Resources``
folder name from the specified location.
+
+.. versionadded:: 4.1
+
+ ``MACOSX_PACKAGE_LOCATION`` may be set on a source directory
+ to copy its entire tree into the bundle.
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/AUTOMOC.rst b/Help/prop_tgt/AUTOMOC.rst
index b376894..221ef47 100644
--- a/Help/prop_tgt/AUTOMOC.rst
+++ b/Help/prop_tgt/AUTOMOC.rst
@@ -5,7 +5,7 @@
``AUTOMOC`` is a boolean specifying whether CMake will handle the Qt ``moc``
preprocessor automatically, i.e. without having to use commands like
-:module:`QT4_WRAP_CPP() <FindQt4>`, `qt5_wrap_cpp()`_, etc.
+:module:`qt4_wrap_cpp() <FindQt4>`, `qt5_wrap_cpp()`_, etc.
Currently, Qt versions 4 to 6 are supported.
.. _qt5_wrap_cpp(): https://doc.qt.io/qt-5/qtcore-cmake-qt5-wrap-cpp.html
diff --git a/Help/prop_tgt/AUTORCC.rst b/Help/prop_tgt/AUTORCC.rst
index fea906c..eadffa3 100644
--- a/Help/prop_tgt/AUTORCC.rst
+++ b/Help/prop_tgt/AUTORCC.rst
@@ -5,7 +5,7 @@
``AUTORCC`` is a boolean specifying whether CMake will handle
the Qt ``rcc`` code generator automatically, i.e. without having to use
-commands like :module:`QT4_ADD_RESOURCES() <FindQt4>`, `qt5_add_resources()`_,
+commands like :module:`qt4_add_resources() <FindQt4>`, `qt5_add_resources()`_,
etc. Currently, Qt versions 4 to 6 are supported.
.. _`qt5_add_resources()`: https://doc.qt.io/qt-5/qtcore-cmake-qt5-add-resources.html
diff --git a/Help/prop_tgt/AUTOUIC.rst b/Help/prop_tgt/AUTOUIC.rst
index 5010220..4dce1b5 100644
--- a/Help/prop_tgt/AUTOUIC.rst
+++ b/Help/prop_tgt/AUTOUIC.rst
@@ -5,7 +5,7 @@
``AUTOUIC`` is a boolean specifying whether CMake will handle
the Qt ``uic`` code generator automatically, i.e. without having to use
-commands like :module:`QT4_WRAP_UI() <FindQt4>`, `qt5_wrap_ui()`_, etc.
+commands like :module:`qt4_wrap_ui() <FindQt4>`, `qt5_wrap_ui()`_, etc.
Currently, Qt versions 4 to 6 are supported.
.. _`qt5_wrap_ui()`: https://doc.qt.io/qt-5/qtwidgets-cmake-qt5-wrap-ui.html
diff --git a/Help/prop_tgt/COMPILE_PDB_NAME.rst b/Help/prop_tgt/COMPILE_PDB_NAME.rst
index b76afeb..0649993 100644
--- a/Help/prop_tgt/COMPILE_PDB_NAME.rst
+++ b/Help/prop_tgt/COMPILE_PDB_NAME.rst
@@ -9,5 +9,10 @@
This property specifies the base name for the debug symbols file.
If not set, the default is unspecified.
+.. versionadded:: 4.1
+
+ Contents of ``COMPILE_PDB_NAME`` may use
+ :manual:`generator expressions <cmake-generator-expressions(7)>`.
+
.. |PDB_XXX| replace:: :prop_tgt:`PDB_NAME`
.. include:: COMPILE_PDB_NOTE.txt
diff --git a/Help/prop_tgt/COMPILE_PDB_NAME_CONFIG.rst b/Help/prop_tgt/COMPILE_PDB_NAME_CONFIG.rst
index 4c9825d..4a78f85 100644
--- a/Help/prop_tgt/COMPILE_PDB_NAME_CONFIG.rst
+++ b/Help/prop_tgt/COMPILE_PDB_NAME_CONFIG.rst
@@ -8,5 +8,10 @@
This is the configuration-specific version of :prop_tgt:`COMPILE_PDB_NAME`.
+.. versionadded:: 4.1
+
+ Contents of ``COMPILE_PDB_NAME_<CONFIG>`` may use
+ :manual:`generator expressions <cmake-generator-expressions(7)>`.
+
.. |PDB_XXX| replace:: :prop_tgt:`PDB_NAME_<CONFIG>`
.. include:: COMPILE_PDB_NOTE.txt
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_NAME.rst b/Help/prop_tgt/PDB_NAME.rst
index 3a65796..e8cb4e6 100644
--- a/Help/prop_tgt/PDB_NAME.rst
+++ b/Help/prop_tgt/PDB_NAME.rst
@@ -8,5 +8,10 @@
If not set, the :prop_tgt:`OUTPUT_NAME` target property value or
logical target name is used by default.
+.. versionadded:: 4.1
+
+ Contents of ``PDB_NAME`` may use
+ :manual:`generator expressions <cmake-generator-expressions(7)>`.
+
.. |COMPILE_PDB_XXX| replace:: :prop_tgt:`COMPILE_PDB_NAME`
.. include:: PDB_NOTE.txt
diff --git a/Help/prop_tgt/PDB_NAME_CONFIG.rst b/Help/prop_tgt/PDB_NAME_CONFIG.rst
index cb3121c..7b1edda 100644
--- a/Help/prop_tgt/PDB_NAME_CONFIG.rst
+++ b/Help/prop_tgt/PDB_NAME_CONFIG.rst
@@ -6,5 +6,10 @@
This is the configuration-specific version of :prop_tgt:`PDB_NAME`.
+.. versionadded:: 4.1
+
+ Contents of ``PDB_NAME_<CONFIG>`` may use
+ :manual:`generator expressions <cmake-generator-expressions(7)>`.
+
.. |COMPILE_PDB_XXX| replace:: :prop_tgt:`COMPILE_PDB_NAME_<CONFIG>`
.. include:: PDB_NOTE.txt
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/cmake-pkg-config-import.rst b/Help/release/dev/cmake-pkg-config-import.rst
new file mode 100644
index 0000000..5a9d086
--- /dev/null
+++ b/Help/release/dev/cmake-pkg-config-import.rst
@@ -0,0 +1,6 @@
+cmake-pkg-config-import
+-----------------------
+
+* The :command:`cmake_pkg_config` command now supports the ``IMPORT`` and
+ ``POPULATE`` subcommands for interfacing CMake targets with pkg-config based
+ dependencies.
diff --git a/Help/release/dev/compiler-architecture-id.rst b/Help/release/dev/compiler-architecture-id.rst
new file mode 100644
index 0000000..aa4bd89
--- /dev/null
+++ b/Help/release/dev/compiler-architecture-id.rst
@@ -0,0 +1,5 @@
+compiler-architecture-id
+------------------------
+
+* The :variable:`CMAKE_<LANG>_COMPILER_ARCHITECTURE_ID` variable is now
+ populated for most compilers, and documented for public use.
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/ctest-schedule-random-seed.rst b/Help/release/dev/ctest-schedule-random-seed.rst
new file mode 100644
index 0000000..3a24292
--- /dev/null
+++ b/Help/release/dev/ctest-schedule-random-seed.rst
@@ -0,0 +1,7 @@
+ctest-schedule-random-seed
+--------------------------
+
+* :manual:`ctest(1)` gained a
+ :option:`--schedule-random-seed <ctest --schedule-random-seed>`
+ option to specify a numeric random seed to make
+ :option:`ctest --schedule-random` deterministic for reproduction.
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/macos-bundle-content-dir.rst b/Help/release/dev/macos-bundle-content-dir.rst
new file mode 100644
index 0000000..02c4d6f
--- /dev/null
+++ b/Help/release/dev/macos-bundle-content-dir.rst
@@ -0,0 +1,6 @@
+macos-bundle-content-dir
+------------------------
+
+* The :prop_sf:`MACOSX_PACKAGE_LOCATION` source file property now
+ works when set on a source directory, and copies its entire tree
+ into the bundle.
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/pdb-name-genex-support.rst b/Help/release/dev/pdb-name-genex-support.rst
new file mode 100644
index 0000000..de26b73
--- /dev/null
+++ b/Help/release/dev/pdb-name-genex-support.rst
@@ -0,0 +1,5 @@
+pdb-name-genex-support
+----------------------
+
+* The :prop_tgt:`PDB_NAME` and :prop_tgt:`COMPILE_PDB_NAME` target properties
+ now support :manual:`generator expressions <cmake-generator-expressions(7)>`.
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_ARCHITECTURE_ID.rst b/Help/variable/CMAKE_LANG_COMPILER_ARCHITECTURE_ID.rst
index 8057566..9554037 100644
--- a/Help/variable/CMAKE_LANG_COMPILER_ARCHITECTURE_ID.rst
+++ b/Help/variable/CMAKE_LANG_COMPILER_ARCHITECTURE_ID.rst
@@ -3,8 +3,304 @@
.. versionadded:: 3.10
-An internal variable subject to change.
+:ref:`List <CMake Language Lists>` of identifiers indicating the
+target architecture(s) of the compiler for language ``<LANG>``.
-This is used to identify the variant of a compiler based on its target
-architecture. For some compilers this is needed to determine the correct
-usage.
+Typically the list has one entry unless :variable:`CMAKE_OSX_ARCHITECTURES`
+lists multiple architectures.
+
+Possible values for each platform are documented in the following sections.
+
+.. Sync with:
+ Modules/CMakeCompilerABI.h
+ Modules/CMakeFortranCompilerABI.F
+ Modules/CMakeFortranCompilerABI.F90
+ Modules/Internal/CMakeParseCompilerArchitectureId.cmake
+
+Apple Platforms
+^^^^^^^^^^^^^^^
+
+.. versionadded:: 4.1
+
+These identifiers are used when the :variable:`CMAKE_<LANG>_COMPILER`
+targets an Apple platform (``__APPLE__`` is defined).
+
+``arm64``
+ ARM 64-bit
+
+``arm64e``
+ ARM 64-bit with Pointer Authentication (PACs)
+
+``arm64_32``
+ ARM 64-bit with 32-bit pointers (watchOS)
+
+``armv5``, ``armv6``, ``armv7``, ``armv7k``, ``armv7s``
+ ARM 32-bit
+
+``i386``, ``i486``, ``i586``, ``i686``
+ Intel 32-bit
+
+``ppc``
+ PowerPC 32-bit
+
+``x86_64``
+ Intel 64-bit
+
+UNIX Platforms
+^^^^^^^^^^^^^^
+
+.. versionadded:: 4.1
+
+These identifiers are used when the :variable:`CMAKE_<LANG>_COMPILER`
+targets a UNIX platform.
+
+``aarch64``
+ ARM 64-bit
+
+``alpha``
+ DEC Alpha
+
+``armv5``, ``armv6``, ``armv7``
+ ARM 32-bit
+
+``i386``, ``i486``, ``i586``, ``i686``
+ Intel 32-bit
+
+``ia64``
+ Itanium 64-bit
+
+``loongarch32``
+ LoongArch 32-bit
+
+``loongarch64``
+ LoongArch 64-bit
+
+``m68k``
+ Motorola 68000
+
+``mips``
+ MIPS 32-bit big-endian
+
+``mipsel``
+ MIPS 32-bit little-endian
+
+``mips64``
+ MIPS 64-bit big-endian
+
+``mips64el``
+ MIPS 64-bit little-endian
+
+``parisc``
+ PA-RISC 32-bit
+
+``parisc64``
+ PA-RISC 64-bit
+
+``ppc``
+ PowerPC 32-bit big-endian
+
+``ppcle``
+ PowerPC 32-bit little-endian
+
+``ppc64``
+ PowerPC 64-bit big-endian
+
+``ppc64le``
+ PowerPC 64-bit little-endian
+
+``riscv32``
+ RISC-V 32-bit
+
+``riscv64``
+ RISC-V 64-bit
+
+``s390``, ``s390x``
+ IBM Z
+
+``sparc``
+ SPARC 32-bit
+
+``sparcv9``
+ SPARC 64-bit
+
+``x86_64``
+ Intel 64-bit
+
+Windows Platforms with GNU ABI (MinGW)
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+.. versionadded:: 4.1
+
+These identifiers are used when the :variable:`CMAKE_<LANG>_COMPILER`
+targets Windows with a GNU ABI (``_WIN32`` and ``__MINGW32__`` are defined).
+
+``aarch64``
+ ARM 64-bit
+
+``armv7``
+ ARM 32-bit
+
+``i386``, ``i486``, ``i586``, ``i686``
+ Intel 32-bit
+
+``x86_64``
+ Intel 64-bit
+
+Windows Platforms with MSVC ABI
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+.. versionadded:: 3.10
+
+These identifiers are used when the :variable:`CMAKE_<LANG>_COMPILER`
+targets Windows with a MSVC ABI (``_WIN32`` and ``_MSC_VER`` are defined).
+
+``ARM64``
+ ARM 64-bit
+
+``ARM64EC``
+ ARM 64-bit Emulation-Compatible
+
+``ARMV4I``, ``ARMV5I``, ``ARMV7``
+ ARM 32-bit
+
+``IA64``
+ Itanium 64-bit
+
+``MIPS``
+ MIPS
+
+``SHx``, ``SH3``, ``SH3DSP``, ``SH4``, ``SH5``
+ SuperH
+
+``x64``
+ Intel 64-bit
+
+``X86``
+ Intel 32-bit
+
+Windows Platforms with Watcom ABI
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+.. versionadded:: 3.10
+
+These identifiers are used when :variable:`CMAKE_<LANG>_COMPILER_ID` is
+``OpenWatcom`` or ``Watcom``.
+
+``I86``
+ Intel 16-bit
+
+``X86``
+ Intel 32-bit
+
+Green Hills MULTI Platforms
+^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+.. versionadded:: 3.14
+
+These identifiers are used when :variable:`CMAKE_<LANG>_COMPILER_ID` is
+``GHS``.
+
+``ARM``
+ ARM 32-bit
+
+``PPC``
+ PowerPC 32-bit
+
+``PPC64``
+ PowerPC 64-bit
+
+``x64``
+ Intel 64-bit
+
+``X86``
+ Intel 32-bit
+
+IAR Platforms
+^^^^^^^^^^^^^
+
+.. versionadded:: 3.10
+
+These identifiers are used when :variable:`CMAKE_<LANG>_COMPILER_ID` is
+``IAR``.
+
+``8051``
+ ..
+
+``ARM``
+ ..
+
+``AVR``
+ ..
+
+``MSP430``
+ ..
+
+``RH850``
+ ..
+
+``RISCV``
+ ..
+
+``RL78``
+ ..
+
+``RX``
+ ..
+
+``STM8``
+ ..
+
+``V850``
+ ..
+
+TASKING Platforms
+^^^^^^^^^^^^^^^^^
+
+.. versionadded:: 3.25
+
+These identifiers are used when :variable:`CMAKE_<LANG>_COMPILER_ID` is
+``Tasking``.
+
+``8051``
+ ..
+
+``ARC``
+ ..
+
+``ARM``
+ ..
+
+``MCS``
+ ..
+
+``PCP``
+ ..
+
+``TriCore``
+ ..
+
+Texas Instruments Platforms
+^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+.. versionadded:: 3.19
+
+These identifiers are used when :variable:`CMAKE_<LANG>_COMPILER_ID` is
+``TI``.
+
+``ARM``
+ ..
+
+``Blackfin``
+ ..
+
+``MSP430``
+ ..
+
+``SHARC``
+ ..
+
+``TMS320C28x``
+ ..
+
+``TMS320C6x``
+ ..
diff --git a/Help/variable/CMAKE_LANG_COMPILER_ID.rst b/Help/variable/CMAKE_LANG_COMPILER_ID.rst
index a4f899e..bed7dc2 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`_
@@ -40,6 +41,8 @@
``OpenWatcom`` `Open Watcom`_
``PGI`` The Portland Group
``PathScale`` PathScale
+``QCC`` QNX C/C++ compiler
+``SCO`` SCO OpenServer/UnixWare C/C++ Compiler
``SDCC`` `Small Device C Compiler`_
``SunPro`` Oracle Developer Studio
``Tasking`` `Tasking Compiler Toolsets`_
@@ -71,3 +74,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/Help/variable/CTEST_CVS_CHECKOUT.rst b/Help/variable/CTEST_CVS_CHECKOUT.rst
index 32cf9eb..442138f 100644
--- a/Help/variable/CTEST_CVS_CHECKOUT.rst
+++ b/Help/variable/CTEST_CVS_CHECKOUT.rst
@@ -1,6 +1,6 @@
CTEST_CVS_CHECKOUT
------------------
-.. versionadded:: 3.1
+.. deprecated:: 3.1
-Deprecated. Use :variable:`CTEST_CHECKOUT_COMMAND` instead.
+ Use :variable:`CTEST_CHECKOUT_COMMAND` variable instead.
diff --git a/Modules/CMakeASMCompiler.cmake.in b/Modules/CMakeASMCompiler.cmake.in
index ac92379..7c75837 100644
--- a/Modules/CMakeASMCompiler.cmake.in
+++ b/Modules/CMakeASMCompiler.cmake.in
@@ -18,7 +18,7 @@
set(CMAKE_ASM@ASM_DIALECT@_COMPILER_VERSION "@_CMAKE_ASM_COMPILER_VERSION@")
set(CMAKE_ASM@ASM_DIALECT@_COMPILER_ENV_VAR "@_CMAKE_ASM_COMPILER_ENV_VAR@")
@_SET_CMAKE_ASM_COMPILER_ID_VENDOR_MATCH@
-@_SET_CMAKE_ASM_COMPILER_ARCHITECTURE_ID@
+set(CMAKE_ASM@ASM_DIALECT@_ARCHITECTURE_ID "@_CMAKE_ASM_ARCHITECTURE_ID@")
@_SET_CMAKE_ASM_COMPILER_SYSROOT@
set(CMAKE_ASM@ASM_DIALECT@_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC)
diff --git a/Modules/CMakeAddFortranSubdirectory.cmake b/Modules/CMakeAddFortranSubdirectory.cmake
index dca6d23..223c5d5 100644
--- a/Modules/CMakeAddFortranSubdirectory.cmake
+++ b/Modules/CMakeAddFortranSubdirectory.cmake
@@ -5,42 +5,116 @@
CMakeAddFortranSubdirectory
---------------------------
-Add a fortran-only subdirectory, find a fortran compiler, and build.
+This module provides a function to add a Fortran project located in a
+subdirectory:
-The ``cmake_add_fortran_subdirectory`` function adds a subdirectory
-to a project that contains a fortran-only subproject. The module will
-check the current compiler and see if it can support fortran. If no
-fortran compiler is found and the compiler is MSVC, then this module
-will find the MinGW gfortran. It will then use an external project to
-build with the MinGW tools. It will also create imported targets for
-the libraries created. This will only work if the fortran code is
-built into a dll, so :variable:`BUILD_SHARED_LIBS` is turned on in
-the project. In addition the :variable:`CMAKE_GNUtoMS` option is set
-to on, so that Microsoft ``.lib`` files are created. Usage is as follows:
+.. command:: cmake_add_fortran_subdirectory
+
+ Adds a Fortran-only subproject from ``<subdir>`` to the current project.
+
+ .. code-block:: cmake
+
+ cmake_add_fortran_subdirectory(
+ <subdir>
+ PROJECT <project-name>
+ ARCHIVE_DIR <dir>
+ RUNTIME_DIR <dir>
+ LIBRARIES <libs>...
+ LINK_LIBRARIES
+ [LINK_LIBS <lib> <deps>...]...
+ [CMAKE_COMMAND_LINE <flags>...]
+ NO_EXTERNAL_INSTALL
+ )
+
+ This function checks whether the current compiler supports Fortran or attempts
+ to locate a Fortran compiler. If a compatible Fortran compiler is found, the
+ Fortran project is added as a subdirectory.
+
+ If no Fortran compiler is found and the compiler is ``MSVC``, it searches for
+ the MinGW ``gfortran`` compiler. In this case, the Fortran project is built
+ as an external project using MinGW tools, and Fortran-related imported targets
+ are created. This setup works only if the Fortran code is built as a shared
+ DLL library, so the :variable:`BUILD_SHARED_LIBS` variable is enabled in the
+ external project. Additionally, the :variable:`CMAKE_GNUtoMS` variable is set
+ to ``ON`` to ensure that Microsoft-compatible ``.lib`` files are created.
+
+ The options are:
+
+ ``PROJECT``
+ The name of the Fortran project as defined in the top-level
+ ``CMakeLists.txt`` located in ``<subdir>``.
+
+ ``ARCHIVE_DIR``
+ Directory where the project places ``.lib`` archive files. A relative path
+ is interpreted as relative to :variable:`CMAKE_CURRENT_BINARY_DIR`.
+
+ ``RUNTIME_DIR``
+ Directory where the project places ``.dll`` runtime files. A relative path
+ is interpreted as relative to :variable:`CMAKE_CURRENT_BINARY_DIR`.
+
+ ``LIBRARIES``
+ Names of library targets to create or import into the current project.
+
+ ``LINK_LIBRARIES``
+ Specifies link interface libraries for ``LIBRARIES``. This option expects a
+ list of ``LINK_LIBS <lib> <deps>...`` items, where:
+
+ * ``LINK_LIBS`` marks the start of a new pair
+ * ``<lib>`` is a library target.
+ * ``<deps>...`` represents one or more dependencies required by ``<lib>``.
+
+ ``CMAKE_COMMAND_LINE``
+ Additional command-line flags passed to :manual:`cmake(1)` command when
+ configuring the Fortran subproject.
+
+ ``NO_EXTERNAL_INSTALL``
+ Prevents installation of the external project.
+
+ .. note::
+
+ The ``NO_EXTERNAL_INSTALL`` option is required for forward compatibility
+ with a future version that supports installation of the external project
+ binaries during ``make install``.
+
+Examples
+^^^^^^^^
+
+Adding a Fortran subdirectory to a project can be done by including this module
+and calling the ``cmake_add_fortran_subdirectory()`` function. In the following
+example, a Fortran project provides the ``hello`` library and its dependent
+``world`` library:
.. code-block:: cmake
+ include(CMakeAddFortranSubdirectory)
+
cmake_add_fortran_subdirectory(
- <subdir> # name of subdirectory
- PROJECT <project_name> # project name in subdir top CMakeLists.txt
- ARCHIVE_DIR <dir> # dir where project places .lib files
- RUNTIME_DIR <dir> # dir where project places .dll files
- LIBRARIES <lib>... # names of library targets to import
- LINK_LIBRARIES # link interface libraries for LIBRARIES
- [LINK_LIBS <lib> <dep>...]...
- CMAKE_COMMAND_LINE ... # extra command line flags to pass to cmake
- NO_EXTERNAL_INSTALL # skip installation of external project
- )
+ fortran-subdir
+ PROJECT FortranHelloWorld
+ ARCHIVE_DIR lib
+ RUNTIME_DIR bin
+ LIBRARIES hello world
+ LINK_LIBRARIES
+ LINK_LIBS hello world # hello library depends on the world library
+ NO_EXTERNAL_INSTALL
+ )
-Relative paths in ``ARCHIVE_DIR`` and ``RUNTIME_DIR`` are interpreted with
-respect to the build directory corresponding to the source directory
-in which the function is invoked.
+ # The Fortran target can be then linked to the main project target.
+ add_executable(main main.c)
+ target_link_libraries(main PRIVATE hello)
-Limitations:
+See Also
+^^^^^^^^
-``NO_EXTERNAL_INSTALL`` is required for forward compatibility with a
-future version that supports installation of the external project
-binaries during ``make install``.
+There are multiple ways to integrate Fortran libraries. Alternative approaches
+include:
+
+* The :command:`add_subdirectory` command to add the subdirectory directly to
+ the build.
+* The :command:`export` command can be used in the subproject to provide
+ :ref:`Imported Targets` or similar for integration with other projects.
+* The :module:`FetchContent` or :module:`ExternalProject` modules when working
+ with external dependencies.
#]=======================================================================]
include(CheckLanguage)
diff --git a/Modules/CMakeBackwardCompatibilityCXX.cmake b/Modules/CMakeBackwardCompatibilityCXX.cmake
index e6b87f6..b0e6c16 100644
--- a/Modules/CMakeBackwardCompatibilityCXX.cmake
+++ b/Modules/CMakeBackwardCompatibilityCXX.cmake
@@ -5,16 +5,36 @@
CMakeBackwardCompatibilityCXX
-----------------------------
-define a bunch of backwards compatibility variables
+This module defines several backward compatibility cache variables for the
+``CXX`` language to support early C++ (pre-C++98, ANSI C++).
-::
+The following modules are included by this module:
- CMAKE_ANSI_CXXFLAGS - flag for ansi c++
- CMAKE_HAS_ANSI_STRING_STREAM - has <strstream>
- include(TestForANSIStreamHeaders)
- include(CheckIncludeFileCXX)
- include(TestForSTDNamespace)
- include(TestForANSIForScope)
+* :module:`TestForANSIForScope`
+* :module:`TestForANSIStreamHeaders`
+* :module:`TestForSSTREAM`
+* :module:`TestForSTDNamespace`
+
+Additionally, the following cache variable may be defined:
+
+``CMAKE_ANSI_CXXFLAGS``
+ A space-separated string of compiler options for enabling ANSI C++ mode, if
+ available.
+
+.. note::
+
+ This module is intended for C++ code written before ``C++ 98``. As of the
+ ``C++ 98`` standard, these issues have been formally addressed, making such
+ checks obsolete.
+
+Examples
+^^^^^^^^
+
+Including this module provides backward compatibility cache variables:
+
+.. code-block:: cmake
+
+ include(CMakeBackwardCompatibilityCXX)
#]=======================================================================]
if(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)
@@ -28,7 +48,7 @@
# if CMAKE_TRY_ANSI_CXX_FLAGS has something in it, see
# if the compiler accepts it
if(NOT CMAKE_TRY_ANSI_CXX_FLAGS STREQUAL "")
- CHECK_CXX_ACCEPTS_FLAG(${CMAKE_TRY_ANSI_CXX_FLAGS} CMAKE_CXX_ACCEPTS_FLAGS)
+ check_cxx_accepts_flag(${CMAKE_TRY_ANSI_CXX_FLAGS} CMAKE_CXX_ACCEPTS_FLAGS)
# if the compiler liked the flag then set CMAKE_ANSI_CXXFLAGS
# to the flag
if(CMAKE_CXX_ACCEPTS_FLAGS)
diff --git a/Modules/CMakeCCompiler.cmake.in b/Modules/CMakeCCompiler.cmake.in
index 5642f99..61bf9f2 100644
--- a/Modules/CMakeCCompiler.cmake.in
+++ b/Modules/CMakeCCompiler.cmake.in
@@ -18,7 +18,7 @@
set(CMAKE_C_SIMULATE_ID "@CMAKE_C_SIMULATE_ID@")
set(CMAKE_C_COMPILER_FRONTEND_VARIANT "@CMAKE_C_COMPILER_FRONTEND_VARIANT@")
set(CMAKE_C_SIMULATE_VERSION "@CMAKE_C_SIMULATE_VERSION@")
-@_SET_CMAKE_C_COMPILER_ARCHITECTURE_ID@
+set(CMAKE_C_COMPILER_ARCHITECTURE_ID "@CMAKE_C_COMPILER_ARCHITECTURE_ID@")
@_SET_CMAKE_C_COMPILER_SYSROOT@
@SET_MSVC_C_ARCHITECTURE_ID@
@SET_CMAKE_XCODE_ARCHS@
diff --git a/Modules/CMakeCCompilerABI.c b/Modules/CMakeCCompilerABI.c
index 63596be..61e31d5 100644
--- a/Modules/CMakeCCompilerABI.c
+++ b/Modules/CMakeCCompilerABI.c
@@ -23,6 +23,9 @@
#if defined(ABI_ID)
require += info_abi[argc];
#endif
+#if defined(ARCHITECTURE_ID)
+ require += info_arch[argc];
+#endif
(void)argv;
return require;
}
diff --git a/Modules/CMakeCUDACompiler.cmake.in b/Modules/CMakeCUDACompiler.cmake.in
index 6b8b433..ea31ea0 100644
--- a/Modules/CMakeCUDACompiler.cmake.in
+++ b/Modules/CMakeCUDACompiler.cmake.in
@@ -23,6 +23,7 @@
set(CMAKE_CUDA_SIMULATE_ID "@CMAKE_CUDA_SIMULATE_ID@")
set(CMAKE_CUDA_COMPILER_FRONTEND_VARIANT "@CMAKE_CUDA_COMPILER_FRONTEND_VARIANT@")
set(CMAKE_CUDA_SIMULATE_VERSION "@CMAKE_CUDA_SIMULATE_VERSION@")
+set(CMAKE_CUDA_COMPILER_ARCHITECTURE_ID "@CMAKE_CUDA_COMPILER_ARCHITECTURE_ID@")
@SET_MSVC_CUDA_ARCHITECTURE_ID@
@_SET_CMAKE_CUDA_COMPILER_SYSROOT@
diff --git a/Modules/CMakeCUDACompilerABI.cu b/Modules/CMakeCUDACompilerABI.cu
index b04d0ec..1550a9d 100644
--- a/Modules/CMakeCUDACompilerABI.cu
+++ b/Modules/CMakeCUDACompilerABI.cu
@@ -14,6 +14,9 @@
#if defined(ABI_ID)
require += info_abi[argc];
#endif
+#if defined(ARCHITECTURE_ID)
+ require += info_arch[argc];
+#endif
static_cast<void>(argv);
if (!cmakeCompilerCUDAArch()) {
diff --git a/Modules/CMakeCXXCompiler.cmake.in b/Modules/CMakeCXXCompiler.cmake.in
index b1de7fb..a69d289 100644
--- a/Modules/CMakeCXXCompiler.cmake.in
+++ b/Modules/CMakeCXXCompiler.cmake.in
@@ -20,7 +20,7 @@
set(CMAKE_CXX_SIMULATE_ID "@CMAKE_CXX_SIMULATE_ID@")
set(CMAKE_CXX_COMPILER_FRONTEND_VARIANT "@CMAKE_CXX_COMPILER_FRONTEND_VARIANT@")
set(CMAKE_CXX_SIMULATE_VERSION "@CMAKE_CXX_SIMULATE_VERSION@")
-@_SET_CMAKE_CXX_COMPILER_ARCHITECTURE_ID@
+set(CMAKE_CXX_COMPILER_ARCHITECTURE_ID "@CMAKE_CXX_COMPILER_ARCHITECTURE_ID@")
@_SET_CMAKE_CXX_COMPILER_SYSROOT@
@SET_MSVC_CXX_ARCHITECTURE_ID@
@SET_CMAKE_XCODE_ARCHS@
diff --git a/Modules/CMakeCXXCompilerABI.cpp b/Modules/CMakeCXXCompilerABI.cpp
index 036b96e..23e4bdf 100644
--- a/Modules/CMakeCXXCompilerABI.cpp
+++ b/Modules/CMakeCXXCompilerABI.cpp
@@ -13,6 +13,9 @@
#if defined(ABI_ID)
require += info_abi[argc];
#endif
+#if defined(ARCHITECTURE_ID)
+ require += info_arch[argc];
+#endif
(void)argv;
return require;
}
diff --git a/Modules/CMakeCompilerABI.h b/Modules/CMakeCompilerABI.h
index ec0d785..dc71f9f 100644
--- a/Modules/CMakeCompilerABI.h
+++ b/Modules/CMakeCompilerABI.h
@@ -40,6 +40,121 @@
# define ABI_ID "ELF"
#endif
+/* Sync with:
+ * Help/variable/CMAKE_LANG_COMPILER_ARCHITECTURE_ID.rst
+ * Modules/CMakeFortranCompilerABI.F
+ * Modules/CMakeFortranCompilerABI.F90
+ * Modules/Internal/CMakeParseCompilerArchitectureId.cmake
+ */
+#if defined(__APPLE__) && defined(__arm64__)
+# if defined(__ARM64_ARCH_8_32__)
+# define ARCHITECTURE_ID "arm64_32"
+# elif defined(__arm64e__)
+# define ARCHITECTURE_ID "arm64e"
+# else
+# define ARCHITECTURE_ID "arm64"
+# endif
+#elif defined(_MSC_VER) && defined(_M_ARM64EC)
+# define ARCHITECTURE_ID "arm64ec"
+#elif defined(_MSC_VER) && defined(_M_ARM64)
+# define ARCHITECTURE_ID "arm64"
+#elif defined(__arm64ec__)
+# define ARCHITECTURE_ID "arm64ec"
+#elif defined(__aarch64__)
+# define ARCHITECTURE_ID "aarch64"
+#elif __ARM_ARCH == 7 || _M_ARM == 7 || defined(__ARM_ARCH_7__) || \
+ defined(__TI_ARM_V7__)
+# if defined(__APPLE__) && defined(__ARM_ARCH_7K__)
+# define ARCHITECTURE_ID "armv7k"
+# elif defined(__APPLE__) && defined(__ARM_ARCH_7S__)
+# define ARCHITECTURE_ID "armv7s"
+# else
+# define ARCHITECTURE_ID "armv7"
+# endif
+#elif __ARM_ARCH == 6 || _M_ARM == 6 || defined(__ARM_ARCH_6__) || \
+ defined(__TI_ARM_V6__)
+# define ARCHITECTURE_ID "armv6"
+#elif __ARM_ARCH == 5 || _M_ARM == 5 || defined(__ARM_ARCH_5__) || \
+ defined(__TI_ARM_V5__)
+# define ARCHITECTURE_ID "armv5"
+#elif defined(__alpha) || defined(__alpha) || defined(_M_ALPHA)
+# define ARCHITECTURE_ID "alpha"
+#elif defined(__x86_64) || defined(__x86_64__) || defined(__amd64) || \
+ defined(__amd64__) || defined(_M_X64) || defined(_M_AMD64)
+# define ARCHITECTURE_ID "x86_64"
+#elif defined(__i686) || defined(__i686__) || _M_IX86 == 600
+# define ARCHITECTURE_ID "i686"
+#elif defined(__i586) || defined(__i586__) || _M_IX86 == 500
+# define ARCHITECTURE_ID "i586"
+#elif defined(__i486) || defined(__i486__) || _M_IX86 == 400
+# define ARCHITECTURE_ID "i486"
+#elif defined(__i386) || defined(__i386__) || defined(_M_IX86)
+# define ARCHITECTURE_ID "i386"
+#elif defined(__ia64) || defined(__ia64__) || defined(_M_IA64)
+# define ARCHITECTURE_ID "ia64"
+#elif defined(__loongarch64)
+# define ARCHITECTURE_ID "loongarch64"
+#elif defined(__loongarch__)
+# define ARCHITECTURE_ID "loongarch32"
+#elif defined(__m68k__)
+# define ARCHITECTURE_ID "m68k"
+#elif defined(__mips64) || defined(__mips64__)
+# if defined(_MIPSEL)
+# define ARCHITECTURE_ID "mips64el"
+# else
+# define ARCHITECTURE_ID "mips64"
+# endif
+#elif defined(__mips) || defined(__mips__)
+# if defined(_MIPSEL)
+# define ARCHITECTURE_ID "mipsel"
+# else
+# define ARCHITECTURE_ID "mips"
+# endif
+#elif defined(__riscv) && __riscv_xlen == 64
+# define ARCHITECTURE_ID "riscv64"
+#elif defined(__riscv) && __riscv_xlen == 32
+# define ARCHITECTURE_ID "riscv32"
+#elif defined(__s390x__)
+# define ARCHITECTURE_ID "s390x"
+#elif defined(__s390__)
+# define ARCHITECTURE_ID "s390"
+#elif defined(__sparcv9) || defined(__sparcv9__) || defined(__sparc64__)
+# define ARCHITECTURE_ID "sparcv9"
+#elif defined(__sparc) || defined(__sparc__)
+# define ARCHITECTURE_ID "sparc"
+#elif defined(__hppa) || defined(__hppa__)
+# if defined(__LP64__)
+# define ARCHITECTURE_ID "parisc64"
+# else
+# define ARCHITECTURE_ID "parisc"
+# endif
+#elif defined(__ppc64__) || defined(__powerpc64__) || defined(__PPC64__) || \
+ defined(_ARCH_PPC64)
+# if defined(_LITTLE_ENDIAN) || defined(__LITTLE_ENDIAN__)
+# define ARCHITECTURE_ID "ppc64le"
+# else
+# define ARCHITECTURE_ID "ppc64"
+# endif
+#elif defined(__ppc__) || defined(__powerpc__) || defined(__PPC__) || \
+ defined(_ARCH_PPC)
+# if defined(_LITTLE_ENDIAN) || defined(__LITTLE_ENDIAN__)
+# define ARCHITECTURE_ID "ppcle"
+# else
+# define ARCHITECTURE_ID "ppc"
+# endif
+#endif
+
+/* Construct the string literal in pieces to prevent the source from
+ getting matched. Store it in a pointer rather than an array
+ because some compilers will just produce instructions to fill the
+ array rather than assigning a pointer to a static array. */
#if defined(ABI_ID)
-static char const info_abi[] = "INFO:abi[" ABI_ID "]";
+static char const* info_abi = "INFO"
+ ":"
+ "abi[" ABI_ID "]";
+#endif
+#if defined(ARCHITECTURE_ID)
+static char const* info_arch = "INFO"
+ ":"
+ "arch[" ARCHITECTURE_ID "]";
#endif
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..e0bcf5c 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)")
@@ -234,18 +238,6 @@
message(STATUS "Didn't find assembler")
endif()
-foreach(_var
- COMPILER
- COMPILER_ID
- COMPILER_ARG1
- COMPILER_ENV_VAR
- COMPILER_AR
- COMPILER_RANLIB
- COMPILER_VERSION
- )
- set(_CMAKE_ASM_${_var} "${CMAKE_ASM${ASM_DIALECT}_${_var}}")
-endforeach()
-
if(CMAKE_ASM${ASM_DIALECT}_COMPILER_SYSROOT)
string(CONCAT _SET_CMAKE_ASM_COMPILER_SYSROOT
"set(CMAKE_ASM${ASM_DIALECT}_COMPILER_SYSROOT \"${CMAKE_ASM${ASM_DIALECT}_COMPILER_SYSROOT}\")\n"
@@ -261,25 +253,21 @@
set(_SET_CMAKE_ASM_COMPILER_ID_VENDOR_MATCH "")
endif()
-if(CMAKE_ASM${ASM_DIALECT}_COMPILER_ARCHITECTURE_ID)
- set(_SET_CMAKE_ASM_COMPILER_ARCHITECTURE_ID
- "set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ARCHITECTURE_ID ${CMAKE_ASM${ASM_DIALECT}_COMPILER_ARCHITECTURE_ID})")
-else()
- set(_SET_CMAKE_ASM_COMPILER_ARCHITECTURE_ID "")
-endif()
-
# configure variables set in this file for fast reload later on
-configure_file(${CMAKE_ROOT}/Modules/CMakeASMCompiler.cmake.in
- ${CMAKE_PLATFORM_INFO_DIR}/CMakeASM${ASM_DIALECT}Compiler.cmake @ONLY)
-
-foreach(_var
- COMPILER
- COMPILER_ID
- COMPILER_ARG1
- COMPILER_ENV_VAR
- COMPILER_AR
- COMPILER_RANLIB
- COMPILER_VERSION
- )
- unset(_CMAKE_ASM_${_var})
-endforeach()
+block()
+ foreach(_var IN ITEMS
+ # Keep in sync with Internal/CMakeTestASMLinker.
+ COMPILER
+ COMPILER_ID
+ COMPILER_ARG1
+ COMPILER_ENV_VAR
+ COMPILER_AR
+ COMPILER_RANLIB
+ COMPILER_VERSION
+ COMPILER_ARCHITECTURE_ID
+ )
+ set(_CMAKE_ASM_${_var} "${CMAKE_ASM${ASM_DIALECT}_${_var}}")
+ endforeach()
+ configure_file(${CMAKE_ROOT}/Modules/CMakeASMCompiler.cmake.in
+ ${CMAKE_PLATFORM_INFO_DIR}/CMakeASM${ASM_DIALECT}Compiler.cmake @ONLY)
+endblock()
diff --git a/Modules/CMakeDetermineCCompiler.cmake b/Modules/CMakeDetermineCCompiler.cmake
index 214bca1..98d57c8 100644
--- a/Modules/CMakeDetermineCCompiler.cmake
+++ b/Modules/CMakeDetermineCCompiler.cmake
@@ -210,13 +210,6 @@
set(_SET_CMAKE_C_COMPILER_SYSROOT "")
endif()
-if(CMAKE_C_COMPILER_ARCHITECTURE_ID)
- set(_SET_CMAKE_C_COMPILER_ARCHITECTURE_ID
- "set(CMAKE_C_COMPILER_ARCHITECTURE_ID ${CMAKE_C_COMPILER_ARCHITECTURE_ID})")
-else()
- set(_SET_CMAKE_C_COMPILER_ARCHITECTURE_ID "")
-endif()
-
if(MSVC_C_ARCHITECTURE_ID)
set(SET_MSVC_C_ARCHITECTURE_ID
"set(MSVC_C_ARCHITECTURE_ID ${MSVC_C_ARCHITECTURE_ID})")
diff --git a/Modules/CMakeDetermineCUDACompiler.cmake b/Modules/CMakeDetermineCUDACompiler.cmake
index 698346f..1cb91f0 100644
--- a/Modules/CMakeDetermineCUDACompiler.cmake
+++ b/Modules/CMakeDetermineCUDACompiler.cmake
@@ -70,7 +70,7 @@
# We determine the vendor to help with find the toolkit and use the right flags for detection right away.
# The main compiler identification is still needed below to extract other information.
list(APPEND CMAKE_CUDA_COMPILER_ID_VENDORS NVIDIA Clang)
- set(CMAKE_CUDA_COMPILER_ID_VENDOR_REGEX_NVIDIA "nvcc: NVIDIA \\(R\\) Cuda compiler driver")
+ set(CMAKE_CUDA_COMPILER_ID_VENDOR_REGEX_NVIDIA "nvcc: [^\n]+ Cuda compiler driver")
set(CMAKE_CUDA_COMPILER_ID_VENDOR_REGEX_Clang "(clang version)")
CMAKE_DETERMINE_COMPILER_ID_VENDOR(CUDA "--version")
@@ -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/CMakeDetermineCXXCompiler.cmake b/Modules/CMakeDetermineCXXCompiler.cmake
index 895f558..a5d33a0 100644
--- a/Modules/CMakeDetermineCXXCompiler.cmake
+++ b/Modules/CMakeDetermineCXXCompiler.cmake
@@ -216,13 +216,6 @@
set(_SET_CMAKE_CXX_COMPILER_SYSROOT "")
endif()
-if(CMAKE_CXX_COMPILER_ARCHITECTURE_ID)
- set(_SET_CMAKE_CXX_COMPILER_ARCHITECTURE_ID
- "set(CMAKE_CXX_COMPILER_ARCHITECTURE_ID ${CMAKE_CXX_COMPILER_ARCHITECTURE_ID})")
-else()
- set(_SET_CMAKE_CXX_COMPILER_ARCHITECTURE_ID "")
-endif()
-
if(MSVC_CXX_ARCHITECTURE_ID)
set(SET_MSVC_CXX_ARCHITECTURE_ID
"set(MSVC_CXX_ARCHITECTURE_ID ${MSVC_CXX_ARCHITECTURE_ID})")
diff --git a/Modules/CMakeDetermineCompilerABI.cmake b/Modules/CMakeDetermineCompilerABI.cmake
index 9fe3951..23509ac 100644
--- a/Modules/CMakeDetermineCompilerABI.cmake
+++ b/Modules/CMakeDetermineCompilerABI.cmake
@@ -150,6 +150,7 @@
set(ABI_SIZEOF_DPTR "NOTFOUND")
set(ABI_BYTE_ORDER "NOTFOUND")
set(ABI_NAME "NOTFOUND")
+ set(ARCHITECTURE_ID "")
foreach(info ${ABI_STRINGS})
if("${info}" MATCHES "INFO:sizeof_dptr\\[0*([^]]*)\\]" AND NOT ABI_SIZEOF_DPTR)
set(ABI_SIZEOF_DPTR "${CMAKE_MATCH_1}")
@@ -167,6 +168,9 @@
if("${info}" MATCHES "INFO:abi\\[([^]]*)\\]" AND NOT ABI_NAME)
set(ABI_NAME "${CMAKE_MATCH_1}")
endif()
+ if("${info}" MATCHES "INFO:arch\\[([^]\"]*)\\]")
+ list(APPEND ARCHITECTURE_ID "${CMAKE_MATCH_1}")
+ endif()
endforeach()
if(ABI_SIZEOF_DPTR)
@@ -183,6 +187,28 @@
set(CMAKE_${lang}_COMPILER_ABI "${ABI_NAME}" PARENT_SCOPE)
endif()
+ # The GNU Fortran compiler does not predefine architecture macros.
+ if(NOT CMAKE_${lang}_COMPILER_ARCHITECTURE_ID AND NOT ARCHITECTURE_ID
+ AND lang STREQUAL "Fortran" AND CMAKE_${lang}_COMPILER_ID STREQUAL "GNU")
+ execute_process(COMMAND "${CMAKE_${lang}_COMPILER}" -dumpmachine
+ OUTPUT_VARIABLE _dumpmachine_triple OUTPUT_STRIP_TRAILING_WHITESPACE
+ ERROR_VARIABLE _dumpmachine_stderr
+ RESULT_VARIABLE _dumpmachine_result
+ )
+ if(_dumpmachine_result EQUAL 0)
+ include(Internal/CMakeParseCompilerArchitectureId)
+ cmake_parse_compiler_architecture_id("${_dumpmachine_triple}" ARCHITECTURE_ID)
+ endif()
+ endif()
+
+ # For some compilers we detect the architecture id during compiler identification.
+ # If this was not one of those, use what was detected during compiler ABI detection,
+ # which might be a list, e.g., when CMAKE_OSX_ARCHITECTURES has multiple values.
+ if(NOT CMAKE_${lang}_COMPILER_ARCHITECTURE_ID AND ARCHITECTURE_ID)
+ list(SORT ARCHITECTURE_ID)
+ set(CMAKE_${lang}_COMPILER_ARCHITECTURE_ID "${ARCHITECTURE_ID}" PARENT_SCOPE)
+ endif()
+
# Parse implicit include directory for this language, if available.
if(CMAKE_${lang}_VERBOSE_FLAG)
set (implicit_incdirs "")
diff --git a/Modules/CMakeDetermineFortranCompiler.cmake b/Modules/CMakeDetermineFortranCompiler.cmake
index e0f9bef..f7727a9 100644
--- a/Modules/CMakeDetermineFortranCompiler.cmake
+++ b/Modules/CMakeDetermineFortranCompiler.cmake
@@ -327,13 +327,6 @@
set(_SET_CMAKE_Fortran_COMPILER_SYSROOT "")
endif()
-if(CMAKE_Fortran_COMPILER_ARCHITECTURE_ID)
- set(_SET_CMAKE_Fortran_COMPILER_ARCHITECTURE_ID
- "set(CMAKE_Fortran_COMPILER_ARCHITECTURE_ID ${CMAKE_Fortran_COMPILER_ARCHITECTURE_ID})")
-else()
- set(_SET_CMAKE_Fortran_COMPILER_ARCHITECTURE_ID "")
-endif()
-
if(MSVC_Fortran_ARCHITECTURE_ID)
set(SET_MSVC_Fortran_ARCHITECTURE_ID
"set(MSVC_Fortran_ARCHITECTURE_ID ${MSVC_Fortran_ARCHITECTURE_ID})")
diff --git a/Modules/CMakeDetermineHIPCompiler.cmake b/Modules/CMakeDetermineHIPCompiler.cmake
index 041302a..a331715 100644
--- a/Modules/CMakeDetermineHIPCompiler.cmake
+++ b/Modules/CMakeDetermineHIPCompiler.cmake
@@ -90,7 +90,7 @@
# We determine the vendor to use the right flags for detection right away.
# The main compiler identification is still needed below to extract other information.
list(APPEND CMAKE_HIP_COMPILER_ID_VENDORS NVIDIA Clang)
- set(CMAKE_HIP_COMPILER_ID_VENDOR_REGEX_NVIDIA "nvcc: NVIDIA \\(R\\) Cuda compiler driver")
+ set(CMAKE_HIP_COMPILER_ID_VENDOR_REGEX_NVIDIA "nvcc: [^\n]+ Cuda compiler driver")
set(CMAKE_HIP_COMPILER_ID_VENDOR_REGEX_Clang "(clang version)")
CMAKE_DETERMINE_COMPILER_ID_VENDOR(HIP "--version")
@@ -268,13 +268,6 @@
set(_SET_CMAKE_HIP_COMPILER_SYSROOT "")
endif()
-if(CMAKE_HIP_COMPILER_ARCHITECTURE_ID)
- set(_SET_CMAKE_HIP_COMPILER_ARCHITECTURE_ID
- "set(CMAKE_HIP_COMPILER_ARCHITECTURE_ID ${CMAKE_HIP_COMPILER_ARCHITECTURE_ID})")
-else()
- set(_SET_CMAKE_HIP_COMPILER_ARCHITECTURE_ID "")
-endif()
-
if(MSVC_HIP_ARCHITECTURE_ID)
set(SET_MSVC_HIP_ARCHITECTURE_ID
"set(MSVC_HIP_ARCHITECTURE_ID ${MSVC_HIP_ARCHITECTURE_ID})")
diff --git a/Modules/CMakeDetermineOBJCCompiler.cmake b/Modules/CMakeDetermineOBJCCompiler.cmake
index 280be74..43a0b4a 100644
--- a/Modules/CMakeDetermineOBJCCompiler.cmake
+++ b/Modules/CMakeDetermineOBJCCompiler.cmake
@@ -169,13 +169,6 @@
include(Compiler/${CMAKE_OBJC_COMPILER_ID}-FindBinUtils OPTIONAL)
unset(_CMAKE_PROCESSING_LANGUAGE)
-if(CMAKE_OBJC_COMPILER_ARCHITECTURE_ID)
- set(_SET_CMAKE_OBJC_COMPILER_ARCHITECTURE_ID
- "set(CMAKE_OBJC_COMPILER_ARCHITECTURE_ID ${CMAKE_OBJC_COMPILER_ARCHITECTURE_ID})")
-else()
- set(_SET_CMAKE_OBJC_COMPILER_ARCHITECTURE_ID "")
-endif()
-
if(CMAKE_OBJC_XCODE_ARCHS)
set(SET_CMAKE_XCODE_ARCHS
"set(CMAKE_XCODE_ARCHS \"${CMAKE_OBJC_XCODE_ARCHS}\")")
diff --git a/Modules/CMakeDetermineOBJCXXCompiler.cmake b/Modules/CMakeDetermineOBJCXXCompiler.cmake
index 24f9175..cf56342 100644
--- a/Modules/CMakeDetermineOBJCXXCompiler.cmake
+++ b/Modules/CMakeDetermineOBJCXXCompiler.cmake
@@ -176,13 +176,6 @@
include(Compiler/${CMAKE_OBJCXX_COMPILER_ID}-FindBinUtils OPTIONAL)
unset(_CMAKE_PROCESSING_LANGUAGE)
-if(CMAKE_OBJCXX_COMPILER_ARCHITECTURE_ID)
- set(_SET_CMAKE_OBJCXX_COMPILER_ARCHITECTURE_ID
- "set(CMAKE_OBJCXX_COMPILER_ARCHITECTURE_ID ${CMAKE_OBJCXX_COMPILER_ARCHITECTURE_ID})")
-else()
- set(_SET_CMAKE_OBJCXX_COMPILER_ARCHITECTURE_ID "")
-endif()
-
if(CMAKE_OBJCXX_XCODE_ARCHS)
set(SET_CMAKE_XCODE_ARCHS
"set(CMAKE_XCODE_ARCHS \"${CMAKE_OBJCXX_XCODE_ARCHS}\")")
diff --git a/Modules/CMakeDetermineVSServicePack.cmake b/Modules/CMakeDetermineVSServicePack.cmake
index b2dfd1d..4706634 100644
--- a/Modules/CMakeDetermineVSServicePack.cmake
+++ b/Modules/CMakeDetermineVSServicePack.cmake
@@ -7,15 +7,35 @@
.. deprecated:: 3.0
- Do not use.
+ This module should no longer be used. The functionality of this module has
+ been superseded by the :variable:`CMAKE_<LANG>_COMPILER_VERSION` variable that
+ contains the compiler version number.
-The functionality of this module has been superseded by the
-:variable:`CMAKE_<LANG>_COMPILER_VERSION` variable that contains
-the compiler version number.
+This module provides a function to determine the installed Visual Studio service
+pack version for Visual Studio 2012 and earlier.
-Determine the Visual Studio service pack of the 'cl' in use.
+.. command:: DetermineVSServicePack
-Usage:
+ .. code-block:: cmake
+
+ DetermineVSServicePack(<result>)
+
+ Determines the Visual Studio service pack version of the ``cl`` compiler in
+ use and stores the result in the specified internal cache variable
+ ``<result>``.
+
+ The ``<result>`` variable will be set to one of the following values or an
+ empty string if the service pack cannot be determined:
+
+ * ``vc80``, ``vc80sp1``
+ * ``vc90``, ``vc90sp1``
+ * ``vc100``, ``vc100sp1``
+ * ``vc110``, ``vc110sp1``, ``vc110sp2``, ``vc110sp3``, ``vc110sp4``
+
+Examples
+^^^^^^^^
+
+Determining the Visual Studio service pack version in a project:
.. code-block:: cmake
@@ -26,14 +46,6 @@
message(STATUS "Detected: ${my_service_pack}")
endif()
endif()
-
-Function DetermineVSServicePack sets the given variable to one of the
-following values or an empty string if unknown::
-
- vc80, vc80sp1
- vc90, vc90sp1
- vc100, vc100sp1
- vc110, vc110sp1, vc110sp2, vc110sp3, vc110sp4
#]=======================================================================]
if(NOT CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 2.8.8)
diff --git a/Modules/CMakeExpandImportedTargets.cmake b/Modules/CMakeExpandImportedTargets.cmake
index 4fad7f6..64561e8 100644
--- a/Modules/CMakeExpandImportedTargets.cmake
+++ b/Modules/CMakeExpandImportedTargets.cmake
@@ -7,37 +7,69 @@
.. deprecated:: 3.4
- Do not use.
+ This module should no longer be used.
-This module was once needed to expand imported targets to the underlying
-libraries they reference on disk for use with the :command:`try_compile`
-and :command:`try_run` commands. These commands now support imported
-libraries in their ``LINK_LIBRARIES`` options (since CMake 2.8.11
-for :command:`try_compile` and since CMake 3.2 for :command:`try_run`).
+ It was once needed to replace :ref:`Imported Targets` with their underlying
+ libraries referenced on disk for use with the :command:`try_compile` and
+ :command:`try_run` commands. These commands now support imported targets in
+ their ``LINK_LIBRARIES`` options (since CMake 2.8.11 for
+ :command:`try_compile` command and since CMake 3.2 for :command:`try_run`
+ command).
-This module does not support the policy :policy:`CMP0022` ``NEW``
-behavior or use of the :prop_tgt:`INTERFACE_LINK_LIBRARIES` property
-because :manual:`generator expressions <cmake-generator-expressions(7)>`
-cannot be evaluated during configuration.
+.. note::
+
+ This module does not support the policy :policy:`CMP0022` ``NEW`` behavior,
+ nor does it use the :prop_tgt:`INTERFACE_LINK_LIBRARIES` property, because
+ :manual:`generator expressions <cmake-generator-expressions(7)>` cannot be
+ evaluated at the configuration phase.
+
+Functions
+^^^^^^^^^
+
+This module defines the following function:
+
+.. command:: cmake_expand_imported_targets
+
+ .. code-block:: cmake
+
+ cmake_expand_imported_targets(
+ <result-var>
+ LIBRARIES <libs>...
+ [CONFIGURATION <config>]
+ )
+
+ Expands all imported targets in a list of libraries ``<libs>...`` to their
+ corresponding file paths on disk and stores the resulting list in a local
+ variable ``<result-var>``.
+
+ The options are:
+
+ ``LIBRARIES``
+ A :ref:`semicolon-separated list <CMake Language Lists>` of system and
+ imported targets. Imported targets in this list are replaced with their
+ corresponding library file paths, including libraries from their link
+ interfaces.
+
+ ``CONFIGURATION``
+ If this option is given, it uses the respective build configuration
+ ``<config>`` of the imported targets if it exists. If omitted, it defaults
+ to the first entry in the :variable:`CMAKE_CONFIGURATION_TYPES` variable, or
+ falls back to :variable:`CMAKE_BUILD_TYPE` if ``CMAKE_CONFIGURATION_TYPES``
+ is not set.
+
+Examples
+^^^^^^^^
+
+Using this module to get a list of library paths:
.. code-block:: cmake
- CMAKE_EXPAND_IMPORTED_TARGETS(<var> LIBRARIES lib1 lib2...libN
- [CONFIGURATION <config>])
-
-CMAKE_EXPAND_IMPORTED_TARGETS() takes a list of libraries and replaces
-all imported targets contained in this list with their actual file
-paths of the referenced libraries on disk, including the libraries
-from their link interfaces. If a CONFIGURATION is given, it uses the
-respective configuration of the imported targets if it exists. If no
-CONFIGURATION is given, it uses the first configuration from
-${CMAKE_CONFIGURATION_TYPES} if set, otherwise ${CMAKE_BUILD_TYPE}.
-
-.. code-block:: cmake
-
- cmake_expand_imported_targets(expandedLibs
- LIBRARIES ${CMAKE_REQUIRED_LIBRARIES}
- CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}" )
+ include(CMakeExpandImportedTargets)
+ cmake_expand_imported_targets(
+ expandedLibs
+ LIBRARIES ${CMAKE_REQUIRED_LIBRARIES}
+ CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}"
+ )
#]=======================================================================]
function(CMAKE_EXPAND_IMPORTED_TARGETS _RESULT )
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/CMakeFortranCompiler.cmake.in b/Modules/CMakeFortranCompiler.cmake.in
index 1a4acc4..bfcf3f4 100644
--- a/Modules/CMakeFortranCompiler.cmake.in
+++ b/Modules/CMakeFortranCompiler.cmake.in
@@ -8,7 +8,7 @@
set(CMAKE_Fortran_COMPILER_FRONTEND_VARIANT "@CMAKE_Fortran_COMPILER_FRONTEND_VARIANT@")
set(CMAKE_Fortran_SIMULATE_VERSION "@CMAKE_Fortran_SIMULATE_VERSION@")
@_SET_CMAKE_Fortran_XL_CPP@
-@_SET_CMAKE_Fortran_COMPILER_ARCHITECTURE_ID@
+set(CMAKE_Fortran_COMPILER_ARCHITECTURE_ID "@CMAKE_Fortran_COMPILER_ARCHITECTURE_ID@")
@_SET_CMAKE_Fortran_COMPILER_SYSROOT@
@SET_MSVC_Fortran_ARCHITECTURE_ID@
set(CMAKE_AR "@CMAKE_AR@")
diff --git a/Modules/CMakeFortranCompilerABI.F b/Modules/CMakeFortranCompilerABI.F
index f4a5489..81676cb 100644
--- a/Modules/CMakeFortranCompilerABI.F
+++ b/Modules/CMakeFortranCompilerABI.F
@@ -12,6 +12,8 @@
PRINT *, 'INFO:sizeof_dptr[8]'
#elif defined(__x86_64__)
PRINT *, 'INFO:sizeof_dptr[8]'
+#elif defined(__sparcv9) || defined(__sparcv9__) || defined(__sparc64__)
+ PRINT *, 'INFO:sizeof_dptr[8]'
#elif defined(_ILP32)
PRINT *, 'INFO:sizeof_dptr[4]'
@@ -19,6 +21,8 @@
PRINT *, 'INFO:sizeof_dptr[4]'
#elif defined(__i386__)
PRINT *, 'INFO:sizeof_dptr[4]'
+#elif defined(__sparc) || defined(__sparc__)
+ PRINT *, 'INFO:sizeof_dptr[4]'
#elif defined(__SIZEOF_POINTER__) && __SIZEOF_POINTER__ == 8
PRINT *, 'INFO:sizeof_dptr[8]'
@@ -36,5 +40,108 @@
#if defined(__ELF__)
PRINT *, 'INFO:abi[ELF]'
#endif
+
+#if 0
+! Sync with
+! Help/variable/CMAKE_LANG_COMPILER_ARCHITECTURE_ID.rst
+! Modules/CMakeCompilerABI.h
+! Modules/CMakeFortranCompilerABI.F90
+! Modules/Internal/CMakeParseCompilerArchitectureId.cmake
+#endif
+#if defined(__APPLE__) && defined(__arm64__)
+# if defined(__ARM64_ARCH_8_32__)
+ PRINT *, 'INFO:arch[arm64_32]'
+# elif defined(__arm64e__)
+ PRINT *, 'INFO:arch[arm64e]'
+# else
+ PRINT *, 'INFO:arch[arm64]'
+# endif
+#elif defined(_MSC_VER) && defined(_M_ARM64EC)
+ PRINT *, 'INFO:arch[arm64ec]'
+#elif defined(_MSC_VER) && defined(_M_ARM64)
+ PRINT *, 'INFO:arch[arm64]'
+#elif defined(__arm64ec__)
+ PRINT *, 'INFO:arch[arm64ec]'
+#elif defined(__aarch64__)
+ PRINT *, 'INFO:arch[aarch64]'
+#elif __ARM_ARCH == 7 || _M_ARM == 7 || defined(__ARM_ARCH_7__)
+# if defined(__APPLE__) && defined(__ARM_ARCH_7K__)
+ PRINT *, 'INFO:arch[armv7k]'
+# elif defined(__APPLE__) && defined(__ARM_ARCH_7S__)
+ PRINT *, 'INFO:arch[armv7s]'
+# else
+ PRINT *, 'INFO:arch[armv7]'
+# endif
+#elif __ARM_ARCH == 6 || _M_ARM == 6 || defined(__ARM_ARCH_6__)
+ PRINT *, 'INFO:arch[armv6]'
+#elif __ARM_ARCH == 5 || _M_ARM == 5 || defined(__ARM_ARCH_5__)
+ PRINT *, 'INFO:arch[armv5]'
+#elif defined(__alpha) || defined(__alpha) || defined(_M_ALPHA)
+ PRINT *, 'INFO:arch[alpha]'
+#elif defined(__x86_64) || defined(__x86_64__) || defined(__amd64) || \
+ defined(__amd64__) || defined(_M_X64) || defined(_M_AMD64)
+ PRINT *, 'INFO:arch[x86_64]'
+#elif defined(__i686) || defined(__i686__) || _M_IX86 == 600
+ PRINT *, 'INFO:arch[i686]'
+#elif defined(__i586) || defined(__i586__) || _M_IX86 == 500
+ PRINT *, 'INFO:arch[i586]'
+#elif defined(__i486) || defined(__i486__) || _M_IX86 == 400
+ PRINT *, 'INFO:arch[i486]'
+#elif defined(__i386) || defined(__i386__) || defined(_M_IX86)
+ PRINT *, 'INFO:arch[i386]'
+#elif defined(__ia64) || defined(__ia64__) || defined(_M_IA64)
+ PRINT *, 'INFO:arch[ia64]'
+#elif defined(__loongarch64)
+ PRINT *, 'INFO:arch[loongarch64]'
+#elif defined(__loongarch__)
+ PRINT *, 'INFO:arch[loongarch32]'
+#elif defined(__m68k__)
+ PRINT *, 'INFO:arch[m68k]'
+#elif defined(__mips64) || defined(__mips64__)
+# if defined(_MIPSEL)
+ PRINT *, 'INFO:arch[mips64el]'
+# else
+ PRINT *, 'INFO:arch[mips64]'
+# endif
+#elif defined(__mips) || defined(__mips__)
+# if defined(_MIPSEL)
+ PRINT *, 'INFO:arch[mipsel]'
+# else
+ PRINT *, 'INFO:arch[mips]'
+# endif
+#elif defined(__riscv) && __riscv_xlen == 64
+ PRINT *, 'INFO:arch[riscv64]'
+#elif defined(__riscv) && __riscv_xlen == 32
+ PRINT *, 'INFO:arch[riscv32]'
+#elif defined(__s390x__)
+ PRINT *, 'INFO:arch[s390x]'
+#elif defined(__s390__)
+ PRINT *, 'INFO:arch[s390]'
+#elif defined(__sparcv9) || defined(__sparcv9__) || defined(__sparc64__)
+ PRINT *, 'INFO:arch[sparcv9]'
+#elif defined(__sparc) || defined(__sparc__)
+ PRINT *, 'INFO:arch[sparc]'
+#elif defined(__hppa) || defined(__hppa__)
+# if defined(__LP64__)
+ PRINT *, 'INFO:arch[parisc64]'
+# else
+ PRINT *, 'INFO:arch[parisc]'
+# endif
+#elif defined(__ppc64__) || defined(__powerpc64__) || defined(__PPC64__) || \
+ defined(_ARCH_PPC64)
+# if defined(_LITTLE_ENDIAN) || defined(__LITTLE_ENDIAN__)
+ PRINT *, 'INFO:arch[ppc64le]'
+# else
+ PRINT *, 'INFO:arch[ppc64]'
+# endif
+#elif defined(__ppc__) || defined(__powerpc__) || defined(__PPC__) || \
+ defined(_ARCH_PPC)
+# if defined(_LITTLE_ENDIAN) || defined(__LITTLE_ENDIAN__)
+ PRINT *, 'INFO:arch[ppcle]'
+# else
+ PRINT *, 'INFO:arch[ppc]'
+# endif
+#endif
+
PRINT *, 'ABI Detection'
END
diff --git a/Modules/CMakeFortranCompilerABI.F90 b/Modules/CMakeFortranCompilerABI.F90
index 4a17153..2a9259b 100644
--- a/Modules/CMakeFortranCompilerABI.F90
+++ b/Modules/CMakeFortranCompilerABI.F90
@@ -20,6 +20,8 @@
PRINT *, 'INFO:sizeof_dptr[8]'
#elif defined(__x86_64__)
PRINT *, 'INFO:sizeof_dptr[8]'
+#elif defined(__sparcv9) || defined(__sparcv9__) || defined(__sparc64__)
+PRINT *, 'INFO:sizeof_dptr[8]'
#elif defined(_ILP32)
PRINT *, 'INFO:sizeof_dptr[4]'
@@ -27,6 +29,8 @@
PRINT *, 'INFO:sizeof_dptr[4]'
#elif defined(__i386__)
PRINT *, 'INFO:sizeof_dptr[4]'
+#elif defined(__sparc) || defined(__sparc__)
+PRINT *, 'INFO:sizeof_dptr[4]'
#elif defined(__SIZEOF_POINTER__) && __SIZEOF_POINTER__ == 8
PRINT *, 'INFO:sizeof_dptr[8]'
@@ -44,5 +48,108 @@
#if defined(__ELF__)
PRINT *, 'INFO:abi[ELF]'
#endif
+
+#if 0
+! Sync with
+! Help/variable/CMAKE_LANG_COMPILER_ARCHITECTURE_ID.rst
+! Modules/CMakeCompilerABI.h
+! Modules/CMakeFortranCompilerABI.F
+! Modules/Internal/CMakeParseCompilerArchitectureId.cmake
+#endif
+#if defined(__APPLE__) && defined(__arm64__)
+# if defined(__ARM64_ARCH_8_32__)
+PRINT *, 'INFO:arch[arm64_32]'
+# elif defined(__arm64e__)
+PRINT *, 'INFO:arch[arm64e]'
+# else
+PRINT *, 'INFO:arch[arm64]'
+# endif
+#elif defined(_MSC_VER) && defined(_M_ARM64EC)
+PRINT *, 'INFO:arch[arm64ec]'
+#elif defined(_MSC_VER) && defined(_M_ARM64)
+PRINT *, 'INFO:arch[arm64]'
+#elif defined(__arm64ec__)
+PRINT *, 'INFO:arch[arm64ec]'
+#elif defined(__aarch64__)
+PRINT *, 'INFO:arch[aarch64]'
+#elif __ARM_ARCH == 7 || _M_ARM == 7 || defined(__ARM_ARCH_7__)
+# if defined(__APPLE__) && defined(__ARM_ARCH_7K__)
+PRINT *, 'INFO:arch[armv7k]'
+# elif defined(__APPLE__) && defined(__ARM_ARCH_7S__)
+PRINT *, 'INFO:arch[armv7s]'
+# else
+PRINT *, 'INFO:arch[armv7]'
+# endif
+#elif __ARM_ARCH == 6 || _M_ARM == 6 || defined(__ARM_ARCH_6__)
+PRINT *, 'INFO:arch[armv6]'
+#elif __ARM_ARCH == 5 || _M_ARM == 5 || defined(__ARM_ARCH_5__)
+PRINT *, 'INFO:arch[armv5]'
+#elif defined(__alpha) || defined(__alpha) || defined(_M_ALPHA)
+PRINT *, 'INFO:arch[alpha]'
+#elif defined(__x86_64) || defined(__x86_64__) || defined(__amd64) || \
+ defined(__amd64__) || defined(_M_X64) || defined(_M_AMD64)
+PRINT *, 'INFO:arch[x86_64]'
+#elif defined(__i686) || defined(__i686__) || _M_IX86 == 600
+PRINT *, 'INFO:arch[i686]'
+#elif defined(__i586) || defined(__i586__) || _M_IX86 == 500
+PRINT *, 'INFO:arch[i586]'
+#elif defined(__i486) || defined(__i486__) || _M_IX86 == 400
+PRINT *, 'INFO:arch[i486]'
+#elif defined(__i386) || defined(__i386__) || defined(_M_IX86)
+PRINT *, 'INFO:arch[i386]'
+#elif defined(__ia64) || defined(__ia64__) || defined(_M_IA64)
+PRINT *, 'INFO:arch[ia64]'
+#elif defined(__loongarch64)
+PRINT *, 'INFO:arch[loongarch64]'
+#elif defined(__loongarch__)
+PRINT *, 'INFO:arch[loongarch32]'
+#elif defined(__m68k__)
+PRINT *, 'INFO:arch[m68k]'
+#elif defined(__mips64) || defined(__mips64__)
+# if defined(_MIPSEL)
+PRINT *, 'INFO:arch[mips64el]'
+# else
+PRINT *, 'INFO:arch[mips64]'
+# endif
+#elif defined(__mips) || defined(__mips__)
+# if defined(_MIPSEL)
+PRINT *, 'INFO:arch[mipsel]'
+# else
+PRINT *, 'INFO:arch[mips]'
+# endif
+#elif defined(__riscv) && __riscv_xlen == 64
+PRINT *, 'INFO:arch[riscv64]'
+#elif defined(__riscv) && __riscv_xlen == 32
+PRINT *, 'INFO:arch[riscv32]'
+#elif defined(__s390x__)
+PRINT *, 'INFO:arch[s390x]'
+#elif defined(__s390__)
+PRINT *, 'INFO:arch[s390]'
+#elif defined(__sparcv9) || defined(__sparcv9__) || defined(__sparc64__)
+PRINT *, 'INFO:arch[sparcv9]'
+#elif defined(__sparc) || defined(__sparc__)
+PRINT *, 'INFO:arch[sparc]'
+#elif defined(__hppa) || defined(__hppa__)
+# if defined(__LP64__)
+PRINT *, 'INFO:arch[parisc64]'
+# else
+PRINT *, 'INFO:arch[parisc]'
+# endif
+#elif defined(__ppc64__) || defined(__powerpc64__) || defined(__PPC64__) || \
+ defined(_ARCH_PPC64)
+# if defined(_LITTLE_ENDIAN) || defined(__LITTLE_ENDIAN__)
+PRINT *, 'INFO:arch[ppc64le]'
+# else
+PRINT *, 'INFO:arch[ppc64]'
+# endif
+#elif defined(__ppc__) || defined(__powerpc__) || defined(__PPC__) || \
+ defined(_ARCH_PPC)
+# if defined(_LITTLE_ENDIAN) || defined(__LITTLE_ENDIAN__)
+PRINT *, 'INFO:arch[ppcle]'
+# else
+PRINT *, 'INFO:arch[ppc]'
+# endif
+#endif
+
PRINT *, 'ABI Detection'
end program
diff --git a/Modules/CMakeHIPCompiler.cmake.in b/Modules/CMakeHIPCompiler.cmake.in
index 0077c19..2c762b8 100644
--- a/Modules/CMakeHIPCompiler.cmake.in
+++ b/Modules/CMakeHIPCompiler.cmake.in
@@ -21,6 +21,7 @@
set(CMAKE_HIP_SIMULATE_ID "@CMAKE_HIP_SIMULATE_ID@")
set(CMAKE_HIP_COMPILER_FRONTEND_VARIANT "@CMAKE_HIP_COMPILER_FRONTEND_VARIANT@")
set(CMAKE_HIP_SIMULATE_VERSION "@CMAKE_HIP_SIMULATE_VERSION@")
+set(CMAKE_HIP_COMPILER_ARCHITECTURE_ID "@CMAKE_HIP_COMPILER_ARCHITECTURE_ID@")
@SET_MSVC_HIP_ARCHITECTURE_ID@
@_SET_CMAKE_HIP_COMPILER_SYSROOT@
set(CMAKE_HIP_COMPILER_ROCM_ROOT "@CMAKE_HIP_COMPILER_ROCM_ROOT@")
diff --git a/Modules/CMakeHIPCompilerABI.hip b/Modules/CMakeHIPCompilerABI.hip
index 7d8b815..9910195 100644
--- a/Modules/CMakeHIPCompilerABI.hip
+++ b/Modules/CMakeHIPCompilerABI.hip
@@ -15,6 +15,9 @@
#if defined(ABI_ID)
require += info_abi[argc];
#endif
+#if defined(ARCHITECTURE_ID)
+ require += info_arch[argc];
+#endif
static_cast<void>(argv);
#if defined(__NVCC__)
diff --git a/Modules/CMakeOBJCCompiler.cmake.in b/Modules/CMakeOBJCCompiler.cmake.in
index 23175b2..65207ba 100644
--- a/Modules/CMakeOBJCCompiler.cmake.in
+++ b/Modules/CMakeOBJCCompiler.cmake.in
@@ -18,7 +18,7 @@
set(CMAKE_OBJC_SIMULATE_ID "@CMAKE_OBJC_SIMULATE_ID@")
set(CMAKE_OBJC_COMPILER_FRONTEND_VARIANT "@CMAKE_OBJC_COMPILER_FRONTEND_VARIANT@")
set(CMAKE_OBJC_SIMULATE_VERSION "@CMAKE_OBJC_SIMULATE_VERSION@")
-@_SET_CMAKE_OBJC_COMPILER_ARCHITECTURE_ID@
+set(CMAKE_OBJC_COMPILER_ARCHITECTURE_ID "@CMAKE_OBJC_COMPILER_ARCHITECTURE_ID@")
@SET_CMAKE_XCODE_ARCHS@
set(CMAKE_AR "@CMAKE_AR@")
set(CMAKE_OBJC_COMPILER_AR "@CMAKE_OBJC_COMPILER_AR@")
diff --git a/Modules/CMakeOBJCCompilerABI.m b/Modules/CMakeOBJCCompilerABI.m
index 0726cd3..8a6e99f 100644
--- a/Modules/CMakeOBJCCompilerABI.m
+++ b/Modules/CMakeOBJCCompilerABI.m
@@ -17,6 +17,9 @@
#if defined(ABI_ID)
require += info_abi[argc];
#endif
+#if defined(ARCHITECTURE_ID)
+ require += info_arch[argc];
+#endif
(void)argv;
return require;
}
diff --git a/Modules/CMakeOBJCXXCompiler.cmake.in b/Modules/CMakeOBJCXXCompiler.cmake.in
index a374acd..78afc16 100644
--- a/Modules/CMakeOBJCXXCompiler.cmake.in
+++ b/Modules/CMakeOBJCXXCompiler.cmake.in
@@ -19,7 +19,7 @@
set(CMAKE_OBJCXX_SIMULATE_ID "@CMAKE_OBJCXX_SIMULATE_ID@")
set(CMAKE_OBJCXX_COMPILER_FRONTEND_VARIANT "@CMAKE_OBJCXX_COMPILER_FRONTEND_VARIANT@")
set(CMAKE_OBJCXX_SIMULATE_VERSION "@CMAKE_OBJCXX_SIMULATE_VERSION@")
-@_SET_CMAKE_OBJCXX_COMPILER_ARCHITECTURE_ID@
+set(CMAKE_OBJCXX_COMPILER_ARCHITECTURE_ID "@CMAKE_OBJCXX_COMPILER_ARCHITECTURE_ID@")
@SET_CMAKE_XCODE_ARCHS@
set(CMAKE_AR "@CMAKE_AR@")
set(CMAKE_OBJCXX_COMPILER_AR "@CMAKE_OBJCXX_COMPILER_AR@")
diff --git a/Modules/CMakeOBJCXXCompilerABI.mm b/Modules/CMakeOBJCXXCompilerABI.mm
index 7b9fefc..84a96d4 100644
--- a/Modules/CMakeOBJCXXCompilerABI.mm
+++ b/Modules/CMakeOBJCXXCompilerABI.mm
@@ -17,6 +17,9 @@
#if defined(ABI_ID)
require += info_abi[argc];
#endif
+#if defined(ARCHITECTURE_ID)
+ require += info_arch[argc];
+#endif
(void)argv;
return require;
}
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/CMakePrintSystemInformation.cmake b/Modules/CMakePrintSystemInformation.cmake
index 45ad38e..98e48e5 100644
--- a/Modules/CMakePrintSystemInformation.cmake
+++ b/Modules/CMakePrintSystemInformation.cmake
@@ -5,10 +5,26 @@
CMakePrintSystemInformation
---------------------------
-Print system information.
+This module can be used for diagnostics to print system information.
-This module serves diagnostic purposes. Just include it in a
-project to see various internal CMake variables.
+Examples
+^^^^^^^^
+
+Including this module in a project:
+
+.. code-block:: cmake
+
+ include(CMakePrintSystemInformation)
+
+prints various internal CMake variables. For example::
+
+ CMAKE_SYSTEM is Linux-6.11.0-17-generic Linux 6.11.0-17-generic x86_64
+ CMAKE_SYSTEM file is Platform/Linux
+ CMAKE_C_COMPILER is /usr/bin/cc
+ CMAKE_CXX_COMPILER is /usr/bin/c++
+ CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS is -shared
+ CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS is -shared
+ ...
#]=======================================================================]
message("CMAKE_SYSTEM is ${CMAKE_SYSTEM} ${CMAKE_SYSTEM_NAME} ${CMAKE_SYSTEM_VERSION} ${CMAKE_SYSTEM_PROCESSOR}")
diff --git a/Modules/CPack.cmake b/Modules/CPack.cmake
index 026b8c0..803332b 100644
--- a/Modules/CPack.cmake
+++ b/Modules/CPack.cmake
@@ -572,6 +572,11 @@
set("${var}" "${escaped}" PARENT_SCOPE)
endfunction()
+# Resolve CPACK_PROJECT_CONFIG_FILE relative to the source directory
+if(DEFINED CPACK_PROJECT_CONFIG_FILE)
+ cmake_path(ABSOLUTE_PATH CPACK_PROJECT_CONFIG_FILE)
+endif()
+
# Set the package name
_cpack_set_default(CPACK_PACKAGE_NAME "${CMAKE_PROJECT_NAME}")
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/CTestTargets.cmake b/Modules/CTestTargets.cmake
index 0a08b71..5a7232f 100644
--- a/Modules/CTestTargets.cmake
+++ b/Modules/CTestTargets.cmake
@@ -44,6 +44,9 @@
${CMAKE_ROOT}/Modules/DartConfiguration.tcl.in
${PROJECT_BINARY_DIR}/DartConfiguration.tcl )
endif()
+ configure_file(
+ ${CMAKE_ROOT}/Templates/CTestScript.cmake.in
+ ${PROJECT_BINARY_DIR}/CMakeFiles/CTestScript.cmake @ONLY)
endblock()
#
@@ -73,7 +76,9 @@
# For all generators add basic testing targets.
foreach(mode Experimental Nightly Continuous NightlyMemoryCheck)
add_custom_target(${mode}
- ${CMAKE_CTEST_COMMAND} ${__conf_types} -D ${mode}
+ COMMAND
+ ${CMAKE_CTEST_COMMAND} ${__conf_types}
+ -DMODEL=${mode} -S CMakeFiles/CTestScript.cmake -V
USES_TERMINAL
)
set_property(TARGET ${mode} PROPERTY RULE_LAUNCH_CUSTOM "")
@@ -89,7 +94,10 @@
# missing purify
)
add_custom_target(${mode}${testtype}
- ${CMAKE_CTEST_COMMAND} ${__conf_types} -D ${mode}${testtype}
+ COMMAND
+ ${CMAKE_CTEST_COMMAND} ${__conf_types}
+ -DMODEL=${mode} -DACTIONS=${testtype}
+ -S CMakeFiles/CTestScript.cmake -V
USES_TERMINAL
)
set_property(TARGET ${mode}${testtype} PROPERTY RULE_LAUNCH_CUSTOM "")
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/CheckIPOSupported.cmake b/Modules/CheckIPOSupported.cmake
index 9c4f61e..3db7ae4 100644
--- a/Modules/CheckIPOSupported.cmake
+++ b/Modules/CheckIPOSupported.cmake
@@ -7,9 +7,9 @@
.. versionadded:: 3.9
-Check whether the compiler supports an interprocedural optimization (IPO/LTO).
-Use this before enabling the :prop_tgt:`INTERPROCEDURAL_OPTIMIZATION` target
-property.
+This module provides a function to check whether the compiler supports an
+interprocedural optimization (IPO/LTO). Use this module before enabling the
+:prop_tgt:`INTERPROCEDURAL_OPTIMIZATION` target property.
.. command:: check_ipo_supported
@@ -60,21 +60,33 @@
Examples
^^^^^^^^
+Checking whether the compiler supports IPO and emitting a fatal error if it is
+not supported:
+
.. code-block:: cmake
+ include(CheckIPOSupported)
check_ipo_supported() # fatal error if IPO is not supported
set_property(TARGET foo PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
+The following example demonstrates how to use the ``CheckIPOSupported`` module
+to enable IPO for the target only when supported by the compiler and to issue a
+warning if it is not. Additionally, projects may want to provide a
+configuration option to control when IPO is enabled. For example:
+
.. code-block:: cmake
- # Optional IPO. Do not use IPO if it's not supported by compiler.
- check_ipo_supported(RESULT result OUTPUT output)
- if(result)
- set_property(TARGET foo PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
- else()
- message(WARNING "IPO is not supported: ${output}")
- endif()
+ option(FOO_ENABLE_IPO "Enable IPO/LTO")
+ if(FOO_ENABLE_IPO)
+ include(CheckIPOSupported)
+ check_ipo_supported(RESULT result OUTPUT output)
+ if(result)
+ set_property(TARGET foo PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
+ else()
+ message(WARNING "IPO is not supported: ${output}")
+ endif()
+ endif()
#]=======================================================================]
# X_RESULT - name of the final result variable
diff --git a/Modules/CheckIncludeFile.cmake b/Modules/CheckIncludeFile.cmake
index f070ba5..a3a2cee 100644
--- a/Modules/CheckIncludeFile.cmake
+++ b/Modules/CheckIncludeFile.cmake
@@ -35,9 +35,24 @@
.. include:: /module/CMAKE_REQUIRED_QUIET.txt
-See the :module:`CheckIncludeFiles` module to check for multiple headers
-at once. See the :module:`CheckIncludeFileCXX` module to check for headers
-using the ``CXX`` language.
+Examples
+^^^^^^^^
+
+Checking whether the ``C`` header ``<unistd.h>`` exists and storing the check
+result in the ``HAVE_UNISTD_H`` cache variable:
+
+.. code-block:: cmake
+
+ include(CheckIncludeFile)
+
+ check_include_file(unistd.h HAVE_UNISTD_H)
+
+See Also
+^^^^^^^^
+
+* The :module:`CheckIncludeFileCXX` module to check for single ``C++`` header.
+* The :module:`CheckIncludeFiles` module to check for one or more ``C`` or
+ ``C++`` headers at once.
#]=======================================================================]
include_guard(GLOBAL)
diff --git a/Modules/CheckIncludeFileCXX.cmake b/Modules/CheckIncludeFileCXX.cmake
index ec02b36..756abf1 100644
--- a/Modules/CheckIncludeFileCXX.cmake
+++ b/Modules/CheckIncludeFileCXX.cmake
@@ -35,8 +35,24 @@
.. include:: /module/CMAKE_REQUIRED_QUIET.txt
-See modules :module:`CheckIncludeFile` and :module:`CheckIncludeFiles`
-to check for one or more ``C`` headers.
+Examples
+^^^^^^^^
+
+Checking whether the ``C++23`` header ``<stdfloat>`` exists and storing the
+check result in the ``HAVE_STDFLOAT_HEADER`` cache variable:
+
+.. code-block:: cmake
+
+ include(CheckIncludeFileCXX)
+
+ check_include_file_cxx(stdfloat HAVE_STDFLOAT_HEADER)
+
+See Also
+^^^^^^^^
+
+* The :module:`CheckIncludeFile` module to check for single ``C`` header.
+* The :module:`CheckIncludeFiles` module to check for one or more ``C`` or
+ ``C++`` headers at once.
#]=======================================================================]
include_guard(GLOBAL)
diff --git a/Modules/CheckIncludeFiles.cmake b/Modules/CheckIncludeFiles.cmake
index 6dfb41d..855d450 100644
--- a/Modules/CheckIncludeFiles.cmake
+++ b/Modules/CheckIncludeFiles.cmake
@@ -41,8 +41,41 @@
.. include:: /module/CMAKE_REQUIRED_QUIET.txt
-See modules :module:`CheckIncludeFile` and :module:`CheckIncludeFileCXX`
-to check for a single header file in ``C`` or ``CXX`` languages.
+Examples
+^^^^^^^^
+
+Checking whether one or more ``C`` headers exist and storing the check result
+in cache variables:
+
+.. code-block:: cmake
+
+ include(CheckIncludeFiles)
+
+ check_include_files(sys/socket.h HAVE_SYS_SOCKET_H)
+
+ if(HAVE_SYS_SOCKET_H)
+ # The <net/if.h> header on Darwin and BSD-like systems is not self-contained
+ # and also requires <sys/socket.h>
+ check_include_files("sys/socket.h;net/if.h" HAVE_NET_IF_H)
+ else()
+ check_include_files(net/if.h HAVE_NET_IF_H)
+ endif()
+
+The ``LANGUAGE`` option can be used to specify which compiler to use. For
+example, checking multiple ``C++`` headers, when both ``C`` and ``CXX``
+languages are enabled in the project:
+
+.. code-block:: cmake
+
+ include(CheckIncludeFiles)
+
+ check_include_files("header_1.hpp;header_2.hpp" HAVE_HEADERS LANGUAGE CXX)
+
+See Also
+^^^^^^^^
+
+* The :module:`CheckIncludeFile` module to check for single ``C`` header.
+* The :module:`CheckIncludeFileCXX` module to check for single ``C++`` header.
#]=======================================================================]
include_guard(GLOBAL)
diff --git a/Modules/CheckLanguage.cmake b/Modules/CheckLanguage.cmake
index 5ca5f68..fa64d05 100644
--- a/Modules/CheckLanguage.cmake
+++ b/Modules/CheckLanguage.cmake
@@ -5,8 +5,9 @@
CheckLanguage
-------------
-Check whether a language can be enabled by the :command:`enable_language`
-or :command:`project` commands:
+This module provides the ``check_language()`` macro to check whether a language
+can be enabled using the :command:`enable_language` or :command:`project`
+commands.
.. command:: check_language
@@ -14,8 +15,8 @@
check_language(<lang>)
- Try enabling language ``<lang>`` in a test project and record results
- in the cache:
+ This macro attempts to enable the language ``<lang>`` in a test project and
+ records the results in the following cache variables:
:variable:`CMAKE_<LANG>_COMPILER`
If the language can be enabled, this variable is set to the compiler
@@ -44,13 +45,19 @@
:variable:`CMAKE_<LANG>_PLATFORM <CMAKE_HIP_PLATFORM>`
This variable is set to the detected GPU platform when ``<lang>`` is ``HIP``.
- If the variable is already set its value is always preserved. Only compatible values
- will be considered for :variable:`CMAKE_<LANG>_COMPILER`.
+ If this variable is already set, its value is always preserved. Only
+ compatible values will be considered for :variable:`CMAKE_<LANG>_COMPILER`.
-For example:
+Examples
+^^^^^^^^
+
+This module is useful when a project does not always require a specific language
+but may need to enable it for certain parts. The following example checks for
+the availability of the ``Fortran`` language and enables it if possible:
.. code-block:: cmake
+ include(CheckLanguage)
check_language(Fortran)
if(CMAKE_Fortran_COMPILER)
enable_language(Fortran)
diff --git a/Modules/CheckPIESupported.cmake b/Modules/CheckPIESupported.cmake
index 9922aec..c0cc3c0 100644
--- a/Modules/CheckPIESupported.cmake
+++ b/Modules/CheckPIESupported.cmake
@@ -7,10 +7,16 @@
.. versionadded:: 3.14
-Check whether the linker supports Position Independent Code (PIE) or No
-Position Independent Code (NO_PIE) for executables.
-Use this to ensure that the :prop_tgt:`POSITION_INDEPENDENT_CODE` target
-property for executables will be honored at link time.
+This module provides the ``check_pie_supported()`` function to check whether the
+linker supports Position Independent Code (PIE) or No Position Independent Code
+(NO_PIE) for executables.
+
+When setting the :prop_tgt:`POSITION_INDEPENDENT_CODE` target property,
+PIC-related compile and link options are added when building library objects,
+and PIE-related compile options are added when building objects of executable
+targets, regardless of this module. Use this module to ensure that the
+``POSITION_INDEPENDENT_CODE`` target property for executables is also honored at
+link time.
.. command:: check_pie_supported
@@ -36,14 +42,16 @@
``OBJC``, ``OBJCXX``, ``CUDA``, and ``HIP`` are supported.
-It makes no sense to use this module when :policy:`CMP0083` is set to ``OLD``,
-so the command will return an error in this case. See policy :policy:`CMP0083`
-for details.
+ .. note::
+
+ To use ``check_pie_supported()``, policy :policy:`CMP0083` must be set to
+ ``NEW``; otherwise, a fatal error will occur.
Variables
^^^^^^^^^
-For each language checked, two boolean cache variables are defined.
+For each language checked, the ``check_pie_supported()`` function defines two
+boolean cache variables:
``CMAKE_<lang>_LINK_PIE_SUPPORTED``
Set to true if ``PIE`` is supported by the linker and false otherwise.
@@ -53,21 +61,44 @@
Examples
^^^^^^^^
+To enable PIE on an executable target at link time as well, include this module
+and call ``check_pie_supported()`` before setting the
+``POSITION_INDEPENDENT_CODE`` target property. This will determine whether the
+linker for each checked language supports PIE-related link options. For
+example:
+
.. code-block:: cmake
+ add_executable(foo ...)
+
+ include(CheckPIESupported)
check_pie_supported()
set_property(TARGET foo PROPERTY POSITION_INDEPENDENT_CODE TRUE)
+Since not all linkers require or support PIE-related link options (for example,
+``MSVC``), retrieving any error messages might be useful for logging purposes:
+
.. code-block:: cmake
- # Retrieve any error message.
+ add_executable(foo ...)
+
+ include(CheckPIESupported)
check_pie_supported(OUTPUT_VARIABLE output LANGUAGES C)
set_property(TARGET foo PROPERTY POSITION_INDEPENDENT_CODE TRUE)
if(NOT CMAKE_C_LINK_PIE_SUPPORTED)
- message(WARNING "PIE is not supported at link time: ${output}.\n"
+ message(WARNING "PIE is not supported at link time:\n${output}"
"PIE link options will not be passed to linker.")
endif()
+Setting the ``POSITION_INDEPENDENT_CODE`` target property on an executable
+without this module will set PIE-related compile options but not PIE-related
+link options, which might not be sufficient in certain cases:
+
+.. code-block:: cmake
+
+ add_executable(foo ...)
+ set_property(TARGET foo PROPERTY POSITION_INDEPENDENT_CODE TRUE)
+
#]=======================================================================]
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/FindAVIFile.cmake b/Modules/FindAVIFile.cmake
index 4798c34..d3387ea 100644
--- a/Modules/FindAVIFile.cmake
+++ b/Modules/FindAVIFile.cmake
@@ -5,20 +5,41 @@
FindAVIFile
-----------
-Locate `AVIFILE <https://avifile.sourceforge.net/>`_
-library and include paths.
+Finds `AVIFile <https://avifile.sourceforge.net/>`_ library and include paths.
-AVIFILE is a set of libraries for
-i386 machines to use various AVI codecs. Support is limited beyond
-Linux. Windows provides native AVI support, and so doesn't need this
-library. This module defines
+AVIFile is a set of libraries for i386 machines to use various AVI codecs.
+Support is limited beyond Linux. Windows provides native AVI support, and so
+doesn't need this library.
-::
+Result Variables
+^^^^^^^^^^^^^^^^
- AVIFILE_INCLUDE_DIR, where to find avifile.h , etc.
- AVIFILE_LIBRARIES, the libraries to link against
- AVIFILE_DEFINITIONS, definitions to use when compiling
- AVIFILE_FOUND, If false, don't try to use AVIFILE
+This module defines the following variables:
+
+``AVIFile_FOUND``
+ True if AVIFile is found. For backward compatibility, the ``AVIFILE_FOUND``
+ variable is also set to the same value.
+``AVIFILE_LIBRARIES``
+ The libraries to link against.
+``AVIFILE_DEFINITIONS``
+ Definitions to use when compiling.
+
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may be also set:
+
+``AVIFILE_INCLUDE_DIR``
+ Directory containing ``avifile.h`` and other AVIFile headers.
+
+Examples
+^^^^^^^^
+
+Finding AVIFile:
+
+.. code-block:: cmake
+
+ find_package(AVIFile)
#]=======================================================================]
if (UNIX)
@@ -31,7 +52,7 @@
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(AVIFile DEFAULT_MSG AVIFILE_INCLUDE_DIR AVIFILE_AVIPLAY_LIBRARY)
-if (AVIFILE_FOUND)
+if (AVIFile_FOUND)
set(AVIFILE_LIBRARIES ${AVIFILE_AVIPLAY_LIBRARY})
set(AVIFILE_DEFINITIONS "")
endif()
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/FindBullet.cmake b/Modules/FindBullet.cmake
index f9250ae..61a5fb3 100644
--- a/Modules/FindBullet.cmake
+++ b/Modules/FindBullet.cmake
@@ -5,35 +5,39 @@
FindBullet
----------
-Try to find the Bullet physics engine
+Finds the Bullet physics engine.
+Result Variables
+^^^^^^^^^^^^^^^^
+This module defines the following variables:
-::
+``Bullet_FOUND``
+ Boolean true if Bullet was found. For backward compatibility, the
+ ``BULLET_FOUND`` variable is also set to the same value.
+``BULLET_INCLUDE_DIRS``
+ The Bullet include directories.
+``BULLET_LIBRARIES``
+ Libraries needed to link to Bullet. By default, all Bullet components
+ (Dynamics, Collision, LinearMath, and SoftBody) are added.
- This module defines the following variables
+Hints
+^^^^^
+This module accepts the following variables:
+``BULLET_ROOT``
+ Can be set to Bullet install path or Windows build path to specify where to
+ find Bullet.
-::
+Examples
+^^^^^^^^
- BULLET_FOUND - Was bullet found
- BULLET_INCLUDE_DIRS - the Bullet include directories
- BULLET_LIBRARIES - Link to this, by default it includes
- all bullet components (Dynamics,
- Collision, LinearMath, & SoftBody)
+Finding Bullet:
+.. code-block:: cmake
-
-::
-
- This module accepts the following variables
-
-
-
-::
-
- BULLET_ROOT - Can be set to bullet install path or Windows build path
+ find_package(Bullet)
#]=======================================================================]
macro(_FIND_BULLET_LIBRARY _var)
@@ -85,7 +89,7 @@
BULLET_SOFTBODY_LIBRARY BULLET_INCLUDE_DIR)
set(BULLET_INCLUDE_DIRS ${BULLET_INCLUDE_DIR})
-if(BULLET_FOUND)
+if(Bullet_FOUND)
_BULLET_APPEND_LIBRARIES(BULLET_LIBRARIES BULLET_DYNAMICS_LIBRARY)
_BULLET_APPEND_LIBRARIES(BULLET_LIBRARIES BULLET_COLLISION_LIBRARY)
_BULLET_APPEND_LIBRARIES(BULLET_LIBRARIES BULLET_MATH_LIBRARY)
diff --git a/Modules/FindCABLE.cmake b/Modules/FindCABLE.cmake
index 4d72897..6e530c3 100644
--- a/Modules/FindCABLE.cmake
+++ b/Modules/FindCABLE.cmake
@@ -5,23 +5,43 @@
FindCABLE
---------
-Find CABLE
+Finds the CABLE installation and determines its include paths and libraries.
-This module finds if CABLE is installed and determines where the
-include files and libraries are. This code sets the following
-variables:
+Package called CABLE (CABLE Automates Bindings for Language Extension) was
+initially developed by Kitware to generate bindings to C++ classes for use in
+interpreted languages, such as Tcl. It worked in conjunction with packages like
+GCC-XML. The CABLE package has since been superseded by the ITK CableSwig
+package.
-::
+.. note::
- CABLE the path to the cable executable
- CABLE_TCL_LIBRARY the path to the Tcl wrapper library
- CABLE_INCLUDE_DIR the path to the include directory
+ When building wrappers for interpreted languages, these packages are no longer
+ necessary. The CastXML package now serves as the recommended tool for this
+ purpose and can be found directly using the :command:`find_program` command.
+Cache Variables
+^^^^^^^^^^^^^^^
+The following cache variables may be set when using this module:
-To build Tcl wrappers, you should add shared library and link it to
-${CABLE_TCL_LIBRARY}. You should also add ${CABLE_INCLUDE_DIR} as an
-include directory.
+``CABLE``
+ Path to the ``cable`` executable.
+``CABLE_INCLUDE_DIR``
+ Path to the include directory.
+``CABLE_TCL_LIBRARY``
+ Path to the Tcl wrapper library.
+
+Examples
+^^^^^^^^
+
+Finding CABLE to build Tcl wrapper, by linking library and adding the include
+directories:
+
+.. code-block:: cmake
+
+ find_package(CABLE)
+ target_link_libraries(tcl_wrapper_target PRIVATE ${CABLE_TCL_LIBRARY})
+ target_include_directories(tcl_wrapper_target PRIVATE ${CABLE_INCLUDE_DIR})
#]=======================================================================]
if(NOT CABLE)
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 b23cd09..aaa1246 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/FindCVS.cmake b/Modules/FindCVS.cmake
index 9ae6d8c..d50a758 100644
--- a/Modules/FindCVS.cmake
+++ b/Modules/FindCVS.cmake
@@ -5,23 +5,35 @@
FindCVS
-------
-Find the Concurrent Versions System (CVS).
+Finds the Concurrent Versions System (CVS).
-The module defines the following variables:
+Result Variables
+^^^^^^^^^^^^^^^^
-::
+This module defines the following variables:
- CVS_EXECUTABLE - path to cvs command line client
- CVS_FOUND - true if the command line client was found
+``CVS_FOUND``
+ True if the command-line client was found.
-Example usage:
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``CVS_EXECUTABLE``
+ Path to ``cvs`` command-line client.
+
+Examples
+^^^^^^^^
+
+Finding CVS and executing it in a process:
.. code-block:: cmake
- find_package(CVS)
- if(CVS_FOUND)
- message("CVS found: ${CVS_EXECUTABLE}")
- endif()
+ find_package(CVS)
+ if(CVS_FOUND)
+ execute_process(COMMAND ${CVS_EXECUTABLE} --help)
+ endif()
#]=======================================================================]
# CVSNT
diff --git a/Modules/FindCoin3D.cmake b/Modules/FindCoin3D.cmake
index f517f3b..1d89c60 100644
--- a/Modules/FindCoin3D.cmake
+++ b/Modules/FindCoin3D.cmake
@@ -5,18 +5,38 @@
FindCoin3D
----------
-Find Coin3D (Open Inventor)
+Finds Coin3D (Open Inventor).
Coin3D is an implementation of the Open Inventor API. It provides
data structures and algorithms for 3D visualization.
-This module defines the following variables
+Result Variables
+^^^^^^^^^^^^^^^^
-::
+This module defines the following variables:
- COIN3D_FOUND - system has Coin3D - Open Inventor
- COIN3D_INCLUDE_DIRS - where the Inventor include directory can be found
- COIN3D_LIBRARIES - Link to this to use Coin3D
+``Coin3D_FOUND``
+ True if Coin3D, Open Inventor was found. For backward compatibility, the
+ ``COIN3D_FOUND`` variable is also set to the same value.
+
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``COIN3D_INCLUDE_DIRS``
+ Directory containing the Open Inventor header files (``Inventor/So.h``).
+``COIN3D_LIBRARIES``
+ Coin3D libraries required for linking.
+
+Examples
+^^^^^^^^
+
+Finding Coin3D:
+
+.. code-block:: cmake
+
+ find_package(Coin3D)
#]=======================================================================]
if (WIN32)
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/FindGSL.cmake b/Modules/FindGSL.cmake
index 5714979..a3cd654 100644
--- a/Modules/FindGSL.cmake
+++ b/Modules/FindGSL.cmake
@@ -7,7 +7,7 @@
.. versionadded:: 3.2
-Find the native GNU Scientific Library (GSL) includes and libraries.
+Finds the native GNU Scientific Library (GSL) includes and libraries.
The GNU Scientific Library (GSL) is a numerical library for C and C++
programmers. It is free software under the GNU General Public
@@ -16,47 +16,71 @@
Imported Targets
^^^^^^^^^^^^^^^^
-If GSL is found, this module defines the following :prop_tgt:`IMPORTED`
-targets::
+If GSL is found, this module defines the following :ref:`Imported Targets`:
- GSL::gsl - The main GSL library.
- GSL::gslcblas - The CBLAS support library used by GSL.
+``GSL::gsl``
+ The main GSL library that provides all usage requirements to use GSL.
+``GSL::gslcblas``
+ The CBLAS support library used by GSL. It is linked also into the
+ ``GSL::gsl`` target but provided separately for granularity.
Result Variables
^^^^^^^^^^^^^^^^
-This module will set the following variables in your project::
+This module will set the following variables in the project:
- GSL_FOUND - True if GSL found on the local system
- GSL_INCLUDE_DIRS - Location of GSL header files.
- GSL_LIBRARIES - The GSL libraries.
- GSL_VERSION - The version of the discovered GSL install.
+``GSL_FOUND``
+ True if GSL is found on the local system.
+``GSL_INCLUDE_DIRS``
+ Directory containing GSL header files.
+``GSL_LIBRARIES``
+ The GSL libraries.
+``GSL_VERSION``
+ The version of the discovered GSL installation.
Hints
^^^^^
-Set ``GSL_ROOT_DIR`` to a directory that contains a GSL installation.
+``GSL_ROOT_DIR``
+ Set this variable to a directory that contains a GSL installation.
-This script expects to find libraries at ``$GSL_ROOT_DIR/lib`` and the GSL
-headers at ``$GSL_ROOT_DIR/include/gsl``. The library directory may
-optionally provide Release and Debug folders. If available, the libraries
-named ``gsld``, ``gslblasd`` or ``cblasd`` are recognized as debug libraries.
-For Unix-like systems, this script will use ``$GSL_ROOT_DIR/bin/gsl-config``
-(if found) to aid in the discovery of GSL.
+ If this variable is not set, this module will use pkg-config and default paths
+ to find GSL. If this variable is provided, then this module expects to find
+ libraries at ``${GSL_ROOT_DIR}/lib`` and the GSL headers at
+ ``${GSL_ROOT_DIR}/include/gsl``.
+
+ The library directory may optionally provide Release and Debug folders. If
+ available, the libraries named ``gsld``, ``gslblasd`` or ``cblasd`` are
+ recognized as debug libraries. For Unix-like systems, this module will also
+ use ``gsl-config`` (if found) to aid in the discovery of GSL.
Cache Variables
^^^^^^^^^^^^^^^
This module may set the following variables depending on platform and type
of GSL installation discovered. These variables may optionally be set to
-help this module find the correct files::
+help this module find the correct files:
- GSL_CBLAS_LIBRARY - Location of the GSL CBLAS library.
- GSL_CBLAS_LIBRARY_DEBUG - Location of the debug GSL CBLAS library (if any).
- GSL_CONFIG_EXECUTABLE - Location of the ``gsl-config`` script (if any).
- GSL_LIBRARY - Location of the GSL library.
- GSL_LIBRARY_DEBUG - Location of the debug GSL library (if any).
+``GSL_CBLAS_LIBRARY``
+ Location of the GSL CBLAS library.
+``GSL_CBLAS_LIBRARY_DEBUG``
+ Location of the debug GSL CBLAS library (if any).
+``GSL_CONFIG_EXECUTABLE``
+ Location of the ``gsl-config`` script (if any).
+``GSL_LIBRARY``
+ Location of the GSL library.
+``GSL_LIBRARY_DEBUG``
+ Location of the debug GSL library (if any).
+Examples
+^^^^^^^^
+
+Finding GSL and linking it to a project target:
+
+.. code-block:: cmake
+
+ find_package(GSL)
+ target_link_libraries(project_target PRIVATE GSL::gsl)
#]=======================================================================]
cmake_policy(PUSH)
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/FindGnuplot.cmake b/Modules/FindGnuplot.cmake
index 851f193..abbb681 100644
--- a/Modules/FindGnuplot.cmake
+++ b/Modules/FindGnuplot.cmake
@@ -5,21 +5,42 @@
FindGnuplot
-----------
-This module looks for gnuplot.
+Finds the Gnuplot command-line graphing utility for generating two- and
+three-dimensional plots (``gnuplot``).
Result Variables
^^^^^^^^^^^^^^^^
-``GNUPLOT_FOUND``
- System has Gnuplot.
+This module sets the following variables:
-``GNUPLOT_EXECUTABLE``
- The Gnuplot executable.
+``Gnuplot_FOUND``
+ Boolean indicating whether Gnuplot has been found. For backward
+ compatibility, the ``GNUPLOT_FOUND`` variable is also set to the same value.
``GNUPLOT_VERSION_STRING``
The version of Gnuplot found.
- .. note:: Version string detection will not work for old versions like 3.7.1.
+ .. note::
+
+ Version detection is available only for Gnuplot 4 and later. Earlier
+ versions did not provide version output.
+
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``GNUPLOT_EXECUTABLE``
+ Absolute path to the ``gnuplot`` executable.
+
+Examples
+^^^^^^^^
+
+Finding Gnuplot:
+
+.. code-block:: cmake
+
+ find_package(Gnuplot)
#]=======================================================================]
include(${CMAKE_CURRENT_LIST_DIR}/FindCygwin.cmake)
diff --git a/Modules/FindHDF5.cmake b/Modules/FindHDF5.cmake
index 2f0c3c1..89058ca 100644
--- a/Modules/FindHDF5.cmake
+++ b/Modules/FindHDF5.cmake
@@ -218,6 +218,13 @@
set(HDF5_Fortran_COMPILER_NAMES h5fc h5pfc)
endif()
+# Prefer h5hl<LANG> compilers if HDF5_FIND_HL is enabled
+if(HDF5_FIND_HL)
+ list(PREPEND HDF5_C_COMPILER_NAMES h5hlcc)
+ list(PREPEND HDF5_CXX_COMPILER_NAMES h5hlc++)
+ list(PREPEND HDF5_Fortran_COMPILER_NAMES h5hlfc)
+endif()
+
# Test first if the current compilers automatically wrap HDF5
function(_HDF5_test_regular_compiler_C success version is_parallel)
if(NOT ${success} OR
diff --git a/Modules/FindHTMLHelp.cmake b/Modules/FindHTMLHelp.cmake
index c6ee4bc..76b3dcf 100644
--- a/Modules/FindHTMLHelp.cmake
+++ b/Modules/FindHTMLHelp.cmake
@@ -5,15 +5,39 @@
FindHTMLHelp
------------
-This module looks for Microsoft HTML Help Compiler
+This module finds the Microsoft HTML Help Compiler and its API. It is part of
+the HTML Help Workshop.
-It defines:
+.. note::
-::
+ HTML Help Workshop is in maintenance mode only and is considered deprecated.
+ For modern documentation, consider alternatives such as Microsoft Help Viewer
+ for producing ``.mshc`` files or web-based documentation tools.
- HTML_HELP_COMPILER : full path to the Compiler (hhc.exe)
- HTML_HELP_INCLUDE_PATH : include path to the API (htmlhelp.h)
- HTML_HELP_LIBRARY : full path to the library (htmlhelp.lib)
+Cache Variables
+^^^^^^^^^^^^^^^
+
+This module may set the following cache variables:
+
+``HTML_HELP_COMPILER``
+ Full path to the HTML Help Compiler (``hhc.exe``), used to compile ``.chm``
+ files.
+``HTML_HELP_INCLUDE_PATH``
+ Directory containing ``htmlhelp.h``, required for applications integrating the
+ HTML Help API.
+``HTML_HELP_LIBRARY``
+ Full path to ``htmlhelp.lib`` library, required for linking applications that
+ use the HTML Help API.
+
+Examples
+^^^^^^^^
+
+Finding HTML Help Compiler:
+
+.. code-block:: cmake
+
+ find_package(HTMLHelp)
+ message(STATUS "HTML Help Compiler found at: ${HTML_HELP_COMPILER}")
#]=======================================================================]
if(WIN32)
diff --git a/Modules/FindHg.cmake b/Modules/FindHg.cmake
index a26e01f..c88a523 100644
--- a/Modules/FindHg.cmake
+++ b/Modules/FindHg.cmake
@@ -5,42 +5,68 @@
FindHg
------
-Extract information from a mercurial working copy.
+Finds the Mercurial command-line client executable (``hg``) and provides a
+command for extracting information from a Mercurial working copy.
-The module defines the following variables:
+Result Variables
+^^^^^^^^^^^^^^^^
-::
+This module sets the following variables:
- HG_EXECUTABLE - path to mercurial command line client (hg)
- HG_FOUND - true if the command line client was found
- HG_VERSION_STRING - the version of mercurial found
+``Hg_FOUND``
+ Boolean indicating whether the Mercurial client was found. For backward
+ compatibility, the ``HG_FOUND`` variable is also set to the same value.
-.. versionadded:: 3.1
- If the command line client executable is found the following macro is defined:
+``HG_VERSION_STRING``
+ The version of Mercurial found.
+
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``HG_EXECUTABLE``
+ Absolute path to the Mercurial command-line client (``hg``).
+
+Commands
+^^^^^^^^
+
+This module defines the following command when Mercurial client (``hg``) is
+found:
+
+.. command:: Hg_WC_INFO
+
+ .. versionadded:: 3.1
+
+ Extracts information of a Mercurial working copy:
+
+ .. code-block:: cmake
+
+ Hg_WC_INFO(<dir> <var-prefix>)
+
+ This macro defines the following variables if running Mercurial client on
+ working copy located at a given location ``<dir>`` succeeds; otherwise a
+ ``SEND_ERROR`` message is generated:
+
+ ``<var-prefix>_WC_CHANGESET``
+ Current changeset.
+ ``<var-prefix>_WC_REVISION``
+ Current revision.
+
+Examples
+^^^^^^^^
+
+Finding the Mercurial client and retrieving information about the current
+project's working copy:
.. code-block:: cmake
- HG_WC_INFO(<dir> <var-prefix>)
-
-Hg_WC_INFO extracts information of a mercurial working copy
-at a given location. This macro defines the following variables:
-
-::
-
- <var-prefix>_WC_CHANGESET - current changeset
- <var-prefix>_WC_REVISION - current revision
-
-Example usage:
-
-.. code-block:: cmake
-
- find_package(Hg)
- if(HG_FOUND)
- message("hg found: ${HG_EXECUTABLE}")
- HG_WC_INFO(${PROJECT_SOURCE_DIR} Project)
- message("Current revision is ${Project_WC_REVISION}")
- message("Current changeset is ${Project_WC_CHANGESET}")
- endif()
+ find_package(Hg)
+ if(Hg_FOUND)
+ Hg_WC_INFO(${PROJECT_SOURCE_DIR} Project)
+ message("Current revision is ${Project_WC_REVISION}")
+ message("Current changeset is ${Project_WC_CHANGESET}")
+ endif()
#]=======================================================================]
find_program(HG_EXECUTABLE
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/FindLibArchive.cmake b/Modules/FindLibArchive.cmake
index 538b654..9072d95 100644
--- a/Modules/FindLibArchive.cmake
+++ b/Modules/FindLibArchive.cmake
@@ -5,30 +5,50 @@
FindLibArchive
--------------
-Find libarchive library and headers.
-Libarchive is multi-format archive and compression library.
+Finds the libarchive library and include directories. Libarchive is a
+multi-format archive and compression library.
-The module defines the following variables:
+Import Targets
+^^^^^^^^^^^^^^
-::
+This module defines the following :ref:`Imported Targets`:
- LibArchive_FOUND - true if libarchive was found
- LibArchive_INCLUDE_DIRS - include search path
- LibArchive_LIBRARIES - libraries to link
- LibArchive_VERSION - libarchive 3-component version number
+``LibArchive::LibArchive``
+ .. versionadded:: 3.17
-The module defines the following ``IMPORTED`` targets:
+ A target for linking against libarchive.
-::
+Result Variables
+^^^^^^^^^^^^^^^^
- LibArchive::LibArchive - target for linking against libarchive
+This module defines the following variables:
-.. versionadded:: 3.6
- Support for new libarchive 3.2 version string format.
+``LibArchive_FOUND``
+ Boolean indicating whether libarchive was found.
+``LibArchive_INCLUDE_DIRS``
+ Include search path for using libarchive.
+``LibArchive_LIBRARIES``
+ Libraries to link against libarchive.
+``LibArchive_VERSION``
+ A 3-component version string (``major.minor.patch``) of libarchive found.
-.. versionadded:: 3.17
- Provides an imported target.
+ .. versionadded:: 3.6
+ Support for a new libarchive version string format. Starting from
+ libarchive version 3.2, a different preprocessor macro is used in the header
+ to define the version. In CMake 3.5 and earlier, this variable will be set
+ only for libarchive versions 3.1 and earlier. In CMake 3.6 and newer, this
+ variable will be set for all libarchive versions.
+
+Examples
+^^^^^^^^
+
+Finding LibArchive and linking it to a project target:
+
+.. code-block:: cmake
+
+ find_package(LibArchive)
+ target_link_libraries(project_target PRIVATE LibArchive::LibArchive)
#]=======================================================================]
cmake_policy(PUSH)
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/FindPNG.cmake b/Modules/FindPNG.cmake
index 52d137f..64b35b5 100644
--- a/Modules/FindPNG.cmake
+++ b/Modules/FindPNG.cmake
@@ -5,47 +5,62 @@
FindPNG
-------
-Find libpng, the official reference library for the PNG image format.
+Finds libpng, the official reference library for the PNG image format.
+
+.. note::
+
+ The PNG library depends on the ZLib compression library, which must be found
+ for this module to succeed.
Imported Targets
^^^^^^^^^^^^^^^^
.. versionadded:: 3.5
-This module defines the following :prop_tgt:`IMPORTED` target:
+This module defines the following :ref:`Imported Targets`:
``PNG::PNG``
The libpng library, if found.
-Result variables
+Result Variables
^^^^^^^^^^^^^^^^
-This module will set the following variables in your project:
+This module sets the following variables:
``PNG_INCLUDE_DIRS``
- where to find png.h, etc.
+ Directory containing the PNG headers (e.g., ``png.h``).
``PNG_LIBRARIES``
- the libraries to link against to use PNG.
+ PNG libraries required for linking.
``PNG_DEFINITIONS``
- You should add_definitions(${PNG_DEFINITIONS}) before compiling code
- that includes png library files.
+ Compile definitions for using PNG, if any. They can be added with
+ :command:`target_compile_definitions` command when not using the ``PNG::PNG``
+ imported target.
``PNG_FOUND``
- If false, do not try to use PNG.
+ True if PNG library is found.
``PNG_VERSION_STRING``
- the version of the PNG library found (since CMake 2.8.8)
+ .. versionadded:: 2.8.8
-Obsolete variables
+ The version of the PNG library found.
+
+Obsolete Variables
^^^^^^^^^^^^^^^^^^
-The following variables may also be set, for backwards compatibility:
+The following variables may also be set for backward compatibility:
``PNG_LIBRARY``
- where to find the PNG library.
+ Path to the PNG library.
``PNG_INCLUDE_DIR``
- where to find the PNG headers (same as PNG_INCLUDE_DIRS)
+ Directory containing the PNG headers (same as ``PNG_INCLUDE_DIRS``).
-Since PNG depends on the ZLib compression library, none of the above
-will be defined unless ZLib can be found.
+Examples
+^^^^^^^^
+
+Finding PNG library and using it in a project:
+
+.. code-block:: cmake
+
+ find_package(PNG)
+ target_link_libraries(project_target PRIVATE PNG::PNG)
#]=======================================================================]
cmake_policy(PUSH)
diff --git a/Modules/FindPackageHandleStandardArgs.cmake b/Modules/FindPackageHandleStandardArgs.cmake
index c2eeb49..5081936 100644
--- a/Modules/FindPackageHandleStandardArgs.cmake
+++ b/Modules/FindPackageHandleStandardArgs.cmake
@@ -569,7 +569,7 @@
# print the result:
if(${_NAME}_FOUND)
- FIND_PACKAGE_MESSAGE(${_NAME} "Found ${_NAME}: ${${_FIRST_REQUIRED_VAR}} ${VERSION_MSG} ${COMPONENT_MSG}" "${DETAILS}")
+ find_package_message(${_NAME} "Found ${_NAME}: ${${_FIRST_REQUIRED_VAR}} ${VERSION_MSG} ${COMPONENT_MSG}" "${DETAILS}")
else()
if(FPHSA_CONFIG_MODE)
diff --git a/Modules/FindPackageMessage.cmake b/Modules/FindPackageMessage.cmake
index a9f2d2b..27f1514 100644
--- a/Modules/FindPackageMessage.cmake
+++ b/Modules/FindPackageMessage.cmake
@@ -5,29 +5,75 @@
FindPackageMessage
------------------
-.. code-block:: cmake
+This module is intended to be used in
+:ref:`FindXXX.cmake modules <Find Modules>` and provides a function for printing
+find result messages.
- find_package_message(<name> "message for user" "find result details")
+.. command:: find_package_message
-This function is intended to be used in FindXXX.cmake modules files.
-It will print a message once for each unique find result. This is
-useful for telling the user where a package was found. The first
-argument specifies the name (XXX) of the package. The second argument
-specifies the message to display. The third argument lists details
-about the find result so that if they change the message will be
-displayed again. The macro also obeys the QUIET argument to the
-find_package command.
+ .. code-block:: cmake
-Example:
+ find_package_message(<PackageName> <message> <details>)
+
+ Prints a ``<message>`` once for each unique find result to inform the user
+ which package was found and where.
+
+ ``<PackageName>``
+ The name of the package (for example, as used in the
+ ``Find<PackageName>.cmake`` module filename).
+
+ ``<message>``
+ The message string to display.
+
+ ``<details>``
+ A unique identifier for tracking message display. The ``<message>`` is
+ printed only once per distinct ``<details>`` value. If ``<details>`` string
+ changes in a subsequent configuration phase, the message will be displayed
+ again.
+
+ If :command:`find_package` was called with the ``QUIET`` option, the
+ ``<message>`` is not printed.
+
+Examples
+^^^^^^^^
+
+Printing result message in a find module:
.. code-block:: cmake
+ :caption: FindFoo.cmake
- if(X11_FOUND)
- find_package_message(X11 "Found X11: ${X11_X11_LIB}"
- "[${X11_X11_LIB}][${X11_INCLUDE_DIR}]")
+ find_library(Foo_LIBRARY foo)
+ find_path(Foo_INCLUDE_DIR foo.h)
+
+ # ...
+
+ include(FindPackageMessage)
+
+ if(Foo_FOUND)
+ find_package_message(
+ Foo
+ "Found Foo: ${Foo_LIBRARY}"
+ "[${Foo_LIBRARY}][${Foo_INCLUDE_DIR}]"
+ )
else()
- ...
+ # ...
endif()
+
+When writing standard :ref:`Find modules <Find Modules>`, use the
+:module:`find_package_handle_standard_args() <FindPackageHandleStandardArgs>`
+function, which automatically prints the find result message:
+
+.. code-block:: cmake
+ :caption: FindFoo.cmake
+
+ # ...
+
+ include(FindPackageHandleStandardArgs)
+
+ find_package_handle_standard_args(
+ Foo
+ REQUIRED_VARS Foo_LIBRARY Foo_INCLUDE_DIR
+ )
#]=======================================================================]
function(find_package_message pkg msg details)
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..5595967 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)
@@ -75,6 +79,53 @@
endfunction()
+function (_PYTHON_RESET_ARTIFACTS comp)
+ set(components ${comp})
+ if (comp STREQUAL "Interpreter")
+ list (APPEND components Compiler Development NumPy)
+ endif()
+ if (comp STREQUAL "Development")
+ list (APPEND components NumPy)
+ endif()
+ set(find_components ${${_PYTHON_BASE}_FIND_COMPONENTS})
+ list(TRANSFORM find_components REPLACE "^Development.*" "Development")
+ list(REMOVE_DUPLICATES find_components)
+
+ foreach (component IN LISTS components)
+ if (NOT component IN_LIST find_components)
+ continue()
+ endif()
+ if (component STREQUAL "Interpreter")
+ unset(_${_PYTHON_PREFIX}_EXECUTABLE CACHE)
+ endif()
+ if (component STREQUAL "Compiler"
+ AND "IronPython" IN_LIST _${_PYTHON_PREFIX}_FIND_IMPLEMENTATIONS)
+ unset(_${_PYTHON_PREFIX}_COMPILER CACHE)
+ endif()
+ if (component STREQUAL "Development")
+ set(artifacts ${ARGN})
+ if (NOT artifacts)
+ set(artifacts LIBRARY SABI_LIBRARY INCLUDE_DIR)
+ endif()
+ unset(_${_PYTHON_PREFIX}_CONFIG)
+ foreach (artifact IN LISTS artifacts)
+ if (artifact IN_LIST _${_PYTHON_PREFIX}_FIND_DEVELOPMENT_ARTIFACTS)
+ if (artifact MATCHES "LIBRARY")
+ unset(_${_PYTHON_PREFIX}_${artifact}_RELEASE CACHE)
+ unset(_${_PYTHON_PREFIX}_${artifact}_DEBUG CACHE)
+ elseif(arifact STREQUAL "INCLUDE_DIR")
+ unset(_${_PYTHON_PREFIX}_${artifact} CACHE)
+ endif()
+ endif()
+ endforeach()
+ endif()
+ if (component STREQUAL "NumPy")
+ unset(_${_PYTHON_PREFIX}_NumPy_INCLUDE_DIR CACHE)
+ endif()
+ endforeach()
+endfunction()
+
+
macro (_PYTHON_SELECT_LIBRARY_CONFIGURATIONS _PYTHON_BASENAME)
if(NOT DEFINED ${_PYTHON_BASENAME}_LIBRARY_RELEASE)
set(${_PYTHON_BASENAME}_LIBRARY_RELEASE "${_PYTHON_BASENAME}_LIBRARY_RELEASE-NOTFOUND")
@@ -528,7 +579,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 +897,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 +1057,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 +1141,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 +1496,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)
@@ -1890,6 +1962,8 @@
if (NOT ${_PYTHON_PREFIX}_EXECUTABLE STREQUAL _${_PYTHON_PREFIX}_EXECUTABLE)
# invalidate cache properties
unset (_${_PYTHON_PREFIX}_INTERPRETER_PROPERTIES CACHE)
+ # invalidate the previous results for any other requested components
+ _python_reset_artifacts(Interpreter)
endif()
set (_${_PYTHON_PREFIX}_EXECUTABLE "${${_PYTHON_PREFIX}_EXECUTABLE}" CACHE INTERNAL "")
unset (_${_PYTHON_PREFIX}_EXECUTABLE_DEBUG CACHE)
@@ -2664,7 +2738,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)
@@ -2796,18 +2870,17 @@
if (DEFINED ${_PYTHON_PREFIX}_LIBRARY
AND IS_ABSOLUTE "${${_PYTHON_PREFIX}_LIBRARY}")
+ _python_reset_artifacts(Development)
set (_${_PYTHON_PREFIX}_LIBRARY_RELEASE "${${_PYTHON_PREFIX}_LIBRARY}" CACHE INTERNAL "")
- unset (_${_PYTHON_PREFIX}_LIBRARY_DEBUG CACHE)
- unset (_${_PYTHON_PREFIX}_INCLUDE_DIR CACHE)
endif()
if (DEFINED ${_PYTHON_PREFIX}_SABI_LIBRARY
AND IS_ABSOLUTE "${${_PYTHON_PREFIX}_SABI_LIBRARY}")
+ _python_reset_artifacts(Development SABI_LIBRARY INCLUDE_DIR)
set (_${_PYTHON_PREFIX}_SABI_LIBRARY_RELEASE "${${_PYTHON_PREFIX}_SABI_LIBRARY}" CACHE INTERNAL "")
- unset (_${_PYTHON_PREFIX}_SABI_LIBRARY_DEBUG CACHE)
- unset (_${_PYTHON_PREFIX}_INCLUDE_DIR CACHE)
endif()
if (DEFINED ${_PYTHON_PREFIX}_INCLUDE_DIR
AND IS_ABSOLUTE "${${_PYTHON_PREFIX}_INCLUDE_DIR}")
+ _python_reset_artifacts(Development INCLUDE_DIR)
set (_${_PYTHON_PREFIX}_INCLUDE_DIR "${${_PYTHON_PREFIX}_INCLUDE_DIR}" CACHE INTERNAL "")
endif()
@@ -2827,7 +2900,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 +3167,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 +3437,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 +3700,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/FindQt.cmake b/Modules/FindQt.cmake
index 31d4c0b..98cd1e2 100644
--- a/Modules/FindQt.cmake
+++ b/Modules/FindQt.cmake
@@ -6,35 +6,56 @@
------
.. deprecated:: 3.14
- This module is available only if policy :policy:`CMP0084` is not set to ``NEW``.
-Searches for all installed versions of Qt3 or Qt4.
+ This module is available only if policy :policy:`CMP0084` is not set to
+ ``NEW``. It supports only Qt3 and Qt4. For Qt5 or later versions see
+ :manual:`cmake-qt(7)`.
-This module cannot handle Qt5 or any later versions.
-For those, see :manual:`cmake-qt(7)`.
+This module finds an installed version of Qt3 or Qt4. Qt is a cross-platform
+application development framework for creating graphical user interfaces and
+applications.
-This module should only be used if your project can work with multiple
-versions of Qt. If not, you should just directly use FindQt4 or
-FindQt3. If multiple versions of Qt are found on the machine, then
-The user must set the option DESIRED_QT_VERSION to the version they
-want to use. If only one version of qt is found on the machine, then
-the DESIRED_QT_VERSION is set to that version and the matching FindQt3
-or FindQt4 module is included. Once the user sets DESIRED_QT_VERSION,
-then the FindQt3 or FindQt4 module is included.
+Use this module only if the project can work with both Qt3 and Qt4
+versions. If a specific version is required, use :module:`FindQt4` or
+:module:`FindQt3` module directly.
-::
+Behavior:
- QT_REQUIRED if this is set to TRUE then if CMake can
- not find Qt4 or Qt3 an error is raised
- and a message is sent to the user.
+* If multiple Qt versions are found, the user must set the preferred major
+ Qt version with the ``DESIRED_QT_VERSION`` variable.
+* If only one Qt version is found, then the ``DESIRED_QT_VERSION`` is set
+ automatically.
+* Once the ``DESIRED_QT_VERSION`` variable is set, the corresponding
+ :module:`FindQt3` or :module:`FindQt4` module is included.
+Result Variables
+^^^^^^^^^^^^^^^^
+This module sets the following variables:
-::
+``QT4_INSTALLED``
+ ``TRUE`` if Qt4 is found.
+``QT3_INSTALLED``
+ ``TRUE`` if Qt3 is found.
- DESIRED_QT_VERSION OPTION is created
- QT4_INSTALLED is set to TRUE if qt4 is found.
- QT3_INSTALLED is set to TRUE if qt3 is found.
+Hints
+^^^^^
+
+``QT_REQUIRED``
+ If this variable is set to ``TRUE`` before calling ``find_package(Qt)``,
+ CMake will raise an error if neither Qt3 nor Qt4 is found.
+``DESIRED_QT_VERSION``
+ Specifies the Qt major version to use. Can be either ``3``, ``4``, or empty,
+ to search for version automatically.
+
+Examples
+^^^^^^^^
+
+Finding Qt3 or Qt4 version:
+
+.. code-block:: cmake
+
+ find_package(Qt)
#]=======================================================================]
if(_findqt_testing)
diff --git a/Modules/FindQt3.cmake b/Modules/FindQt3.cmake
index 594fc63..2c62a5f 100644
--- a/Modules/FindQt3.cmake
+++ b/Modules/FindQt3.cmake
@@ -5,33 +5,78 @@
FindQt3
-------
-Locate Qt include paths and libraries
+This module finds Qt3, a cross-platform application development framework for
+creating graphical user interfaces and applications.
-This module defines:
+.. note::
-::
+ This module is for Qt version 3. As of Qt version 5, the Qt upstream also
+ provides an exported configuration to find Qt. New code should follow the
+ :manual:`cmake-qt(7)` instead of using this module.
- QT_INCLUDE_DIR - where to find qt.h, etc.
- QT_LIBRARIES - the libraries to link against to use Qt.
- QT_DEFINITIONS - definitions to use when
- compiling code that uses Qt.
- QT_FOUND - If false, don't try to use Qt.
- QT_VERSION_STRING - the version of Qt found
+Result Variables
+^^^^^^^^^^^^^^^^
+This module sets the following variables:
+``Qt3_FOUND``
+ True if Qt3 has been found.
+``QT_FOUND``
+ True if Qt3 has been found. This variable is for compatibility with other Qt
+ find modules.
+``QT_VERSION_STRING``
+ The version of Qt3 that was found.
+``QT_LIBRARIES``
+ Libraries needed to link against for using Qt3.
+``QT_DEFINITIONS``
+ A list of compile definitions to use when compiling code that uses Qt3.
-If you need the multithreaded version of Qt, set QT_MT_REQUIRED to
-TRUE
+Cache Variables
+^^^^^^^^^^^^^^^
-Also defined, but not for general use are:
+The following cache variables may also be set:
-::
+``QT_INCLUDE_DIR``
+ The directory containing ``qt.h`` and other Qt3 header files.
- QT_MOC_EXECUTABLE, where to find the moc tool.
- QT_UIC_EXECUTABLE, where to find the uic tool.
- QT_QT_LIBRARY, where to find the Qt library.
- QT_QTMAIN_LIBRARY, where to find the qtmain
- library. This is only required by Qt3 on Windows.
+The following cache variables may also be set but are not meant for general use:
+
+``QT_MOC_EXECUTABLE``
+ Path to the ``moc`` tool.
+``QT_UIC_EXECUTABLE``
+ Path to the ``uic`` tool.
+``QT_QT_LIBRARY``
+ Path to the Qt3 library.
+``QT_QTMAIN_LIBRARY``
+ Path to the ``qtmain`` library. This is only required by Qt3 on Windows.
+
+Hints
+^^^^^
+
+``QT_MT_REQUIRED``
+ To search for the multithreaded version of Qt3, set this variable to ``TRUE``
+ before looking for Qt3.
+
+Examples
+^^^^^^^^
+
+Finding Qt3 on the system:
+
+.. code-block:: cmake
+
+ find_package(Qt3)
+ if(Qt3_FOUND)
+ target_link_libraries(foo PRIVATE ${QT_LIBRARIES})
+ target_include_directories(foo PRIVATE ${QT_INCLUDE_DIR})
+ target_compile_definitions(foo PRIVATE ${QT_DEFINITIONS})
+ endif()
+
+Looking for the multithreaded version of Qt3:
+
+.. code-block:: cmake
+
+ set(QT_MT_REQUIRED TRUE)
+ find_package(Qt3)
#]=======================================================================]
cmake_policy(PUSH)
diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake
index 580e1e2..2c9e39f 100644
--- a/Modules/FindQt4.cmake
+++ b/Modules/FindQt4.cmake
@@ -5,32 +5,26 @@
FindQt4
-------
-Finding and Using Qt4
-^^^^^^^^^^^^^^^^^^^^^
-
-This module can be used to find Qt4. The most important issue is that
-the Qt4 qmake is available via the system path. This qmake is then
-used to detect basically everything else. This module defines a
-number of :prop_tgt:`IMPORTED` targets, macros and variables.
-
-Typical usage could be something like:
-
-.. code-block:: cmake
-
- set(CMAKE_AUTOMOC ON)
- set(CMAKE_INCLUDE_CURRENT_DIR ON)
- find_package(Qt4 4.4.3 REQUIRED QtGui QtXml)
- add_executable(myexe main.cpp)
- target_link_libraries(myexe Qt4::QtGui Qt4::QtXml)
+This module finds Qt4, a cross-platform application development framework for
+creating graphical user interfaces and applications. It defines a number of
+imported targets, macros, and variables to use Qt4 in the project.
.. note::
- When using :prop_tgt:`IMPORTED` targets, the qtmain.lib static library is
- automatically linked on Windows for :prop_tgt:`WIN32 <WIN32_EXECUTABLE>`
- executables. To disable that globally, set the
- ``QT4_NO_LINK_QTMAIN`` variable before finding Qt4. To disable that
- for a particular executable, set the ``QT4_NO_LINK_QTMAIN`` target
- property to ``TRUE`` on the executable.
+ This module is for Qt version 4. As of Qt version 5, the Qt upstream also
+ provides an exported configuration to find Qt. New code should follow the
+ :manual:`cmake-qt(7)` instead of using this module.
+
+To detect the Qt4 package, the Qt4 ``qmake`` tool is required and must be
+available in the system path.
+
+.. note::
+
+ When using :ref:`Imported Targets`, the ``qtmain.lib`` static library is
+ automatically linked on Windows for :prop_tgt:`WIN32 <WIN32_EXECUTABLE>`
+ executables. To disable this globally, set the ``QT4_NO_LINK_QTMAIN``
+ variable before finding Qt4. To disable this for a particular executable,
+ set the ``QT4_NO_LINK_QTMAIN`` target property to ``TRUE`` on that executable.
Qt Build Tools
^^^^^^^^^^^^^^
@@ -41,264 +35,415 @@
automatically invoked by :manual:`cmake(1)` if the appropriate conditions
are met. See :manual:`cmake-qt(7)` for more.
-Qt Macros
-^^^^^^^^^
-
-In some cases it can be necessary or useful to invoke the Qt build tools in a
-more-manual way. Several macros are available to add targets for such uses.
-
-::
-
- macro QT4_WRAP_CPP(outfiles inputfile ... [TARGET tgt] OPTIONS ...)
- create moc code from a list of files containing Qt class with
- the Q_OBJECT declaration. Per-directory preprocessor definitions
- are also added. If the <tgt> is specified, the
- INTERFACE_INCLUDE_DIRECTORIES and INTERFACE_COMPILE_DEFINITIONS from
- the <tgt> are passed to moc. Options may be given to moc, such as
- those found when executing "moc -help".
-
-
-::
-
- macro QT4_WRAP_UI(outfiles inputfile ... OPTIONS ...)
- create code from a list of Qt designer ui files.
- Options may be given to uic, such as those found
- when executing "uic -help"
-
-
-::
-
- macro QT4_ADD_RESOURCES(outfiles inputfile ... OPTIONS ...)
- create code from a list of Qt resource files.
- Options may be given to rcc, such as those found
- when executing "rcc -help"
-
-
-::
-
- macro QT4_GENERATE_MOC(inputfile outputfile [TARGET tgt])
- creates a rule to run moc on infile and create outfile.
- Use this if for some reason QT4_WRAP_CPP() isn't appropriate, e.g.
- because you need a custom filename for the moc file or something
- similar. If the <tgt> is specified, the
- INTERFACE_INCLUDE_DIRECTORIES and INTERFACE_COMPILE_DEFINITIONS from
- the <tgt> are passed to moc.
-
-
-::
-
- macro QT4_ADD_DBUS_INTERFACE(outfiles interface basename)
- Create the interface header and implementation files with the
- given basename from the given interface xml file and add it to
- the list of sources.
-
- You can pass additional parameters to the qdbusxml2cpp call by setting
- properties on the input file:
-
- INCLUDE the given file will be included in the generate interface header
-
- CLASSNAME the generated class is named accordingly
-
- NO_NAMESPACE the generated class is not wrapped in a namespace
-
-
-::
-
- macro QT4_ADD_DBUS_INTERFACES(outfiles inputfile ... )
- Create the interface header and implementation files
- for all listed interface xml files.
- The basename will be automatically determined from the name
- of the xml file.
-
- The source file properties described for
- QT4_ADD_DBUS_INTERFACE also apply here.
-
-
-::
-
- macro QT4_ADD_DBUS_ADAPTOR(outfiles xmlfile parentheader parentclassname
- [basename] [classname])
- create a dbus adaptor (header and implementation file) from the xml file
- describing the interface, and add it to the list of sources. The adaptor
- forwards the calls to a parent class, defined in parentheader and named
- parentclassname. The name of the generated files will be
- <basename>adaptor.{cpp,h} where basename defaults to the basename of the
- xml file.
- If <classname> is provided, then it will be used as the classname of the
- adaptor itself.
-
-
-::
-
- macro QT4_GENERATE_DBUS_INTERFACE( header [interfacename] OPTIONS ...)
- generate the xml interface file from the given header.
- If the optional argument interfacename is omitted, the name of the
- interface file is constructed from the basename of the header with
- the suffix .xml appended.
- Options may be given to qdbuscpp2xml, such as those found when
- executing "qdbuscpp2xml --help"
-
-
-::
-
- macro QT4_CREATE_TRANSLATION( qm_files directories ... sources ...
- ts_files ... OPTIONS ...)
- out: qm_files
- in: directories sources ts_files
- options: flags to pass to lupdate, such as -extensions to specify
- extensions for a directory scan.
- generates commands to create .ts (via lupdate) and .qm
- (via lrelease) - files from directories and/or sources. The ts files are
- created and/or updated in the source tree (unless given with full paths).
- The qm files are generated in the build tree.
- Updating the translations can be done by adding the qm_files
- to the source list of your library/executable, so they are
- always updated, or by adding a custom target to control when
- they get updated/generated.
-
-
-::
-
- macro QT4_ADD_TRANSLATION( qm_files ts_files ... )
- out: qm_files
- in: ts_files
- generates commands to create .qm from .ts - files. The generated
- filenames can be found in qm_files. The ts_files
- must exist and are not updated in any way.
-
-
-::
-
- macro QT4_AUTOMOC(sourcefile1 sourcefile2 ... [TARGET tgt])
- The qt4_automoc macro is obsolete. Use the CMAKE_AUTOMOC feature instead.
- This macro is still experimental.
- It can be used to have moc automatically handled.
- So if you have the files foo.h and foo.cpp, and in foo.h a
- a class uses the Q_OBJECT macro, moc has to run on it. If you don't
- want to use QT4_WRAP_CPP() (which is reliable and mature), you can insert
- #include "foo.moc"
- in foo.cpp and then give foo.cpp as argument to QT4_AUTOMOC(). This will
- scan all listed files at cmake-time for such included moc files and if it
- finds them cause a rule to be generated to run moc at build time on the
- accompanying header file foo.h.
- If a source file has the SKIP_AUTOMOC property set it will be ignored by
- this macro.
- If the <tgt> is specified, the INTERFACE_INCLUDE_DIRECTORIES and
- INTERFACE_COMPILE_DEFINITIONS from the <tgt> are passed to moc.
-
-
-::
-
- function QT4_USE_MODULES( target [link_type] modules...)
- This function is obsolete. Use target_link_libraries with IMPORTED targets
- instead.
- Make <target> use the <modules> from Qt. Using a Qt module means
- to link to the library, add the relevant include directories for the
- module, and add the relevant compiler defines for using the module.
- Modules are roughly equivalent to components of Qt4, so usage would be
- something like:
- qt4_use_modules(myexe Core Gui Declarative)
- to use QtCore, QtGui and QtDeclarative. The optional <link_type> argument
- can be specified as either LINK_PUBLIC or LINK_PRIVATE to specify the
- same argument to the target_link_libraries call.
-
-
Imported Targets
^^^^^^^^^^^^^^^^
-A particular Qt library may be used by using the corresponding
-:prop_tgt:`IMPORTED` target with the :command:`target_link_libraries`
-command:
+Qt libraries can be linked using their corresponding
+:ref:`IMPORTED target <Imported Targets>` with the
+:command:`target_link_libraries` command:
.. code-block:: cmake
target_link_libraries(myexe Qt4::QtGui Qt4::QtXml)
-Using a target in this way causes :cmake(1)` to use the appropriate include
-directories and compile definitions for the target when compiling ``myexe``.
+Linking to an imported target automatically applies the correct include
+directories and compile definitions when building ``myexe``.
-Targets are aware of their dependencies, so for example it is not necessary
-to list ``Qt4::QtCore`` if another Qt library is listed, and it is not
-necessary to list ``Qt4::QtGui`` if ``Qt4::QtDeclarative`` is listed.
-Targets may be tested for existence in the usual way with the
-:command:`if(TARGET)` command.
+Imported targets also manage their dependencies, so listing ``Qt4::QtCore`` is
+unnecessary if another Qt library depends on it. Likewise, ``Qt4::QtGui`` is
+automatically included when linking ``Qt4::QtDeclarative``. Targets can be
+checked for existence using :command:`if(TARGET)` command.
-The Qt toolkit may contain both debug and release libraries.
-:manual:`cmake(1)` will choose the appropriate version based on the build
-configuration.
+If both debug and release versions of a Qt toolkit library are available, CMake
+selects the appropriate one based on the
+:ref:`build configuration <Build Configurations>`.
+
+This module provides the following imported targets, if found:
``Qt4::QtCore``
- The QtCore target
+ The QtCore target
``Qt4::QtGui``
- The QtGui target
+ The QtGui target
``Qt4::Qt3Support``
- The Qt3Support target
+ The Qt3Support target
``Qt4::QtAssistant``
- The QtAssistant target
+ The QtAssistant target
``Qt4::QtAssistantClient``
- The QtAssistantClient target
+ The QtAssistantClient target
``Qt4::QAxContainer``
- The QAxContainer target (Windows only)
+ The QAxContainer target (Windows only)
``Qt4::QAxServer``
- The QAxServer target (Windows only)
+ The QAxServer target (Windows only)
``Qt4::QtDBus``
- The QtDBus target
+ The QtDBus target
``Qt4::QtDeclarative``
- The QtDeclarative target
+ The QtDeclarative target
``Qt4::QtDesigner``
- The QtDesigner target
+ The QtDesigner target
``Qt4::QtDesignerComponents``
- The QtDesignerComponents target
+ The QtDesignerComponents target
``Qt4::QtHelp``
- The QtHelp target
+ The QtHelp target
``Qt4::QtMotif``
- The QtMotif target
+ The QtMotif target
``Qt4::QtMultimedia``
- The QtMultimedia target
+ The QtMultimedia target
``Qt4::QtNetwork``
- The QtNetwork target
-``Qt4::QtNsPLugin``
- The QtNsPLugin target
+ The QtNetwork target
+``Qt4::QtNsPlugin``
+ The QtNsPlugin target
``Qt4::QtOpenGL``
- The QtOpenGL target
+ The QtOpenGL target
``Qt4::QtScript``
- The QtScript target
+ The QtScript target
``Qt4::QtScriptTools``
- The QtScriptTools target
+ The QtScriptTools target
``Qt4::QtSql``
- The QtSql target
+ The QtSql target
``Qt4::QtSvg``
- The QtSvg target
+ The QtSvg target
``Qt4::QtTest``
- The QtTest target
+ The QtTest target
``Qt4::QtUiTools``
- The QtUiTools target
+ The QtUiTools target
``Qt4::QtWebKit``
- The QtWebKit target
+ The QtWebKit target
``Qt4::QtXml``
- The QtXml target
+ The QtXml target
``Qt4::QtXmlPatterns``
- The QtXmlPatterns target
+ The QtXmlPatterns target
``Qt4::phonon``
- The phonon target
+ The phonon target
Result Variables
^^^^^^^^^^^^^^^^
- Below is a detailed list of variables that FindQt4.cmake sets.
+This module sets the following variables:
``Qt4_FOUND``
- If false, don't try to use Qt 4.
+ Boolean whether Qt4 has been found. If false, don't try to use Qt4.
``QT_FOUND``
- If false, don't try to use Qt. This variable is for compatibility only.
+ Boolean whether Qt4 has been found. If false, don't try to use Qt4. This
+ variable is for compatibility with other Qt find modules.
``QT4_FOUND``
- If false, don't try to use Qt 4. This variable is for compatibility only.
+ Boolean whether Qt4 has been found. If false, don't try to use Qt4. This
+ variable is for backward compatibility only.
``QT_VERSION_MAJOR``
- The major version of Qt found.
+ The major version of Qt found.
``QT_VERSION_MINOR``
- The minor version of Qt found.
+ The minor version of Qt found.
``QT_VERSION_PATCH``
- The patch version of Qt found.
+ The patch version of Qt found.
+
+Hints
+^^^^^
+
+``QT4_NO_LINK_QTMAIN``
+ If set to boolean true before finding Qt4, it globally disables linking
+ ``qtmain.lib`` static library on Windows.
+
+Macros
+^^^^^^
+
+In some cases it can be necessary or useful to invoke the Qt build tools in a
+more-manual way. This module provides the following macros to add targets for
+such uses:
+
+.. command:: qt4_wrap_cpp
+
+ Creates build rules for running ``moc`` on a given list of input files:
+
+ .. code-block:: cmake
+
+ qt4_wrap_cpp(<variable> <files>... [TARGET <target>] [OPTIONS <options>...])
+
+ This macro creates build rules for processing a list of input files
+ ``<files>`` that contain Qt classes with the ``Q_OBJECT`` declaration.
+ Per-directory preprocessor definitions are also added.
+
+ ``<variable>``
+ Name of a variable where a list of generated output files is stored.
+
+ ``<files>``
+ One or more input source files.
+
+ ``TARGET``
+ If specified, the ``INTERFACE_INCLUDE_DIRECTORIES`` and
+ ``INTERFACE_COMPILE_DEFINITIONS`` target properties from the ``<target>``
+ are passed to ``moc``.
+
+ ``OPTIONS``
+ Optional list of options given to ``moc``, such as those found when
+ executing ``moc -help``.
+
+ .. note::
+
+ Instead of using ``qt4_wrap_cpp()``, the :variable:`CMAKE_AUTOMOC` variable
+ can be set to process source files with ``moc`` automatically.
+
+.. command:: qt4_wrap_ui
+
+ Creates build rules for running ``uic`` on a given list of Qt designer ui
+ input files:
+
+ .. code-block:: cmake
+
+ qt4_wrap_ui(<variable> <files>... [OPTIONS <options>...])
+
+ ``<variable>``
+ Name of a variable where a list of generated output filenames is stored.
+
+ ``<files>``
+ One or more Qt designer ui input source files.
+
+ ``OPTIONS``
+ Optional list of options given to ``uic``, such as those found when
+ executing ``uic -help``.
+
+ .. note::
+
+ Instead of using ``qt4_wrap_ui()``, the :variable:`CMAKE_AUTOUIC` variable
+ can be set to process ui files with ``uic`` automatically.
+
+.. command:: qt4_add_resources
+
+ Creates build rules for running ``rcc`` on a given list of input Qt resource
+ files:
+
+ .. code-block:: cmake
+
+ qt4_add_resources(<variable> <files>... [OPTIONS <options>...])
+
+ ``<variable>``
+ Name of a variable where a list of generated output filenames is stored.
+
+ ``<files>``
+ One or more Qt resource input source files.
+
+ ``OPTIONS``
+ Optional list of options given to ``rcc``, such as those found when
+ executing ``rcc -help``.
+
+ .. note::
+
+ Instead of using ``qt4_add_resources()``, the :variable:`CMAKE_AUTORCC`
+ variable can be set to process resource files with ``rcc`` automatically.
+
+.. command:: qt4_generate_moc
+
+ Creates a build rule that generates output file by running ``moc`` on a given
+ input file.
+
+ .. code-block:: cmake
+
+ qt4_generate_moc(<input-file> <output-file> [TARGET <target>])
+
+ This macro creates a build rule for ``<input-file>`` to generate
+ ``<output-file>``. Use this if for some reason ``qt4_wrap_cpp()`` isn't
+ feasible, e.g. because a custom filename is needed for the moc file or
+ similar.
+
+ ``TARGET``
+ If specified, the ``INTERFACE_INCLUDE_DIRECTORIES`` and
+ ``INTERFACE_COMPILE_DEFINITIONS`` target properties from the ``<target>``
+ are passed to ``moc``.
+
+.. command:: qt4_add_dbus_interface
+
+ Creates the interface header and implementation files from an interface XML
+ file:
+
+ .. code-block:: cmake
+
+ qt4_add_dbus_interface(<variable> <interface-file> <basename>)
+
+ This macro creates the interface header (``<basename>.h``) and implementation
+ files (``<basename>.{cpp,moc}``) from the given interface XML file
+ ``<interface-file>`` and adds it to the variable which contains a list of
+ sources (specified as variable name ``<variable>``).
+
+ Additional parameters can be passed to the ``qdbusxml2cpp`` call by setting
+ the following source file properties on the input file ``<interface-file>``:
+
+ ``INCLUDE``
+ The given file will be included in the generate interface header.
+
+ ``CLASSNAME``
+ The name of the generated class.
+
+ ``NO_NAMESPACE``
+ The generated class will not be wrapped in a namespace.
+
+.. command:: qt4_add_dbus_interfaces
+
+ Creates the interface header and implementation files from multiple interface
+ XML files:
+
+ .. code-block:: cmake
+
+ qt4_add_dbus_interfaces(<variable> <interface-files>...)
+
+ This macro creates the interface header and implementation files for all
+ listed interface XML files ``<interface-files>``. The basename will be
+ automatically determined from the name of the XML file. The resulting output
+ files list is stored in a variable ``<variable>``.
+
+ The source file properties described for ``qt4_add_dbus_interface()`` also
+ apply here.
+
+.. command:: qt4_add_dbus_adaptor
+
+ Generates an adaptor class for a D-Bus interface:
+
+ .. code-block:: cmake
+
+ qt4_add_dbus_adaptor(<variable> <xmlfile> <parent-header> <parent-classname>
+ [<basename>] [<classname>])
+
+ Creates a D-Bus adaptor (header and implementation file) from the XML file
+ describing the interface, and adds it to the list of sources. The adaptor
+ forwards the calls to a parent class, defined in ``<parent-header>`` and named
+ ``<parent-classname>``. The generated filenames will be
+ ``<basename>adaptor.{cpp,h}`` where ``<basename>`` defaults to the basename of
+ the XML file if not given. If ``<classname>`` is provided, then it will be
+ used as the classname of the adaptor itself. Generated filenames are stored
+ in a variable ``<variable>``.
+
+.. command:: qt4_generate_dbus_interface
+
+ Generates a D-Bus XML interface file from a given header file:
+
+ .. code-block:: cmake
+
+ qt4_generate_dbus_interface(<header> [<interface>] [OPTIONS <options>...])
+
+ This macro creates a build rule to extract declaration from the given
+ ``<header>`` file to generate a corresponding XML interface file.
+
+ ``<header>``
+ Path to header file from which XML interface file is generated.
+
+ ``<interface>``
+ Path to the generated XML interface file. If this optional argument is
+ omitted, the name of the interface file is constructed from the basename of
+ the header with the suffix ``.xml`` appended. A relative path is
+ interpreted as relative to :variable:`CMAKE_CURRENT_BINARY_DIR`.
+
+ ``OPTIONS``
+ A list of options that may be given to ``qdbuscpp2xml``, such as those found
+ when executing ``qdbuscpp2xml --help``.
+
+.. command:: qt4_create_translation
+
+ Creates build rules for generating TS and QM files:
+
+ .. code-block:: cmake
+
+ qt4_create_translation(<qm-files-var> <directories>... <sources>...
+ <ts-files>... [OPTIONS <options>...])
+
+ This macro creates build rules to generate TS (Translation Source files
+ ``.ts``) files via ``lupdate`` and QM (Qt Message files ``.qm``) files via
+ ``lrelease`` from the given ``<directories>`` and/or ``<sources>``. The TS
+ files are created and/or updated in the source tree (unless given with full
+ paths). The QM files are generated in the build tree.
+
+ ``<qm-files-var>``
+ A list of generated QM files is stored in this variable. Updating the
+ translations can be done by adding the ``<qm-files-var>`` to the source list
+ of the project library/executable, so they are always updated, or by adding
+ a custom target to control when they get updated/generated.
+
+ ``<directories>``
+ A list of directories containing source files.
+
+ ``<sources>``
+ A list of source files.
+
+ ``<ts-files>``
+ A list of TS (Translation Source) files.
+
+ ``OPTIONS``
+ Optional list of flags passed to ``lupdate``, such as ``-extensions``, to
+ specify file extensions for directory scanning.
+
+.. command:: qt4_add_translation
+
+ Creates build rules for generating QM files from the given TS files:
+
+ .. code-block:: cmake
+
+ qt4_add_translation(<qm-files-var> <ts-files>...)
+
+ This macro creates build rules for generating QM files from the given TS files
+ and stores a list of generated filenames of QM files in the ``<qm-files-var>``
+ variable. The ``<ts-files>`` must exist and are not updated in any way.
+
+.. command:: qt4_automoc
+
+ .. deprecated:: 2.8.11
+
+ Use feature provided by the :variable:`CMAKE_AUTOMOC` variable instead.
+
+ Runs ``moc`` on input files:
+
+ .. code-block:: cmake
+
+ qt4_automoc(<source-files>... [TARGET <target>])
+
+ This macro can be used to have ``moc`` automatically handled. For example, if
+ there are ``foo.h`` and ``foo.cpp`` files, and in ``foo.h`` a class uses the
+ ``Q_OBJECT`` preprocessor macro, ``moc`` has to run on it. If using
+ ``qt4_wrap_cpp()`` isn't wanted (however, it is reliable and mature), the
+ ``#include "foo.moc"`` can be inserted in ``foo.cpp`` and then ``foo.cpp``
+ given as argument to ``qt4_automoc()``. This will scan all listed files
+ ``<source-files>`` at configuration phase for such included moc files and if
+ it finds them, a rule is generated to run moc at build time on the
+ accompanying header file ``foo.h``. If a source file has the
+ :prop_sf:`SKIP_AUTOMOC` property set, file will be ignored by this macro.
+
+ ``TARGET``
+ If specified, the ``INTERFACE_INCLUDE_DIRECTORIES`` and
+ ``INTERFACE_COMPILE_DEFINITIONS`` target properties from the ``<target>``
+ are passed to ``moc``.
+
+.. command:: qt4_use_modules
+
+ .. deprecated:: 2.8.11
+
+ Use :command:`target_link_libraries` with :ref:`Imported Targets` instead.
+
+ Provides Qt modules to a project for linking them to a target:
+
+ .. code-block:: cmake
+
+ qt4_use_modules(<target> [<LINK_PUBLIC|LINK_PRIVATE>] <modules>...)
+
+ This function makes ``<target>`` use the ``<modules>`` from Qt. Using a Qt
+ module means to link to the library, add the relevant include directories for
+ the module, and add the relevant compiler defines for using the module.
+ Modules are roughly equivalent to Qt4 components.
+
+ ``LINK_PUBLIC`` or ``LINK_PRIVATE``
+ Optional linking mode, used as the corresponding argument in the
+ ``target_link_libraries()`` call.
+
+ For example, calling ``qt4_use_modules(myexe Core Gui Declarative)`` will use
+ the ``QtCore``, ``QtGui`` and ``QtDeclarative`` components on the project
+ target ``myexe``.
+
+Examples
+^^^^^^^^
+
+Typical usage to find Qt4, could be something like:
+
+.. code-block:: cmake
+
+ set(CMAKE_AUTOMOC ON)
+ set(CMAKE_INCLUDE_CURRENT_DIR ON)
+ find_package(Qt4 4.4.3 REQUIRED QtGui QtXml)
+ add_executable(myexe main.cpp)
+ target_link_libraries(myexe PRIVATE Qt4::QtGui Qt4::QtXml)
#]=======================================================================]
# Use find_package( Qt4 COMPONENTS ... ) to enable modules
@@ -333,10 +478,12 @@
include(${CMAKE_CURRENT_LIST_DIR}/CheckCXXSymbolExists.cmake)
-include(${CMAKE_CURRENT_LIST_DIR}/MacroAddFileDependencies.cmake)
include(FindPackageHandleStandardArgs)
include(${CMAKE_CURRENT_LIST_DIR}/CMakePushCheckState.cmake)
+# Included for backward compatibility, otherwise unused.
+include(${CMAKE_CURRENT_LIST_DIR}/MacroAddFileDependencies.cmake)
+
set(QT_USE_FILE ${CMAKE_ROOT}/Modules/UseQt4.cmake)
set( QT_DEFINITIONS "")
diff --git a/Modules/FindRTI.cmake b/Modules/FindRTI.cmake
index 0431f09..6a1a024 100644
--- a/Modules/FindRTI.cmake
+++ b/Modules/FindRTI.cmake
@@ -5,33 +5,43 @@
FindRTI
-------
-Try to find M&S HLA RTI libraries
+Finds HLA RTI standard libraries and their include directories.
-This module finds if any HLA RTI is installed and locates the standard
-RTI include files and libraries.
+`RTI <https://en.wikipedia.org/wiki/Run-time_infrastructure_(simulation)>`_
+(Run-Time Infrastructure) is a simulation infrastructure standardized by IEEE
+and SISO, required when implementing HLA (High Level Architecture). It provides
+a well-defined C++ API, ensuring that M&S (Modeling and Simulation) applications
+remain independent of a particular RTI implementation.
-RTI is a simulation infrastructure standardized by IEEE and SISO. It
-has a well defined C++ API that assures that simulation applications
-are independent on a particular RTI implementation.
+Result Variables
+^^^^^^^^^^^^^^^^
-::
+This module defines the following variables:
- http://en.wikipedia.org/wiki/Run-Time_Infrastructure_(simulation)
+``RTI_FOUND``
+ Set to FALSE if any HLA RTI was not found.
+``RTI_LIBRARIES``
+ The libraries to link against to use RTI.
+``RTI_DEFINITIONS``
+ Compile definitions for using RTI. Default value is set to
+ ``-DRTI_USES_STD_FSTREAM``.
+Cache Variables
+^^^^^^^^^^^^^^^
+The following cache variables may also be set:
-This code sets the following variables:
+``RTI_INCLUDE_DIR``
+ Directory where RTI include files are found.
-::
+Examples
+^^^^^^^^
- RTI_INCLUDE_DIR = the directory where RTI includes file are found
- RTI_LIBRARIES = The libraries to link against to use RTI
- RTI_DEFINITIONS = -DRTI_USES_STD_FSTREAM
- RTI_FOUND = Set to FALSE if any HLA RTI was not found
+Finding RTI:
+.. code-block:: cmake
-
-Report problems to <certi-devel@nongnu.org>
+ find_package(RTI)
#]=======================================================================]
macro(RTI_MESSAGE_QUIETLY QUIET TYPE MSG)
@@ -43,8 +53,12 @@
set(RTI_DEFINITIONS "-DRTI_USES_STD_FSTREAM")
# noqa: spellcheck off
-# Detect the CERTI installation, http://www.cert.fr/CERTI
-# Detect the MAK Technologies RTI installation, http://www.mak.com/products/rti.php
+# Detect the CERTI installation:
+# - https://www.nongnu.org/certi/
+# - Mailing list for reporting issues and development discussions:
+# <certi-devel@nongnu.org>
+# Detect the MAK Technologies RTI installation:
+# - https://www.mak.com/mak-one/tools/mak-rti
# note: the following list is ordered to find the most recent version first
set(RTI_POSSIBLE_DIRS
ENV CERTI_HOME
@@ -100,5 +114,3 @@
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(RTI DEFAULT_MSG
RTI_LIBRARY RTI_INCLUDE_DIR)
-
-# $Id$
diff --git a/Modules/FindSQLite3.cmake b/Modules/FindSQLite3.cmake
index fcacbef..60eb541 100644
--- a/Modules/FindSQLite3.cmake
+++ b/Modules/FindSQLite3.cmake
@@ -66,7 +66,7 @@
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(SQLite3
- REQUIRED_VARS SQLite3_INCLUDE_DIR SQLite3_LIBRARY
+ REQUIRED_VARS SQLite3_LIBRARY SQLite3_INCLUDE_DIR
VERSION_VAR SQLite3_VERSION)
# Create the imported target
diff --git a/Modules/FindSubversion.cmake b/Modules/FindSubversion.cmake
index 294f415..32d28ce 100644
--- a/Modules/FindSubversion.cmake
+++ b/Modules/FindSubversion.cmake
@@ -5,67 +5,111 @@
FindSubversion
--------------
-Extract information from a subversion working copy
+This module finds a Subversion command-line client executable (``svn``) and
+provides macros for extracting information from a Subversion working copy.
-The module defines the following variables:
+Result Variables
+^^^^^^^^^^^^^^^^
-::
+This module defines the following variables:
- Subversion_SVN_EXECUTABLE - path to svn command line client
- Subversion_VERSION_SVN - version of svn command line client
- Subversion_FOUND - true if the command line client was found
- SUBVERSION_FOUND - same as Subversion_FOUND, set for compatibility reasons
+``Subversion_FOUND``
+ True if the Subversion command-line client was found. For backward
+ compatibility, the ``SUBVERSION_FOUND`` variable is also set to the same
+ value.
+``Subversion_VERSION_SVN``
+ Version of the ``svn`` command-line client.
+Cache Variables
+^^^^^^^^^^^^^^^
-The minimum required version of Subversion can be specified using the
-standard syntax, e.g. ``find_package(Subversion 1.4)``.
+The following cache variables may also be set:
-If the command line client executable is found two macros are defined:
+``Subversion_SVN_EXECUTABLE``
+ Path to the ``svn`` command-line client.
-.. code-block:: cmake
+Macros
+^^^^^^
- Subversion_WC_INFO(<dir> <var-prefix> [IGNORE_SVN_FAILURE])
- Subversion_WC_LOG(<dir> <var-prefix>)
+If the Subversion command-line client is found, the following macros are
+defined:
-``Subversion_WC_INFO`` extracts information of a subversion working copy at a
-given location. This macro defines the following variables if running
-Subversion's ``info`` command on ``<dir>`` succeeds; otherwise a
-``SEND_ERROR`` message is generated.
+.. command:: Subversion_WC_INFO
-.. versionadded:: 3.13
- The error can be ignored by providing the
- ``IGNORE_SVN_FAILURE`` option, which causes these variables to remain
- undefined.
+ Extracts information from a Subversion working copy located at a specified
+ directory:
-::
+ .. code-block:: cmake
- <var-prefix>_WC_URL - url of the repository (at <dir>)
- <var-prefix>_WC_ROOT - root url of the repository
- <var-prefix>_WC_REVISION - current revision
- <var-prefix>_WC_LAST_CHANGED_AUTHOR - author of last commit
- <var-prefix>_WC_LAST_CHANGED_DATE - date of last commit
- <var-prefix>_WC_LAST_CHANGED_REV - revision of last commit
- <var-prefix>_WC_INFO - output of command `svn info <dir>'
+ Subversion_WC_INFO(<dir> <var-prefix> [IGNORE_SVN_FAILURE])
-``Subversion_WC_LOG`` retrieves the log message of the base revision of a
-subversion working copy at a given location. This macro defines the variable:
+ This macro defines the following variables if running Subversion's ``info``
+ subcommand on ``<dir>`` succeeds; otherwise a ``SEND_ERROR`` message is
+ generated:
-::
+ ``<var-prefix>_WC_URL``
+ URL of the repository (at ``<dir>``).
+ ``<var-prefix>_WC_ROOT``
+ Root URL of the repository.
+ ``<var-prefix>_WC_REVISION``
+ Current revision.
+ ``<var-prefix>_WC_LAST_CHANGED_AUTHOR``
+ Author of last commit.
+ ``<var-prefix>_WC_LAST_CHANGED_DATE``
+ Date of last commit.
+ ``<var-prefix>_WC_LAST_CHANGED_REV``
+ Revision of last commit.
+ ``<var-prefix>_WC_INFO``
+ Output of the command ``svn info <dir>``
- <var-prefix>_LAST_CHANGED_LOG - last log of base revision
+ The options are:
+
+ ``IGNORE_SVN_FAILURE``
+ .. versionadded:: 3.13
+
+ When specified, errors from Subversion operation will not trigger a
+ ``SEND_ERROR`` message. In case of an error, the ``<var-prefix>_*``
+ variables remain undefined.
+
+.. command:: Subversion_WC_LOG
+
+ Retrieves the log message of the base revision of a Subversion working copy at
+ a given location:
+
+ .. code-block:: cmake
+
+ Subversion_WC_LOG(<dir> <var-prefix>)
+
+ This macro defines the following variable if running Subversion's ``log``
+ subcommand on ``<dir>`` succeeds; otherwise a ``SEND_ERROR`` message is
+ generated:
+
+ ``<var-prefix>_LAST_CHANGED_LOG``
+ Last log of the base revision of a Subversion working copy located at
+ ``<dir>``.
+
+Examples
+^^^^^^^^
Example usage:
.. code-block:: cmake
find_package(Subversion)
- if(SUBVERSION_FOUND)
+ if(Subversion_FOUND)
Subversion_WC_INFO(${PROJECT_SOURCE_DIR} Project)
message("Current revision is ${Project_WC_REVISION}")
Subversion_WC_LOG(${PROJECT_SOURCE_DIR} Project)
message("Last changed log is ${Project_LAST_CHANGED_LOG}")
endif()
+
+The minimum required version of Subversion can be specified using the standard
+syntax:
+
+.. code-block:: cmake
+
+ find_package(Subversion 1.4)
#]=======================================================================]
find_program(Subversion_SVN_EXECUTABLE svn
diff --git a/Modules/FindVulkan.cmake b/Modules/FindVulkan.cmake
index fab9806..c047b01 100644
--- a/Modules/FindVulkan.cmake
+++ b/Modules/FindVulkan.cmake
@@ -458,23 +458,35 @@
endif()
if(volk IN_LIST Vulkan_FIND_COMPONENTS)
find_library(Vulkan_volk_LIBRARY
- NAMES volk
- HINTS
- ${_Vulkan_hint_library_search_paths})
- mark_as_advanced(Vulkan_Volk_LIBRARY)
+ NAMES volk
+ HINTS
+ ${_Vulkan_hint_library_search_paths})
+ mark_as_advanced(Vulkan_volk_LIBRARY)
+
+ find_library(Vulkan_volk_DEBUG_LIBRARY
+ NAMES volkd
+ HINTS
+ ${_Vulkan_hint_library_search_paths})
+ mark_as_advanced(Vulkan_volk_DEBUG_LIBRARY)
endif()
if (dxc IN_LIST Vulkan_FIND_COMPONENTS)
find_library(Vulkan_dxc_LIBRARY
- NAMES dxcompiler
- HINTS
- ${_Vulkan_hint_library_search_paths})
+ NAMES dxcompiler
+ HINTS
+ ${_Vulkan_hint_library_search_paths})
mark_as_advanced(Vulkan_dxc_LIBRARY)
+ find_library(Vulkan_dxc_DEBUG_LIBRARY
+ NAMES dxcompilerd
+ HINTS
+ ${_Vulkan_hint_library_search_paths})
+ mark_as_advanced(Vulkan_dxc_DEBUG_LIBRARY)
+
find_program(Vulkan_dxc_EXECUTABLE
- NAMES dxc
- HINTS
- ${_Vulkan_hint_executable_search_paths})
+ NAMES dxc
+ HINTS
+ ${_Vulkan_hint_executable_search_paths})
mark_as_advanced(Vulkan_dxc_EXECUTABLE)
endif()
@@ -828,36 +840,57 @@
endif()
endif()
- if(Vulkan_volk_LIBRARY AND NOT TARGET Vulkan::volk)
+ if((Vulkan_volk_LIBRARY OR Vulkan_volk_DEBUG_LIBRARY) AND NOT TARGET Vulkan::volk)
add_library(Vulkan::volk STATIC IMPORTED)
set_property(TARGET Vulkan::volk
PROPERTY
INTERFACE_INCLUDE_DIRECTORIES "${Vulkan_INCLUDE_DIRS}")
- set_property(TARGET Vulkan::volk APPEND
- PROPERTY
- IMPORTED_CONFIGURATIONS Release)
- set_property(TARGET Vulkan::volk APPEND
- PROPERTY
- IMPORTED_LOCATION_RELEASE "${Vulkan_volk_LIBRARY}")
+ if(Vulkan_volk_LIBRARY)
+ set_property(TARGET Vulkan::volk APPEND
+ PROPERTY
+ IMPORTED_CONFIGURATIONS Release)
+ set_property(TARGET Vulkan::volk
+ PROPERTY
+ IMPORTED_LOCATION_RELEASE "${Vulkan_volk_LIBRARY}")
+ endif()
+ if(Vulkan_volk_DEBUG_LIBRARY)
+ set_property(TARGET Vulkan::volk APPEND
+ PROPERTY
+ IMPORTED_CONFIGURATIONS Debug)
+ set_property(TARGET Vulkan::volk
+ PROPERTY
+ IMPORTED_LOCATION_DEBUG "${Vulkan_volk_DEBUG_LIBRARY}")
+ endif()
if (NOT WIN32)
set_property(TARGET Vulkan::volk APPEND
- PROPERTY
- IMPORTED_LINK_INTERFACE_LIBRARIES dl)
+ PROPERTY
+ IMPORTED_LINK_INTERFACE_LIBRARIES dl)
endif()
endif()
- if (Vulkan_dxc_LIBRARY AND NOT TARGET Vulkan::dxc_lib)
+ if ((Vulkan_dxc_LIBRARY OR Vulkan_dxc_DEBUG_LIBRARY) AND NOT TARGET Vulkan::dxc_lib)
add_library(Vulkan::dxc_lib STATIC IMPORTED)
set_property(TARGET Vulkan::dxc_lib
PROPERTY
INTERFACE_INCLUDE_DIRECTORIES "${Vulkan_INCLUDE_DIRS}")
- set_property(TARGET Vulkan::dxc_lib APPEND
- PROPERTY
- IMPORTED_CONFIGURATIONS Release)
- set_property(TARGET Vulkan::dxc_lib APPEND
- PROPERTY
- IMPORTED_LOCATION_RELEASE "${Vulkan_dxc_LIBRARY}")
+ if(Vulkan_dxc_LIBRARY)
+ set_property(TARGET Vulkan::dxc_lib APPEND
+ PROPERTY
+ IMPORTED_CONFIGURATIONS Release)
+ set_property(TARGET Vulkan::dxc_lib
+ PROPERTY
+ IMPORTED_LOCATION_RELEASE "${Vulkan_dxc_LIBRARY}")
+ endif()
+ if(Vulkan_dxc_DEBUG_LIBRARY)
+ set_property(TARGET Vulkan::dxc_lib APPEND
+ PROPERTY
+ IMPORTED_CONFIGURATIONS Debug)
+ set_property(TARGET Vulkan::dxc_lib
+ PROPERTY
+ IMPORTED_LOCATION_DEBUG "${Vulkan_dxc_DEBUG_LIBRARY}")
+ endif()
+
endif()
if(Vulkan_dxc_EXECUTABLE AND NOT TARGET Vulkan::dxc_exe)
diff --git a/Modules/FindWget.cmake b/Modules/FindWget.cmake
index 9e3226a..ef63d1e 100644
--- a/Modules/FindWget.cmake
+++ b/Modules/FindWget.cmake
@@ -5,14 +5,42 @@
FindWget
--------
-Find wget
+This module finds the ``wget`` command-line tool for retrieving content from web
+servers.
-This module looks for wget. This module defines the following values:
+Result Variables
+^^^^^^^^^^^^^^^^
-::
+This module defines the following local variables:
- WGET_EXECUTABLE: the full path to the wget tool.
- WGET_FOUND: True if wget has been found.
+``Wget_FOUND``
+ True if ``wget`` has been found.
+
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``WGET_EXECUTABLE``
+ The full path to the ``wget`` tool.
+
+Examples
+^^^^^^^^
+
+Finding ``wget`` and executing it in a process:
+
+.. code-block:: cmake
+
+ find_package(Wget)
+ if(Wget_FOUND)
+ execute_process(COMMAND ${WGET_EXECUTABLE} -h)
+ endif()
+
+See Also
+^^^^^^^^
+
+* The :command:`file(DOWNLOAD)` command to download the given URL to a local
+ file.
#]=======================================================================]
include(${CMAKE_CURRENT_LIST_DIR}/FindCygwin.cmake)
diff --git a/Modules/FindWish.cmake b/Modules/FindWish.cmake
index 9e39d36..00b1201 100644
--- a/Modules/FindWish.cmake
+++ b/Modules/FindWish.cmake
@@ -5,19 +5,32 @@
FindWish
--------
-Find wish installation
+Finds ``wish``, a simple windowing shell command-line executable.
-This module finds if TCL is installed and determines where the include
-files and libraries are. It also determines what the name of the
-library is. This code sets the following variables:
+This module is commonly used in conjunction with finding a TCL installation (see
+the :module:`FindTCL` module). It helps determine where the TCL include paths
+and libraries are, as well as identifying the name of the TCL library.
-::
+If the :variable:`UNIX` variable is defined, the module will prioritize looking
+for the Cygwin version of ``wish`` executable.
- TK_WISH = the path to the wish executable
+Cache Variables
+^^^^^^^^^^^^^^^
+The following cache variables may be set:
+``TK_WISH``
+ The path to the ``wish`` executable.
-if UNIX is defined, then it will look for the cygwin version first
+Examples
+^^^^^^^^
+
+Finding ``wish``:
+
+.. code-block:: cmake
+
+ find_package(Wish)
+ message(STATUS "Found wish at: ${TK_WISH}")
#]=======================================================================]
if(UNIX)
diff --git a/Modules/FindwxWidgets.cmake b/Modules/FindwxWidgets.cmake
index 86f34ee..fa2ad7b 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)
@@ -1057,8 +1061,8 @@
#
# NOTE: This is a generic piece of code that should be renamed to
# SPLIT_ARGUMENTS_ON and put in a file serving the same purpose as
-# FindPackageStandardArgs.cmake. At the time of this writing
-# FindQt4.cmake has a QT4_EXTRACT_OPTIONS, which I basically copied
+# FindPackageHandleStandardArgs.cmake. At the time of this writing
+# FindQt4.cmake has a qt4_extract_options(), which I basically copied
# here a bit more generalized. So, there are already two find modules
# using this approach.
#
diff --git a/Modules/FortranCInterface.cmake b/Modules/FortranCInterface.cmake
index 685f310..70ad3c7 100644
--- a/Modules/FortranCInterface.cmake
+++ b/Modules/FortranCInterface.cmake
@@ -59,6 +59,19 @@
The case for a module symbol without an underscore,
either ``UPPER`` or ``LOWER``.
+``FortranCInterface_MODULE_ORDER``
+ .. versionadded:: 4.1
+
+ Order of components for module symbols without an underscore:
+
+ ``MODULE_THEN_SYMBOL``
+ The module name appears *before* the symbol name, i.e.,
+ ``<PREFIX><module><MIDDLE><symbol><SUFFIX>``.
+
+ ``SYMBOL_THEN_MODULE``
+ The module name appears *after* the symbol name, i.e.,
+ ``<PREFIX><symbol><MIDDLE><module><SUFFIX>``.
+
``FortranCInterface_MODULE__PREFIX``
Prefix for a module symbol with an underscore.
@@ -73,6 +86,19 @@
The case for a module symbol with an underscore,
either ``UPPER`` or ``LOWER``.
+``FortranCInterface_MODULE__ORDER``
+ .. versionadded:: 4.1
+
+ Order of components for module symbols with an underscore:
+
+ ``MODULE_THEN_SYMBOL``
+ The module name appears *before* the symbol name, i.e.,
+ ``<PREFIX><module><MIDDLE><symbol><SUFFIX>``.
+
+ ``SYMBOL_THEN_MODULE``
+ The module name appears *after* the symbol name, i.e.,
+ ``<PREFIX><symbol><MIDDLE><module><SUFFIX>``.
+
Module Functions
^^^^^^^^^^^^^^^^
diff --git a/Modules/FortranCInterface/CMakeLists.txt b/Modules/FortranCInterface/CMakeLists.txt
index c0a9256..3db6577 100644
--- a/Modules/FortranCInterface/CMakeLists.txt
+++ b/Modules/FortranCInterface/CMakeLists.txt
@@ -39,6 +39,8 @@
my_module_my_sub_ # PGI
my_module_MP_my_sub # NAG
mymodule$mysub # HP
+ mysub$mymodule_ # Cray
+ my_sub$my_module_ # Cray
mymodule_mp_mysub_ # Intel
MYMODULE_mp_MYSUB # Intel on Windows
mymodule_mysub_ # PGI
@@ -64,14 +66,13 @@
# Generate C symbol sources.
set(symbol_sources)
-if(NOT CMAKE_Fortran_COMPILER_ID MATCHES "^(PathScale|Cray)$")
+if(NOT CMAKE_Fortran_COMPILER_ID MATCHES "^(PathScale)$")
# Provide mymodule_ and my_module_ init symbols because:
# - PGI Fortran uses module init symbols
+ # - Cray Fortran >= 7.3.2 uses module init symbols
# but not for:
# - PathScale Fortran uses module init symbols but module symbols
# use '.in.' so we cannot provide them anyway.
- # - Cray Fortran >= 7.3.2 uses module init symbols but module symbols
- # use 'mysub$mymodule_' so we cannot provide them anyway.
list(APPEND symbol_sources mymodule_.c my_module_.c MY_MODULE.c MYMODULE.c)
endif()
foreach(symbol IN LISTS global_symbols module_symbols)
diff --git a/Modules/FortranCInterface/Detect.cmake b/Modules/FortranCInterface/Detect.cmake
index 177fdf8..a4ee521 100644
--- a/Modules/FortranCInterface/Detect.cmake
+++ b/Modules/FortranCInterface/Detect.cmake
@@ -92,6 +92,8 @@
set(_global__regex "^(_*)(my_sub|MY_SUB)([_$]*)$")
set(_module_regex "^([A-Za-z_$]*)(mymodule|MYMODULE)([A-Za-z_$]*)(mysub|MYSUB)([_$]*)$")
set(_module__regex "^([A-Za-z_$]*)(my_module|MY_MODULE)([A-Za-z_$]*)(my_sub|MY_SUB)([_$]*)$")
+set(_module_reverse_regex "^([A-Za-z_$]*)(mysub|MYSUB)([A-Za-z_$]*)(mymodule|MYMODULE)([_$]*)$")
+set(_module_reverse__regex "^([A-Za-z_$]*)(my_sub|MY_SUB)([A-Za-z_$]*)(my_module|MY_MODULE)([_$]*)$")
# Parse the symbol names.
foreach(symbol ${FortranCInterface_SYMBOLS})
@@ -120,7 +122,24 @@
list(GET pieces 3 name)
list(GET pieces 4 FortranCInterface_MODULE_${form}SUFFIX)
set(FortranCInterface_MODULE_${form}CASE "${_case_${name}}")
+ set(FortranCInterface_MODULE_${form}ORDER "MODULE_THEN_SYMBOL")
endif()
+
+ # Look for module symbols with subroutine name first.
+ string(REGEX REPLACE "${_module_reverse_${form}regex}"
+ "\\1;\\2;\\3;\\4;\\5" pieces "${symbol}")
+ list(LENGTH pieces len)
+ if(len EQUAL 5)
+ set(FortranCInterface_MODULE_${form}SYMBOL "${symbol}")
+ list(GET pieces 0 FortranCInterface_MODULE_${form}PREFIX)
+ list(GET pieces 1 name)
+ list(GET pieces 2 FortranCInterface_MODULE_${form}MIDDLE)
+ list(GET pieces 3 module)
+ list(GET pieces 4 FortranCInterface_MODULE_${form}SUFFIX)
+ set(FortranCInterface_MODULE_${form}CASE "${_case_${name}}")
+ set(FortranCInterface_MODULE_${form}ORDER "SYMBOL_THEN_MODULE")
+ endif()
+
endforeach()
endforeach()
@@ -156,8 +175,13 @@
endif()
set(_name "${_name_${FortranCInterface_MODULE_${form}CASE}}")
set(_middle "##${FortranCInterface_MODULE_${form}MIDDLE}##")
- set(FortranCInterface_MODULE${form}_MACRO
- "(mod_name,name, mod_NAME,NAME) ${_prefix}mod_${_name}${_middle}${_name}${_suffix}")
+ if(FortranCInterface_MODULE_${form}ORDER STREQUAL "SYMBOL_THEN_MODULE")
+ set(FortranCInterface_MODULE${form}_MACRO
+ "(mod_name,name, mod_NAME,NAME) ${_prefix}${_name}${_middle}mod_${_name}${_suffix}")
+ else()
+ set(FortranCInterface_MODULE${form}_MACRO
+ "(mod_name,name, mod_NAME,NAME) ${_prefix}mod_${_name}${_middle}${_name}${_suffix}")
+ endif()
endif()
endforeach()
diff --git a/Modules/FortranCInterface/Output.cmake.in b/Modules/FortranCInterface/Output.cmake.in
index bce410e..8d79e8c 100644
--- a/Modules/FortranCInterface/Output.cmake.in
+++ b/Modules/FortranCInterface/Output.cmake.in
@@ -18,6 +18,7 @@
set(FortranCInterface_MODULE_MIDDLE "@FortranCInterface_MODULE_MIDDLE@")
set(FortranCInterface_MODULE_SUFFIX "@FortranCInterface_MODULE_SUFFIX@")
set(FortranCInterface_MODULE_CASE "@FortranCInterface_MODULE_CASE@")
+set(FortranCInterface_MODULE_ORDER "@FortranCInterface_MODULE_ORDER@")
set(FortranCInterface_MODULE_MACRO "@FortranCInterface_MODULE_MACRO@")
# Module symbol with underscore.
@@ -26,6 +27,7 @@
set(FortranCInterface_MODULE__MIDDLE "@FortranCInterface_MODULE__MIDDLE@")
set(FortranCInterface_MODULE__SUFFIX "@FortranCInterface_MODULE__SUFFIX@")
set(FortranCInterface_MODULE__CASE "@FortranCInterface_MODULE__CASE@")
+set(FortranCInterface_MODULE__ORDER "@FortranCInterface_MODULE__ORDER@")
set(FortranCInterface_MODULE__MACRO "@FortranCInterface_MODULE__MACRO@")
# Summarize what was found.
diff --git a/Modules/FortranCInterface/call_mod.f90 b/Modules/FortranCInterface/call_mod.f90
index 9b6af64..087dfd8 100644
--- a/Modules/FortranCInterface/call_mod.f90
+++ b/Modules/FortranCInterface/call_mod.f90
@@ -1,4 +1,5 @@
subroutine call_mod
+ !DIR$ NOINLINE
use mymodule
use my_module
call mysub()
diff --git a/Modules/FortranCInterface/call_sub.f b/Modules/FortranCInterface/call_sub.f
index ce3d50b..830396a 100644
--- a/Modules/FortranCInterface/call_sub.f
+++ b/Modules/FortranCInterface/call_sub.f
@@ -1,4 +1,5 @@
subroutine call_sub
+ !DIR$ NOINLINE
call mysub()
call my_sub()
end
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/GetPrerequisites.cmake b/Modules/GetPrerequisites.cmake
index 4f9d3e7..f1f5db7 100644
--- a/Modules/GetPrerequisites.cmake
+++ b/Modules/GetPrerequisites.cmake
@@ -9,170 +9,239 @@
Use :command:`file(GET_RUNTIME_DEPENDENCIES)` instead.
-Functions to analyze and list executable file prerequisites.
+This module provides functions to analyze and list the dependencies
+(prerequisites) of executable or shared library files. These functions list the
+shared libraries (``.dll``, ``.dylib``, or ``.so`` files) required by an
+executable or shared library.
-This module provides functions to list the .dll, .dylib or .so files
-that an executable or shared library file depends on. (Its
-prerequisites.)
+It determines dependencies using the following platform-specific tools:
-It uses various tools to obtain the list of required shared library
-files:
-
-::
-
- dumpbin (Windows)
- objdump (MinGW on Windows)
- ldd (Linux/Unix)
- otool (Mac OSX)
+* ``dumpbin`` (Windows)
+* ``objdump`` (MinGW on Windows)
+* ``ldd`` (Linux/Unix)
+* ``otool`` (Apple operating systems)
.. versionchanged:: 3.16
- The tool specified by the :variable:`CMAKE_OBJDUMP` variable
- will be used, if set.
+ The tool specified by the :variable:`CMAKE_OBJDUMP` variable will be used, if
+ set.
The following functions are provided by this module:
-::
+* :command:`get_prerequisites`
+* :command:`list_prerequisites`
+* :command:`list_prerequisites_by_glob`
+* :command:`gp_append_unique`
+* :command:`is_file_executable`
+* :command:`gp_item_default_embedded_path`
+ (projects can override it with ``gp_item_default_embedded_path_override()``)
+* :command:`gp_resolve_item`
+ (projects can override it with ``gp_resolve_item_override()``)
+* :command:`gp_resolved_file_type`
+ (projects can override it with ``gp_resolved_file_type_override()``)
+* :command:`gp_file_type`
- get_prerequisites
- list_prerequisites
- list_prerequisites_by_glob
- gp_append_unique
- is_file_executable
- gp_item_default_embedded_path
- (projects can override with gp_item_default_embedded_path_override)
- gp_resolve_item
- (projects can override with gp_resolve_item_override)
- gp_resolved_file_type
- (projects can override with gp_resolved_file_type_override)
- gp_file_type
+Functions
+^^^^^^^^^
+
+.. command:: get_prerequisites
+
+ .. code-block:: cmake
+
+ get_prerequisites(<target> <prerequisites-var> <exclude-system> <recurse>
+ <exepath> <dirs> [<rpaths>])
+
+ Gets the list of shared library files required by ``<target>``. The list
+ in the variable named ``<prerequisites-var>`` should be empty on first
+ entry to this function. On exit, ``<prerequisites-var>`` will contain the
+ list of required shared library files.
+
+ The arguments are:
+
+ ``<target>``
+ The full path to an executable or shared library file.
+ ``<prerequisites-var>``
+ The name of a CMake variable to contain the results.
+ ``<exclude-system>``
+ If set to 1 system prerequisites will be excluded, if set to 0 they will be
+ included.
+ ``<recurse>``
+ If set to 1 all prerequisites will be found recursively, if set to 0 only
+ direct prerequisites are listed.
+ ``<exepath>``
+ The path to the top level executable used for ``@executable_path``
+ replacement on Apple operating systems.
+ ``<dirs>``
+ A list of paths where libraries might be found: these paths are searched
+ first when a target without any path info is given. Then standard system
+ locations are also searched: PATH, Framework locations, /usr/lib...
+ ``<rpaths>``
+ Optional run-time search paths for an executable file or library to help
+ find files.
+
+ .. versionadded:: 3.14
+ The variable ``GET_PREREQUISITES_VERBOSE`` can be set to true before calling
+ this function to enable verbose output.
+
+.. command:: list_prerequisites
+
+ .. code-block:: cmake
+
+ list_prerequisites(<target> [<recurse> [<exclude-system> [<verbose>]]])
+
+ Prints a message listing the prerequisites of ``<target>``.
+
+ The arguments are:
+
+ ``<target>``
+ The name of a shared library or executable target or the full path to a
+ shared library or executable file.
+ ``<recurse>``
+ If set to 1 all prerequisites will be found recursively, if set to 0 only
+ direct prerequisites are listed.
+ ``<exclude-system>``
+ If set to 1 system prerequisites will be excluded, if set to 0 they will be
+ included.
+ ``<verbose>``
+ If set to 0 only the full path names of the prerequisites are printed. If
+ set to 1 extra information will be displayed.
+
+.. command:: list_prerequisites_by_glob
+
+ .. code-block:: cmake
+
+ list_prerequisites_by_glob(<GLOB|GLOB_RECURSE>
+ <glob-exp>
+ [<optional-args>...])
+
+ Prints the prerequisites of shared library and executable files matching a
+ globbing pattern.
+
+ The arguments are:
+
+ ``GLOB`` or ``GLOB_RECURSE``
+ The globbing mode, whether to traverse only the match or also its
+ subdirectories recursively.
+ ``<glob-exp>``
+ A globbing expression used with :command:`file(GLOB)` or
+ :command:`file(GLOB_RECURSE)` to retrieve a list of matching files. If a
+ matching file is executable, its prerequisites are listed.
+ ``<optional-args>...``
+ Any additional (optional) arguments provided are passed along as the
+ optional arguments to the ``list_prerequisite()`` calls.
+
+.. command:: gp_append_unique
+
+ .. code-block:: cmake
+
+ gp_append_unique(<list-var> <value>)
+
+ Appends ``<value>`` to the list variable ``<list-var>`` only if the value is
+ not already in the list.
+
+.. command:: is_file_executable
+
+ .. code-block:: cmake
+
+ is_file_executable(<file> <result-var>)
+
+ Sets ``<result-var>`` to 1 if ``<file>`` is a binary executable; otherwise
+ sets it to 0.
+
+.. command:: gp_item_default_embedded_path
+
+ .. code-block:: cmake
+
+ gp_item_default_embedded_path(<item> <default-embedded-path-var>)
+
+ Determines the reference path for ``<item>`` when it is embedded inside a
+ bundle and stores it to a variable ``<default-embedded-path-var>``.
+
+ Projects can override this function by defining a custom
+ ``gp_item_default_embedded_path_override()`` function.
+
+.. command:: gp_resolve_item
+
+ .. code-block:: cmake
+
+ gp_resolve_item(<context> <item> <exepath> <dirs> <resolved-item-var>
+ [<rpaths>])
+
+ Resolves a given ``<item>`` into an existing full path file and stores it to a
+ ``<resolved-item-var>`` variable.
+
+ The arguments are:
+
+ ``<context>``
+ The path to the top level loading path used for ``@loader_path`` replacement
+ on Apple operating systems. When resolving item, ``@loader_path``
+ references will be resolved relative to the directory of the given context
+ value (presumably another library).
+ ``<item>``
+ The item to resolve.
+ ``<exepath>``
+ See the argument description in :command:`get_prerequisites`.
+ ``<dirs>``
+ See the argument description in :command:`get_prerequisites`.
+ ``<resolved-item-var>``
+ The result variable where the resolved item is stored into.
+ ``<rpaths>``
+ See the argument description in :command:`get_prerequisites`.
+
+ Projects can override this function by defining a custom
+ ``gp_resolve_item_override()`` function.
+
+.. command:: gp_resolved_file_type
+
+ .. code-block:: cmake
+
+ gp_resolved_file_type(<original-file> <file> <exepath> <dirs> <type-var>
+ [<rpaths>])
+
+ Determines the type of ``<file>`` with respect to ``<original-file>``. The
+ resulting type of prerequisite is stored in the ``<type-var>`` variable.
+
+ Use ``<exepath>`` and ``<dirs>`` if necessary to resolve non-absolute
+ ``<file>`` values -- but only for non-embedded items.
+
+ ``<rpaths>``
+ See the argument description in :command:`get_prerequisites`.
+
+ The ``<type-var>`` variable will be set to one of the following values:
+
+ * ``system``
+ * ``local``
+ * ``embedded``
+ * ``other``
+
+ Projects can override this function by defining a custom
+ ``gp_resolved_file_type_override()`` function.
+
+.. command:: gp_file_type
+
+ .. code-block:: cmake
+
+ gp_file_type(<original-file> <file> <type-var>)
+
+ Determines the type of ``<file>`` with respect to ``<original-file>``. The
+ resulting type of prerequisite is stored in the ``<type-var>`` variable.
+
+ The ``<type-var>`` variable will be set to one of the following values:
+
+ * ``system``
+ * ``local``
+ * ``embedded``
+ * ``other``
+
+Examples
+^^^^^^^^
+
+Printing all dependencies of a shared library, including system libraries, with
+verbose output:
.. code-block:: cmake
- GET_PREREQUISITES(<target> <prerequisites_var> <exclude_system> <recurse>
- <exepath> <dirs> [<rpaths>])
-
-Get the list of shared library files required by <target>. The list
-in the variable named <prerequisites_var> should be empty on first
-entry to this function. On exit, <prerequisites_var> will contain the
-list of required shared library files.
-
-<target> is the full path to an executable file. <prerequisites_var>
-is the name of a CMake variable to contain the results.
-<exclude_system> must be 0 or 1 indicating whether to include or
-exclude "system" prerequisites. If <recurse> is set to 1 all
-prerequisites will be found recursively, if set to 0 only direct
-prerequisites are listed. <exepath> is the path to the top level
-executable used for @executable_path replacement on the Mac. <dirs> is
-a list of paths where libraries might be found: these paths are
-searched first when a target without any path info is given. Then
-standard system locations are also searched: PATH, Framework
-locations, /usr/lib...
-
-.. versionadded:: 3.14
- The variable GET_PREREQUISITES_VERBOSE can be set to true to enable verbose
- output.
-
-.. code-block:: cmake
-
- LIST_PREREQUISITES(<target> [<recurse> [<exclude_system> [<verbose>]]])
-
-Print a message listing the prerequisites of <target>.
-
-<target> is the name of a shared library or executable target or the
-full path to a shared library or executable file. If <recurse> is set
-to 1 all prerequisites will be found recursively, if set to 0 only
-direct prerequisites are listed. <exclude_system> must be 0 or 1
-indicating whether to include or exclude "system" prerequisites. With
-<verbose> set to 0 only the full path names of the prerequisites are
-printed, set to 1 extra information will be displayed.
-
-.. code-block:: cmake
-
- LIST_PREREQUISITES_BY_GLOB(<glob_arg> <glob_exp>)
-
-Print the prerequisites of shared library and executable files
-matching a globbing pattern. <glob_arg> is GLOB or GLOB_RECURSE and
-<glob_exp> is a globbing expression used with "file(GLOB" or
-"file(GLOB_RECURSE" to retrieve a list of matching files. If a
-matching file is executable, its prerequisites are listed.
-
-Any additional (optional) arguments provided are passed along as the
-optional arguments to the list_prerequisites calls.
-
-.. code-block:: cmake
-
- GP_APPEND_UNIQUE(<list_var> <value>)
-
-Append <value> to the list variable <list_var> only if the value is
-not already in the list.
-
-.. code-block:: cmake
-
- IS_FILE_EXECUTABLE(<file> <result_var>)
-
-Return 1 in <result_var> if <file> is a binary executable, 0
-otherwise.
-
-.. code-block:: cmake
-
- GP_ITEM_DEFAULT_EMBEDDED_PATH(<item> <default_embedded_path_var>)
-
-Return the path that others should refer to the item by when the item
-is embedded inside a bundle.
-
-Override on a per-project basis by providing a project-specific
-gp_item_default_embedded_path_override function.
-
-.. code-block:: cmake
-
- GP_RESOLVE_ITEM(<context> <item> <exepath> <dirs> <resolved_item_var>
- [<rpaths>])
-
-Resolve an item into an existing full path file.
-
-Override on a per-project basis by providing a project-specific
-gp_resolve_item_override function.
-
-.. code-block:: cmake
-
- GP_RESOLVED_FILE_TYPE(<original_file> <file> <exepath> <dirs> <type_var>
- [<rpaths>])
-
-Return the type of <file> with respect to <original_file>. String
-describing type of prerequisite is returned in variable named
-<type_var>.
-
-Use <exepath> and <dirs> if necessary to resolve non-absolute <file>
-values -- but only for non-embedded items.
-
-Possible types are:
-
-::
-
- system
- local
- embedded
- other
-
-Override on a per-project basis by providing a project-specific
-gp_resolved_file_type_override function.
-
-.. code-block:: cmake
-
- GP_FILE_TYPE(<original_file> <file> <type_var>)
-
-Return the type of <file> with respect to <original_file>. String
-describing type of prerequisite is returned in variable named
-<type_var>.
-
-Possible types are:
-
-::
-
- system
- local
- embedded
- other
+ include(GetPrerequisites)
+ list_prerequisites("path/to/libfoo.dylib" 1 0 1)
#]=======================================================================]
function(gp_append_unique list_var value)
@@ -512,7 +581,8 @@
string(TOLOWER "${resolved_file}" lower)
if(UNIX)
- if(resolved_file MATCHES "^/*(/lib/|/lib32/|/libx32/|/lib64/|/usr/lib/|/usr/lib32/|/usr/libx32/|/usr/lib64/|/usr/X11R6/|/usr/bin/)")
+ if(resolved_file MATCHES "^/*(/lib/|/lib32/|/libx32/|/lib64/|/usr/lib/|/usr/lib32/|/usr/libx32/|/usr/lib64/|/usr/X11R6/|/usr/bin/)" OR
+ resolved_file MATCHES "/cce/.*/lib/lib[^/]+\.so\\.[0-9][^/]*$")
set(is_system 1)
endif()
endif()
diff --git a/Modules/Internal/CMakeInspectASMLinker.cmake b/Modules/Internal/CMakeInspectASMLinker.cmake
index 3f25676..1ae7a40 100644
--- a/Modules/Internal/CMakeInspectASMLinker.cmake
+++ b/Modules/Internal/CMakeInspectASMLinker.cmake
@@ -4,6 +4,8 @@
# Re-configure to save learned information.
block()
foreach(_var IN ITEMS
+ # Compiler information.
+ # Keep in sync with CMakeDetermineASMCompiler.
COMPILER
COMPILER_ID
COMPILER_ARG1
@@ -11,6 +13,8 @@
COMPILER_AR
COMPILER_RANLIB
COMPILER_VERSION
+ COMPILER_ARCHITECTURE_ID
+ # Linker information.
COMPILER_LINKER
COMPILER_LINKER_ID
COMPILER_LINKER_VERSION
diff --git a/Modules/Internal/CMakeParseCompilerArchitectureId.cmake b/Modules/Internal/CMakeParseCompilerArchitectureId.cmake
new file mode 100644
index 0000000..9200158
--- /dev/null
+++ b/Modules/Internal/CMakeParseCompilerArchitectureId.cmake
@@ -0,0 +1,74 @@
+# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+# file LICENSE.rst or https://cmake.org/licensing for details.
+
+function(cmake_parse_compiler_architecture_id triple arch_id_var)
+ # Sync with:
+ # Help/variable/CMAKE_LANG_COMPILER_ARCHITECTURE_ID.rst
+ # Modules/CMakeCompilerABI.h
+ # Modules/CMakeFortranCompilerABI.F
+ # Modules/CMakeFortranCompilerABI.F90
+ if(_dumpmachine_triple MATCHES "^(aarch64|arm64)-apple-")
+ set(ARCHITECTURE_ID "arm64")
+ elseif(_dumpmachine_triple MATCHES "^(aarch64|arm64)_32-apple-")
+ set(ARCHITECTURE_ID "arm64_32")
+ elseif(_dumpmachine_triple MATCHES "^(aarch64|arm64)e-apple-")
+ set(ARCHITECTURE_ID "arm64e")
+ elseif(_dumpmachine_triple MATCHES "^(armv7k|armv7s)-apple-")
+ set(ARCHITECTURE_ID "${CMAKE_MATCH_1}")
+ elseif(_dumpmachine_triple MATCHES "^(aarch64|arm64)-")
+ set(ARCHITECTURE_ID "aarch64")
+ elseif(_dumpmachine_triple MATCHES "^(armv[5-7])[^-]*-")
+ set(ARCHITECTURE_ID "${CMAKE_MATCH_1}")
+ elseif(_dumpmachine_triple MATCHES "^alpha[^-]*-")
+ set(ARCHITECTURE_ID "alpha")
+ elseif(_dumpmachine_triple MATCHES "^(x86_64|amd64)-")
+ set(ARCHITECTURE_ID "x86_64")
+ elseif(_dumpmachine_triple MATCHES "^(i[3-6]86)-")
+ set(ARCHITECTURE_ID "${CMAKE_MATCH_1}")
+ elseif(_dumpmachine_triple MATCHES "^ia64-")
+ set(ARCHITECTURE_ID "ia64")
+ elseif(_dumpmachine_triple MATCHES "^loongarch64-")
+ set(ARCHITECTURE_ID "loongarch64")
+ elseif(_dumpmachine_triple MATCHES "^loongarch(32)?-")
+ set(ARCHITECTURE_ID "loongarch32")
+ elseif(_dumpmachine_triple MATCHES "^m68k-")
+ set(ARCHITECTURE_ID "m68k")
+ elseif(_dumpmachine_triple MATCHES "^mingw32$") # MinGW/MSYS 1.0: http://mingw.osdn.io/
+ set(ARCHITECTURE_ID "i386")
+ elseif(_dumpmachine_triple MATCHES "^mips[^-]*64[^-]*el-")
+ set(ARCHITECTURE_ID "mips64el")
+ elseif(_dumpmachine_triple MATCHES "^mips[^-]*64[^-]*-")
+ set(ARCHITECTURE_ID "mips64")
+ elseif(_dumpmachine_triple MATCHES "^mips[^-]*el[^-]*-")
+ set(ARCHITECTURE_ID "mipsel")
+ elseif(_dumpmachine_triple MATCHES "^mips[^-]*-")
+ set(ARCHITECTURE_ID "mips")
+ elseif(_dumpmachine_triple MATCHES "^riscv64-")
+ set(ARCHITECTURE_ID "riscv64")
+ elseif(_dumpmachine_triple MATCHES "^riscv32-")
+ set(ARCHITECTURE_ID "riscv32")
+ elseif(_dumpmachine_triple MATCHES "^s390x-")
+ set(ARCHITECTURE_ID "s390x")
+ elseif(_dumpmachine_triple MATCHES "^s390-")
+ set(ARCHITECTURE_ID "s390")
+ elseif(_dumpmachine_triple MATCHES "^(sparcv9|sparc64)-")
+ set(ARCHITECTURE_ID "sparcv9")
+ elseif(_dumpmachine_triple MATCHES "^sparc-")
+ set(ARCHITECTURE_ID "sparc")
+ elseif(_dumpmachine_triple MATCHES "^(hppa64|parisc64)-")
+ set(ARCHITECTURE_ID "parisc64")
+ elseif(_dumpmachine_triple MATCHES "^(hppa[0-9.]*|parisc)-")
+ set(ARCHITECTURE_ID "parisc")
+ elseif(_dumpmachine_triple MATCHES "^(powerpc64le|ppc64le)-")
+ set(ARCHITECTURE_ID "ppc64le")
+ elseif(_dumpmachine_triple MATCHES "^(powerpc64|ppc64)-")
+ set(ARCHITECTURE_ID "ppc64")
+ elseif(_dumpmachine_triple MATCHES "^(powerpcle|ppcle)-")
+ set(ARCHITECTURE_ID "ppcle")
+ elseif(_dumpmachine_triple MATCHES "^(powerpc|ppc)-")
+ set(ARCHITECTURE_ID "ppc")
+ else()
+ set(ARCHITECTURE_ID "")
+ endif()
+ set("${arch_id_var}" "${ARCHITECTURE_ID}" PARENT_SCOPE)
+endfunction()
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/KDE3Macros.cmake b/Modules/KDE3Macros.cmake
index da65561..3214bd7 100644
--- a/Modules/KDE3Macros.cmake
+++ b/Modules/KDE3Macros.cmake
@@ -21,6 +21,7 @@
#neundorf@kde.org
+# Included for backward compatibility, otherwise unused.
include(AddFileDependencies)
#create the kidl and skeletion file for dcop stuff
@@ -234,7 +235,7 @@
DEPENDS ${_header}
)
- ADD_FILE_DEPENDENCIES(${_abs_FILE} ${_moc})
+ set_property(SOURCE "${_abs_FILE}" APPEND PROPERTY OBJECT_DEPENDS "${_moc}")
endforeach ()
unset(_match)
diff --git a/Modules/MacroAddFileDependencies.cmake b/Modules/MacroAddFileDependencies.cmake
index 80f7b32..9dee09d 100644
--- a/Modules/MacroAddFileDependencies.cmake
+++ b/Modules/MacroAddFileDependencies.cmake
@@ -9,7 +9,7 @@
.. code-block:: cmake
- MACRO_ADD_FILE_DEPENDENCIES(<source> <files>...)
+ macro_add_file_dependencies(<source> <files>...)
Do not use this command in new code. It is just a wrapper around:
diff --git a/Modules/Platform/Windows-Clang.cmake b/Modules/Platform/Windows-Clang.cmake
index c6dc423..34ed2bc 100644
--- a/Modules/Platform/Windows-Clang.cmake
+++ b/Modules/Platform/Windows-Clang.cmake
@@ -228,7 +228,7 @@
set(CMAKE_INCLUDE_SYSTEM_FLAG_${lang} "-imsvc")
set(CMAKE_${lang}_LINK_MODE LINKER)
-endmacro()
+ endmacro()
else()
cmake_policy(GET CMP0091 __WINDOWS_CLANG_CMP0091)
if(__WINDOWS_CLANG_CMP0091 STREQUAL "NEW")
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/Qt4Macros.cmake b/Modules/Qt4Macros.cmake
index eee413b..8f44b97 100644
--- a/Modules/Qt4Macros.cmake
+++ b/Modules/Qt4Macros.cmake
@@ -141,7 +141,7 @@
macro (QT4_GENERATE_MOC infile outfile )
# get include dirs and flags
- QT4_GET_MOC_FLAGS(moc_flags)
+ qt4_get_moc_flags(moc_flags)
get_filename_component(abs_infile ${infile} ABSOLUTE)
set(_outfile "${outfile}")
if(NOT IS_ABSOLUTE "${outfile}")
@@ -151,23 +151,22 @@
if (${ARGC} GREATER 3 AND "x${ARGV2}" STREQUAL "xTARGET")
set(moc_target ${ARGV3})
endif()
- QT4_CREATE_MOC_COMMAND(${abs_infile} ${_outfile} "${moc_flags}" "" "${moc_target}")
+ qt4_create_moc_command(${abs_infile} ${_outfile} "${moc_flags}" "" "${moc_target}")
set_property(SOURCE ${outfile} PROPERTY SKIP_AUTOMOC TRUE) # don't run automoc on this file
set_property(SOURCE ${outfile} PROPERTY SKIP_AUTOUIC TRUE) # don't run autouic on this file
endmacro ()
-# QT4_WRAP_CPP(outfiles inputfile ... )
-
+# qt4_wrap_cpp(outfiles inputfile ... )
macro (QT4_WRAP_CPP outfiles )
# get include dirs
- QT4_GET_MOC_FLAGS(moc_flags)
- QT4_EXTRACT_OPTIONS(moc_files moc_options moc_target ${ARGN})
+ qt4_get_moc_flags(moc_flags)
+ qt4_extract_options(moc_files moc_options moc_target ${ARGN})
foreach (it ${moc_files})
get_filename_component(it ${it} ABSOLUTE)
- QT4_MAKE_OUTPUT_FILE(${it} moc_ cxx outfile)
- QT4_CREATE_MOC_COMMAND(${it} ${outfile} "${moc_flags}" "${moc_options}" "${moc_target}")
+ qt4_make_output_file(${it} moc_ cxx outfile)
+ qt4_create_moc_command(${it} ${outfile} "${moc_flags}" "${moc_options}" "${moc_target}")
set_property(SOURCE ${outfile} PROPERTY SKIP_AUTOMOC TRUE) # don't run automoc on this file
set_property(SOURCE ${outfile} PROPERTY SKIP_AUTOUIC TRUE) # don't run autouic on this file
set(${outfiles} ${${outfiles}} ${outfile})
@@ -176,10 +175,9 @@
endmacro ()
-# QT4_WRAP_UI(outfiles inputfile ... )
-
+# qt4_wrap_ui(outfiles inputfile ... )
macro (QT4_WRAP_UI outfiles )
- QT4_EXTRACT_OPTIONS(ui_files ui_options ui_target ${ARGN})
+ qt4_extract_options(ui_files ui_options ui_target ${ARGN})
foreach (it ${ui_files})
get_filename_component(outfile ${it} NAME_WE)
@@ -197,10 +195,9 @@
endmacro ()
-# QT4_ADD_RESOURCES(outfiles inputfile ... )
-
+# qt4_add_resources(outfiles inputfile ... )
macro (QT4_ADD_RESOURCES outfiles )
- QT4_EXTRACT_OPTIONS(rcc_files rcc_options rcc_target ${ARGN})
+ qt4_extract_options(rcc_files rcc_options rcc_target ${ARGN})
foreach (it ${rcc_files})
get_filename_component(outfilename ${it} NAME_WE)
@@ -226,7 +223,7 @@
# Since this cmake macro is doing the dependency scanning for these files,
# let's make a configured file and add it as a dependency so cmake is run
# again when dependencies need to be recomputed.
- QT4_MAKE_OUTPUT_FILE("${infile}" "" "qrc.depends" out_depends)
+ qt4_make_output_file("${infile}" "" "qrc.depends" out_depends)
configure_file("${infile}" "${out_depends}" COPYONLY)
else()
# The .qrc file does not exist (yet). Let's add a dependency and hope
@@ -277,10 +274,10 @@
set_property(SOURCE ${_impl} PROPERTY SKIP_AUTOMOC TRUE) # don't run automoc on this file
set_property(SOURCE ${_impl} PROPERTY SKIP_AUTOUIC TRUE) # don't run autouic on this file
- QT4_GENERATE_MOC("${_header}" "${_moc}")
+ qt4_generate_moc("${_header}" "${_moc}")
list(APPEND ${_sources} "${_impl}" "${_header}" "${_moc}")
- MACRO_ADD_FILE_DEPENDENCIES("${_impl}" "${_moc}")
+ set_property(SOURCE "${_impl}" APPEND PROPERTY OBJECT_DEPENDS "${_moc}")
endmacro()
@@ -292,13 +289,13 @@
# get the part before the ".xml" suffix
string(TOLOWER ${_basename} _basename)
string(REGEX REPLACE "(.*\\.)?([^\\.]+)\\.xml" "\\2" _basename ${_basename})
- QT4_ADD_DBUS_INTERFACE(${_sources} ${_infile} ${_basename}interface)
+ qt4_add_dbus_interface(${_sources} ${_infile} ${_basename}interface)
endforeach ()
endmacro()
macro(QT4_GENERATE_DBUS_INTERFACE _header) # _customName OPTIONS -some -options )
- QT4_EXTRACT_OPTIONS(_customName _qt4_dbus_options _qt4_dbus_target ${ARGN})
+ qt4_extract_options(_customName _qt4_dbus_options _qt4_dbus_target ${ARGN})
get_filename_component(_in_file ${_header} ABSOLUTE)
get_filename_component(_basename ${_header} NAME_WE)
@@ -358,10 +355,10 @@
)
endif()
- QT4_GENERATE_MOC("${_header}" "${_moc}")
+ qt4_generate_moc("${_header}" "${_moc}")
set_property(SOURCE ${_impl} PROPERTY SKIP_AUTOMOC TRUE) # don't run automoc on this file
set_property(SOURCE ${_impl} PROPERTY SKIP_AUTOUIC TRUE) # don't run autouic on this file
- MACRO_ADD_FILE_DEPENDENCIES("${_impl}" "${_moc}")
+ set_property(SOURCE "${_impl}" APPEND PROPERTY OBJECT_DEPENDS "${_moc}")
list(APPEND ${_sources} "${_impl}" "${_header}" "${_moc}")
endmacro()
@@ -371,7 +368,7 @@
if(NOT CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 2.8.11)
message(DEPRECATION "The qt4_automoc macro is obsolete. Use the CMAKE_AUTOMOC feature instead.")
endif()
- QT4_GET_MOC_FLAGS(_moc_INCS)
+ qt4_get_moc_flags(_moc_INCS)
set(_matching_FILES )
foreach (_current_FILE ${ARGN})
@@ -404,8 +401,8 @@
set(_header ${_abs_PATH}/${_basename}.h)
endif()
set(_moc ${CMAKE_CURRENT_BINARY_DIR}/${_current_MOC})
- QT4_CREATE_MOC_COMMAND(${_header} ${_moc} "${_moc_INCS}" "" "")
- MACRO_ADD_FILE_DEPENDENCIES(${_abs_FILE} ${_moc})
+ qt4_create_moc_command(${_header} ${_moc} "${_moc_INCS}" "" "")
+ set_property(SOURCE "${_abs_FILE}" APPEND PROPERTY OBJECT_DEPENDS "${_moc}")
endforeach ()
endif()
endif ()
@@ -414,7 +411,7 @@
macro(QT4_CREATE_TRANSLATION _qm_files)
- QT4_EXTRACT_OPTIONS(_lupdate_files _lupdate_options _lupdate_target ${ARGN})
+ qt4_extract_options(_lupdate_files _lupdate_options _lupdate_target ${ARGN})
set(_my_sources)
set(_my_dirs)
set(_my_tsfiles)
@@ -456,7 +453,7 @@
ARGS ${_lupdate_options} ${_ts_pro} ${_my_dirs} -ts ${_ts_file}
DEPENDS ${_my_sources} ${_ts_pro} VERBATIM)
endforeach()
- QT4_ADD_TRANSLATION(${_qm_files} ${_my_tsfiles})
+ qt4_add_translation(${_qm_files} ${_my_tsfiles})
endmacro()
diff --git a/Modules/SelectLibraryConfigurations.cmake b/Modules/SelectLibraryConfigurations.cmake
index 7227367..46d9dbe 100644
--- a/Modules/SelectLibraryConfigurations.cmake
+++ b/Modules/SelectLibraryConfigurations.cmake
@@ -5,35 +5,126 @@
SelectLibraryConfigurations
---------------------------
+This module is intended to be used in :ref:`Find Modules` when finding packages
+that are available with multiple :ref:`Build Configurations`. It provides a
+macro that automatically sets and adjusts library variables. Supported library
+build configurations are ``Release`` and ``Debug`` as these are the most common
+ones in such packages.
+
+.. note::
+
+ This module has been available since early versions of CMake, when the
+ ``<PackageName>_LIBRARIES`` result variable was used for linking found
+ packages. When writing standard find modules, :ref:`Imported Targets` should
+ be preferred. In addition to or as an alternative to this module, imported
+ targets provide finer control over linking through the
+ :prop_tgt:`IMPORTED_CONFIGURATIONS` property.
+
+.. command:: select_library_configurations
+
+ .. code-block:: cmake
+
+ select_library_configurations(<basename>)
+
+ This macro is a helper for setting the ``<basename>_LIBRARY`` and
+ ``<basename>_LIBRARIES`` result variables when a library might be provided
+ with multiple build configurations.
+
+ The argument is:
+
+ ``<basename>``
+ The base name of the library, used as a prefix for variable names. This is
+ the name of the package as used in the ``Find<PackageName>.cmake`` module
+ filename, or the component name, when find module provides them.
+
+ Prior to calling this macro the following cache variables should be set in the
+ find module (for example, by the :command:`find_library` command):
+
+ ``<basename>_LIBRARY_RELEASE``
+ A cache variable storing the full path to the ``Release`` build of the
+ library. If not set or found, this macro will set its value to
+ ``<basename>_LIBRARY_RELEASE-NOTFOUND``.
+
+ ``<basename>_LIBRARY_DEBUG``
+ A cache variable storing the full path to the ``Debug`` build of the
+ library. If not set or found, this macro will set its value to
+ ``<basename>_LIBRARY_DEBUG-NOTFOUND``.
+
+ This macro then sets the following local result variables:
+
+ ``<basename>_LIBRARY``
+ A result variable that is set to the value of
+ ``<basename>_LIBRARY_RELEASE`` variable if found, otherwise it is set to the
+ value of ``<basename>_LIBRARY_DEBUG`` variable if found. If both are found,
+ the release library value takes precedence. If both are not found, it is set
+ to value ``<basename>_LIBRARY-NOTFOUND``.
+
+ If the :manual:`CMake Generator <cmake-generators(7)>` in use supports
+ build configurations, then this variable will be a list of found libraries
+ each prepended with the ``optimized`` or ``debug`` keywords specifying which
+ library should be linked for the given configuration. These keywords are
+ used by the :command:`target_link_libraries` command. If a build
+ configuration has not been set or the generator in use does not support
+ build configurations, then this variable value will not contain these
+ keywords.
+
+ ``<basename>_LIBRARIES``
+ A result variable that is set to the same value as the
+ ``<basename>_LIBRARY`` variable.
+
+ .. note::
+
+ The ``select_library_configurations()`` macro should be called before
+ handling standard find module arguments with
+ :module:`find_package_handle_standard_args()
+ <FindPackageHandleStandardArgs>` to ensure that the ``<PackageName>_FOUND``
+ result variable is correctly set based on ``<basename>_LIBRARY`` or other
+ related variables.
+
+Examples
+^^^^^^^^
+
+Setting library variables based on the build configuration inside a find module
+file:
+
.. code-block:: cmake
+ :caption: FindFoo.cmake
- select_library_configurations(basename)
+ # Find release and debug build of the library
+ find_library(Foo_LIBRARY_RELEASE ...)
+ find_library(Foo_LIBRARY_DEBUG ...)
-This macro takes a library base name as an argument, and will choose
-good values for the variables
+ # Set Foo_LIBRARY and Foo_LIBRARIES result variables
+ include(SelectLibraryConfigurations)
+ select_library_configurations(Foo)
-::
+ # Set Foo_FOUND variable and print result message.
+ include(FindPackageHandleStandardArgs)
+ find_package_handle_standard_args(
+ Foo
+ REQUIRED_VARS Foo_LIBRARY ...
+ )
- basename_LIBRARY
- basename_LIBRARIES
- basename_LIBRARY_DEBUG
- basename_LIBRARY_RELEASE
+When find module provides components with multiple build configurations:
-depending on what has been found and set.
+.. code-block:: cmake
+ :caption: FindFoo.cmake
-If only ``basename_LIBRARY_RELEASE`` is defined, ``basename_LIBRARY`` will
-be set to the release value, and ``basename_LIBRARY_DEBUG`` will be set
-to ``basename_LIBRARY_DEBUG-NOTFOUND``. If only ``basename_LIBRARY_DEBUG``
-is defined, then ``basename_LIBRARY`` will take the debug value, and
-``basename_LIBRARY_RELEASE`` will be set to ``basename_LIBRARY_RELEASE-NOTFOUND``.
+ include(SelectLibraryConfigurations)
+ foreach(component IN LISTS Foo_FIND_COMPONENTS)
+ # ...
+ select_library_configurations(Foo_${component})
+ # ...
+ endforeach()
-If the generator supports configuration types, then ``basename_LIBRARY``
-and ``basename_LIBRARIES`` will be set with debug and optimized flags
-specifying the library to be used for the given configuration. If no
-build type has been set or the generator in use does not support
-configuration types, then ``basename_LIBRARY`` and ``basename_LIBRARIES``
-will take only the release value, or the debug value if the release one
-is not set.
+A project can then use this find module as follows:
+
+.. code-block:: cmake
+ :caption: CMakeLists.txt
+
+ find_package(Foo)
+ target_link_libraries(project_target PRIVATE ${Foo_LIBRARIES})
+ # ...
#]=======================================================================]
# This macro was adapted from the FindQt4 CMake module and is maintained by Will
diff --git a/Modules/SystemInformation.in b/Modules/SystemInformation.in
index 50b5720..8d4b046 100644
--- a/Modules/SystemInformation.in
+++ b/Modules/SystemInformation.in
@@ -18,8 +18,14 @@
CMAKE_SYSTEM_INFO_FILE == "${CMAKE_SYSTEM_INFO_FILE}"
CMAKE_SYSTEM_NAME == "${CMAKE_SYSTEM_NAME}"
CMAKE_SYSTEM == "${CMAKE_SYSTEM}"
-CMAKE_CXX_COMPILER == "${CMAKE_CXX_COMPILER}"
CMAKE_C_COMPILER == "${CMAKE_C_COMPILER}"
+CMAKE_C_COMPILER_ID == "${CMAKE_C_COMPILER_ID}"
+CMAKE_C_COMPILER_VERSION == "${CMAKE_C_COMPILER_VERSION}"
+CMAKE_C_COMPILER_ARCHITECTURE_ID == "${CMAKE_C_COMPILER_ARCHITECTURE_ID}"
+CMAKE_CXX_COMPILER == "${CMAKE_CXX_COMPILER}"
+CMAKE_CXX_COMPILER_ID == "${CMAKE_CXX_COMPILER_ID}"
+CMAKE_CXX_COMPILER_VERSION == "${CMAKE_CXX_COMPILER_VERSION}"
+CMAKE_CXX_COMPILER_ARCHITECTURE_ID == "${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}"
CMAKE_COMPILER_IS_GNUCC == "${CMAKE_COMPILER_IS_GNUCC}"
CMAKE_COMPILER_IS_GNUCXX == "${CMAKE_COMPILER_IS_GNUCXX}"
diff --git a/Modules/TestCXXAcceptsFlag.cmake b/Modules/TestCXXAcceptsFlag.cmake
index 239db61..a39f8b3 100644
--- a/Modules/TestCXXAcceptsFlag.cmake
+++ b/Modules/TestCXXAcceptsFlag.cmake
@@ -7,18 +7,49 @@
.. deprecated:: 3.0
- See :module:`CheckCXXCompilerFlag`.
+ This module should no longer be used. It has been superseded by the
+ :module:`CheckCXXCompilerFlag` module. As of CMake 3.19, the
+ :module:`CheckCompilerFlag` module is also available for checking flags across
+ multiple languages.
-Check if the CXX compiler accepts a flag.
+This module provides a macro to test whether the C++ (CXX) compiler supports
+specific flags.
+
+Macros
+^^^^^^
+
+.. command:: check_cxx_accepts_flag
+
+ Checks whether the CXX compiler accepts the specified flags:
+
+ .. code-block:: cmake
+
+ check_cxx_accepts_flag(<flags> <result-variable>)
+
+ ``<flags>``
+ One or more compiler flags to test. For multiple flags, provide them as a
+ space-separated string.
+
+ ``<result-variable>``
+ Name of an internal cache variable that stores the result. It is set to
+ boolean true if the compiler accepts the flags and false otherwise.
+
+Examples
+^^^^^^^^
+
+Checking if the C++ compiler supports specific flags:
.. code-block:: cmake
- CHECK_CXX_ACCEPTS_FLAG(<flags> <variable>)
+ include(TestCXXAcceptsFlag)
+ check_cxx_accepts_flag("-fno-common -fstack-clash-protection" HAVE_FLAGS)
-``<flags>``
- the flags to try
-``<variable>``
- variable to store the result
+Migrating to the :module:`CheckCompilerFlag` module:
+
+.. code-block:: cmake
+
+ include(CheckCompilerFlag)
+ check_compiler_flag(CXX "-fno-common;-fstack-clash-protection" HAVE_FLAGS)
#]=======================================================================]
macro(CHECK_CXX_ACCEPTS_FLAG FLAGS VARIABLE)
diff --git a/Modules/TestForANSIForScope.cmake b/Modules/TestForANSIForScope.cmake
index 1224a21..2b539fc 100644
--- a/Modules/TestForANSIForScope.cmake
+++ b/Modules/TestForANSIForScope.cmake
@@ -5,14 +5,32 @@
TestForANSIForScope
-------------------
-Check for ANSI for scope support
+This module checks whether the ``CXX`` compiler restricts the scope of variables
+declared in a for-init-statement to the loop body. In early C++ (pre-C++98),
+variables declared in ``for(<init-statement> ...)`` could remain accessible
+outside the loop after its body (``for() { <body> }``).
-Check if the compiler restricts the scope of variables declared in a
-for-init-statement to the loop body.
+This module defines the following cache variable:
-::
+``CMAKE_NO_ANSI_FOR_SCOPE``
+ A cache variable containing the result of the check. It will be set to value
+ ``0`` if the for-init-statement has restricted scope (``C++ 98`` and newer),
+ and to value ``1`` if not (``ANSI C++``).
- CMAKE_NO_ANSI_FOR_SCOPE - holds result
+.. note::
+
+ As of the ``C++ 98`` standard, variables declared in a for-init-statement are
+ restricted to the loop body, making this behavior obsolete.
+
+Examples
+^^^^^^^^
+
+Including this module will check the ``for()`` loop scope behavior and define
+the ``CMAKE_NO_ANSI_FOR_SCOPE`` cache variable:
+
+.. code-block:: cmake
+
+ include(TestForANSIForScope)
#]=======================================================================]
if(NOT DEFINED CMAKE_ANSI_FOR_SCOPE)
diff --git a/Modules/TestForANSIStreamHeaders.cmake b/Modules/TestForANSIStreamHeaders.cmake
index d156991..cd25c0a 100644
--- a/Modules/TestForANSIStreamHeaders.cmake
+++ b/Modules/TestForANSIStreamHeaders.cmake
@@ -5,14 +5,52 @@
TestForANSIStreamHeaders
------------------------
-Test for compiler support of ANSI stream headers iostream, etc.
+This module checks whether the ``CXX`` compiler supports standard library
+headers without the ``.h`` extension (e.g. ``<iostream>``). Early
+versions of C++ (pre-C++98) didn't support including standard headers without
+extensions.
-check if the compiler supports the standard ANSI iostream header
-(without the .h)
+This module defines the following cache variable:
-::
+``CMAKE_NO_ANSI_STREAM_HEADERS``
+ A cache variable containing the result of the check. It will be set to value
+ ``0`` if the standard headers can be included without the ``.h`` extension
+ (``C++ 98`` and newer), and to value ``1`` if ``.h`` is required
+ (``ANSI C++``).
- CMAKE_NO_ANSI_STREAM_HEADERS - defined by the results
+.. note::
+
+ The C++ standard headers without extensions got formally introduced in the
+ ``C++ 98`` standard, making this issue obsolete.
+
+Examples
+^^^^^^^^
+
+Including this module will check how the C++ standard headers can be included
+and define the ``CMAKE_NO_ANSI_STREAM_HEADERS`` cache variable:
+
+.. code-block:: cmake
+
+ include(TestForANSIStreamHeaders)
+ file(
+ CONFIGURE
+ OUTPUT config.h
+ CONTENT "#cmakedefine CMAKE_NO_ANSI_STREAM_HEADERS"
+ )
+
+C++ program can then include the available header conditionally:
+
+.. code-block:: c++
+
+ #include "config.h"
+
+ #ifdef CMAKE_NO_ANSI_STREAM_HEADERS
+ # include <iostream.h>
+ #else
+ # include <iostream>
+ #endif
+
+ int main() { ... }
#]=======================================================================]
include(${CMAKE_CURRENT_LIST_DIR}/CheckIncludeFileCXX.cmake)
diff --git a/Modules/TestForSSTREAM.cmake b/Modules/TestForSSTREAM.cmake
index 40fb373..f335a8a 100644
--- a/Modules/TestForSSTREAM.cmake
+++ b/Modules/TestForSSTREAM.cmake
@@ -5,13 +5,52 @@
TestForSSTREAM
--------------
-Test for compiler support of ANSI sstream header
+This module checks whether the C++ standard header ``<sstream>`` exists and
+functions correctly. In early versions of C++ (pre-C++98), this header was not
+formally standardized and may not have been available.
-check if the compiler supports the standard ANSI sstream header
+This module defines the following cache variables:
-::
+``CMAKE_NO_ANSI_STRING_STREAM``
+ A cache variable indicating whether the ``<sstream>`` header is available. It
+ will be set to value ``0`` if ``<sstream>`` is available (``C++ 98`` and
+ newer), and to value ``1`` if ``<sstream>`` is missing (``ANSI C++``).
- CMAKE_NO_ANSI_STRING_STREAM - defined by the results
+``CMAKE_HAS_ANSI_STRING_STREAM``
+ A cache variable that is the opposite of ``CMAKE_NO_ANSI_STRING_STREAM``
+ (true if ``<sstream>`` is available and false if ``<sstream>`` is missing).
+
+.. note::
+
+ The ``<sstream>`` header was formally introduced in the ``C++ 98`` standard,
+ making this check obsolete for modern compilers.
+
+Examples
+^^^^^^^^
+
+Including this module will check for ``<sstream>`` support and define the
+``CMAKE_NO_ANSI_STRING_STREAM`` cache variable:
+
+.. code-block:: cmake
+
+ include(TestForSSTREAM)
+ file(
+ CONFIGURE
+ OUTPUT config.h
+ CONTENT "#cmakedefine CMAKE_NO_ANSI_STRING_STREAM"
+ )
+
+Then it can be used in a C++ program:
+
+.. code-block:: c++
+
+ #include "config.h"
+
+ #ifndef CMAKE_NO_ANSI_STRING_STREAM
+ # include <sstream>
+ #endif
+
+ int main() { ... }
#]=======================================================================]
if(NOT DEFINED CMAKE_HAS_ANSI_STRING_STREAM)
diff --git a/Modules/TestForSTDNamespace.cmake b/Modules/TestForSTDNamespace.cmake
index e565e5c..f057d7e 100644
--- a/Modules/TestForSTDNamespace.cmake
+++ b/Modules/TestForSTDNamespace.cmake
@@ -5,13 +5,48 @@
TestForSTDNamespace
-------------------
-Test for std:: namespace support
+This module checks whether the ``CXX`` compiler supports the ``std`` namespace
+for the C++ Standard Library. Early versions of C++ (pre-C++98) did not have a
+requirement for a dedicated namespace of C++ Standard Template Library (STL)
+components (e.g. ``list``, etc.) and other parts of the C++ Standard Library
+(such as I/O streams ``cout``, ``endl``, etc), so they were available globally.
-check if the compiler supports std:: on stl classes
+This module defines the following cache variable:
-::
+``CMAKE_NO_STD_NAMESPACE``
+ A cache variable containing the result of the check. It will be set to value
+ ``0`` if the ``std`` namespace is supported (``C++ 98`` and newer), and to
+ value ``1`` if not (``ANSI C++``).
- CMAKE_NO_STD_NAMESPACE - defined by the results
+.. note::
+
+ The ``std`` namespace got formally introduced in ``C++ 98`` standard, making
+ this issue obsolete.
+
+Examples
+^^^^^^^^
+
+Including this module will check for the ``std`` namespace support and define
+the ``CMAKE_NO_STD_NAMESPACE`` cache variable:
+
+.. code-block:: cmake
+
+ include(TestForSTDNamespace)
+ file(
+ CONFIGURE
+ OUTPUT config.h
+ CONTENT "#cmakedefine CMAKE_NO_STD_NAMESPACE"
+ )
+
+which can be then used in a C++ program to define the missing namespace:
+
+.. code-block:: c++
+
+ #include "config.h"
+
+ #ifdef CMAKE_NO_STD_NAMESPACE
+ # define std
+ #endif
#]=======================================================================]
if(NOT DEFINED CMAKE_STD_NAMESPACE)
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/Modules/UsePkgConfig.cmake b/Modules/UsePkgConfig.cmake
index 3771db1..2c34c26 100644
--- a/Modules/UsePkgConfig.cmake
+++ b/Modules/UsePkgConfig.cmake
@@ -6,18 +6,81 @@
------------
.. deprecated:: 3.0
- Use :module:`FindPkgConfig` instead.
+
+ This module should no longer be used. Instead, use the
+ :module:`FindPkgConfig` module or the :command:`cmake_pkg_config` command.
+
+ This module provided a macro for finding external packages using
+ ``pkg-config`` command-line utility. It has been replaced by the more
+ convenient ``FindPkgConfig`` module, which is commonly used in
+ :ref:`Find Modules`.
+
+ As of CMake 3.31, the built-in :command:`cmake_pkg_config` command provides
+ even more features to extract package information.
+
+Macros
+^^^^^^
This module defines the following macro:
-PKGCONFIG(package includedir libdir linkflags cflags)
+.. command:: pkgconfig
-Calling PKGCONFIG will fill the desired information into the 4 given
-arguments, e.g. PKGCONFIG(libart-2.0 LIBART_INCLUDE_DIR
-LIBART_LINK_DIR LIBART_LINK_FLAGS LIBART_CFLAGS) if pkg-config was NOT
-found or the specified software package doesn't exist, the variable
-will be empty when the function returns, otherwise they will contain
-the respective information
+ Finds external package using ``pkg-config`` and sets result variables:
+
+ .. code-block:: cmake
+
+ pkgconfig(<package> <includedir> <libdir> <linkflags> <cflags>)
+
+ This macro invokes ``pkg-config`` command-line utility to retrieve the package
+ information into specified variables. If ``pkg-config`` or the specified
+ package ``<package>`` is NOT found, the result variables remain empty.
+
+ The arguments are:
+
+ ``<package>``
+ Name of the package as defined in its PC metadata file (``<package>.pc``).
+
+ ``<includedir>``
+ Variable name to store the package's include directory.
+
+ ``<libdir>``
+ Variable name to store the directory containing the package library.
+
+ ``<linkflags>``
+ Variable name to store the linker flags for the package.
+
+ ``<cflags>``
+ Variable name to store the compiler flags for the package.
+
+Examples
+^^^^^^^^
+
+Using this module fills the desired information into the four given variables:
+
+.. code-block:: cmake
+
+ include(UsePkgConfig)
+ pkgconfig(
+ libart-2.0
+ LIBART_INCLUDEDIR
+ LIBART_LIBDIR
+ LIBART_LDFLAGS
+ LIBART_CFLAGS
+ )
+
+Migrating to the :module:`FindPkgConfig` would look something like this:
+
+.. code-block:: cmake
+
+ find_package(PkgConfig QUIET)
+ if(PKG_CONFIG_FOUND)
+ pkg_check_modules(LIBART QUIET libart-2.0)
+ endif()
+
+ message(STATUS "LIBART_INCLUDEDIR=${LIBART_INCLUDEDIR}")
+ message(STATUS "LIBART_LIBDIR=${LIBART_LIBDIR}")
+ message(STATUS "LIBART_LDFLAGS=${LIBART_LDFLAGS}")
+ message(STATUS "LIBART_CFLAGS=${LIBART_CFLAGS}")
#]=======================================================================]
find_program(PKGCONFIG_EXECUTABLE NAMES pkg-config )
diff --git a/Modules/Use_wxWindows.cmake b/Modules/Use_wxWindows.cmake
index 5f46784..e3c1870 100644
--- a/Modules/Use_wxWindows.cmake
+++ b/Modules/Use_wxWindows.cmake
@@ -7,39 +7,41 @@
.. deprecated:: 2.8.10
- Use ``find_package(wxWidgets)`` and ``include(${wxWidgets_USE_FILE})`` instead.
+ Use :module:`find_package(wxWidgets) <FindwxWidgets>` instead.
-This convenience include finds if wxWindows is installed and set the
-appropriate libs, incdirs, flags etc. author Jan Woetzel <jw -at-
-mip.informatik.uni-kiel.de> (07/2003)
+This convenience include finds if wxWindows library is installed and sets the
+appropriate libraries, include directories, flags, etc.
-USAGE:
+Examples
+^^^^^^^^
-::
+Include ``Use_wxWindows`` module in project's ``CMakeLists.txt``:
- just include Use_wxWindows.cmake
- in your projects CMakeLists.txt
+.. code-block:: cmake
-include( ${CMAKE_MODULE_PATH}/Use_wxWindows.cmake)
+ # CMakeLists.txt
+ include(Use_wxWindows)
-::
+When the GL support is required, set ``WXWINDOWS_USE_GL`` *before* including
+this module:
- if you are sure you need GL then
+.. code-block:: cmake
-set(WXWINDOWS_USE_GL 1)
-
-::
-
- *before* you include this file.
+ set(WXWINDOWS_USE_GL ON)
+ include(Use_wxWindows)
#]=======================================================================]
+# Author: Jan Woetzel <jw -at- mip.informatik.uni-kiel.de> (07/2003)
+
# -----------------------------------------------------
# 16.Feb.2004: changed INCLUDE to FIND_PACKAGE to read from users own non-system CMAKE_MODULE_PATH (Jan Woetzel JW)
# 07/2006: rewrite as FindwxWidgets.cmake, kept for backward compatibility JW
-message(STATUS "Use_wxWindows.cmake is DEPRECATED. \n"
-"Please use find_package(wxWidgets) and include(${wxWidgets_USE_FILE}) instead. (JW)")
-
+message(
+ DEPRECATION
+ "Use_wxWindows module is DEPRECATED.\n"
+ "Please use find_package(wxWidgets) instead. (JW)"
+)
# ------------------------
diff --git a/Modules/UsewxWidgets.cmake b/Modules/UsewxWidgets.cmake
index 7152afe..3751025 100644
--- a/Modules/UsewxWidgets.cmake
+++ b/Modules/UsewxWidgets.cmake
@@ -5,39 +5,46 @@
UsewxWidgets
------------
-Convenience include for using wxWidgets library.
+This module calls :command:`include_directories` and
+:command:`link_directories`, sets compile definitions for the current directory
+and appends some compile flags to use wxWidgets library after calling the
+:module:`find_package(wxWidgets) <FindwxWidgets>`.
-Determines if wxWidgets was FOUND and sets the appropriate libs,
-incdirs, flags, etc. INCLUDE_DIRECTORIES and LINK_DIRECTORIES are
-called.
+Examples
+^^^^^^^^
-USAGE
+Include ``UsewxWidgets`` module in project's ``CMakeLists.txt``:
.. code-block:: cmake
- # Note that for MinGW users the order of libs is important!
+ # Note that for MinGW users the order of libraries is important.
find_package(wxWidgets REQUIRED net gl core base)
+
+ # Above also sets the wxWidgets_USE_FILE variable that points to this module.
include(${wxWidgets_USE_FILE})
- # and for each of your dependent executable/library targets:
- target_link_libraries(<YourTarget> ${wxWidgets_LIBRARIES})
+ # Link wxWidgets libraries for each dependent executable/library target.
+ target_link_libraries(<ProjectTarget> ${wxWidgets_LIBRARIES})
+As of CMake 3.27, a better approach is to link only the
+:module:`wxWidgets::wxWidgets <FindwxWidgets>` ``IMPORTED`` target to specific
+targets that require it, rather than including this module. Imported targets
+provide better control of the package usage properties, such as include
+directories and compile flags, by applying them only to the targets they are
+linked to, avoiding unnecessary propagation to all targets in the current
+directory.
-DEPRECATED
+.. code-block:: cmake
-::
+ # CMakeLists.txt
+ find_package(wxWidgets)
- LINK_LIBRARIES is not called in favor of adding dependencies per target.
-
-
-
-AUTHOR
-
-::
-
- Jan Woetzel <jw -at- mip.informatik.uni-kiel.de>
+ # Link the imported target for each dependent executable/library target.
+ target_link_libraries(<ProjectTarget> wxWidgets::wxWidgets)
#]=======================================================================]
+# Author: Jan Woetzel <jw -at- mip.informatik.uni-kiel.de>
+
if (wxWidgets_FOUND)
if (wxWidgets_INCLUDE_DIRS)
if(wxWidgets_INCLUDE_DIRS_NO_SYSTEM)
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 2c0db2e..4af5239 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -1,7 +1,7 @@
# CMake version number components.
set(CMake_VERSION_MAJOR 4)
set(CMake_VERSION_MINOR 0)
-set(CMake_VERSION_PATCH 0)
+set(CMake_VERSION_PATCH 20250327)
#set(CMake_VERSION_RC 0)
set(CMake_VERSION_IS_DIRTY 0)
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx
index f725580..fac06bf 100644
--- a/Source/CPack/cmCPackGenerator.cxx
+++ b/Source/CPack/cmCPackGenerator.cxx
@@ -1239,7 +1239,11 @@
// Load the project specific config file
cmValue config = this->GetOption("CPACK_PROJECT_CONFIG_FILE");
if (config) {
- mf->ReadListFile(*config);
+ if (!mf->ReadListFile(*config)) {
+ cmCPackLogger(cmCPackLog::LOG_WARNING,
+ "CPACK_PROJECT_CONFIG_FILE not found: " << *config
+ << std::endl);
+ }
}
int result = this->InitializeInternal();
if (cmSystemTools::GetErrorOccurredFlag()) {
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/cmCTestEmptyBinaryDirectoryCommand.cxx b/Source/CTest/cmCTestEmptyBinaryDirectoryCommand.cxx
index 0fc89e8..17dd47e 100644
--- a/Source/CTest/cmCTestEmptyBinaryDirectoryCommand.cxx
+++ b/Source/CTest/cmCTestEmptyBinaryDirectoryCommand.cxx
@@ -7,6 +7,7 @@
#include "cmExecutionStatus.h"
#include "cmMakefile.h"
#include "cmMessageType.h"
+#include "cmMessenger.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
@@ -94,10 +95,12 @@
std::string err;
if (!EmptyBinaryDirectory(args[0], err)) {
- status.GetMakefile().IssueMessage(
+ cmMakefile& mf = status.GetMakefile();
+ mf.GetMessenger()->DisplayMessage(
MessageType::FATAL_ERROR,
cmStrCat("Did not remove the binary directory:\n ", args[0],
- "\nbecause:\n ", err));
+ "\nbecause:\n ", err),
+ mf.GetBacktrace());
return true;
}
diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx
index 0df9657..d5a84e5 100644
--- a/Source/CTest/cmCTestMultiProcessHandler.cxx
+++ b/Source/CTest/cmCTestMultiProcessHandler.cxx
@@ -1668,7 +1668,7 @@
{
if (!this->ResourceSpec.ReadFromJSONFile(this->ResourceSpecFile)) {
error = cmStrCat("Could not read/parse resource spec file ",
- this->ResourceSpecFile, ": ",
+ this->ResourceSpecFile, ":\n",
this->ResourceSpec.parseState.GetErrorMessage());
return false;
}
diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx
index 48f0935..ca66f18 100644
--- a/Source/CTest/cmCTestScriptHandler.cxx
+++ b/Source/CTest/cmCTestScriptHandler.cxx
@@ -63,10 +63,7 @@
res |= this->RunConfigurationScript(this->ConfigurationScripts[i],
this->ScriptProcessScope[i]);
}
- if (res) {
- return -1;
- }
- return 0;
+ return res;
}
void cmCTestScriptHandler::UpdateElapsedTime()
@@ -180,6 +177,8 @@
this->CMake->SetHomeOutputDirectory("");
this->CMake->GetCurrentSnapshot().SetDefaultDefinitions();
this->CMake->AddCMakePaths();
+ this->CMake->SetWorkingMode(cmake::SCRIPT_MODE,
+ cmake::CommandFailureAction::EXIT_CODE);
this->GlobalGenerator =
cm::make_unique<cmGlobalGenerator>(this->CMake.get());
@@ -289,7 +288,7 @@
cmSystemTools::GetErrorOccurredFlag()) {
cmCTestLog(this->CTest, ERROR_MESSAGE,
"Error in read:" << systemFile << "\n");
- return 2;
+ return -1;
}
// Add definitions of variables passed in on the command line:
@@ -299,16 +298,20 @@
this->Makefile->AddDefinition(d.first, d.second);
}
+ int res = 0;
+
// finally read in the script
if (!this->Makefile->ReadListFile(script) ||
cmSystemTools::GetErrorOccurredFlag()) {
// Reset the error flag so that it can run more than
// one script with an error when you use ctest_run_script.
cmSystemTools::ResetErrorOccurredFlag();
- return 2;
+ res = -1;
}
- return 0;
+ return this->CMake->HasScriptModeExitCode()
+ ? this->CMake->GetScriptModeExitCode()
+ : res;
}
// run a specific script
diff --git a/Source/CTest/cmCTestTestCommand.h b/Source/CTest/cmCTestTestCommand.h
index 5c90c64..090d42d 100644
--- a/Source/CTest/cmCTestTestCommand.h
+++ b/Source/CTest/cmCTestTestCommand.h
@@ -43,6 +43,7 @@
cm::optional<ArgumentParser::Maybe<std::string>> ParallelLevel;
std::string Repeat;
std::string ScheduleRandom;
+ std::string ScheduleRandomSeed;
std::string StopTime;
std::string TestLoad;
std::string ResourceSpecFile;
@@ -70,6 +71,7 @@
.Bind("PARALLEL_LEVEL"_s, &TestArguments::ParallelLevel)
.Bind("REPEAT"_s, &TestArguments::Repeat)
.Bind("SCHEDULE_RANDOM"_s, &TestArguments::ScheduleRandom)
+ .Bind("SCHEDULE_RANDOM_SEED"_s, &TestArguments::ScheduleRandomSeed)
.Bind("STOP_TIME"_s, &TestArguments::StopTime)
.Bind("TEST_LOAD"_s, &TestArguments::TestLoad)
.Bind("RESOURCE_SPEC_FILE"_s, &TestArguments::ResourceSpecFile)
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx
index 69ab748..80e6214 100644
--- a/Source/CTest/cmCTestTestHandler.cxx
+++ b/Source/CTest/cmCTestTestHandler.cxx
@@ -1324,7 +1324,14 @@
bool randomSchedule = this->CTest->GetScheduleType() == "Random";
if (randomSchedule) {
- srand(static_cast<unsigned>(time(nullptr)));
+ cm::optional<unsigned int> scheduleRandomSeed =
+ this->CTest->GetRandomSeed();
+ if (!scheduleRandomSeed.has_value()) {
+ scheduleRandomSeed = static_cast<unsigned int>(time(nullptr));
+ }
+ srand(*scheduleRandomSeed);
+ *this->LogFile << "Test order random seed: " << *scheduleRandomSeed
+ << std::endl;
}
for (cmCTestTestProperties& p : this->TestList) {
diff --git a/Source/CTest/cmCTestTestHandler.h b/Source/CTest/cmCTestTestHandler.h
index 6ad2e60..9388425 100644
--- a/Source/CTest/cmCTestTestHandler.h
+++ b/Source/CTest/cmCTestTestHandler.h
@@ -34,6 +34,7 @@
bool ScheduleRandom = false;
bool StopOnFailure = false;
bool UseUnion = false;
+ cm::optional<unsigned int> ScheduleRandomSeed;
int OutputSizePassed = 1 * 1024;
int OutputSizeFailed = 300 * 1024;
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/CursesDialog/cmCursesCacheEntryComposite.cxx b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx
index 557d32c..0569821 100644
--- a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx
+++ b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx
@@ -29,7 +29,7 @@
{
this->Label =
cm::make_unique<cmCursesLabelWidget>(this->LabelWidth, 1, 1, 1, key);
- this->IsNewLabel = cm::make_unique<cmCursesLabelWidget>(1, 1, 1, 1, " ");
+ this->IsNewLabel = cm::make_unique<cmCursesLabelWidget>(3, 1, 1, 1, " ");
this->Entry =
cm::make_unique<cmCursesStringWidget>(this->EntryWidth, 1, 1, 1);
}
@@ -44,9 +44,9 @@
this->Label =
cm::make_unique<cmCursesLabelWidget>(this->LabelWidth, 1, 1, 1, key);
if (isNew) {
- this->IsNewLabel = cm::make_unique<cmCursesLabelWidget>(1, 1, 1, 1, "*");
+ this->IsNewLabel = cm::make_unique<cmCursesLabelWidget>(3, 1, 1, 1, " * ");
} else {
- this->IsNewLabel = cm::make_unique<cmCursesLabelWidget>(1, 1, 1, 1, " ");
+ this->IsNewLabel = cm::make_unique<cmCursesLabelWidget>(3, 1, 1, 1, " ");
}
cmValue value = state->GetCacheEntryValue(key);
diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx
index cd42fb2..7b223dc 100644
--- a/Source/CursesDialog/cmCursesMainForm.cxx
+++ b/Source/CursesDialog/cmCursesMainForm.cxx
@@ -72,6 +72,9 @@
// Create new cmCursesCacheEntryComposite entries from the cache
void cmCursesMainForm::InitializeUI()
{
+ // Hide the cursor by default
+ curs_set(0);
+
// Create a vector of cmCursesCacheEntryComposite's
// which contain labels, entries and new entry markers
std::vector<cmCursesCacheEntryComposite> newEntries;
@@ -271,7 +274,7 @@
this->NumberOfPages++;
}
entry.Label->Move(left, top + row - 1, isNewPage);
- entry.IsNewLabel->Move(left + 32, top + row - 1, false);
+ entry.IsNewLabel->Move(left + 30, top + row - 1, false);
entry.Entry->Move(left + 33, top + row - 1, false);
entry.Entry->SetPage(this->NumberOfPages);
i++;
@@ -424,8 +427,11 @@
// Fields are grouped by 3, the first one being the label
// so start at 0 and move up by 3 avoiding the last null entry
for (size_type index = 0; index < this->Fields.size() - 1; index += 3) {
- bool currentLabel = index == currentLabelIndex;
- set_field_fore(this->Fields[index], currentLabel ? A_STANDOUT : A_NORMAL);
+ int attr = (index == currentLabelIndex) ? A_STANDOUT : A_NORMAL;
+ set_field_fore(this->Fields[index], attr);
+ set_field_back(this->Fields[index], attr);
+ set_field_fore(this->Fields[index + 1], attr);
+ set_field_back(this->Fields[index + 1], attr);
}
// Display CMake version under the status bar
@@ -658,6 +664,12 @@
}
}
+void cmCursesMainForm::SetSearchMode(bool enable)
+{
+ this->SearchMode = enable;
+ curs_set(enable);
+}
+
void cmCursesMainForm::HandleInput()
{
int x = 0;
@@ -710,7 +722,7 @@
if (this->SearchMode) {
if (key == 10 || key == KEY_ENTER) {
- this->SearchMode = false;
+ this->SetSearchMode(false);
if (!this->SearchString.empty()) {
this->JumpToCacheEntry(this->SearchString.c_str());
this->OldSearchString = this->SearchString;
@@ -865,7 +877,7 @@
CurrentForm = this;
this->Render(1, 1, x, y);
} else if (key == '/') {
- this->SearchMode = true;
+ this->SetSearchMode(true);
this->UpdateStatusBar("Search");
this->PrintKeys(1);
touchwin(stdscr);
diff --git a/Source/CursesDialog/cmCursesMainForm.h b/Source/CursesDialog/cmCursesMainForm.h
index d92b6c2..d7695b7 100644
--- a/Source/CursesDialog/cmCursesMainForm.h
+++ b/Source/CursesDialog/cmCursesMainForm.h
@@ -63,6 +63,8 @@
MAX_WIDTH = 512
};
+ void SetSearchMode(bool enable);
+
/**
* This method should normally be called only by the form. The only
* exception is during a resize. The optional argument specifies the
diff --git a/Source/CursesDialog/cmCursesStringWidget.cxx b/Source/CursesDialog/cmCursesStringWidget.cxx
index d472236..eb801ca 100644
--- a/Source/CursesDialog/cmCursesStringWidget.cxx
+++ b/Source/CursesDialog/cmCursesStringWidget.cxx
@@ -32,6 +32,12 @@
field_opts_off(this->Field, O_STATIC);
}
+void cmCursesStringWidget::SetInEdit(bool inedit)
+{
+ this->InEdit = inedit;
+ curs_set(inedit);
+}
+
void cmCursesStringWidget::OnTab(cmCursesMainForm* /*unused*/,
WINDOW* /*unused*/)
{
@@ -42,7 +48,7 @@
{
if (this->InEdit) {
cmCursesForm::LogMessage("String widget leaving edit.");
- this->InEdit = false;
+ this->SetInEdit(false);
fm->PrintKeys();
this->OriginalString.clear();
// trick to force forms to update the field buffer
@@ -52,7 +58,7 @@
this->Done = true;
} else {
cmCursesForm::LogMessage("String widget entering edit.");
- this->InEdit = true;
+ this->SetInEdit(true);
fm->PrintKeys();
this->OriginalString = field_buffer(this->Field, 0);
}
@@ -114,7 +120,7 @@
} else if (key == KEY_DOWN || key == ctrl('n') || key == KEY_UP ||
key == ctrl('p') || key == KEY_NPAGE || key == ctrl('d') ||
key == KEY_PPAGE || key == ctrl('u')) {
- this->InEdit = false;
+ this->SetInEdit(false);
this->OriginalString.clear();
// trick to force forms to update the field buffer
form_driver(form, REQ_NEXT_FIELD);
@@ -124,7 +130,7 @@
// esc
else if (key == 27) {
if (this->InEdit) {
- this->InEdit = false;
+ this->SetInEdit(false);
fm->PrintKeys();
this->SetString(this->OriginalString);
this->OriginalString.clear();
diff --git a/Source/CursesDialog/cmCursesStringWidget.h b/Source/CursesDialog/cmCursesStringWidget.h
index 6d94369..e0ee897 100644
--- a/Source/CursesDialog/cmCursesStringWidget.h
+++ b/Source/CursesDialog/cmCursesStringWidget.h
@@ -40,7 +40,7 @@
* Set/Get InEdit flag. Can be used to tell the widget to leave
* edit mode (in case of a resize for example).
*/
- void SetInEdit(bool inedit) { this->InEdit = inedit; }
+ void SetInEdit(bool inedit);
bool GetInEdit() { return this->InEdit; }
/**
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 790c008..baf8fbd 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;
@@ -321,8 +310,8 @@
InterruptFlag = 0;
cmSystemTools::ResetErrorOccurredFlag();
- auto successful =
- this->CMakeInstance->Open(this->BinaryDirectory.toStdString(), false);
+ auto successful = this->CMakeInstance->Open(
+ this->BinaryDirectory.toStdString(), cmake::DryRun::No);
#ifdef Q_OS_WIN
SetErrorMode(lastErrorMode);
@@ -573,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) {
@@ -727,6 +715,6 @@
void QCMake::checkOpenPossible()
{
std::string data = this->BinaryDirectory.toStdString();
- auto possible = this->CMakeInstance->Open(data, true);
+ auto possible = this->CMakeInstance->Open(data, cmake::DryRun::Yes);
emit openPossible(possible);
}
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/cmCMakePkgConfigCommand.cxx b/Source/cmCMakePkgConfigCommand.cxx
index ae7b1d3..24676d7 100644
--- a/Source/cmCMakePkgConfigCommand.cxx
+++ b/Source/cmCMakePkgConfigCommand.cxx
@@ -6,6 +6,7 @@
#include <cstdio>
#include <memory>
#include <string>
+#include <unordered_map>
#include <utility>
#include <vector>
@@ -28,12 +29,15 @@
#include "cmStringAlgorithms.h"
#include "cmSubcommandTable.h"
#include "cmSystemTools.h"
+#include "cmTarget.h"
#include "cmValue.h"
#include <cmllpkgc/llpkgc.h>
// IWYU wants this
namespace {
struct ExtractArguments;
+struct PopulateArguments;
+struct ImportArguments;
}
namespace {
@@ -441,89 +445,59 @@
*env.SysLibs += GetPkgConfSysLibs(mf);
}
-cm::optional<cmPkgConfigResult> HandleCommon(CommonArguments& args,
- cmExecutionStatus& status)
+struct ImportEnv
{
+ bool required;
+ bool quiet;
+ bool exact;
+ bool err;
+ CommonArguments::StrictnessType strictness;
+ cmExecutionStatus& status;
+};
- auto& mf = status.GetMakefile();
-
- if (!args.CheckArgs(status)) {
- return {};
+void warn_or_error(std::string const& err, ImportEnv& imEnv)
+{
+ if (imEnv.required) {
+ imEnv.status.SetError(err);
+ cmSystemTools::SetFatalErrorOccurred();
+ } else if (!imEnv.quiet) {
+ imEnv.status.GetMakefile().IssueMessage(MessageType::WARNING, err);
}
+ imEnv.err = true;
+}
- auto warn_or_error = [&](std::string const& err) {
- if (args.Required) {
- status.SetError(err);
- cmSystemTools::SetFatalErrorOccurred();
- } else if (!args.Quiet) {
- mf.IssueMessage(MessageType::WARNING, err);
- }
- };
-
- cm::filesystem::path path{ *args.Package };
-
- cmPkgConfigEnv env;
-
- if (args.PcLibdir) {
- env.LibDirs = std::move(*args.PcLibdir);
- }
-
- if (args.PcPath) {
- env.Path = std::move(*args.PcPath);
- }
-
- if (args.DisableUninstalled) {
- env.DisableUninstalled = args.DisableUninstalled;
- }
-
- if (args.SysrootDir) {
- env.SysrootDir = std::move(*args.SysrootDir);
- }
-
- if (args.TopBuildDir) {
- env.TopBuildDir = std::move(*args.TopBuildDir);
- }
-
- CollectEnv(mf, env, args.EnvMode);
+cm::optional<cmPkgConfigResult> ReadPackage(std::string const& package,
+ ImportEnv& imEnv,
+ cmPkgConfigEnv& pcEnv)
+{
+ cm::optional<cmPkgConfigResult> result;
+ cm::filesystem::path path{ package };
if (path.extension() == ".pc") {
if (!cmSystemTools::FileExists(path.string())) {
- warn_or_error(cmStrCat("Could not find '", *args.Package, "'"));
- return {};
+ return result;
}
} else {
- std::vector<std::string> search;
- if (env.Path) {
- search = *env.Path;
- if (env.LibDirs) {
- search += *env.LibDirs;
- }
- } else if (env.LibDirs) {
- search = *env.LibDirs;
- }
-
- if (env.DisableUninstalled && !*env.DisableUninstalled) {
+ if (pcEnv.DisableUninstalled && !*pcEnv.DisableUninstalled) {
auto uninstalled = path;
uninstalled.concat("-uninstalled.pc");
uninstalled =
- cmSystemTools::FindFile(uninstalled.string(), search, true);
+ cmSystemTools::FindFile(uninstalled.string(), pcEnv.search, true);
if (uninstalled.empty()) {
- path =
- cmSystemTools::FindFile(path.concat(".pc").string(), search, true);
+ path = cmSystemTools::FindFile(path.concat(".pc").string(),
+ pcEnv.search, true);
if (path.empty()) {
- warn_or_error(cmStrCat("Could not find '", *args.Package, "'"));
- return {};
+ return result;
}
} else {
path = uninstalled;
}
} else {
- path =
- cmSystemTools::FindFile(path.concat(".pc").string(), search, true);
+ path = cmSystemTools::FindFile(path.concat(".pc").string(), pcEnv.search,
+ true);
if (path.empty()) {
- warn_or_error(cmStrCat("Could not find '", *args.Package, "'"));
- return {};
+ return result;
}
}
}
@@ -534,8 +508,9 @@
cmsys::ifstream ifs(path.string().c_str(), std::ios::binary);
if (!ifs) {
- warn_or_error(cmStrCat("Could not open file '", path.string(), "'"));
- return {};
+ warn_or_error(cmStrCat("Could not open file '", path.string(), "'"),
+ imEnv);
+ return result;
}
std::unique_ptr<char[]> buf(new char[len]);
@@ -543,8 +518,9 @@
// Shouldn't have hit eof on previous read, should hit eof now
if (ifs.fail() || ifs.eof() || ifs.get() != EOF) {
- warn_or_error(cmStrCat("Error while reading file '", path.string(), "'"));
- return {};
+ warn_or_error(cmStrCat("Error while reading file '", path.string(), "'"),
+ imEnv);
+ return result;
}
using StrictnessType = CommonArguments::StrictnessType;
@@ -552,53 +528,161 @@
cmPkgConfigParser parser;
auto err = parser.Finish(buf.get(), len);
- if (args.Strictness != StrictnessType::STRICTNESS_BEST_EFFORT &&
+ if (imEnv.strictness != StrictnessType::STRICTNESS_BEST_EFFORT &&
err != PCE_OK) {
- warn_or_error(cmStrCat("Parsing failed for file '", path.string(), "'"));
- return {};
+ warn_or_error(cmStrCat("Parsing failed for file '", path.string(), "'"),
+ imEnv);
+ return result;
}
- cm::optional<cmPkgConfigResult> result;
- if (args.Strictness == StrictnessType::STRICTNESS_STRICT) {
- result = cmPkgConfigResolver::ResolveStrict(parser.Data(), std::move(env));
- } else if (args.Strictness == StrictnessType::STRICTNESS_PERMISSIVE) {
- result =
- cmPkgConfigResolver::ResolvePermissive(parser.Data(), std::move(env));
+ if (imEnv.strictness == StrictnessType::STRICTNESS_STRICT) {
+ result = cmPkgConfigResolver::ResolveStrict(parser.Data(), pcEnv);
+ } else if (imEnv.strictness == StrictnessType::STRICTNESS_PERMISSIVE) {
+ result = cmPkgConfigResolver::ResolvePermissive(parser.Data(), pcEnv);
} else {
- result =
- cmPkgConfigResolver::ResolveBestEffort(parser.Data(), std::move(env));
+ result = cmPkgConfigResolver::ResolveBestEffort(parser.Data(), pcEnv);
}
if (!result) {
- warn_or_error(
- cmStrCat("Resolution failed for file '", path.string(), "'"));
- } else if (args.Exact) {
+ warn_or_error(cmStrCat("Resolution failed for file '", path.string(), "'"),
+ imEnv);
+ }
+
+ return result;
+}
+
+cm::optional<cmPkgConfigResult> ImportPackage(
+ std::string const& package, cm::optional<std::string> version,
+ ImportEnv& imEnv, cmPkgConfigEnv& pcEnv)
+{
+ auto result = ReadPackage(package, imEnv, pcEnv);
+
+ if (!result) {
+ if (!imEnv.err) {
+ warn_or_error(cmStrCat("Could not find pkg-config: '", package, "'"),
+ imEnv);
+ }
+ return result;
+ }
+
+ if (imEnv.exact) {
std::string ver;
- if (args.Version) {
- ver = cmPkgConfigResolver::ParseVersion(*args.Version).Version;
+ if (version) {
+ ver = cmPkgConfigResolver::ParseVersion(*version).Version;
}
if (ver != result->Version()) {
warn_or_error(
- cmStrCat("Package '", *args.Package, "' version '", result->Version(),
- "' does not meet exact version requirement '", ver, "'"));
+ cmStrCat("Package '", package, "' version '", result->Version(),
+ "' does not meet exact version requirement '", ver, "'"),
+ imEnv);
return {};
}
- } else if (args.Version) {
- auto rv = cmPkgConfigResolver::ParseVersion(*args.Version);
+ } else if (version) {
+ auto rv = cmPkgConfigResolver::ParseVersion(*version);
if (!cmPkgConfigResolver::CheckVersion(rv, result->Version())) {
warn_or_error(
- cmStrCat("Package '", *args.Package, "' version '", result->Version(),
- "' does not meet version requirement '", *args.Version, "'"));
+ cmStrCat("Package '", package, "' version '", result->Version(),
+ "' does not meet version requirement '", *version, "'"),
+ imEnv);
return {};
}
}
+ result->env = &pcEnv;
return result;
}
+struct pkgStackEntry
+{
+ cmPkgConfigVersionReq ver;
+ std::string parent;
+};
+
+cm::optional<cmPkgConfigResult> ImportPackage(
+ std::string const& package, std::vector<pkgStackEntry> const& reqs,
+ ImportEnv& imEnv, cmPkgConfigEnv& pcEnv)
+{
+ auto result = ReadPackage(package, imEnv, pcEnv);
+
+ if (!result) {
+ if (!imEnv.err) {
+ std::string req_str = cmStrCat("'", reqs.begin()->parent, "'");
+ for (auto it = reqs.begin() + 1; it != reqs.end(); ++it) {
+ req_str = cmStrCat(req_str, ", '", it->parent, "'");
+ }
+ warn_or_error(cmStrCat("Could not find pkg-config: '", package,
+ "' required by: ", req_str),
+ imEnv);
+ }
+ return result;
+ }
+
+ auto ver = result->Version();
+ for (auto const& req : reqs) {
+
+ if (!cmPkgConfigResolver::CheckVersion(req.ver, ver)) {
+ warn_or_error(cmStrCat("Package '", package, "' version '", ver,
+ "' does not meet version requirement '",
+ req.ver.string(), "' ", "of '", req.parent, "'"),
+ imEnv);
+ return {};
+ }
+ }
+
+ result->env = &pcEnv;
+ return result;
+}
+
+cm::optional<std::pair<cmPkgConfigEnv, ImportEnv>> HandleCommon(
+ CommonArguments& args, cmExecutionStatus& status)
+{
+
+ auto& mf = status.GetMakefile();
+
+ if (!args.CheckArgs(status)) {
+ return {};
+ }
+
+ cmPkgConfigEnv pcEnv;
+
+ if (args.PcLibdir) {
+ pcEnv.LibDirs = std::move(*args.PcLibdir);
+ }
+
+ if (args.PcPath) {
+ pcEnv.Path = std::move(*args.PcPath);
+ }
+
+ pcEnv.DisableUninstalled = args.DisableUninstalled;
+
+ if (args.SysrootDir) {
+ pcEnv.SysrootDir = std::move(*args.SysrootDir);
+ }
+
+ if (args.TopBuildDir) {
+ pcEnv.TopBuildDir = std::move(*args.TopBuildDir);
+ }
+
+ CollectEnv(mf, pcEnv, args.EnvMode);
+
+ if (pcEnv.Path) {
+ pcEnv.search = *pcEnv.Path;
+ if (pcEnv.LibDirs) {
+ pcEnv.search += *pcEnv.LibDirs;
+ }
+ } else if (pcEnv.LibDirs) {
+ pcEnv.search = *pcEnv.LibDirs;
+ }
+
+ return std::pair<cmPkgConfigEnv, ImportEnv>{
+ pcEnv,
+ { args.Required, args.Quiet, args.Exact, false, args.Strictness, status }
+ };
+}
+
struct ExtractArguments : CommonArguments
{
cm::optional<bool> AllowSystemIncludes;
@@ -623,35 +707,41 @@
std::vector<std::string> unparsed;
auto parsedArgs = ExtractParser.Parse(args, &unparsed);
- auto maybeResolved = HandleCommon(parsedArgs, status);
+ auto maybeEnv = HandleCommon(parsedArgs, status);
- if (!maybeResolved) {
+ if (!maybeEnv) {
return !parsedArgs.Required;
}
+ auto& pcEnv = maybeEnv->first;
+ auto& imEnv = maybeEnv->second;
- auto& resolved = *maybeResolved;
- auto version = resolved.Version();
+ auto maybePackage =
+ ImportPackage(*parsedArgs.Package, parsedArgs.Version, imEnv, pcEnv);
+ if (!maybePackage) {
+ return !parsedArgs.Required;
+ }
+ auto& package = *maybePackage;
if (parsedArgs.AllowSystemIncludes) {
- resolved.env.AllowSysCflags = *parsedArgs.AllowSystemIncludes;
+ pcEnv.AllowSysCflags = *parsedArgs.AllowSystemIncludes;
}
if (parsedArgs.AllowSystemLibs) {
- resolved.env.AllowSysLibs = *parsedArgs.AllowSystemLibs;
+ pcEnv.AllowSysLibs = *parsedArgs.AllowSystemLibs;
}
if (parsedArgs.SystemIncludeDirs) {
- resolved.env.SysCflags = *parsedArgs.SystemIncludeDirs;
+ pcEnv.SysCflags = *parsedArgs.SystemIncludeDirs;
}
if (parsedArgs.SystemLibraryDirs) {
- resolved.env.SysLibs = *parsedArgs.SystemLibraryDirs;
+ pcEnv.SysLibs = *parsedArgs.SystemLibraryDirs;
}
auto& mf = status.GetMakefile();
- mf.AddDefinition("CMAKE_PKG_CONFIG_NAME", resolved.Name());
- mf.AddDefinition("CMAKE_PKG_CONFIG_DESCRIPTION", resolved.Description());
- mf.AddDefinition("CMAKE_PKG_CONFIG_VERSION", version);
+ mf.AddDefinition("CMAKE_PKG_CONFIG_NAME", package.Name());
+ mf.AddDefinition("CMAKE_PKG_CONFIG_DESCRIPTION", package.Description());
+ mf.AddDefinition("CMAKE_PKG_CONFIG_VERSION", package.Version());
auto make_list = [&](char const* def,
std::vector<cmPkgConfigDependency> const& deps) {
@@ -665,26 +755,26 @@
mf.AddDefinition(def, cmList::to_string(vec));
};
- make_list("CMAKE_PKG_CONFIG_CONFLICTS", resolved.Conflicts());
- make_list("CMAKE_PKG_CONFIG_PROVIDES", resolved.Provides());
- make_list("CMAKE_PKG_CONFIG_REQUIRES", resolved.Requires());
- make_list("CMAKE_PKG_CONFIG_REQUIRES_PRIVATE", resolved.Requires(true));
+ make_list("CMAKE_PKG_CONFIG_CONFLICTS", package.Conflicts());
+ make_list("CMAKE_PKG_CONFIG_PROVIDES", package.Provides());
+ make_list("CMAKE_PKG_CONFIG_REQUIRES", package.Requires());
+ make_list("CMAKE_PKG_CONFIG_REQUIRES_PRIVATE", package.Requires(true));
- auto cflags = resolved.Cflags();
+ auto cflags = package.Cflags();
mf.AddDefinition("CMAKE_PKG_CONFIG_CFLAGS", cflags.Flagline);
mf.AddDefinition("CMAKE_PKG_CONFIG_INCLUDES",
cmList::to_string(cflags.Includes));
mf.AddDefinition("CMAKE_PKG_CONFIG_COMPILE_OPTIONS",
cmList::to_string(cflags.CompileOptions));
- cflags = resolved.Cflags(true);
+ cflags = package.Cflags(true);
mf.AddDefinition("CMAKE_PKG_CONFIG_CFLAGS_PRIVATE", cflags.Flagline);
mf.AddDefinition("CMAKE_PKG_CONFIG_INCLUDES_PRIVATE",
cmList::to_string(cflags.Includes));
mf.AddDefinition("CMAKE_PKG_CONFIG_COMPILE_OPTIONS_PRIVATE",
cmList::to_string(cflags.CompileOptions));
- auto libs = resolved.Libs();
+ auto libs = package.Libs();
mf.AddDefinition("CMAKE_PKG_CONFIG_LIBS", libs.Flagline);
mf.AddDefinition("CMAKE_PKG_CONFIG_LIBDIRS",
cmList::to_string(libs.LibDirs));
@@ -693,7 +783,7 @@
mf.AddDefinition("CMAKE_PKG_CONFIG_LINK_OPTIONS",
cmList::to_string(libs.LinkOptions));
- libs = resolved.Libs(true);
+ libs = package.Libs(true);
mf.AddDefinition("CMAKE_PKG_CONFIG_LIBS_PRIVATE", libs.Flagline);
mf.AddDefinition("CMAKE_PKG_CONFIG_LIBDIRS_PRIVATE",
cmList::to_string(libs.LibDirs));
@@ -704,6 +794,246 @@
return true;
}
+
+using pkgStack = std::unordered_map<std::string, std::vector<pkgStackEntry>>;
+using pkgProviders = std::unordered_map<std::string, std::string>;
+
+cmTarget* CreateCMakeTarget(std::string const& name, std::string const& prefix,
+ cmPkgConfigResult& pkg, pkgProviders& providers,
+ cmMakefile& mf)
+{
+ auto* tgt = mf.AddForeignTarget("pkgcfg", cmStrCat(prefix, name));
+
+ tgt->AppendProperty("VERSION", pkg.Version());
+
+ auto libs = pkg.Libs();
+ for (auto const& flag : libs.LibNames) {
+ tgt->AppendProperty("INTERFACE_LINK_LIBRARIES", flag.substr(2));
+ }
+ for (auto const& flag : libs.LibDirs) {
+ tgt->AppendProperty("INTERFACE_LINK_DIRECTORIES", flag.substr(2));
+ }
+ tgt->AppendProperty("INTERFACE_LINK_OPTIONS",
+ cmList::to_string(libs.LinkOptions));
+
+ auto cflags = pkg.Cflags();
+ for (auto const& flag : cflags.Includes) {
+ tgt->AppendProperty("INTERFACE_INCLUDE_DIRECTORIES", flag.substr(2));
+ }
+ tgt->AppendProperty("INTERFACE_COMPILE_OPTIONS",
+ cmList::to_string(cflags.CompileOptions));
+
+ for (auto& dep : pkg.Requires()) {
+ auto it = providers.find(dep.Name);
+ if (it != providers.end()) {
+ tgt->AppendProperty("INTERFACE_LINK_LIBRARIES", it->second);
+ continue;
+ }
+
+ tgt->AppendProperty("INTERFACE_LINK_LIBRARIES",
+ cmStrCat("@foreign_pkgcfg::", prefix, dep.Name));
+ }
+ return tgt;
+}
+
+bool CheckPackageDependencies(
+ std::string const& name, std::string const& prefix, cmPkgConfigResult& pkg,
+ pkgStack& inStack,
+ std::unordered_map<std::string, cmPkgConfigResult>& outStack,
+ pkgProviders& providers, ImportEnv& imEnv)
+{
+ for (auto& dep : pkg.Requires()) {
+ auto prov_it = providers.find(dep.Name);
+ if (prov_it != providers.end()) {
+ continue;
+ }
+
+ auto* tgt = imEnv.status.GetMakefile().FindTargetToUse(
+ cmStrCat("@foreign_pkgcfg::", prefix, dep.Name),
+ cmStateEnums::TargetDomain::FOREIGN);
+ if (tgt) {
+ auto ver = tgt->GetProperty("VERSION");
+ if (!cmPkgConfigResolver::CheckVersion(dep.VerReq, *ver)) {
+ warn_or_error(cmStrCat("Package '", dep.Name, "' version '", *ver,
+ "' does not meet version requirement '",
+ dep.VerReq.string(), "' ", "of '", name, "'"),
+ imEnv);
+ return false;
+ }
+ continue;
+ }
+
+ auto it = outStack.find(dep.Name);
+ if (it != outStack.end()) {
+ auto ver = it->second.Version();
+ if (!cmPkgConfigResolver::CheckVersion(dep.VerReq, ver)) {
+ warn_or_error(cmStrCat("Package '", dep.Name, "' version '", ver,
+ "' does not meet version requirement '",
+ dep.VerReq.string(), "' ", "of '", name, "'"),
+ imEnv);
+ return false;
+ }
+ continue;
+ }
+
+ inStack[dep.Name].emplace_back(
+ pkgStackEntry{ std::move(dep.VerReq), name });
+ }
+
+ return true;
+}
+
+struct PopulateArguments : CommonArguments
+{
+ cm::optional<std::string> Prefix;
+ cm::optional<ArgumentParser::MaybeEmpty<std::vector<std::string>>> Providers;
+};
+
+#define BIND_POPULATE(argtype) \
+ BIND_COMMON(argtype) \
+ .Bind("PREFIX"_s, &argtype::Prefix) \
+ .Bind("BIND_PC_REQUIRES"_s, &argtype::Providers)
+
+auto const PopulateParser = BIND_POPULATE(PopulateArguments);
+
+std::pair<bool, bool> PopulatePCTarget(PopulateArguments& args,
+ cmExecutionStatus& status)
+{
+
+ std::string prefix = args.Prefix ? cmStrCat(*args.Prefix, "_"_s) : "";
+
+ auto& mf = status.GetMakefile();
+ auto maybeEnv = HandleCommon(args, status);
+
+ if (!maybeEnv) {
+ return { !args.Required, false };
+ }
+ auto& pcEnv = maybeEnv->first;
+ auto& imEnv = maybeEnv->second;
+
+ pkgProviders providers;
+ if (args.Providers) {
+ for (auto const& provider_str : *args.Providers) {
+ auto assignment = provider_str.find('=');
+ if (assignment != std::string::npos) {
+ providers.emplace(provider_str.substr(0, assignment),
+ provider_str.substr(assignment + 1));
+ } else {
+ imEnv.status.SetError(cmStrCat(
+ "No '=' found in BIND_PC_REQUIRES argument '", provider_str, "'"));
+ cmSystemTools::SetFatalErrorOccurred();
+ return { false, false };
+ }
+ }
+ }
+
+ pkgStack inStack;
+ std::unordered_map<std::string, cmPkgConfigResult> outStack;
+
+ auto maybePackage = ImportPackage(*args.Package, args.Version, imEnv, pcEnv);
+ if (!maybePackage) {
+ return { !args.Required, false };
+ }
+ imEnv.exact = false;
+
+ if (!CheckPackageDependencies(*args.Package, prefix, *maybePackage, inStack,
+ outStack, providers, imEnv)) {
+ return { !args.Required, false };
+ }
+ outStack[*args.Package] = std::move(*maybePackage);
+
+ while (!inStack.empty()) {
+ auto name = inStack.begin()->first;
+ auto reqs = inStack.begin()->second;
+ maybePackage = ImportPackage(name, reqs, imEnv, pcEnv);
+ if (!maybePackage) {
+ return { !args.Required, false };
+ }
+ if (!CheckPackageDependencies(name, prefix, *maybePackage, inStack,
+ outStack, providers, imEnv)) {
+ return { !args.Required, false };
+ }
+ inStack.erase(name);
+ outStack[std::move(name)] = std::move(*maybePackage);
+ }
+
+ for (auto& entry : outStack) {
+ CreateCMakeTarget(entry.first, prefix, entry.second, providers, mf);
+ }
+
+ return { true, true };
+}
+
+bool HandlePopulateCommand(std::vector<std::string> const& args,
+ cmExecutionStatus& status)
+{
+ std::vector<std::string> unparsed;
+ auto parsedArgs = PopulateParser.Parse(args, &unparsed);
+
+ std::string prefix =
+ parsedArgs.Prefix ? cmStrCat(*parsedArgs.Prefix, "_"_s) : "";
+
+ auto foreign_name =
+ cmStrCat("@foreign_pkgcfg::", prefix, *parsedArgs.Package);
+ auto found_var = cmStrCat("PKGCONFIG_", *parsedArgs.Package, "_FOUND");
+
+ auto& mf = status.GetMakefile();
+
+ if (mf.FindTargetToUse(foreign_name, cmStateEnums::TargetDomain::FOREIGN)) {
+ mf.AddDefinition(found_var, "TRUE");
+ return true;
+ }
+
+ auto result = PopulatePCTarget(parsedArgs, status);
+ mf.AddDefinition(found_var, result.second ? "TRUE" : "FALSE");
+ return result.first;
+}
+
+struct ImportArguments : PopulateArguments
+{
+ cm::optional<std::string> Name;
+};
+
+auto const ImportParser =
+ BIND_POPULATE(ImportArguments).Bind("NAME"_s, &ImportArguments::Name);
+
+bool HandleImportCommand(std::vector<std::string> const& args,
+ cmExecutionStatus& status)
+{
+ std::vector<std::string> unparsed;
+ auto parsedArgs = ImportParser.Parse(args, &unparsed);
+
+ std::string prefix =
+ parsedArgs.Prefix ? cmStrCat(*parsedArgs.Prefix, "_"_s) : "";
+
+ auto foreign_name =
+ cmStrCat("@foreign_pkgcfg::", prefix, *parsedArgs.Package);
+ auto local_name =
+ cmStrCat("PkgConfig::", parsedArgs.Name.value_or(*parsedArgs.Package));
+ auto found_var = cmStrCat("PKGCONFIG_", *parsedArgs.Package, "_FOUND");
+
+ auto& mf = status.GetMakefile();
+
+ if (mf.FindTargetToUse(local_name)) {
+ mf.AddDefinition(found_var, "TRUE");
+ return true;
+ }
+
+ if (!mf.FindTargetToUse(foreign_name, cmStateEnums::TargetDomain::FOREIGN)) {
+ auto result = PopulatePCTarget(parsedArgs, status);
+ if (!result.second) {
+ mf.AddDefinition(found_var, "FALSE");
+ return result.first;
+ }
+ }
+
+ mf.AddDefinition(found_var, "TRUE");
+ auto* tgt = mf.AddImportedTarget(
+ local_name, cmStateEnums::TargetType::INTERFACE_LIBRARY, false);
+ tgt->AppendProperty("INTERFACE_LINK_LIBRARIES", foreign_name);
+ return true;
+}
+
} // namespace
bool cmCMakePkgConfigCommand(std::vector<std::string> const& args,
@@ -716,6 +1046,8 @@
static cmSubcommandTable const subcommand{
{ "EXTRACT"_s, HandleExtractCommand },
+ { "POPULATE"_s, HandlePopulateCommand },
+ { "IMPORT"_s, HandleImportCommand },
};
return subcommand(args[0], args, status);
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index 8f691bf..f5af092 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -1556,7 +1556,7 @@
auto result = settingsFile.ReadProjectPresets(workingDirectory);
if (result != true) {
cmSystemTools::Error(cmStrCat("Could not read presets from ",
- workingDirectory, ":",
+ workingDirectory, ":\n",
settingsFile.parseState.GetErrorMessage()));
return false;
}
@@ -2527,6 +2527,20 @@
this->Impl->TestOptions.ScheduleRandom = true;
return true;
} },
+ CommandArgument{
+ "--schedule-random-seed", CommandArgument::Values::One,
+ [this](std::string const& sz) -> bool {
+ unsigned long seed_value;
+ if (cmStrToULong(sz, &seed_value)) {
+ this->Impl->TestOptions.ScheduleRandomSeed =
+ static_cast<unsigned int>(seed_value);
+ } else {
+ cmCTestLog(this, WARNING,
+ "Invalid value for '--schedule-random-seed': " << sz
+ << "\n");
+ }
+ return true;
+ } },
CommandArgument{ "--rerun-failed", CommandArgument::Values::Zero,
[this](std::string const&) -> bool {
this->Impl->TestOptions.RerunFailed = true;
@@ -2795,6 +2809,11 @@
}
}
+cm::optional<unsigned int> cmCTest::GetRandomSeed() const
+{
+ return this->Impl->TestOptions.ScheduleRandomSeed;
+}
+
std::string cmCTest::GetScheduleType() const
{
return this->Impl->ScheduleType;
diff --git a/Source/cmCTest.h b/Source/cmCTest.h
index 53e9b0e..cc240cc 100644
--- a/Source/cmCTest.h
+++ b/Source/cmCTest.h
@@ -198,6 +198,8 @@
std::string GetScheduleType() const;
void SetScheduleType(std::string const& type);
+ cm::optional<unsigned int> GetRandomSeed() const;
+
/** The max output width */
int GetMaxTestNameWidth() const;
void SetMaxTestNameWidth(int w);
diff --git a/Source/cmCurl.h b/Source/cmCurl.h
index 933a173..b588c5f 100644
--- a/Source/cmCurl.h
+++ b/Source/cmCurl.h
@@ -11,6 +11,11 @@
#include <cm3p/curl/curl.h>
+// curl versions before 7.87.0 did not provide CURL_WRITEFUNC_ERROR
+#if defined(LIBCURL_VERSION_NUM) && LIBCURL_VERSION_NUM < 0x075700
+# define CURL_WRITEFUNC_ERROR 0xFFFFFFFF
+#endif
+
void cmCurlInitOnce();
cm::optional<int> cmCurlParseTLSVersion(cm::string_view tls_version);
cm::optional<std::string> cmCurlPrintTLSVersion(int curl_tls_version);
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/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index e9f234f..78dda57 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -1703,7 +1703,9 @@
cmsys::ofstream* fout = static_cast<cmsys::ofstream*>(data);
if (fout) {
char const* chPtr = static_cast<char*>(ptr);
- fout->write(chPtr, realsize);
+ if (!fout->write(chPtr, realsize)) {
+ return CURL_WRITEFUNC_ERROR;
+ }
}
return realsize;
}
@@ -2283,6 +2285,14 @@
g_curl.release();
::curl_easy_cleanup(curl);
+ // Explicitly close the file so we can check for write errors.
+ if (!file.empty()) {
+ fout.close();
+ if (!fout) {
+ res = CURLE_WRITE_ERROR;
+ }
+ }
+
if (!statusVar.empty()) {
std::string m = curl_easy_strerror(res);
if ((res == CURLE_SSL_CONNECT_ERROR ||
@@ -2306,13 +2316,6 @@
status.GetMakefile().AddDefinition(logVar, chunkDebug.data());
}
- // Explicitly flush/close so we can measure the md5 accurately.
- //
- if (!file.empty()) {
- fout.flush();
- fout.close();
- }
-
// Verify MD5 sum if requested:
//
if (hash) {
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..2a4f347 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -1274,16 +1274,20 @@
std::string configProp = cmStrCat("COMPILE_PDB_NAME_", configUpper);
cmValue config_name = this->GetProperty(configProp);
if (cmNonempty(config_name)) {
+ std::string pdbName = cmGeneratorExpression::Evaluate(
+ *config_name, this->LocalGenerator, config, this);
NameComponents const& components = GetFullNameInternalComponents(
config, cmStateEnums::RuntimeBinaryArtifact);
- return components.prefix + *config_name + ".pdb";
+ return components.prefix + pdbName + ".pdb";
}
cmValue name = this->GetProperty("COMPILE_PDB_NAME");
if (cmNonempty(name)) {
+ std::string pdbName = cmGeneratorExpression::Evaluate(
+ *name, this->LocalGenerator, config, this);
NameComponents const& components = GetFullNameInternalComponents(
config, cmStateEnums::RuntimeBinaryArtifact);
- return components.prefix + *name + ".pdb";
+ return components.prefix + pdbName + ".pdb";
}
return "";
@@ -3771,26 +3775,50 @@
std::string cmGeneratorTarget::GetPDBOutputName(
std::string const& config) const
{
- std::string base =
- this->GetOutputName(config, cmStateEnums::RuntimeBinaryArtifact);
+ // Lookup/compute/cache the pdb output name for this configuration.
+ auto i = this->PdbOutputNameMap.find(config);
+ if (i == this->PdbOutputNameMap.end()) {
+ // Add empty name in map to detect potential recursion.
+ PdbOutputNameMapType::value_type entry(config, "");
+ i = this->PdbOutputNameMap.insert(entry).first;
- std::vector<std::string> props;
- std::string configUpper = cmSystemTools::UpperCase(config);
- if (!configUpper.empty()) {
- // PDB_NAME_<CONFIG>
- props.push_back("PDB_NAME_" + configUpper);
- }
-
- // PDB_NAME
- props.emplace_back("PDB_NAME");
-
- for (std::string const& p : props) {
- if (cmValue outName = this->GetProperty(p)) {
- base = *outName;
- break;
+ // Compute output name.
+ std::vector<std::string> props;
+ std::string configUpper = cmSystemTools::UpperCase(config);
+ if (!configUpper.empty()) {
+ // PDB_NAME_<CONFIG>
+ props.push_back("PDB_NAME_" + configUpper);
}
+
+ // PDB_NAME
+ props.emplace_back("PDB_NAME");
+
+ std::string outName;
+ for (std::string const& p : props) {
+ if (cmValue outNameProp = this->GetProperty(p)) {
+ outName = *outNameProp;
+ break;
+ }
+ }
+
+ // Now evaluate genex and update the previously-prepared map entry.
+ if (outName.empty()) {
+ i->second =
+ this->GetOutputName(config, cmStateEnums::RuntimeBinaryArtifact) +
+ this->GetFilePostfix(config);
+ } else {
+ i->second =
+ cmGeneratorExpression::Evaluate(outName, this->LocalGenerator, config);
+ }
+ } else if (i->second.empty()) {
+ // An empty map entry indicates we have been called recursively
+ // from the above block.
+ this->LocalGenerator->GetCMakeInstance()->IssueMessage(
+ MessageType::FATAL_ERROR,
+ "Target '" + this->GetName() + "' PDB_NAME depends on itself.",
+ this->GetBacktrace());
}
- return base;
+ return i->second;
}
std::string cmGeneratorTarget::GetPDBName(std::string const& config) const
@@ -3798,22 +3826,9 @@
NameComponents const& parts = this->GetFullNameInternalComponents(
config, cmStateEnums::RuntimeBinaryArtifact);
- std::vector<std::string> props;
- std::string configUpper = cmSystemTools::UpperCase(config);
- if (!configUpper.empty()) {
- // PDB_NAME_<CONFIG>
- props.push_back("PDB_NAME_" + configUpper);
- }
+ std::string base = this->GetPDBOutputName(config);
- // PDB_NAME
- props.emplace_back("PDB_NAME");
-
- for (std::string const& p : props) {
- if (cmValue outName = this->GetProperty(p)) {
- return parts.prefix + *outName + ".pdb";
- }
- }
- return parts.prefix + parts.base + ".pdb";
+ return parts.prefix + base + ".pdb";
}
std::string cmGeneratorTarget::GetObjectDirectory(
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index 083de54..e17f500 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -1372,6 +1372,9 @@
using OutputInfoMapType = std::map<std::string, OutputInfo>;
mutable OutputInfoMapType OutputInfoMap;
+ using PdbOutputNameMapType = std::map<std::string, std::string>;
+ mutable PdbOutputNameMapType PdbOutputNameMap;
+
using ModuleDefinitionInfoMapType =
std::map<std::string, ModuleDefinitionInfo>;
mutable ModuleDefinitionInfoMapType ModuleDefinitionInfoMap;
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..8f9a471 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);
@@ -420,20 +419,30 @@
void cmGlobalNinjaGenerator::AddMacOSXContentRule()
{
- cmNinjaRule rule("COPY_OSX_CONTENT");
- rule.Command = cmStrCat(this->CMakeCmd(), " -E copy $in $out");
- rule.Description = "Copying OS X Content $out";
- rule.Comment = "Rule for copying OS X bundle content file.";
- this->AddRule(rule);
+ {
+ cmNinjaRule rule("COPY_OSX_CONTENT_FILE");
+ rule.Command = cmStrCat(this->CMakeCmd(), " -E copy $in $out");
+ rule.Description = "Copying OS X Content $out";
+ rule.Comment = "Rule for copying OS X bundle content file, with style.";
+ this->AddRule(rule);
+ }
+ {
+ cmNinjaRule rule("COPY_OSX_CONTENT_DIR");
+ rule.Command = cmStrCat(this->CMakeCmd(), " -E copy_directory $in $out");
+ rule.Description = "Copying OS X Content $out";
+ rule.Comment = "Rule for copying OS X bundle content dir, with style.";
+ this->AddRule(rule);
+ }
}
-
void cmGlobalNinjaGenerator::WriteMacOSXContentBuild(std::string input,
std::string output,
std::string const& config)
{
this->AddMacOSXContentRule();
{
- cmNinjaBuild build("COPY_OSX_CONTENT");
+ cmNinjaBuild build(cmSystemTools::FileIsDirectory(input)
+ ? "COPY_OSX_CONTENT_DIR"
+ : "COPY_OSX_CONTENT_FILE");
build.Outputs.push_back(std::move(output));
build.ExplicitDeps.push_back(std::move(input));
this->WriteBuild(*this->GetImplFileStream(config), build);
@@ -1223,11 +1232,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 +1244,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 +1254,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/cmInstrumentation.cxx b/Source/cmInstrumentation.cxx
index 3d743dc..4f92bfb 100644
--- a/Source/cmInstrumentation.cxx
+++ b/Source/cmInstrumentation.cxx
@@ -148,6 +148,16 @@
auto query = cmInstrumentationQuery();
query.ReadJSON(file, this->errorMsg, this->queries, this->hooks,
this->callbacks);
+ if (!this->errorMsg.empty()) {
+ cmSystemTools::Error(cmStrCat(
+ "Could not load instrumentation queries from ",
+ cmSystemTools::GetParentDirectory(file), ":\n", this->errorMsg));
+ }
+}
+
+bool cmInstrumentation::HasErrors() const
+{
+ return !this->errorMsg.empty();
}
void cmInstrumentation::WriteJSONQuery(
diff --git a/Source/cmInstrumentation.h b/Source/cmInstrumentation.h
index b044885..901f1cb 100644
--- a/Source/cmInstrumentation.h
+++ b/Source/cmInstrumentation.h
@@ -53,7 +53,7 @@
int CollectTimingAfterBuild(int ppid);
void AddHook(cmInstrumentationQuery::Hook hook);
void AddQuery(cmInstrumentationQuery::Query query);
- std::string errorMsg;
+ bool HasErrors() const;
std::string const& GetCDashDir();
private:
@@ -83,5 +83,6 @@
std::vector<std::string> queryFiles;
std::map<std::string, std::string> cdashSnippetsMap;
Json::Value preTestStats;
+ std::string errorMsg;
bool hasQuery = false;
};
diff --git a/Source/cmJSONState.cxx b/Source/cmJSONState.cxx
index d9ba87e..4827940 100644
--- a/Source/cmJSONState.cxx
+++ b/Source/cmJSONState.cxx
@@ -4,20 +4,24 @@
#include "cmJSONState.h"
#include <iterator>
+#include <memory>
#include <sstream>
#include <cm3p/json/reader.h>
#include <cm3p/json/value.h>
+#include <cm3p/json/version.h>
#include "cmsys/FStream.hxx"
#include "cmStringAlgorithms.h"
+#include "cmSystemTools.h"
-cmJSONState::cmJSONState(std::string const& filename, Json::Value* root)
+cmJSONState::cmJSONState(std::string jsonFile, Json::Value* root)
+ : Filename(std::move(jsonFile))
{
- cmsys::ifstream fin(filename.c_str(), std::ios::in | std::ios::binary);
+ cmsys::ifstream fin(this->Filename.c_str(), std::ios::in | std::ios::binary);
if (!fin) {
- this->AddError(cmStrCat("File not found: ", filename));
+ this->AddError(cmStrCat("File not found: ", this->Filename));
return;
}
// If there's a BOM, toss it.
@@ -33,14 +37,27 @@
}
fin.seekg(finBegin);
- // Parse the document.
Json::CharReaderBuilder builder;
Json::CharReaderBuilder::strictMode(&builder.settings_);
std::string errMsg;
+
+#if JSONCPP_VERSION_HEXA >= 0x01090600
+ // Has StructuredError
+ std::unique_ptr<Json::CharReader> const reader(builder.newCharReader());
+ reader->parse(doc.data(), doc.data() + doc.size(), root, &errMsg);
+ std::vector<Json::CharReader::StructuredError> structuredErrors =
+ reader->getStructuredErrors();
+ for (auto const& structuredError : structuredErrors) {
+ this->AddErrorAtOffset(structuredError.message,
+ structuredError.offset_start);
+ }
+#else
+ // No StructuredError Available, Use error string from jsonCpp
if (!Json::parseFromStream(builder, fin, root, &errMsg)) {
- errMsg = cmStrCat("JSON Parse Error: ", filename, ":\n", errMsg);
+ errMsg = cmStrCat("JSON Parse Error: ", this->Filename, ":\n", errMsg);
this->AddError(errMsg);
}
+#endif
}
void cmJSONState::AddError(std::string const& errMsg)
@@ -72,16 +89,17 @@
std::string cmJSONState::GetErrorMessage(bool showContext)
{
std::string message;
+ std::string filenameName = cmSystemTools::GetFilenameName(this->Filename);
for (auto const& error : this->errors) {
+ Location loc = error.GetLocation();
+ if (!filenameName.empty() && loc.line > 0) {
+ message = cmStrCat(message, filenameName, ':', loc.line, ": ");
+ }
message = cmStrCat(message, error.GetErrorMessage(), "\n");
- if (showContext) {
- Location loc = error.GetLocation();
- if (loc.column > 0) {
- message = cmStrCat(message, GetJsonContext(loc), "\n");
- }
+ if (showContext && loc.line > 0) {
+ message = cmStrCat(message, GetJsonContext(loc), "\n");
}
}
- message = cmStrCat("\n", message);
message.pop_back();
return message;
}
diff --git a/Source/cmJSONState.h b/Source/cmJSONState.h
index 6bb9a46..8d5731d 100644
--- a/Source/cmJSONState.h
+++ b/Source/cmJSONState.h
@@ -9,8 +9,6 @@
#include <utility>
#include <vector>
-#include "cmStringAlgorithms.h"
-
namespace Json {
class Value;
}
@@ -26,7 +24,7 @@
public:
using JsonPair = std::pair<std::string const, Json::Value const*>;
cmJSONState() = default;
- cmJSONState(std::string const& filename, Json::Value* root);
+ cmJSONState(std::string jsonFile, Json::Value* root);
void AddError(std::string const& errMsg);
void AddErrorAtValue(std::string const& errMsg, Json::Value const* value);
void AddErrorAtOffset(std::string const& errMsg, std::ptrdiff_t offset);
@@ -46,15 +44,7 @@
Error(std::string errMsg)
: location({ -1, -1 })
, message(std::move(errMsg)) {};
- std::string GetErrorMessage() const
- {
- std::string output = message;
- if (location.line > 0) {
- output = cmStrCat("Error: @", location.line, ",", location.column,
- ": ", output);
- }
- return output;
- }
+ std::string GetErrorMessage() const { return message; }
Location GetLocation() const { return location; }
private:
@@ -70,4 +60,5 @@
private:
std::string GetJsonContext(Location loc);
Location LocateInDocument(ptrdiff_t offset);
+ std::string Filename;
};
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/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index ae98399..aa28c86 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -2043,7 +2043,7 @@
}
this->WriteProjectSCC(fout, target);
/* clang-format off */
- fout<< "\tKeyword=\"" << keyword << "\">\n"
+ fout<< "\tKeyword=\"" << keyword << "\"\n"
"\tProjectGUID=\"{" << gg->GetGUID(libName) << "}\">\n"
"\t<Platforms>\n"
"\t\t<Platform\n\t\t\tName=\"" << gg->GetPlatformName() << "\"/>\n"
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index beca10d..7b2e6b1 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -525,7 +525,8 @@
this->IssueMessage(MessageType::FATAL_ERROR, error);
}
result = false;
- if (this->GetCMakeInstance()->GetWorkingMode() != cmake::NORMAL_MODE) {
+ if (this->GetCMakeInstance()->GetCommandFailureAction() ==
+ cmake::CommandFailureAction::FATAL_ERROR) {
cmSystemTools::SetFatalErrorOccurred();
}
}
@@ -3805,14 +3806,14 @@
cmTarget* cmMakefile::AddForeignTarget(std::string const& origin,
std::string const& name)
{
+ auto foreign_name = cmStrCat("@foreign_", origin, "::", name);
std::unique_ptr<cmTarget> target(new cmTarget(
- cmStrCat("@foreign_", origin, "::", name),
- cmStateEnums::TargetType::INTERFACE_LIBRARY, cmTarget::Visibility::Foreign,
- this, cmTarget::PerConfig::Yes));
+ foreign_name, cmStateEnums::TargetType::INTERFACE_LIBRARY,
+ cmTarget::Visibility::Foreign, this, cmTarget::PerConfig::Yes));
- this->ImportedTargets[name] = target.get();
+ this->ImportedTargets[foreign_name] = target.get();
this->GetGlobalGenerator()->IndexTarget(target.get());
- this->GetStateSnapshot().GetDirectory().AddImportedTargetName(name);
+ this->GetStateSnapshot().GetDirectory().AddImportedTargetName(foreign_name);
this->ImportedTargetsOwned.push_back(std::move(target));
return this->ImportedTargetsOwned.back().get();
@@ -4043,14 +4044,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/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 21c1d19..e682efc 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -617,7 +617,9 @@
this->Generator->LocalGenerator->AppendEcho(
commands, copyEcho, cmLocalUnixMakefileGenerator3::EchoBuild);
std::string copyCommand =
- cmStrCat("$(CMAKE_COMMAND) -E copy ",
+ cmStrCat(cmSystemTools::FileIsDirectory(input)
+ ? "$(CMAKE_COMMAND) -E copy_directory "
+ : "$(CMAKE_COMMAND) -E copy ",
this->Generator->LocalGenerator->ConvertToOutputFormat(
input, cmOutputConverter::SHELL),
' ',
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/cmPkgConfigResolver.cxx b/Source/cmPkgConfigResolver.cxx
index 0180245..95110bd 100644
--- a/Source/cmPkgConfigResolver.cxx
+++ b/Source/cmPkgConfigResolver.cxx
@@ -16,6 +16,7 @@
#include <cm/string_view>
#include "cmPkgConfigParser.h"
+#include "cmStringAlgorithms.h"
namespace {
@@ -57,6 +58,27 @@
} // namespace
+std::string cmPkgConfigVersionReq::string() const
+{
+ switch (Operation) {
+ case ANY:
+ return "";
+ case LT:
+ return cmStrCat("<", Version);
+ case LT_EQ:
+ return cmStrCat("<=", Version);
+ case EQ:
+ return cmStrCat("=", Version);
+ case NEQ:
+ return cmStrCat("!=", Version);
+ case GT_EQ:
+ return cmStrCat(">=", Version);
+ case GT:
+ return cmStrCat(">", Version);
+ }
+ return "";
+}
+
std::string cmPkgConfigResult::StrOrDefault(std::string const& key,
cm::string_view def)
{
@@ -127,24 +149,24 @@
auto tokens = cmPkgConfigResolver::TokenizeFlags(cflags);
- if (env.AllowSysCflags) {
- if (env.SysrootDir) {
- return cmPkgConfigResolver::MangleCflags(tokens, *env.SysrootDir);
+ if (env->AllowSysCflags) {
+ if (env->SysrootDir) {
+ return cmPkgConfigResolver::MangleCflags(tokens, *env->SysrootDir);
}
return cmPkgConfigResolver::MangleCflags(tokens);
}
- if (env.SysCflags) {
- if (env.SysrootDir) {
- return cmPkgConfigResolver::MangleCflags(tokens, *env.SysrootDir,
- *env.SysCflags);
+ if (env->SysCflags) {
+ if (env->SysrootDir) {
+ return cmPkgConfigResolver::MangleCflags(tokens, *env->SysrootDir,
+ *env->SysCflags);
}
- return cmPkgConfigResolver::MangleCflags(tokens, *env.SysCflags);
+ return cmPkgConfigResolver::MangleCflags(tokens, *env->SysCflags);
}
- if (env.SysrootDir) {
+ if (env->SysrootDir) {
return cmPkgConfigResolver::MangleCflags(
- tokens, *env.SysrootDir, std::vector<std::string>{ "/usr/include" });
+ tokens, *env->SysrootDir, std::vector<std::string>{ "/usr/include" });
}
return cmPkgConfigResolver::MangleCflags(
@@ -160,24 +182,24 @@
auto tokens = cmPkgConfigResolver::TokenizeFlags(it->second);
- if (env.AllowSysLibs) {
- if (env.SysrootDir) {
- return cmPkgConfigResolver::MangleLibs(tokens, *env.SysrootDir);
+ if (env->AllowSysLibs) {
+ if (env->SysrootDir) {
+ return cmPkgConfigResolver::MangleLibs(tokens, *env->SysrootDir);
}
return cmPkgConfigResolver::MangleLibs(tokens);
}
- if (env.SysLibs) {
- if (env.SysrootDir) {
- return cmPkgConfigResolver::MangleLibs(tokens, *env.SysrootDir,
- *env.SysLibs);
+ if (env->SysLibs) {
+ if (env->SysrootDir) {
+ return cmPkgConfigResolver::MangleLibs(tokens, *env->SysrootDir,
+ *env->SysLibs);
}
- return cmPkgConfigResolver::MangleLibs(tokens, *env.SysLibs);
+ return cmPkgConfigResolver::MangleLibs(tokens, *env->SysLibs);
}
- if (env.SysrootDir) {
+ if (env->SysrootDir) {
return cmPkgConfigResolver::MangleLibs(
- tokens, *env.SysrootDir, std::vector<std::string>{ "/usr/lib" });
+ tokens, *env->SysrootDir, std::vector<std::string>{ "/usr/lib" });
}
return cmPkgConfigResolver::MangleLibs(
@@ -210,7 +232,7 @@
config.Variables["pc_top_builddir"] = *env.TopBuildDir;
}
- config.env = std::move(env);
+ config.env = &env;
for (auto const& entry : entries) {
std::string key(entry.Key);
@@ -288,7 +310,7 @@
result.Variables["pc_top_builddir"] = *env.TopBuildDir;
}
- result.env = std::move(env);
+ result.env = &env;
for (auto const& entry : entries) {
std::string key(entry.Key);
diff --git a/Source/cmPkgConfigResolver.h b/Source/cmPkgConfigResolver.h
index 7112184..e1d9d0a 100644
--- a/Source/cmPkgConfigResolver.h
+++ b/Source/cmPkgConfigResolver.h
@@ -43,6 +43,8 @@
GT,
} Operation = ANY;
std::string Version;
+
+ std::string string() const;
};
struct cmPkgConfigDependency
@@ -60,6 +62,7 @@
cm::optional<std::string> SysrootDir;
cm::optional<std::string> TopBuildDir;
+ std::vector<std::string> search;
cm::optional<bool> DisableUninstalled;
@@ -84,7 +87,7 @@
cmPkgConfigCflagsResult Cflags(bool priv = false);
cmPkgConfigLibsResult Libs(bool priv = false);
- cmPkgConfigEnv env;
+ cmPkgConfigEnv* env;
private:
std::string StrOrDefault(std::string const& key, cm::string_view def = "");
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 c2c5cd7..0755148 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -4357,10 +4357,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/cmTimestamp.cxx b/Source/cmTimestamp.cxx
index fdeff04..35913c7 100644
--- a/Source/cmTimestamp.cxx
+++ b/Source/cmTimestamp.cxx
@@ -16,6 +16,7 @@
#include <cstdlib>
#include <cstring>
+#include <ctime>
#include <sstream>
#include <utility>
@@ -276,7 +277,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..e1edf45 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -659,7 +659,8 @@
GetProjectCommandsInScriptMode(state->GetState());
// Documented behavior of CMAKE{,_CURRENT}_{SOURCE,BINARY}_DIR is to be
// set to $PWD for -P mode.
- state->SetWorkingMode(SCRIPT_MODE);
+ state->SetWorkingMode(SCRIPT_MODE,
+ cmake::CommandFailureAction::FATAL_ERROR);
state->SetHomeDirectory(cmSystemTools::GetLogicalWorkingDirectory());
state->SetHomeOutputDirectory(cmSystemTools::GetLogicalWorkingDirectory());
state->ReadListFile(args, path);
@@ -1540,8 +1541,8 @@
auto result = presetsGraph.ReadProjectPresets(this->GetHomeDirectory());
if (result != true) {
std::string errorMsg =
- cmStrCat("Could not read presets from ", this->GetHomeDirectory(), ":",
- presetsGraph.parseState.GetErrorMessage());
+ cmStrCat("Could not read presets from ", this->GetHomeDirectory(),
+ ":\n", presetsGraph.parseState.GetErrorMessage());
cmSystemTools::Error(errorMsg);
return;
}
@@ -1561,7 +1562,8 @@
presetsGraph.PrintAllPresets();
}
- this->SetWorkingMode(WorkingMode::HELP_MODE);
+ this->SetWorkingMode(WorkingMode::HELP_MODE,
+ cmake::CommandFailureAction::FATAL_ERROR);
return;
}
@@ -2635,8 +2637,7 @@
// actually do the configure
auto startTime = std::chrono::steady_clock::now();
#if !defined(CMAKE_BOOTSTRAP)
- if (!this->Instrumentation->errorMsg.empty()) {
- cmSystemTools::Error(this->Instrumentation->errorMsg);
+ if (this->Instrumentation->HasErrors()) {
return 1;
}
auto doConfigure = [this]() -> int {
@@ -3750,8 +3751,8 @@
auto result = settingsFile.ReadProjectPresets(this->GetHomeDirectory());
if (result != true) {
cmSystemTools::Error(
- cmStrCat("Could not read presets from ", this->GetHomeDirectory(), ":",
- settingsFile.parseState.GetErrorMessage()));
+ cmStrCat("Could not read presets from ", this->GetHomeDirectory(),
+ ":\n", settingsFile.parseState.GetErrorMessage()));
return 1;
}
@@ -3870,7 +3871,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");
@@ -3976,8 +3978,7 @@
#if !defined(CMAKE_BOOTSTRAP)
cmInstrumentation instrumentation(dir);
- if (!instrumentation.errorMsg.empty()) {
- cmSystemTools::Error(instrumentation.errorMsg);
+ if (instrumentation.HasErrors()) {
return 1;
}
instrumentation.CollectTimingData(
@@ -4010,18 +4011,21 @@
return buildresult;
}
-bool cmake::Open(std::string const& dir, bool dryRun)
+bool cmake::Open(std::string const& dir, DryRun dryRun)
{
this->SetHomeDirectory("");
this->SetHomeOutputDirectory("");
if (!cmSystemTools::FileIsDirectory(dir)) {
- std::cerr << "Error: " << dir << " is not a directory\n";
+ if (dryRun == DryRun::No) {
+ std::cerr << "Error: " << dir << " is not a directory\n";
+ }
return false;
}
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");
@@ -4050,7 +4054,7 @@
return false;
}
- return gen->Open(dir, *cachedProjectName, dryRun);
+ return gen->Open(dir, *cachedProjectName, dryRun == DryRun::Yes);
}
#if !defined(CMAKE_BOOTSTRAP)
@@ -4118,7 +4122,7 @@
auto result = settingsFile.ReadProjectPresets(this->GetHomeDirectory());
if (result != true) {
cmSystemTools::Error(cmStrCat("Could not read presets from ",
- this->GetHomeDirectory(), ":",
+ this->GetHomeDirectory(), ":\n",
settingsFile.parseState.GetErrorMessage()));
return 1;
}
diff --git a/Source/cmake.h b/Source/cmake.h
index f128a46..f338c13 100644
--- a/Source/cmake.h
+++ b/Source/cmake.h
@@ -129,6 +129,16 @@
FIND_PACKAGE_MODE
};
+ enum class CommandFailureAction
+ {
+ // When a command fails to execute, treat it as a fatal error.
+ FATAL_ERROR,
+
+ // When a command fails to execute, continue execution, but set the exit
+ // code accordingly.
+ EXIT_CODE,
+ };
+
using TraceFormat = cmTraceEnums::TraceOutputFormat;
struct GeneratorInfo
@@ -441,8 +451,18 @@
//! Do all the checks before running configure
int DoPreConfigureChecks();
- void SetWorkingMode(WorkingMode mode) { this->CurrentWorkingMode = mode; }
- WorkingMode GetWorkingMode() { return this->CurrentWorkingMode; }
+ void SetWorkingMode(WorkingMode mode, CommandFailureAction policy)
+ {
+ this->CurrentWorkingMode = mode;
+ this->CurrentCommandFailureAction = policy;
+ }
+
+ WorkingMode GetWorkingMode() const { return this->CurrentWorkingMode; }
+
+ CommandFailureAction GetCommandFailureAction() const
+ {
+ return this->CurrentCommandFailureAction;
+ }
//! Debug the try compile stuff by not deleting the files
bool GetDebugTryCompile() const { return this->DebugTryCompile; }
@@ -643,8 +663,14 @@
std::string const& presetName, bool listPresets,
std::vector<std::string> const& args);
+ enum class DryRun
+ {
+ No,
+ Yes,
+ };
+
//! run the --open option
- bool Open(std::string const& dir, bool dryRun);
+ bool Open(std::string const& dir, DryRun dryRun);
//! run the --workflow option
enum class WorkflowListPresets
@@ -774,6 +800,8 @@
std::string CMakeWorkingDirectory;
ProgressCallbackType ProgressCallback;
WorkingMode CurrentWorkingMode = NORMAL_MODE;
+ CommandFailureAction CurrentCommandFailureAction =
+ CommandFailureAction::FATAL_ERROR;
bool DebugOutput = false;
bool DebugFindOutput = false;
bool Trace = false;
diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx
index 7c60427..54a2c39 100644
--- a/Source/cmakemain.cxx
+++ b/Source/cmakemain.cxx
@@ -396,6 +396,9 @@
mode = cmState::FindPackage;
break;
}
+ auto const failurePolicy = workingMode == cmake::NORMAL_MODE
+ ? cmake::CommandFailureAction::EXIT_CODE
+ : cmake::CommandFailureAction::FATAL_ERROR;
cmake cm(role, mode);
cm.SetHomeDirectory("");
cm.SetHomeOutputDirectory("");
@@ -406,7 +409,7 @@
cm.SetProgressCallback([&cm](std::string const& msg, float prog) {
cmakemainProgressCallback(msg, prog, &cm);
});
- cm.SetWorkingMode(workingMode);
+ cm.SetWorkingMode(workingMode, failurePolicy);
int res = cm.Run(parsedArgs, view_only);
if (list_cached || list_all_cached) {
@@ -988,7 +991,8 @@
cm.SetHomeDirectory("");
cm.SetHomeOutputDirectory("");
cm.SetDebugOutputOn(verbose);
- cm.SetWorkingMode(cmake::SCRIPT_MODE);
+ cm.SetWorkingMode(cmake::SCRIPT_MODE,
+ cmake::CommandFailureAction::FATAL_ERROR);
ret_ = int(bool(cm.Run(cmd)));
}
}
@@ -1132,7 +1136,7 @@
cm.SetProgressCallback([&cm](std::string const& msg, float prog) {
cmakemainProgressCallback(msg, prog, &cm);
});
- return cm.Open(dir, false) ? 0 : 1;
+ return cm.Open(dir, cmake::DryRun::No) ? 0 : 1;
#endif
}
} // namespace
diff --git a/Source/ctest.cxx b/Source/ctest.cxx
index b25f58b..d0f7a18 100644
--- a/Source/ctest.cxx
+++ b/Source/ctest.cxx
@@ -149,6 +149,7 @@
{ "--extra-submit <file>[;<file>]", "Submit extra files to the dashboard." },
{ "--http-header <header>", "Append HTTP header when submitting" },
{ "--schedule-random", "Use a random order for scheduling tests" },
+ { "--schedule-random-seed", "Override seed for random order of tests" },
{ "--submit-index",
"Submit individual dashboard tests with specific index" },
{ "--timeout <seconds>", "Set the default test timeout." },
diff --git a/Source/kwsys/CMakeLists.txt b/Source/kwsys/CMakeLists.txt
index d6d43f5..b66cbbd 100644
--- a/Source/kwsys/CMakeLists.txt
+++ b/Source/kwsys/CMakeLists.txt
@@ -88,7 +88,7 @@
# any outside mailing list and no documentation of the change will be
# written.
-cmake_minimum_required(VERSION 3.9...3.22 FATAL_ERROR)
+cmake_minimum_required(VERSION 3.13...3.31 FATAL_ERROR)
# Some configure checks depend upon the deployment target. Clear checks when
# the deployment target changes.
@@ -317,7 +317,7 @@
#-----------------------------------------------------------------------------
# Adjust compiler flags for some platforms.
-if(NOT CMAKE_COMPILER_IS_GNUCXX)
+if(NOT CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
if(CMAKE_SYSTEM MATCHES "OSF1-V.*")
string(REGEX MATCH "-timplicit_local"
KWSYS_CXX_FLAGS_HAVE_IMPLICIT_LOCAL "${CMAKE_CXX_FLAGS}")
@@ -1038,7 +1038,7 @@
if(CTEST_TEST_KWSYS)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/ExtraTest.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/ExtraTest.cmake")
- set_directory_properties(PROPERTIES TEST_INCLUDE_FILE "${CMAKE_CURRENT_BINARY_DIR}/ExtraTest.cmake")
+ set_property(DIRECTORY APPEND PROPERTY TEST_INCLUDE_FILES "${CMAKE_CURRENT_BINARY_DIR}/ExtraTest.cmake")
endif()
set(KWSYS_TEST_ARGS_testCommandLineArguments
diff --git a/Source/kwsys/kwsysPlatformTests.cmake b/Source/kwsys/kwsysPlatformTests.cmake
index 6c006bc..7cfdd6e 100644
--- a/Source/kwsys/kwsysPlatformTests.cmake
+++ b/Source/kwsys/kwsysPlatformTests.cmake
@@ -171,51 +171,46 @@
#
# Compile test named by ${var} and store INFO strings extracted from binary.
macro(KWSYS_PLATFORM_INFO_TEST lang var description)
- # We can implement this macro on CMake 2.6 and above.
- if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.6)
- set(${var} "")
- else()
- # Choose a location for the result binary.
- set(KWSYS_PLATFORM_INFO_FILE
- ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/${var}.bin)
+ # Choose a location for the result binary.
+ set(KWSYS_PLATFORM_INFO_FILE
+ ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/${var}.bin)
- # Compile the test binary.
- if(NOT EXISTS ${KWSYS_PLATFORM_INFO_FILE})
- message(STATUS "${description}")
- try_compile(${var}_COMPILED
- ${CMAKE_CURRENT_BINARY_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/${KWSYS_PLATFORM_TEST_FILE_${lang}}
- COMPILE_DEFINITIONS -DTEST_${var}
- ${KWSYS_PLATFORM_${lang}_TEST_DEFINES}
- ${KWSYS_PLATFORM_${lang}_TEST_EXTRA_FLAGS}
- OUTPUT_VARIABLE OUTPUT
- COPY_FILE ${KWSYS_PLATFORM_INFO_FILE}
- )
- if(CMAKE_VERSION VERSION_LESS 3.26)
- if(${var}_COMPILED)
- file(APPEND
- ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
- "${description} compiled with the following output:\n${OUTPUT}\n\n")
- else()
- file(APPEND
- ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
- "${description} failed to compile with the following output:\n${OUTPUT}\n\n")
- endif()
- endif()
+ # Compile the test binary.
+ if(NOT EXISTS ${KWSYS_PLATFORM_INFO_FILE})
+ message(STATUS "${description}")
+ try_compile(${var}_COMPILED
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/${KWSYS_PLATFORM_TEST_FILE_${lang}}
+ COMPILE_DEFINITIONS -DTEST_${var}
+ ${KWSYS_PLATFORM_${lang}_TEST_DEFINES}
+ ${KWSYS_PLATFORM_${lang}_TEST_EXTRA_FLAGS}
+ OUTPUT_VARIABLE OUTPUT
+ COPY_FILE ${KWSYS_PLATFORM_INFO_FILE}
+ )
+ if(CMAKE_VERSION VERSION_LESS 3.26)
if(${var}_COMPILED)
- message(STATUS "${description} - compiled")
+ file(APPEND
+ ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+ "${description} compiled with the following output:\n${OUTPUT}\n\n")
else()
- message(STATUS "${description} - failed")
+ file(APPEND
+ ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+ "${description} failed to compile with the following output:\n${OUTPUT}\n\n")
endif()
endif()
-
- # Parse info strings out of the compiled binary.
if(${var}_COMPILED)
- file(STRINGS ${KWSYS_PLATFORM_INFO_FILE} ${var} REGEX "INFO:[A-Za-z0-9]+\\[[^]]*\\]")
+ message(STATUS "${description} - compiled")
else()
- set(${var} "")
+ message(STATUS "${description} - failed")
endif()
-
- set(KWSYS_PLATFORM_INFO_FILE)
endif()
+
+ # Parse info strings out of the compiled binary.
+ if(${var}_COMPILED)
+ file(STRINGS ${KWSYS_PLATFORM_INFO_FILE} ${var} REGEX "INFO:[A-Za-z0-9]+\\[[^]]*\\]")
+ else()
+ set(${var} "")
+ endif()
+
+ set(KWSYS_PLATFORM_INFO_FILE)
endmacro()
diff --git a/Templates/CTestScript.cmake.in b/Templates/CTestScript.cmake.in
new file mode 100644
index 0000000..54bfda4
--- /dev/null
+++ b/Templates/CTestScript.cmake.in
@@ -0,0 +1,167 @@
+# This file is configured by CMake automatically as CTestScript.cmake
+# If you choose not to use CMake, this file may be hand configured, by
+# filling in the required variables.
+
+cmake_minimum_required(VERSION @CMAKE_VERSION@)
+
+# CTest Start Step
+set(CTEST_SOURCE_DIRECTORY "@PROJECT_SOURCE_DIR@")
+set(CTEST_BINARY_DIRECTORY "@PROJECT_BINARY_DIR@")
+
+# CTest Update Step
+set(CTEST_UPDATE_COMMAND "@UPDATE_COMMAND@")
+set(CTEST_UPDATE_OPTIONS "@UPDATE_OPTIONS@")
+set(CTEST_UPDATE_VERSION_ONLY "@CTEST_UPDATE_VERSION_ONLY@")
+set(CTEST_NIGHTLY_START_TIME "@NIGHTLY_START_TIME@")
+
+# CVS options
+set(CTEST_CVS_COMMAND "@CVSCOMMAND@")
+set(CTEST_CVS_UPDATE_OPTIONS "@CVS_UPDATE_OPTIONS@")
+
+# Subversion options
+set(CTEST_SVN_COMMAND "@SVNCOMMAND@")
+set(CTEST_SVN_OPTIONS "@CTEST_SVN_OPTIONS@")
+set(CTEST_SVN_UPDATE_OPTIONS "@SVN_UPDATE_OPTIONS@")
+
+# Git options
+set(CTEST_GIT_COMMAND "@GITCOMMAND@")
+set(CTEST_GIT_INIT_SUBMODULES "@CTEST_GIT_INIT_SUBMODULES@")
+set(CTEST_GIT_UPDATE_CUSTOM "@CTEST_GIT_UPDATE_CUSTOM@")
+set(CTEST_GIT_UPDATE_OPTIONS "@GIT_UPDATE_OPTIONS@")
+
+# Perforce options
+set(CTEST_P4_COMMAND "@P4COMMAND@")
+set(CTEST_P4_CLIENT "@CTEST_P4_CLIENT@")
+set(CTEST_P4_OPTIONS "@CTEST_P4_OPTIONS@")
+set(CTEST_P4_UPDATE_CUSTOM "@CTEST_P4_UPDATE_CUSTOM@")
+set(CTEST_P4_UPDATE_OPTIONS "@CTEST_P4_UPDATE_OPTIONS@")
+
+# CTest Configure Step
+set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@")
+set(CTEST_LABELS_FOR_SUBPROJECTS "@CTEST_LABELS_FOR_SUBPROJECTS@")
+
+# CTest Build Step
+set(CTEST_CONFIGURATION_TYPE "@DEFAULT_CTEST_CONFIGURATION_TYPE@")
+set(CTEST_USE_LAUNCHERS "@CTEST_USE_LAUNCHERS@")
+
+# CTest Test Step
+set(CTEST_RESOURCE_SPEC_FILE "@CTEST_RESOURCE_SPEC_FILE@")
+set(CTEST_TEST_LOAD "@CTEST_TEST_LOAD@")
+set(CTEST_TEST_TIMEOUT "@DART_TESTING_TIMEOUT@")
+
+# CTest Coverage Step
+set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@")
+set(CTEST_COVERAGE_EXTRA_FLAGS "@COVERAGE_EXTRA_FLAGS@")
+
+# CTest MemCheck Step
+set(CTEST_MEMORYCHECK_COMMAND "@MEMORYCHECK_COMMAND@")
+set(CTEST_MEMORYCHECK_COMMAND_OPTIONS "@MEMORYCHECK_COMMAND_OPTIONS@")
+set(CTEST_MEMORYCHECK_TYPE "@MEMORYCHECK_TYPE@")
+set(CTEST_MEMORYCHECK_SANITIZER_OPTIONS "@MEMORYCHECK_SANITIZER_OPTIONS@")
+set(CTEST_MEMORYCHECK_SUPPRESSIONS_FILE "@MEMORYCHECK_SUPPRESSIONS_FILE@")
+
+# CTest Submit Step
+set(CTEST_SITE "@SITE@")
+set(CTEST_BUILD_NAME "@BUILDNAME@")
+set(CTEST_SUBMIT_URL "@SUBMIT_URL@")
+set(CTEST_SUBMIT_INACTIVITY_TIMEOUT "@CTEST_SUBMIT_INACTIVITY_TIMEOUT@")
+set(CTEST_TLS_VERIFY "@CTEST_TLS_VERIFY@")
+set(CTEST_TLS_VERSION "@CTEST_TLS_VERSION@")
+
+################################################################################
+
+if(NOT MODEL)
+ set(MODEL "Experimental")
+endif()
+
+if(MODEL STREQUAL "NightlyMemoryCheck")
+ set(MODEL "Nightly")
+ set(ACTIONS "Start;Update;Configure;Build;MemCheck;Coverage;Submit")
+endif()
+
+if(NOT ACTIONS)
+ if(MODEL STREQUAL "Experimental")
+ set(ACTIONS "Start;Configure;Build;Test;Coverage;Submit")
+ else()
+ set(ACTIONS "Start;Update;Configure;Build;Test;Coverage;Submit")
+ endif()
+endif()
+
+################################################################################
+
+set(_exit_code 0)
+
+if("Start" IN_LIST ACTIONS OR NOT EXISTS "${CTEST_BINARY_DIRECTORY}/Testing/TAG")
+ ctest_start("${MODEL}")
+else()
+ ctest_start("${MODEL}" APPEND)
+endif()
+
+if("Update" IN_LIST ACTIONS)
+ ctest_update(RETURN_VALUE update_count)
+ if(update_count LESS 0)
+ math(EXPR _exit_code "${_exit_code} | 0x01")
+ endif()
+ if(MODEL STREQUAL "Continuous" AND update_count EQUAL 0)
+ return()
+ endif()
+endif()
+
+if("Configure" IN_LIST ACTIONS)
+ ctest_configure(RETURN_VALUE success)
+ if(success LESS 0)
+ math(EXPR _exit_code "${_exit_code} | 0x02")
+ endif()
+endif()
+
+if("Build" IN_LIST ACTIONS)
+ ctest_read_custom_files("${CTEST_BINARY_DIRECTORY}")
+ ctest_build(RETURN_VALUE success)
+ if(NOT success EQUAL 0)
+ math(EXPR _exit_code "${_exit_code} | 0x04")
+ endif()
+endif()
+
+if("Test" IN_LIST ACTIONS)
+ ctest_read_custom_files("${CTEST_BINARY_DIRECTORY}")
+ ctest_test(RETURN_VALUE success)
+ if(NOT success EQUAL 0)
+ math(EXPR _exit_code "${_exit_code} | 0x08")
+ endif()
+endif()
+
+if("Coverage" IN_LIST ACTIONS)
+ ctest_read_custom_files("${CTEST_BINARY_DIRECTORY}")
+ ctest_coverage(RETURN_VALUE success)
+ if(NOT success EQUAL 0)
+ math(EXPR _exit_code "${_exit_code} | 0x20")
+ endif()
+endif()
+
+if("MemCheck" IN_LIST ACTIONS)
+ ctest_read_custom_files("${CTEST_BINARY_DIRECTORY}")
+ ctest_memcheck(RETURN_VALUE success)
+ if(NOT success EQUAL 0)
+ math(EXPR _exit_code "${_exit_code} | 0x10")
+ endif()
+endif()
+
+file(GLOB notes_files LIST_DIRECTORIES OFF
+ "${CTEST_BINARY_DIRECTORY}/Testing/Notes/*")
+if(notes_files)
+ list(APPEND CTEST_NOTES_FILES "${notes_files}")
+endif()
+
+if("Submit" IN_LIST ACTIONS)
+ ctest_read_custom_files("${CTEST_BINARY_DIRECTORY}")
+ ctest_submit(
+ RETRY_COUNT "@CTEST_SUBMIT_RETRY_COUNT@"
+ RETRY_DELAY "@CTEST_SUBMIT_RETRY_DELAY@"
+ RETURN_VALUE success
+ )
+ if(NOT success EQUAL 0)
+ math(EXPR _exit_code "${_exit_code} | 0x40")
+ endif()
+endif()
+
+cmake_language(EXIT "${_exit_code}")
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/testJSONHelpers.cxx b/Tests/CMakeLib/testJSONHelpers.cxx
index ef7da75..02ec322 100644
--- a/Tests/CMakeLib/testJSONHelpers.cxx
+++ b/Tests/CMakeLib/testJSONHelpers.cxx
@@ -505,7 +505,7 @@
ASSERT_TRUE(m == expected);
auto error = state.GetErrorMessage();
- ASSERT_TRUE(error == "\nFaulty Object Property");
+ ASSERT_TRUE(error == "Faulty Object Property");
return true;
}
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/CMakeLists.txt b/Tests/CMakeLists.txt
index 6617455..b03c827 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)
@@ -580,11 +610,11 @@
endif()
# run test for BundleUtilities on supported platforms/compilers
- if(MSVC OR
- MINGW OR
- CMAKE_SYSTEM_NAME MATCHES "Linux" OR
- CMAKE_SYSTEM_NAME MATCHES "Darwin")
- if(NOT "${CMAKE_GENERATOR}" STREQUAL "Watcom WMake")
+ if((MSVC OR
+ MINGW OR
+ CMAKE_SYSTEM_NAME MATCHES "Linux" OR
+ CMAKE_SYSTEM_NAME MATCHES "Darwin")
+ AND NOT CMAKE_GENERATOR STREQUAL "Watcom WMake")
add_test(BundleUtilities ${CMAKE_CTEST_COMMAND}
--build-and-test
@@ -612,7 +642,6 @@
endif()
endif()
- endif()
set(CMAKE_BUILD_TEST_SOURCE_DIR "${CMake_SOURCE_DIR}/Tests/COnly")
set(CMAKE_BUILD_TEST_BINARY_DIR "${CMake_BINARY_DIR}/Tests/CMakeBuildCOnly")
@@ -1522,44 +1551,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()
@@ -3269,6 +3260,9 @@
# FIXME(lfortran): The compiler fails on the test's modules.
AND NOT CMAKE_Fortran_COMPILER_ID STREQUAL "LFortran"
)
+ if(DEFINED CMake_TEST_Fortran_SUBMODULES)
+ list(PREPEND CMake_TEST_FortranModules_BUILD_OPTIONS -DCMake_TEST_Fortran_SUBMODULES:BOOL=${CMake_TEST_Fortran_SUBMODULES})
+ endif()
add_test(FortranModules ${CMAKE_CTEST_COMMAND}
--build-and-test
"${CMake_SOURCE_DIR}/Tests/FortranModules"
@@ -3277,7 +3271,6 @@
--build-project FortranModules
--build-options
-DCMake_TEST_NESTED_MAKE_PROGRAM:FILEPATH=${CMake_TEST_EXPLICIT_MAKE_PROGRAM}
- -DCMake_TEST_Fortran_SUBMODULES:BOOL=${CMake_TEST_Fortran_SUBMODULES}
${CMake_TEST_FortranModules_BUILD_OPTIONS}
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/FortranModules")
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/CTestTestChecksum/CMakeLists.txt b/Tests/CTestTestChecksum/CMakeLists.txt
new file mode 100644
index 0000000..e76e746
--- /dev/null
+++ b/Tests/CTestTestChecksum/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.10)
+project(CTestTestChecksum NONE)
+include(CTest)
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 88015e6..17a398f 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/FindVulkan/Test/main-dxc_lib.cxx b/Tests/FindVulkan/Test/main-dxc_lib.cxx
index 6ccb0de..37cd163 100644
--- a/Tests/FindVulkan/Test/main-dxc_lib.cxx
+++ b/Tests/FindVulkan/Test/main-dxc_lib.cxx
@@ -1,7 +1,12 @@
+#include <cassert>
+#include <cstdint>
#include <cstdio>
+#ifdef _WIN32
+# include <Windows.h>
+#endif
+
#include "dxc/dxcapi.h"
-#include "printf.h"
int main()
{
diff --git a/Tests/FindVulkan/Test/main-dynamicVulkanLoading.cpp b/Tests/FindVulkan/Test/main-dynamicVulkanLoading.cpp
index e3bf0da..6e25a34 100644
--- a/Tests/FindVulkan/Test/main-dynamicVulkanLoading.cpp
+++ b/Tests/FindVulkan/Test/main-dynamicVulkanLoading.cpp
@@ -15,7 +15,7 @@
try {
// initialize dynamic dispatcher
- vk::DynamicLoader dl;
+ vk::detail::DynamicLoader dl;
PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr =
dl.getProcAddress<PFN_vkGetInstanceProcAddr>("vkGetInstanceProcAddr");
VULKAN_HPP_DEFAULT_DISPATCHER.init(vkGetInstanceProcAddr);
diff --git a/Tests/Fortran/CMakeLists.txt b/Tests/Fortran/CMakeLists.txt
index 456a9fe..ce36829 100644
--- a/Tests/Fortran/CMakeLists.txt
+++ b/Tests/Fortran/CMakeLists.txt
@@ -127,7 +127,7 @@
# if the id's match or the compilers are compatible, then
# call the test_fortran_c_interface_module function
if("${CMAKE_Fortran_COMPILER_ID}:${CMAKE_C_COMPILER_ID}" MATCHES
- "(Intel(LLVM)?:MSVC|Absoft:GNU|(LLVMFlang|LFortran):(GNU|Clang))"
+ "(Intel(LLVM)?:MSVC|Absoft:GNU|(LLVMFlang|LFortran):(GNU|Clang)|Cray:CrayClang)"
OR ("${CMAKE_Fortran_COMPILER_ID}" STREQUAL "${CMAKE_C_COMPILER_ID}" ))
test_fortran_c_interface_module()
else()
diff --git a/Tests/FortranModules/CMakeLists.txt b/Tests/FortranModules/CMakeLists.txt
index 555c994..ecb456b 100644
--- a/Tests/FortranModules/CMakeLists.txt
+++ b/Tests/FortranModules/CMakeLists.txt
@@ -10,9 +10,14 @@
set(CMake_TEST_NESTED_MAKE_PROGRAM "${CMAKE_MAKE_PROGRAM}")
endif()
-if("x${CMake_TEST_Fortran_SUBMODULES}" STREQUAL "x"
- AND NOT CMAKE_VERSION VERSION_LESS 3.6.20160923 # for CheckFortranSourceCompiles SRC_EXT
- )
+if(NOT DEFINED CMake_TEST_Fortran_SUBMODULES AND (
+ # FIXME(#18925): We do not support Cray's module file names.
+ CMAKE_Fortran_COMPILER_ID STREQUAL "Cray"
+ ))
+ set(CMake_TEST_Fortran_SUBMODULES 0)
+endif()
+
+if(NOT DEFINED CMake_TEST_Fortran_SUBMODULES)
include(CheckFortranSourceCompiles)
CHECK_Fortran_SOURCE_COMPILES([[
module parent
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..87b27de 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)
@@ -605,6 +672,7 @@
add_RunCMake_test(ctest_upload)
add_RunCMake_test(ctest_environment)
add_RunCMake_test(ctest_empty_binary_directory)
+add_RunCMake_test(ctest_exit)
add_RunCMake_test(ctest_fixtures)
if(CMAKE_GENERATOR MATCHES "Make|Ninja")
add_RunCMake_test(ctest_instrumentation)
@@ -641,6 +709,9 @@
add_RunCMake_test(block)
add_RunCMake_test(get_filename_component)
add_RunCMake_test(get_property)
+if(DEFINED CMake_TEST_NO_WRITE_ONLY_DIR)
+ list(APPEND if_ARGS -DCMake_TEST_NO_WRITE_ONLY_DIR=${CMake_TEST_NO_WRITE_ONLY_DIR})
+endif()
add_RunCMake_test(if -DMSYS=${MSYS})
add_RunCMake_test(include)
add_RunCMake_test(include_directories)
@@ -659,7 +730,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 +1199,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 +1281,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]")
@@ -1292,3 +1370,7 @@
add_RunCMake_test(TIClang "-DCMake_TEST_TICLANG_TOOLCHAINS=${TOOLCHAINS}")
set_property(TEST RunCMake.TIClang APPEND PROPERTY LABELS "TIClang")
endif()
+if(CMake_TEST_Diab_TOOLCHAINS)
+ add_RunCMake_test(Diab -DCMake_TEST_Diab_TOOLCHAINS=${CMake_TEST_Diab_TOOLCHAINS})
+ set_property(TEST RunCMake.Diab APPEND PROPERTY LABELS "Diab")
+endif()
diff --git a/Tests/RunCMake/CMakePresets/Comment-stderr.txt b/Tests/RunCMake/CMakePresets/Comment-stderr.txt
index 8619cf5..9fdb517 100644
--- a/Tests/RunCMake/CMakePresets/Comment-stderr.txt
+++ b/Tests/RunCMake/CMakePresets/Comment-stderr.txt
@@ -1,8 +1,13 @@
^CMake Error: Could not read presets from [^
]*/Tests/RunCMake/CMakePresets/Comment:
-JSON Parse Error: [^
+(CMakePresets.json:1: Syntax error: value, object or array expected.
+// Comment
+\^
+CMakePresets.json:2: Extra non-whitespace after JSON value.
+{
+\^|JSON Parse Error: [^
]*Comment\/CMakePresets.json:
\* Line 1, Column 1
Syntax error: value, object or array expected\.
\* Line 2, Column 1
- Extra non-whitespace after JSON value\.$
+ Extra non-whitespace after JSON value\.$)
diff --git a/Tests/RunCMake/CMakePresets/CommentValidOldSchema-stderr.txt b/Tests/RunCMake/CMakePresets/CommentValidOldSchema-stderr.txt
index b102f5b..8296a51 100644
--- a/Tests/RunCMake/CMakePresets/CommentValidOldSchema-stderr.txt
+++ b/Tests/RunCMake/CMakePresets/CommentValidOldSchema-stderr.txt
@@ -1,2 +1,2 @@
^CMake Error: Could not read presets from .*
-Error: @2,15: Invalid extra field \"\$comment\" in root object
+CMakePresets.json:2: Invalid extra field \"\$comment\" in root object
diff --git a/Tests/RunCMake/CMakePresets/EmptyPenvInInclude-stderr.txt b/Tests/RunCMake/CMakePresets/EmptyPenvInInclude-stderr.txt
index e0f858a..77579fc 100644
--- a/Tests/RunCMake/CMakePresets/EmptyPenvInInclude-stderr.txt
+++ b/Tests/RunCMake/CMakePresets/EmptyPenvInInclude-stderr.txt
@@ -1,5 +1,5 @@
^CMake Error: Could not read presets from [^
]*/Tests/RunCMake/CMakePresets/EmptyPenvInInclude:
-Error: @3,15: Invalid "include" field
+CMakePresets.json:3: Invalid "include" field
"include": \["\$penv\{\}"\],
\^$
diff --git a/Tests/RunCMake/CMakePresets/EmptyPresetName-stderr.txt b/Tests/RunCMake/CMakePresets/EmptyPresetName-stderr.txt
index 6f84690..6cb7c2a 100644
--- a/Tests/RunCMake/CMakePresets/EmptyPresetName-stderr.txt
+++ b/Tests/RunCMake/CMakePresets/EmptyPresetName-stderr.txt
@@ -1,5 +1,5 @@
^CMake Error: Could not read presets from [^
]*/Tests/RunCMake/CMakePresets/EmptyPresetName:
-Error: @5,15: Invalid Preset Name
+CMakePresets.json:5: Invalid Preset Name
"name": "",
\^$
diff --git a/Tests/RunCMake/CMakePresets/ExtraPresetField-stderr.txt b/Tests/RunCMake/CMakePresets/ExtraPresetField-stderr.txt
index 2e94831..ce25505 100644
--- a/Tests/RunCMake/CMakePresets/ExtraPresetField-stderr.txt
+++ b/Tests/RunCMake/CMakePresets/ExtraPresetField-stderr.txt
@@ -1,5 +1,5 @@
^CMake Error: Could not read presets from [^
]*/Tests/RunCMake/CMakePresets/ExtraPresetField:
-Error: @8,18: Invalid extra field "invalid" in Preset
+CMakePresets.json:8: Invalid extra field "invalid" in Preset
"invalid": true
\^$
diff --git a/Tests/RunCMake/CMakePresets/ExtraRootField-stderr.txt b/Tests/RunCMake/CMakePresets/ExtraRootField-stderr.txt
index 554cd4a..0af4eda 100644
--- a/Tests/RunCMake/CMakePresets/ExtraRootField-stderr.txt
+++ b/Tests/RunCMake/CMakePresets/ExtraRootField-stderr.txt
@@ -1,5 +1,5 @@
^CMake Error: Could not read presets from [^
]*/Tests/RunCMake/CMakePresets/ExtraRootField:
-Error: @10,14: Invalid extra field "invalid" in root object
+CMakePresets.json:10: Invalid extra field "invalid" in root object
"invalid": true
\^$
diff --git a/Tests/RunCMake/CMakePresets/ExtraVariableField-stderr.txt b/Tests/RunCMake/CMakePresets/ExtraVariableField-stderr.txt
index 5cb777c..adf6996 100644
--- a/Tests/RunCMake/CMakePresets/ExtraVariableField-stderr.txt
+++ b/Tests/RunCMake/CMakePresets/ExtraVariableField-stderr.txt
@@ -1,5 +1,5 @@
^CMake Error: Could not read presets from [^
]*/Tests/RunCMake/CMakePresets/ExtraVariableField:
-Error: @11,22: Invalid extra field "invalid" in variable "EXTRA" for preset "ExtraVariableField"
+CMakePresets.json:11: Invalid extra field "invalid" in variable "EXTRA" for preset "ExtraVariableField"
"invalid": true
\^$
diff --git a/Tests/RunCMake/CMakePresets/HighVersion-stderr.txt b/Tests/RunCMake/CMakePresets/HighVersion-stderr.txt
index f8454b9..f1e7c04 100644
--- a/Tests/RunCMake/CMakePresets/HighVersion-stderr.txt
+++ b/Tests/RunCMake/CMakePresets/HighVersion-stderr.txt
@@ -1,5 +1,5 @@
^CMake Error: Could not read presets from [^
]*/Tests/RunCMake/CMakePresets/HighVersion:
-Error: @2,14: Unrecognized "version" 1000: must be >=1 and <=10
+CMakePresets.json:2: Unrecognized "version" 1000: must be >=1 and <=10
"version": 1000,
\^$
diff --git a/Tests/RunCMake/CMakePresets/InvalidArchitectureStrategy-stderr.txt b/Tests/RunCMake/CMakePresets/InvalidArchitectureStrategy-stderr.txt
index 5df075d..713fec0 100644
--- a/Tests/RunCMake/CMakePresets/InvalidArchitectureStrategy-stderr.txt
+++ b/Tests/RunCMake/CMakePresets/InvalidArchitectureStrategy-stderr.txt
@@ -1,5 +1,5 @@
^CMake Error: Could not read presets from [^
]*/Tests/RunCMake/CMakePresets/InvalidArchitectureStrategy:
-Error: @9,21: Invalid preset
+CMakePresets.json:9: Invalid preset
"strategy": {}
\^$
diff --git a/Tests/RunCMake/CMakePresets/InvalidPresetBinaryDir-stderr.txt b/Tests/RunCMake/CMakePresets/InvalidPresetBinaryDir-stderr.txt
index deb35b4..72030c6 100644
--- a/Tests/RunCMake/CMakePresets/InvalidPresetBinaryDir-stderr.txt
+++ b/Tests/RunCMake/CMakePresets/InvalidPresetBinaryDir-stderr.txt
@@ -1,5 +1,5 @@
^CMake Error: Could not read presets from [^
]*/Tests/RunCMake/CMakePresets/InvalidPresetBinaryDir:
-Error: @7,20: "binaryDir" expected a string
+CMakePresets.json:7: "binaryDir" expected a string
"binaryDir": \[\]
\^$
diff --git a/Tests/RunCMake/CMakePresets/InvalidPresetGenerator-stderr.txt b/Tests/RunCMake/CMakePresets/InvalidPresetGenerator-stderr.txt
index 7f19412..e4c8b95 100644
--- a/Tests/RunCMake/CMakePresets/InvalidPresetGenerator-stderr.txt
+++ b/Tests/RunCMake/CMakePresets/InvalidPresetGenerator-stderr.txt
@@ -1,5 +1,5 @@
^CMake Error: Could not read presets from [^
]*/Tests/RunCMake/CMakePresets/InvalidPresetGenerator:
-Error: @6,20: "generator" expected a string
+CMakePresets.json:6: "generator" expected a string
"generator": \[\],
\^$
diff --git a/Tests/RunCMake/CMakePresets/InvalidPresetName-stderr.txt b/Tests/RunCMake/CMakePresets/InvalidPresetName-stderr.txt
index 4cceb73..2a9d2b7 100644
--- a/Tests/RunCMake/CMakePresets/InvalidPresetName-stderr.txt
+++ b/Tests/RunCMake/CMakePresets/InvalidPresetName-stderr.txt
@@ -1,5 +1,5 @@
^CMake Error: Could not read presets from [^
]*/Tests/RunCMake/CMakePresets/InvalidPresetName:
-Error: @5,15: Invalid Preset Name
+CMakePresets.json:5: Invalid Preset Name
"name": \[\],
\^$
diff --git a/Tests/RunCMake/CMakePresets/InvalidPresetVendor-stderr.txt b/Tests/RunCMake/CMakePresets/InvalidPresetVendor-stderr.txt
index f92c48e..923f317 100644
--- a/Tests/RunCMake/CMakePresets/InvalidPresetVendor-stderr.txt
+++ b/Tests/RunCMake/CMakePresets/InvalidPresetVendor-stderr.txt
@@ -1,5 +1,5 @@
^CMake Error: Could not read presets from [^
]*/Tests/RunCMake/CMakePresets/InvalidPresetVendor:
-Error: @8,17: Invalid preset
+CMakePresets.json:8: Invalid preset
"vendor": true
\^$
diff --git a/Tests/RunCMake/CMakePresets/InvalidPresets-stderr.txt b/Tests/RunCMake/CMakePresets/InvalidPresets-stderr.txt
index d7081af..40e7a6a 100644
--- a/Tests/RunCMake/CMakePresets/InvalidPresets-stderr.txt
+++ b/Tests/RunCMake/CMakePresets/InvalidPresets-stderr.txt
@@ -1,5 +1,5 @@
^CMake Error: Could not read presets from [^
]*/Tests/RunCMake/CMakePresets/InvalidPresets:
-Error: @3,23: Invalid "configurePresets" field
+CMakePresets.json:3: Invalid "configurePresets" field
"configurePresets": {}
\^$
diff --git a/Tests/RunCMake/CMakePresets/InvalidRoot-stderr.txt b/Tests/RunCMake/CMakePresets/InvalidRoot-stderr.txt
index 5f2dcc1..39960db 100644
--- a/Tests/RunCMake/CMakePresets/InvalidRoot-stderr.txt
+++ b/Tests/RunCMake/CMakePresets/InvalidRoot-stderr.txt
@@ -1,5 +1,5 @@
^CMake Error: Could not read presets from [^
]*/Tests/RunCMake/CMakePresets/InvalidRoot:
-Error: \@1\,1\: Invalid root object
+CMakePresets.json:1: Invalid root object
\[\]
\^$
diff --git a/Tests/RunCMake/CMakePresets/InvalidToolsetStrategy-stderr.txt b/Tests/RunCMake/CMakePresets/InvalidToolsetStrategy-stderr.txt
index d0974ac..644985e 100644
--- a/Tests/RunCMake/CMakePresets/InvalidToolsetStrategy-stderr.txt
+++ b/Tests/RunCMake/CMakePresets/InvalidToolsetStrategy-stderr.txt
@@ -1,5 +1,5 @@
^CMake Error: Could not read presets from [^
]*/Tests/RunCMake/CMakePresets/InvalidToolsetStrategy:
-Error: @9,21: Invalid preset
+CMakePresets.json:9: Invalid preset
"strategy": {}
\^$
diff --git a/Tests/RunCMake/CMakePresets/InvalidVariableValue-stderr.txt b/Tests/RunCMake/CMakePresets/InvalidVariableValue-stderr.txt
index fdb7072..84e87b4 100644
--- a/Tests/RunCMake/CMakePresets/InvalidVariableValue-stderr.txt
+++ b/Tests/RunCMake/CMakePresets/InvalidVariableValue-stderr.txt
@@ -1,5 +1,5 @@
^CMake Error: Could not read presets from [^
]*/Tests/RunCMake/CMakePresets/InvalidVariableValue:
-Error: @10,20: "value" expected a string
+CMakePresets.json:10: "value" expected a string
"value": \[\]
\^$
diff --git a/Tests/RunCMake/CMakePresets/InvalidVariables-stderr.txt b/Tests/RunCMake/CMakePresets/InvalidVariables-stderr.txt
index f329d97..b9a87ad 100644
--- a/Tests/RunCMake/CMakePresets/InvalidVariables-stderr.txt
+++ b/Tests/RunCMake/CMakePresets/InvalidVariables-stderr.txt
@@ -1,5 +1,5 @@
^CMake Error: Could not read presets from [^
]*/Tests/RunCMake/CMakePresets/InvalidVariables:
-Error: @8,25: Invalid preset
+CMakePresets.json:8: Invalid preset
"cacheVariables": \[\]
\^$
diff --git a/Tests/RunCMake/CMakePresets/InvalidVendor-stderr.txt b/Tests/RunCMake/CMakePresets/InvalidVendor-stderr.txt
index fc6534e..6f8de99 100644
--- a/Tests/RunCMake/CMakePresets/InvalidVendor-stderr.txt
+++ b/Tests/RunCMake/CMakePresets/InvalidVendor-stderr.txt
@@ -1,5 +1,5 @@
^CMake Error: Could not read presets from [^
]*/Tests/RunCMake/CMakePresets/InvalidVendor:
-Error: @3,13: Invalid root object
+CMakePresets.json:3: Invalid root object
"vendor": true,
\^$
diff --git a/Tests/RunCMake/CMakePresets/InvalidVersion-stderr.txt b/Tests/RunCMake/CMakePresets/InvalidVersion-stderr.txt
index 97fe9d6..b539eff 100644
--- a/Tests/RunCMake/CMakePresets/InvalidVersion-stderr.txt
+++ b/Tests/RunCMake/CMakePresets/InvalidVersion-stderr.txt
@@ -1,5 +1,5 @@
^CMake Error: Could not read presets from [^
]*/Tests/RunCMake/CMakePresets/InvalidVersion:
-Error: @2,14: Invalid "version" field
+CMakePresets.json:2: Invalid "version" field
"version": "1.0",
\^$
diff --git a/Tests/RunCMake/CMakePresets/LowVersion-stderr.txt b/Tests/RunCMake/CMakePresets/LowVersion-stderr.txt
index f4f65f9..19b4fe8 100644
--- a/Tests/RunCMake/CMakePresets/LowVersion-stderr.txt
+++ b/Tests/RunCMake/CMakePresets/LowVersion-stderr.txt
@@ -1,5 +1,5 @@
^CMake Error: Could not read presets from [^
]*/Tests/RunCMake/CMakePresets/LowVersion:
-Error: @2,14: Unrecognized "version" 0: must be >=1 and <=10
+CMakePresets.json:2: Unrecognized "version" 0: must be >=1 and <=10
"version": 0,
\^
diff --git a/Tests/RunCMake/CMakePresets/MinimumRequiredInvalid-stderr.txt b/Tests/RunCMake/CMakePresets/MinimumRequiredInvalid-stderr.txt
index 30ab9ce..8f50614 100644
--- a/Tests/RunCMake/CMakePresets/MinimumRequiredInvalid-stderr.txt
+++ b/Tests/RunCMake/CMakePresets/MinimumRequiredInvalid-stderr.txt
@@ -1,5 +1,5 @@
^CMake Error: Could not read presets from [^
]*/Tests/RunCMake/CMakePresets/MinimumRequiredInvalid:
-Error: @3,27: Invalid "cmakeMinimumRequired"
+CMakePresets.json:3: Invalid "cmakeMinimumRequired"
"cmakeMinimumRequired": "3.18",
\^$
diff --git a/Tests/RunCMake/CMakePresets/MinimumRequiredMajor-stderr.txt b/Tests/RunCMake/CMakePresets/MinimumRequiredMajor-stderr.txt
index c9001ea..582b4de 100644
--- a/Tests/RunCMake/CMakePresets/MinimumRequiredMajor-stderr.txt
+++ b/Tests/RunCMake/CMakePresets/MinimumRequiredMajor-stderr.txt
@@ -1,5 +1,5 @@
^CMake Error: Could not read presets from [^
]*/Tests/RunCMake/CMakePresets/MinimumRequiredMajor:
-Error: @4,14: "cmakeMinimumRequired" major version 1000 must be less than [0-9]*
+CMakePresets.json:4: "cmakeMinimumRequired" major version 1000 must be less than [0-9]*
"major": 1000
\^$
diff --git a/Tests/RunCMake/CMakePresets/MinimumRequiredMinor-stderr.txt b/Tests/RunCMake/CMakePresets/MinimumRequiredMinor-stderr.txt
index 3911c84..1344a67 100644
--- a/Tests/RunCMake/CMakePresets/MinimumRequiredMinor-stderr.txt
+++ b/Tests/RunCMake/CMakePresets/MinimumRequiredMinor-stderr.txt
@@ -1,5 +1,5 @@
^CMake Error: Could not read presets from [^
]*/Tests/RunCMake/CMakePresets/MinimumRequiredMinor:
-Error: @5,14: "cmakeMinimumRequired" minor version 1000 must be less than [0-9]*
+CMakePresets.json:5: "cmakeMinimumRequired" minor version 1000 must be less than [0-9]*
"minor": 1000
\^$
diff --git a/Tests/RunCMake/CMakePresets/MinimumRequiredPatch-stderr.txt b/Tests/RunCMake/CMakePresets/MinimumRequiredPatch-stderr.txt
index e989fa8..0452442 100644
--- a/Tests/RunCMake/CMakePresets/MinimumRequiredPatch-stderr.txt
+++ b/Tests/RunCMake/CMakePresets/MinimumRequiredPatch-stderr.txt
@@ -1,5 +1,5 @@
^CMake Error: Could not read presets from [^
]*/Tests/RunCMake/CMakePresets/MinimumRequiredPatch:
-Error: @6,14: "cmakeMinimumRequired" patch version 50000000 must be less than [0-9]*
+CMakePresets.json:6: "cmakeMinimumRequired" patch version 50000000 must be less than [0-9]*
"patch": 50000000
\^$
diff --git a/Tests/RunCMake/CMakePresets/NoPresetName-stderr.txt b/Tests/RunCMake/CMakePresets/NoPresetName-stderr.txt
index 9aff07f..a00ba78 100644
--- a/Tests/RunCMake/CMakePresets/NoPresetName-stderr.txt
+++ b/Tests/RunCMake/CMakePresets/NoPresetName-stderr.txt
@@ -1,5 +1,5 @@
^CMake Error: Could not read presets from [^
]*/Tests/RunCMake/CMakePresets/NoPresetName:
-Error: @4,5: Missing required field "name" in Preset
+CMakePresets.json:4: Missing required field "name" in Preset
{
\^$
diff --git a/Tests/RunCMake/CMakePresets/NoVariableValue-stderr.txt b/Tests/RunCMake/CMakePresets/NoVariableValue-stderr.txt
index 630c288..0ba51fc 100644
--- a/Tests/RunCMake/CMakePresets/NoVariableValue-stderr.txt
+++ b/Tests/RunCMake/CMakePresets/NoVariableValue-stderr.txt
@@ -1,5 +1,5 @@
^CMake Error: Could not read presets from [^
]*/Tests/RunCMake/CMakePresets/NoVariableValue:
-Error: @9,16: Missing required field "value" in variable "VAR" for preset "NoVariableValue"
+CMakePresets.json:9: Missing required field "value" in variable "VAR" for preset "NoVariableValue"
"VAR": {}
\^$
diff --git a/Tests/RunCMake/CMakePresets/PresetNotObject-stderr.txt b/Tests/RunCMake/CMakePresets/PresetNotObject-stderr.txt
index 62e9248..d7df034 100644
--- a/Tests/RunCMake/CMakePresets/PresetNotObject-stderr.txt
+++ b/Tests/RunCMake/CMakePresets/PresetNotObject-stderr.txt
@@ -1,5 +1,5 @@
^CMake Error: Could not read presets from [^
]*/Tests/RunCMake/CMakePresets/PresetNotObject:
-Error: @4,5: Invalid Preset
+CMakePresets.json:4: Invalid Preset
\[\]
\^$
diff --git a/Tests/RunCMake/CMakePresets/UnknownArchitectureStrategy-stderr.txt b/Tests/RunCMake/CMakePresets/UnknownArchitectureStrategy-stderr.txt
index 6063762..bd72eb0 100644
--- a/Tests/RunCMake/CMakePresets/UnknownArchitectureStrategy-stderr.txt
+++ b/Tests/RunCMake/CMakePresets/UnknownArchitectureStrategy-stderr.txt
@@ -1,5 +1,5 @@
^CMake Error: Could not read presets from [^
]*/Tests/RunCMake/CMakePresets/UnknownArchitectureStrategy:
-Error: @9,21: Invalid preset
+CMakePresets.json:9: Invalid preset
"strategy": "unknown"
\^$
diff --git a/Tests/RunCMake/CMakePresets/UnknownToolsetStrategy-stderr.txt b/Tests/RunCMake/CMakePresets/UnknownToolsetStrategy-stderr.txt
index 55f9c7a..fd41955 100644
--- a/Tests/RunCMake/CMakePresets/UnknownToolsetStrategy-stderr.txt
+++ b/Tests/RunCMake/CMakePresets/UnknownToolsetStrategy-stderr.txt
@@ -1,5 +1,5 @@
^CMake Error: Could not read presets from [^
]*/Tests/RunCMake/CMakePresets/UnknownToolsetStrategy:
-Error: @9,21: Invalid preset
+CMakePresets.json:9: Invalid preset
"strategy": "unknown"
\^$
diff --git a/Tests/RunCMake/CMakePresets/VariableNotObject-stderr.txt b/Tests/RunCMake/CMakePresets/VariableNotObject-stderr.txt
index ce1aa20..973fc95 100644
--- a/Tests/RunCMake/CMakePresets/VariableNotObject-stderr.txt
+++ b/Tests/RunCMake/CMakePresets/VariableNotObject-stderr.txt
@@ -1,5 +1,5 @@
^CMake Error: Could not read presets from [^
]*/Tests/RunCMake/CMakePresets/VariableNotObject:
-Error: @9,16: Invalid CMake variable "VAR" for preset "VariableNotObject"
+CMakePresets.json:9: Invalid CMake variable "VAR" for preset "VariableNotObject"
"VAR": \[\]
\^$
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/CPackCommandLine/ProjectConfigMissing-package-stderr.txt b/Tests/RunCMake/CPackCommandLine/ProjectConfigMissing-package-stderr.txt
new file mode 100644
index 0000000..40ec10d
--- /dev/null
+++ b/Tests/RunCMake/CPackCommandLine/ProjectConfigMissing-package-stderr.txt
@@ -0,0 +1 @@
+^CPack Warning: CPACK_PROJECT_CONFIG_FILE not found: .*/missing.cmake
diff --git a/Tests/RunCMake/CPackCommandLine/ProjectConfigMissing.cmake b/Tests/RunCMake/CPackCommandLine/ProjectConfigMissing.cmake
new file mode 100644
index 0000000..23632f3
--- /dev/null
+++ b/Tests/RunCMake/CPackCommandLine/ProjectConfigMissing.cmake
@@ -0,0 +1,2 @@
+set(CPACK_PROJECT_CONFIG_FILE "missing.cmake")
+include(CPack)
diff --git a/Tests/RunCMake/CPackCommandLine/ProjectConfigRelative-package-stdout.txt b/Tests/RunCMake/CPackCommandLine/ProjectConfigRelative-package-stdout.txt
new file mode 100644
index 0000000..1771741
--- /dev/null
+++ b/Tests/RunCMake/CPackCommandLine/ProjectConfigRelative-package-stdout.txt
@@ -0,0 +1 @@
+project_config_example.cmake is included
diff --git a/Tests/RunCMake/CPackCommandLine/ProjectConfigRelative.cmake b/Tests/RunCMake/CPackCommandLine/ProjectConfigRelative.cmake
new file mode 100644
index 0000000..c2a6894
--- /dev/null
+++ b/Tests/RunCMake/CPackCommandLine/ProjectConfigRelative.cmake
@@ -0,0 +1,2 @@
+set(CPACK_PROJECT_CONFIG_FILE "project_config_example.cmake")
+include(CPack)
diff --git a/Tests/RunCMake/CPackCommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CPackCommandLine/RunCMakeTest.cmake
index 53f4e4f..4c2e83a 100644
--- a/Tests/RunCMake/CPackCommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CPackCommandLine/RunCMakeTest.cmake
@@ -31,3 +31,13 @@
if(RunCMake_GENERATOR MATCHES "Visual Studio|Xcode")
run_MultiConfig()
endif()
+
+function(run_cpack_test name)
+ set(RunCMake_TEST_BINARY_DIR "${RunCMake_BINARY_DIR}/${name}-build")
+ run_cmake(${name})
+ set(RunCMake_TEST_NO_CLEAN 1)
+ run_cmake_command(${name}-package ${CMAKE_CPACK_COMMAND} -G ZIP)
+endfunction()
+
+run_cpack_test(ProjectConfigMissing)
+run_cpack_test(ProjectConfigRelative)
diff --git a/Tests/RunCMake/CPackCommandLine/project_config_example.cmake b/Tests/RunCMake/CPackCommandLine/project_config_example.cmake
new file mode 100644
index 0000000..aa476ae
--- /dev/null
+++ b/Tests/RunCMake/CPackCommandLine/project_config_example.cmake
@@ -0,0 +1 @@
+message(STATUS "project_config_example.cmake is included")
diff --git a/Tests/RunCMake/CTest/TestfileErrors.cmake b/Tests/RunCMake/CTest/TestfileErrors.cmake
index 676eb47..68ab6f8 100644
--- a/Tests/RunCMake/CTest/TestfileErrors.cmake
+++ b/Tests/RunCMake/CTest/TestfileErrors.cmake
@@ -1,3 +1,3 @@
include(CTest)
add_test(NAME "unreachable" COMMAND ${CMAKE_COMMAND} -E true)
-set_property(DIRECTORY PROPERTY TEST_INCLUDE_FILE ${CMAKE_CURRENT_SOURCE_DIR}/TestfileErrors-Script.cmake)
+set_property(DIRECTORY APPEND PROPERTY TEST_INCLUDE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/TestfileErrors-Script.cmake")
diff --git a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
index 31f3b72..d12ab92 100644
--- a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
@@ -656,3 +656,17 @@
run_cmake_command(TimeoutSignalBad ${CMAKE_CTEST_COMMAND})
endblock()
endif()
+
+block()
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/ScheduleRandomSeed)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
+ file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+ file(WRITE "${RunCMake_TEST_BINARY_DIR}/CTestTestfile.cmake" "
+foreach(i RANGE 1 5)
+ add_test(test\${i} \"${CMAKE_COMMAND}\" -E true)
+endforeach()
+")
+ run_cmake_command(ScheduleRandomSeed1 ${CMAKE_CTEST_COMMAND} --schedule-random --schedule-random-seed 42)
+ run_cmake_command(ScheduleRandomSeed2 ${CMAKE_CTEST_COMMAND} --schedule-random --schedule-random-seed 42)
+endblock()
diff --git a/Tests/RunCMake/CTestCommandLine/ScheduleRandomSeed1-check.cmake b/Tests/RunCMake/CTestCommandLine/ScheduleRandomSeed1-check.cmake
new file mode 100644
index 0000000..5c1ac43
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/ScheduleRandomSeed1-check.cmake
@@ -0,0 +1,2 @@
+string(REGEX MATCHALL "Start [1-5]" ScheduleRandomSeed1_ORDER "${actual_stdout}")
+set_property(DIRECTORY PROPERTY ScheduleRandomSeed1_ORDER "${ScheduleRandomSeed1_ORDER}")
diff --git a/Tests/RunCMake/CTestCommandLine/ScheduleRandomSeed2-check.cmake b/Tests/RunCMake/CTestCommandLine/ScheduleRandomSeed2-check.cmake
new file mode 100644
index 0000000..2115f45
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/ScheduleRandomSeed2-check.cmake
@@ -0,0 +1,10 @@
+string(REGEX MATCHALL "Start [1-5]" ScheduleRandomSeed2_ORDER "${actual_stdout}")
+get_property(ScheduleRandomSeed1_ORDER DIRECTORY PROPERTY ScheduleRandomSeed1_ORDER)
+if(NOT "${ScheduleRandomSeed1_ORDER}" STREQUAL "${ScheduleRandomSeed2_ORDER}")
+ string(CONCAT RunCMake_TEST_FAILED
+ "ScheduleRandomSeed1 order:\n"
+ " ${ScheduleRandomSeed1_ORDER}\n"
+ "does not match ScheduleRandomSeed2 order:\n"
+ " ${ScheduleRandomSeed2_ORDER}\n"
+ )
+endif()
diff --git a/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-nofile-ctest-s-stderr.txt b/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-nofile-ctest-s-stderr.txt
index 343f632..acba99d 100644
--- a/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-nofile-ctest-s-stderr.txt
+++ b/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-nofile-ctest-s-stderr.txt
@@ -1,5 +1,5 @@
^Could not read/parse resource spec file [^
-]*/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-nofile-ctest-s-build/dynamic-resspec\.json:[ ]
+]*/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-nofile-ctest-s-build/dynamic-resspec\.json:
File not found: [^
]*/Tests/RunCMake/CTestResourceAllocation/dynamic-resource-nofile-ctest-s-build/dynamic-resspec\.json
CMake Error at [^
diff --git a/Tests/RunCMake/CTestResourceAllocation/invalid-nofile-ctest-stderr.txt b/Tests/RunCMake/CTestResourceAllocation/invalid-nofile-ctest-stderr.txt
index df1135e..b7e8d7f 100644
--- a/Tests/RunCMake/CTestResourceAllocation/invalid-nofile-ctest-stderr.txt
+++ b/Tests/RunCMake/CTestResourceAllocation/invalid-nofile-ctest-stderr.txt
@@ -1,5 +1,5 @@
^Could not read/parse resource spec file [^
-]*/Tests/RunCMake/CTestResourceAllocation/noexist\.json:[ ]
+]*/Tests/RunCMake/CTestResourceAllocation/noexist\.json:
File not found: [^
]*/Tests/RunCMake/CTestResourceAllocation/noexist.json
Errors while running CTest
diff --git a/Tests/RunCMake/CTestResourceAllocation/invalid-not-json-ctest-stderr.txt b/Tests/RunCMake/CTestResourceAllocation/invalid-not-json-ctest-stderr.txt
index 5bd9d97..03dce41 100644
--- a/Tests/RunCMake/CTestResourceAllocation/invalid-not-json-ctest-stderr.txt
+++ b/Tests/RunCMake/CTestResourceAllocation/invalid-not-json-ctest-stderr.txt
@@ -1,6 +1,11 @@
^Could not read/parse resource spec file [^
-]*/Tests/RunCMake/CTestResourceAllocation/invalid\.json:[ ]
-JSON Parse Error: [^
+]*/Tests/RunCMake/CTestResourceAllocation/invalid\.json:
+(invalid.json:1: Syntax error: value, object or array expected.
+This is not a valid JSON file!
+\^
+invalid.json:1: Extra non-whitespace after JSON value.
+This is not a valid JSON file!
+ \^|JSON Parse Error: [^
]*/Tests/RunCMake/CTestResourceAllocation/invalid\.json:
\* Line 1, Column 1
Syntax error: value, object or array expected\.
@@ -8,7 +13,7 @@
Extra non-whitespace after JSON value\.
|\* Line 1, Column 1
A valid JSON document must be either an array or an object value\.
-)
+))
Errors while running CTest
Output from these tests are in: [^
]*/Tests/RunCMake/CTestResourceAllocation/invalid-build/Testing/Temporary/LastTest\.log
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/CompilerId/C-stdout.txt b/Tests/RunCMake/CompilerId/C-stdout.txt
index e9ce46b..14fad83 100644
--- a/Tests/RunCMake/CompilerId/C-stdout.txt
+++ b/Tests/RunCMake/CompilerId/C-stdout.txt
@@ -1,3 +1,4 @@
-- CMAKE_C_COMPILER='[^']+'
-- CMAKE_C_COMPILER_ID='[A-Za-z]+'
-- CMAKE_C_COMPILER_VERSION='([0-9]+)(\.([0-9]+))?(\.([0-9]+))?(\.([0-9]+))?'
+-- CMAKE_C_COMPILER_ARCHITECTURE_ID='[A-Za-z0-9_;]+'
diff --git a/Tests/RunCMake/CompilerId/C.cmake b/Tests/RunCMake/CompilerId/C.cmake
index 3bf943f..4705450 100644
--- a/Tests/RunCMake/CompilerId/C.cmake
+++ b/Tests/RunCMake/CompilerId/C.cmake
@@ -2,3 +2,4 @@
message(STATUS "CMAKE_C_COMPILER='${CMAKE_C_COMPILER}'")
message(STATUS "CMAKE_C_COMPILER_ID='${CMAKE_C_COMPILER_ID}'")
message(STATUS "CMAKE_C_COMPILER_VERSION='${CMAKE_C_COMPILER_VERSION}'")
+message(STATUS "CMAKE_C_COMPILER_ARCHITECTURE_ID='${CMAKE_C_COMPILER_ARCHITECTURE_ID}'")
diff --git a/Tests/RunCMake/CompilerId/CUDA-stdout.txt b/Tests/RunCMake/CompilerId/CUDA-stdout.txt
index 459743f..4ed392d 100644
--- a/Tests/RunCMake/CompilerId/CUDA-stdout.txt
+++ b/Tests/RunCMake/CompilerId/CUDA-stdout.txt
@@ -1,11 +1,13 @@
(-- CMAKE_CUDA_COMPILER='[^']+'
-- CMAKE_CUDA_COMPILER_ID='NVIDIA'
-- CMAKE_CUDA_COMPILER_VERSION='([0-9]+)(\.([0-9]+))?(\.([0-9]+))?(\.([0-9]+))?'
+-- CMAKE_CUDA_COMPILER_ARCHITECTURE_ID='[A-Za-z0-9_;]+'
-- CMAKE_CUDA_HOST_COMPILER_ID='[A-Za-z]+'
-- CMAKE_CUDA_HOST_COMPILER_VERSION='([0-9]+)(\.([0-9]+))?(\.([0-9]+))?(\.([0-9]+))?'
|-- CMAKE_CUDA_COMPILER='[^']+'
-- CMAKE_CUDA_COMPILER_ID='([^N]|N[^V]|NV[^I]|NVI[^D]|NVID[^I]|NVIDI[^A])[A-Za-z]*'
-- CMAKE_CUDA_COMPILER_VERSION='([0-9]+)(\.([0-9]+))?(\.([0-9]+))?(\.([0-9]+))?'
+-- CMAKE_CUDA_COMPILER_ARCHITECTURE_ID='[A-Za-z0-9_;]+'
-- CMAKE_CUDA_HOST_COMPILER_ID=''
-- CMAKE_CUDA_HOST_COMPILER_VERSION=''
)
diff --git a/Tests/RunCMake/CompilerId/CUDA.cmake b/Tests/RunCMake/CompilerId/CUDA.cmake
index 874a2ff..8ba97df 100644
--- a/Tests/RunCMake/CompilerId/CUDA.cmake
+++ b/Tests/RunCMake/CompilerId/CUDA.cmake
@@ -2,5 +2,6 @@
message(STATUS "CMAKE_CUDA_COMPILER='${CMAKE_CUDA_COMPILER}'")
message(STATUS "CMAKE_CUDA_COMPILER_ID='${CMAKE_CUDA_COMPILER_ID}'")
message(STATUS "CMAKE_CUDA_COMPILER_VERSION='${CMAKE_CUDA_COMPILER_VERSION}'")
+message(STATUS "CMAKE_CUDA_COMPILER_ARCHITECTURE_ID='${CMAKE_CUDA_COMPILER_ARCHITECTURE_ID}'")
message(STATUS "CMAKE_CUDA_HOST_COMPILER_ID='${CMAKE_CUDA_HOST_COMPILER_ID}'")
message(STATUS "CMAKE_CUDA_HOST_COMPILER_VERSION='${CMAKE_CUDA_HOST_COMPILER_VERSION}'")
diff --git a/Tests/RunCMake/CompilerId/CXX-stdout.txt b/Tests/RunCMake/CompilerId/CXX-stdout.txt
index 4062a97..9fff7df 100644
--- a/Tests/RunCMake/CompilerId/CXX-stdout.txt
+++ b/Tests/RunCMake/CompilerId/CXX-stdout.txt
@@ -1,3 +1,4 @@
-- CMAKE_CXX_COMPILER='[^']+'
-- CMAKE_CXX_COMPILER_ID='[A-Za-z]+'
-- CMAKE_CXX_COMPILER_VERSION='([0-9]+)(\.([0-9]+))?(\.([0-9]+))?(\.([0-9]+))?'
+-- CMAKE_CXX_COMPILER_ARCHITECTURE_ID='[A-Za-z0-9_;]+'
diff --git a/Tests/RunCMake/CompilerId/CXX.cmake b/Tests/RunCMake/CompilerId/CXX.cmake
index 4d8bd0e..eebf5fd 100644
--- a/Tests/RunCMake/CompilerId/CXX.cmake
+++ b/Tests/RunCMake/CompilerId/CXX.cmake
@@ -2,3 +2,4 @@
message(STATUS "CMAKE_CXX_COMPILER='${CMAKE_CXX_COMPILER}'")
message(STATUS "CMAKE_CXX_COMPILER_ID='${CMAKE_CXX_COMPILER_ID}'")
message(STATUS "CMAKE_CXX_COMPILER_VERSION='${CMAKE_CXX_COMPILER_VERSION}'")
+message(STATUS "CMAKE_CXX_COMPILER_ARCHITECTURE_ID='${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}'")
diff --git a/Tests/RunCMake/CompilerId/Fortran-stdout.txt b/Tests/RunCMake/CompilerId/Fortran-stdout.txt
index 6a59c66..cdd17bb 100644
--- a/Tests/RunCMake/CompilerId/Fortran-stdout.txt
+++ b/Tests/RunCMake/CompilerId/Fortran-stdout.txt
@@ -1,3 +1,4 @@
-- CMAKE_Fortran_COMPILER='[^']+'
-- CMAKE_Fortran_COMPILER_ID='[A-Za-z]+'
-- CMAKE_Fortran_COMPILER_VERSION='([0-9]+)(\.([0-9]+))?(\.([0-9]+))?(\.([0-9]+))?'
+-- CMAKE_Fortran_COMPILER_ARCHITECTURE_ID='[A-Za-z0-9_;]+'
diff --git a/Tests/RunCMake/CompilerId/Fortran.cmake b/Tests/RunCMake/CompilerId/Fortran.cmake
index d4ed039..5039f57 100644
--- a/Tests/RunCMake/CompilerId/Fortran.cmake
+++ b/Tests/RunCMake/CompilerId/Fortran.cmake
@@ -2,3 +2,4 @@
message(STATUS "CMAKE_Fortran_COMPILER='${CMAKE_Fortran_COMPILER}'")
message(STATUS "CMAKE_Fortran_COMPILER_ID='${CMAKE_Fortran_COMPILER_ID}'")
message(STATUS "CMAKE_Fortran_COMPILER_VERSION='${CMAKE_Fortran_COMPILER_VERSION}'")
+message(STATUS "CMAKE_Fortran_COMPILER_ARCHITECTURE_ID='${CMAKE_Fortran_COMPILER_ARCHITECTURE_ID}'")
diff --git a/Tests/RunCMake/CompilerId/HIP-stdout.txt b/Tests/RunCMake/CompilerId/HIP-stdout.txt
index ab779aa..6aab4ec 100644
--- a/Tests/RunCMake/CompilerId/HIP-stdout.txt
+++ b/Tests/RunCMake/CompilerId/HIP-stdout.txt
@@ -1,11 +1,13 @@
(-- CMAKE_HIP_COMPILER='[^']+'
-- CMAKE_HIP_COMPILER_ID='NVIDIA'
-- CMAKE_HIP_COMPILER_VERSION='([0-9]+)(\.([0-9]+))?(\.([0-9]+))?(\.([0-9]+))?'
+-- CMAKE_HIP_COMPILER_ARCHITECTURE_ID='[A-Za-z0-9_;]+'
-- CMAKE_HIP_HOST_COMPILER_ID='[A-Za-z]+'
-- CMAKE_HIP_HOST_COMPILER_VERSION='([0-9]+)(\.([0-9]+))?(\.([0-9]+))?(\.([0-9]+))?'
|-- CMAKE_HIP_COMPILER='[^']+'
-- CMAKE_HIP_COMPILER_ID='([^N]|N[^V]|NV[^I]|NVI[^D]|NVID[^I]|NVIDI[^A])[A-Za-z]*'
-- CMAKE_HIP_COMPILER_VERSION='([0-9]+)(\.([0-9]+))?(\.([0-9]+))?(\.([0-9]+))?'
+-- CMAKE_HIP_COMPILER_ARCHITECTURE_ID='[A-Za-z0-9_;]+'
-- CMAKE_HIP_HOST_COMPILER_ID=''
-- CMAKE_HIP_HOST_COMPILER_VERSION=''
)
diff --git a/Tests/RunCMake/CompilerId/HIP.cmake b/Tests/RunCMake/CompilerId/HIP.cmake
index 095c3a8..3fc31b3 100644
--- a/Tests/RunCMake/CompilerId/HIP.cmake
+++ b/Tests/RunCMake/CompilerId/HIP.cmake
@@ -2,5 +2,6 @@
message(STATUS "CMAKE_HIP_COMPILER='${CMAKE_HIP_COMPILER}'")
message(STATUS "CMAKE_HIP_COMPILER_ID='${CMAKE_HIP_COMPILER_ID}'")
message(STATUS "CMAKE_HIP_COMPILER_VERSION='${CMAKE_HIP_COMPILER_VERSION}'")
+message(STATUS "CMAKE_HIP_COMPILER_ARCHITECTURE_ID='${CMAKE_HIP_COMPILER_ARCHITECTURE_ID}'")
message(STATUS "CMAKE_HIP_HOST_COMPILER_ID='${CMAKE_HIP_HOST_COMPILER_ID}'")
message(STATUS "CMAKE_HIP_HOST_COMPILER_VERSION='${CMAKE_HIP_HOST_COMPILER_VERSION}'")
diff --git a/Tests/RunCMake/CompilerId/OBJC-stdout.txt b/Tests/RunCMake/CompilerId/OBJC-stdout.txt
index 528675a..1892caa 100644
--- a/Tests/RunCMake/CompilerId/OBJC-stdout.txt
+++ b/Tests/RunCMake/CompilerId/OBJC-stdout.txt
@@ -1,3 +1,4 @@
-- CMAKE_OBJC_COMPILER='[^']+'
-- CMAKE_OBJC_COMPILER_ID='[A-Za-z]+'
-- CMAKE_OBJC_COMPILER_VERSION='([0-9]+)(\.([0-9]+))?(\.([0-9]+))?(\.([0-9]+))?'
+-- CMAKE_OBJC_COMPILER_ARCHITECTURE_ID='[A-Za-z0-9_;]+'
diff --git a/Tests/RunCMake/CompilerId/OBJC.cmake b/Tests/RunCMake/CompilerId/OBJC.cmake
index 5ae4681..ad78a43 100644
--- a/Tests/RunCMake/CompilerId/OBJC.cmake
+++ b/Tests/RunCMake/CompilerId/OBJC.cmake
@@ -2,3 +2,4 @@
message(STATUS "CMAKE_OBJC_COMPILER='${CMAKE_OBJC_COMPILER}'")
message(STATUS "CMAKE_OBJC_COMPILER_ID='${CMAKE_OBJC_COMPILER_ID}'")
message(STATUS "CMAKE_OBJC_COMPILER_VERSION='${CMAKE_OBJC_COMPILER_VERSION}'")
+message(STATUS "CMAKE_OBJC_COMPILER_ARCHITECTURE_ID='${CMAKE_OBJC_COMPILER_ARCHITECTURE_ID}'")
diff --git a/Tests/RunCMake/CompilerId/OBJCXX-stdout.txt b/Tests/RunCMake/CompilerId/OBJCXX-stdout.txt
index 9d7f822..239217e 100644
--- a/Tests/RunCMake/CompilerId/OBJCXX-stdout.txt
+++ b/Tests/RunCMake/CompilerId/OBJCXX-stdout.txt
@@ -1,3 +1,4 @@
-- CMAKE_OBJCXX_COMPILER='[^']+'
-- CMAKE_OBJCXX_COMPILER_ID='[A-Za-z]+'
-- CMAKE_OBJCXX_COMPILER_VERSION='([0-9]+)(\.([0-9]+))?(\.([0-9]+))?(\.([0-9]+))?'
+-- CMAKE_OBJCXX_COMPILER_ARCHITECTURE_ID='[A-Za-z0-9_;]+'
diff --git a/Tests/RunCMake/CompilerId/OBJCXX.cmake b/Tests/RunCMake/CompilerId/OBJCXX.cmake
index 0e1875b..7d25237 100644
--- a/Tests/RunCMake/CompilerId/OBJCXX.cmake
+++ b/Tests/RunCMake/CompilerId/OBJCXX.cmake
@@ -2,3 +2,4 @@
message(STATUS "CMAKE_OBJCXX_COMPILER='${CMAKE_OBJCXX_COMPILER}'")
message(STATUS "CMAKE_OBJCXX_COMPILER_ID='${CMAKE_OBJCXX_COMPILER_ID}'")
message(STATUS "CMAKE_OBJCXX_COMPILER_VERSION='${CMAKE_OBJCXX_COMPILER_VERSION}'")
+message(STATUS "CMAKE_OBJCXX_COMPILER_ARCHITECTURE_ID='${CMAKE_OBJCXX_COMPILER_ARCHITECTURE_ID}'")
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/CpsExportImport/CMakeLists.txt b/Tests/RunCMake/Diab/CMakeLists.txt
similarity index 100%
copy from Tests/RunCMake/CpsExportImport/CMakeLists.txt
copy to Tests/RunCMake/Diab/CMakeLists.txt
diff --git a/Tests/RunCMake/Diab/RunCMakeTest.cmake b/Tests/RunCMake/Diab/RunCMakeTest.cmake
new file mode 100644
index 0000000..287a308
--- /dev/null
+++ b/Tests/RunCMake/Diab/RunCMakeTest.cmake
@@ -0,0 +1,42 @@
+include(RunCMake)
+
+# Locate Diab toolchain
+if(RunCMake_GENERATOR MATCHES "Makefile|Ninja")
+ file(GLOB _diab_toolchains
+ "${CMake_TEST_Diab_TOOLCHAINS}/*/*/bin/dcc*" )
+ if(_diab_toolchains STREQUAL "")
+ message(FATAL_ERROR "Could not find any Diab toolchains at: ${CMake_TEST_Diab_TOOLCHAINS}.")
+ endif()
+endif()
+
+function(run_toolchain case)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${case}-build)
+ run_cmake_with_options(${case} ${ARGN})
+ set(RunCMake_TEST_NO_CLEAN 1)
+ run_cmake_command(${case}-build ${CMAKE_COMMAND} --build .)
+endfunction()
+
+
+foreach(_diab_toolchain IN LISTS _diab_toolchains)
+ message(STATUS "Found Diab toolchain: ${_diab_toolchain}")
+ cmake_path(GET _diab_toolchain PARENT_PATH BIN_DIR)
+ set(c_comp ${BIN_DIR}/dcc)
+ set(cxx_comp ${BIN_DIR}/dplus)
+
+ # Create an executable from .c sources only.
+ run_toolchain(diab-c
+ -DCMAKE_C_COMPILER=${c_comp}
+ )
+
+ # Create an executale from .c and .cxx sources.
+ run_toolchain(diab-cxx
+ -DCMAKE_C_COMPILER=${c_comp}
+ -DCMAKE_CXX_COMPILER=${cxx_comp}
+ )
+
+ # Create an executable from mixed, c, cxx and assembly.
+ run_toolchain(diab-asm
+ -DCMAKE_C_COMPILER=${c_comp}
+ -DCMAKE_CXX_COMPILER=${cxx_comp}
+ )
+endforeach()
diff --git a/Tests/RunCMake/Diab/diab-asm.cmake b/Tests/RunCMake/Diab/diab-asm.cmake
new file mode 100644
index 0000000..41edc68
--- /dev/null
+++ b/Tests/RunCMake/Diab/diab-asm.cmake
@@ -0,0 +1,2 @@
+enable_language(ASM)
+add_executable(exec-asm module.s)
diff --git a/Tests/RunCMake/Diab/diab-c.cmake b/Tests/RunCMake/Diab/diab-c.cmake
new file mode 100644
index 0000000..39325a7
--- /dev/null
+++ b/Tests/RunCMake/Diab/diab-c.cmake
@@ -0,0 +1,2 @@
+enable_language(C)
+add_executable(exec-c module.c)
diff --git a/Tests/RunCMake/Diab/diab-cxx.cmake b/Tests/RunCMake/Diab/diab-cxx.cmake
new file mode 100644
index 0000000..9e00aa3
--- /dev/null
+++ b/Tests/RunCMake/Diab/diab-cxx.cmake
@@ -0,0 +1,2 @@
+enable_language(CXX)
+add_executable(exec-cxx module.cxx)
diff --git a/Tests/RunCMake/Diab/diab-lib.cmake b/Tests/RunCMake/Diab/diab-lib.cmake
new file mode 100644
index 0000000..62593cf
--- /dev/null
+++ b/Tests/RunCMake/Diab/diab-lib.cmake
@@ -0,0 +1,7 @@
+enable_language(C)
+add_library(diab-test-lib libmod.c)
+
+add_executable(exec-lib-c module.c)
+target_compile_options(exec-lib-c)
+target_compile_definitions(exec-lib-c PRIVATE __USE_LIBFUN)
+target_link_libraries(exec-lib-c PRIVATE diab-test-lib)
diff --git a/Tests/RunCMake/Diab/libmod.c b/Tests/RunCMake/Diab/libmod.c
new file mode 100644
index 0000000..e42ae99
--- /dev/null
+++ b/Tests/RunCMake/Diab/libmod.c
@@ -0,0 +1,4 @@
+int diab_libfun()
+{
+ return 42;
+}
diff --git a/Tests/RunCMake/Diab/module.c b/Tests/RunCMake/Diab/module.c
new file mode 100644
index 0000000..601b65b
--- /dev/null
+++ b/Tests/RunCMake/Diab/module.c
@@ -0,0 +1,15 @@
+#include "module.h"
+#if defined(__USE_LIBFUN)
+extern int diab_libfun();
+#endif
+
+int i;
+int main()
+{
+#if defined(__USE_LIBFUN)
+ i = diab_libfun();
+#else
+ i = INTERNAL;
+#endif
+ return i;
+}
diff --git a/Tests/RunCMake/Diab/module.cxx b/Tests/RunCMake/Diab/module.cxx
new file mode 100644
index 0000000..b4d46b1
--- /dev/null
+++ b/Tests/RunCMake/Diab/module.cxx
@@ -0,0 +1,7 @@
+#include "module.h"
+int i;
+int main()
+{
+ i = INTERNAL;
+ return i;
+}
diff --git a/Tests/RunCMake/Diab/module.h b/Tests/RunCMake/Diab/module.h
new file mode 100644
index 0000000..a8a85a6
--- /dev/null
+++ b/Tests/RunCMake/Diab/module.h
@@ -0,0 +1,12 @@
+#ifndef __MODULE_H__
+#define __MODULE_H__
+
+#if defined(__cplusplus)
+# define INTERNAL 64
+#elif !defined(__cplusplus)
+# define INTERNAL 32
+#else
+# error "Unable to determine INTERNAL symbol."
+#endif
+
+#endif /* __MODULE_H__ */
diff --git a/Tests/RunCMake/Diab/module.s b/Tests/RunCMake/Diab/module.s
new file mode 100644
index 0000000..91faa7d
--- /dev/null
+++ b/Tests/RunCMake/Diab/module.s
@@ -0,0 +1,10 @@
+; module.s: assembly "main" function returns 32.
+;
+ .name "module.s"
+ .text
+ .align 2
+
+ .globl main
+main:
+ diab.li r3,32
+ blr
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 93%
copy from Tests/RunCMake/PackageInfo/RunCMakeTest.cmake
copy to Tests/RunCMake/ExportPackageInfo/RunCMakeTest.cmake
index 4b3493e..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)
@@ -34,4 +35,3 @@
run_cmake(Requirements)
run_cmake(TargetTypes)
run_cmake(DependsMultiple)
-run_cmake(DependsMultipleNotInstalled)
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/Framework/FrameworkLayout.cmake b/Tests/RunCMake/Framework/FrameworkLayout.cmake
index e230e07..4975684 100644
--- a/Tests/RunCMake/Framework/FrameworkLayout.cmake
+++ b/Tests/RunCMake/Framework/FrameworkLayout.cmake
@@ -9,6 +9,7 @@
res.txt
flatresource.txt
deepresource.txt
+ assets
some.txt)
if("${CMAKE_FRAMEWORK}" STREQUAL "")
set_target_properties(Framework PROPERTIES
@@ -23,6 +24,7 @@
RESOURCE "res.txt")
set_source_files_properties(flatresource.txt PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
set_source_files_properties(deepresource.txt PROPERTIES MACOSX_PACKAGE_LOCATION Resources/deep)
+set_source_files_properties(assets PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
set_source_files_properties(some.txt PROPERTIES MACOSX_PACKAGE_LOCATION somedir)
add_custom_command(TARGET Framework POST_BUILD
diff --git a/Tests/RunCMake/Framework/OSXFrameworkLayout-build-check.cmake b/Tests/RunCMake/Framework/OSXFrameworkLayout-build-check.cmake
index b436128..a72810e 100644
--- a/Tests/RunCMake/Framework/OSXFrameworkLayout-build-check.cmake
+++ b/Tests/RunCMake/Framework/OSXFrameworkLayout-build-check.cmake
@@ -3,6 +3,8 @@
set(framework-resource-file "${framework-resources}/res.txt")
set(framework-flat-resource-file "${framework-resources}/flatresource.txt")
set(framework-deep-resource-file "${framework-resources}/deep/deepresource.txt")
+set(framework-assets-dir "${framework-resources}/assets")
+set(framework-assets-file "${framework-assets-dir}/asset.txt")
set(framework-library "${framework-dir}/Framework")
set(framework-versions "${framework-dir}/Versions")
set(framework-some-file "${framework-versions}/Current/somedir/some.txt")
@@ -39,6 +41,16 @@
return()
endif()
+if(NOT IS_DIRECTORY ${framework-assets-dir})
+ set(RunCMake_TEST_FAILED "Framework assets directory not found at \n ${framework-assets-dir}")
+ return()
+endif()
+
+if(NOT EXISTS ${framework-assets-file})
+ set(RunCMake_TEST_FAILED "Framework asset file not found at \n ${framework-assets-file}")
+ return()
+endif()
+
if(NOT EXISTS ${framework-some-file})
set(RunCMake_TEST_FAILED "Framework some file not found at \n ${framework-some-file}")
return()
diff --git a/Tests/RunCMake/Framework/assets/asset.txt b/Tests/RunCMake/Framework/assets/asset.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/RunCMake/Framework/assets/asset.txt
diff --git a/Tests/RunCMake/Framework/iOSFrameworkLayout-build-check.cmake b/Tests/RunCMake/Framework/iOSFrameworkLayout-build-check.cmake
index be9a5fe..5d373fd 100644
--- a/Tests/RunCMake/Framework/iOSFrameworkLayout-build-check.cmake
+++ b/Tests/RunCMake/Framework/iOSFrameworkLayout-build-check.cmake
@@ -3,6 +3,8 @@
set(framework-resource-file "${framework-dir}/res.txt")
set(framework-flat-resource-file "${framework-dir}/flatresource.txt")
set(framework-deep-resource-file "${framework-dir}/deep/deepresource.txt")
+set(framework-assets-dir "${framework-dir}/assets")
+set(framework-assets-file "${framework-assets-dir}/asset.txt")
set(framework-some-file "${framework-dir}/somedir/some.txt")
set(framework-library "${framework-dir}/Framework")
set(framework-versions "${framework-dir}/Versions")
@@ -39,6 +41,16 @@
return()
endif()
+if(NOT IS_DIRECTORY ${framework-assets-dir})
+ set(RunCMake_TEST_FAILED "Framework assets directory not found at \n ${framework-assets-dir}")
+ return()
+endif()
+
+if(NOT EXISTS ${framework-assets-file})
+ set(RunCMake_TEST_FAILED "Framework asset file not found at \n ${framework-assets-file}")
+ return()
+endif()
+
if(NOT EXISTS ${framework-some-file})
set(RunCMake_TEST_FAILED "Framework some file not found at\n ${framework-some-file}")
return()
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/OUTPUT_NAME-recursion-stderr.txt b/Tests/RunCMake/GenEx-TARGET_FILE/OUTPUT_NAME-recursion-stderr.txt
index 9af0573..d0451b3 100644
--- a/Tests/RunCMake/GenEx-TARGET_FILE/OUTPUT_NAME-recursion-stderr.txt
+++ b/Tests/RunCMake/GenEx-TARGET_FILE/OUTPUT_NAME-recursion-stderr.txt
@@ -2,8 +2,7 @@
Target 'empty1' OUTPUT_NAME depends on itself.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
-
-
+.*
CMake Error at OUTPUT_NAME-recursion.cmake:[0-9]+ \(add_executable\):
Target 'empty2' OUTPUT_NAME depends on itself.
Call Stack \(most recent call first\):
diff --git a/Tests/RunCMake/PackageInfo/BadArgs1-result.txt b/Tests/RunCMake/GenEx-TARGET_FILE/PDB_NAME-recursion-result.txt
similarity index 100%
copy from Tests/RunCMake/PackageInfo/BadArgs1-result.txt
copy to Tests/RunCMake/GenEx-TARGET_FILE/PDB_NAME-recursion-result.txt
diff --git a/Tests/RunCMake/GenEx-TARGET_FILE/PDB_NAME-recursion-stderr.txt b/Tests/RunCMake/GenEx-TARGET_FILE/PDB_NAME-recursion-stderr.txt
new file mode 100644
index 0000000..5d288db
--- /dev/null
+++ b/Tests/RunCMake/GenEx-TARGET_FILE/PDB_NAME-recursion-stderr.txt
@@ -0,0 +1,9 @@
+CMake Error at PDB_NAME-recursion.cmake:[0-9]+ \(add_executable\):
+ Target 'empty1' PDB_NAME depends on itself.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
+.*
+CMake Error at PDB_NAME-recursion.cmake:[0-9]+ \(add_executable\):
+ Target 'empty2' PDB_NAME depends on itself.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/GenEx-TARGET_FILE/PDB_NAME-recursion.cmake b/Tests/RunCMake/GenEx-TARGET_FILE/PDB_NAME-recursion.cmake
new file mode 100644
index 0000000..f9b1648
--- /dev/null
+++ b/Tests/RunCMake/GenEx-TARGET_FILE/PDB_NAME-recursion.cmake
@@ -0,0 +1,6 @@
+enable_language(C)
+add_executable(empty1 empty.c)
+set_property(TARGET empty1 PROPERTY PDB_NAME $<TARGET_PDB_FILE_NAME:empty1>)
+
+add_executable(empty2 empty.c)
+set_property(TARGET empty2 PROPERTY OUTPUT_NAME $<TARGET_PDB_FILE_BASE_NAME:empty2>)
diff --git a/Tests/RunCMake/GenEx-TARGET_FILE/RunCMakeTest.cmake b/Tests/RunCMake/GenEx-TARGET_FILE/RunCMakeTest.cmake
index 5abea25..16bc894 100644
--- a/Tests/RunCMake/GenEx-TARGET_FILE/RunCMakeTest.cmake
+++ b/Tests/RunCMake/GenEx-TARGET_FILE/RunCMakeTest.cmake
@@ -32,6 +32,7 @@
run_cmake(ImportedTarget-TARGET_PDB_FILE)
run_cmake(ImportedTarget-TARGET_PDB_FILE_BASE_NAME)
if(LINKER_SUPPORTS_PDB)
+ run_cmake(PDB_NAME-recursion)
run_cmake(NonValidTarget-TARGET_PDB_FILE)
run_cmake(ValidTarget-TARGET_PDB_FILE)
run_cmake(NonValidTarget-TARGET_PDB_FILE_BASE_NAME)
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/DependsMultipleNotInstalled.cmake b/Tests/RunCMake/InstallPackageInfo/DependsMultipleNotInstalled.cmake
similarity index 100%
rename from Tests/RunCMake/PackageInfo/DependsMultipleNotInstalled.cmake
rename to Tests/RunCMake/InstallPackageInfo/DependsMultipleNotInstalled.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 4b3493e..71910a8 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/Instrumentation/bad-hook-stderr.txt b/Tests/RunCMake/Instrumentation/bad-hook-stderr.txt
index 651de1d..6ef5f48 100644
--- a/Tests/RunCMake/Instrumentation/bad-hook-stderr.txt
+++ b/Tests/RunCMake/Instrumentation/bad-hook-stderr.txt
@@ -1,4 +1,5 @@
-^CMake Error: +
-Error: @3,13: Not a valid hook: "bad hook"
+^CMake Error: Could not load instrumentation queries from [^
+]+:
+bad-hook.json:3: Not a valid hook: "bad hook"
"hooks": \["bad hook", "postGenerate", "preCMakeBuild", "postCMakeBuild", "postInstall"\]
\^$
diff --git a/Tests/RunCMake/Instrumentation/bad-query-stderr.txt b/Tests/RunCMake/Instrumentation/bad-query-stderr.txt
index caa0eec..93be7e4 100644
--- a/Tests/RunCMake/Instrumentation/bad-query-stderr.txt
+++ b/Tests/RunCMake/Instrumentation/bad-query-stderr.txt
@@ -1,4 +1,5 @@
-^CMake Error: +
-Error: @3,42: Not a valid query: "bad query"
+^CMake Error: Could not load instrumentation queries from [^
+]+:
+bad-query.json:[0-9]+: Not a valid query: "bad query"
"queries": \["staticSystemInformation", "bad query"\]
\^$
diff --git a/Tests/RunCMake/Instrumentation/empty-stderr.txt b/Tests/RunCMake/Instrumentation/empty-stderr.txt
index c8a5397..b5ae5f8 100644
--- a/Tests/RunCMake/Instrumentation/empty-stderr.txt
+++ b/Tests/RunCMake/Instrumentation/empty-stderr.txt
@@ -1,4 +1,5 @@
-^CMake Error: +
-Error: @1,1: Missing required field "version" in root object
+^CMake Error: Could not load instrumentation queries from [^
+]+:
+empty.json:[0-9]+: Missing required field "version" in root object
{
\^$
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/cmake_pkg_config/TestEnv-stderr.txt b/Tests/RunCMake/cmake_pkg_config/ExtractEnv-stderr.txt
similarity index 100%
rename from Tests/RunCMake/cmake_pkg_config/TestEnv-stderr.txt
rename to Tests/RunCMake/cmake_pkg_config/ExtractEnv-stderr.txt
diff --git a/Tests/RunCMake/cmake_pkg_config/TestEnv.cmake b/Tests/RunCMake/cmake_pkg_config/ExtractEnv.cmake
similarity index 100%
rename from Tests/RunCMake/cmake_pkg_config/TestEnv.cmake
rename to Tests/RunCMake/cmake_pkg_config/ExtractEnv.cmake
diff --git a/Tests/RunCMake/cmake_pkg_config/TestExtract-stderr.txt b/Tests/RunCMake/cmake_pkg_config/ExtractFields-stderr.txt
similarity index 100%
rename from Tests/RunCMake/cmake_pkg_config/TestExtract-stderr.txt
rename to Tests/RunCMake/cmake_pkg_config/ExtractFields-stderr.txt
diff --git a/Tests/RunCMake/cmake_pkg_config/TestExtract.cmake b/Tests/RunCMake/cmake_pkg_config/ExtractFields.cmake
similarity index 100%
rename from Tests/RunCMake/cmake_pkg_config/TestExtract.cmake
rename to Tests/RunCMake/cmake_pkg_config/ExtractFields.cmake
diff --git a/Tests/RunCMake/cmake_pkg_config/TestMangle-stderr.txt b/Tests/RunCMake/cmake_pkg_config/ExtractMangle-stderr.txt
similarity index 100%
rename from Tests/RunCMake/cmake_pkg_config/TestMangle-stderr.txt
rename to Tests/RunCMake/cmake_pkg_config/ExtractMangle-stderr.txt
diff --git a/Tests/RunCMake/cmake_pkg_config/TestMangle.cmake b/Tests/RunCMake/cmake_pkg_config/ExtractMangle.cmake
similarity index 100%
rename from Tests/RunCMake/cmake_pkg_config/TestMangle.cmake
rename to Tests/RunCMake/cmake_pkg_config/ExtractMangle.cmake
diff --git a/Tests/RunCMake/cmake_pkg_config/TestQuiet.cmake b/Tests/RunCMake/cmake_pkg_config/ExtractQuiet.cmake
similarity index 100%
rename from Tests/RunCMake/cmake_pkg_config/TestQuiet.cmake
rename to Tests/RunCMake/cmake_pkg_config/ExtractQuiet.cmake
diff --git a/Tests/RunCMake/cmake_pkg_config/TestRequired-result.txt b/Tests/RunCMake/cmake_pkg_config/ExtractRequired-result.txt
similarity index 100%
rename from Tests/RunCMake/cmake_pkg_config/TestRequired-result.txt
rename to Tests/RunCMake/cmake_pkg_config/ExtractRequired-result.txt
diff --git a/Tests/RunCMake/cmake_pkg_config/ExtractRequired-stderr.txt b/Tests/RunCMake/cmake_pkg_config/ExtractRequired-stderr.txt
new file mode 100644
index 0000000..735b142
--- /dev/null
+++ b/Tests/RunCMake/cmake_pkg_config/ExtractRequired-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at ExtractRequired.cmake:[0-9]+ \(cmake_pkg_config\):
+ cmake_pkg_config Could not find pkg-config: 'does-not-exist'
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/cmake_pkg_config/TestRequired.cmake b/Tests/RunCMake/cmake_pkg_config/ExtractRequired.cmake
similarity index 100%
rename from Tests/RunCMake/cmake_pkg_config/TestRequired.cmake
rename to Tests/RunCMake/cmake_pkg_config/ExtractRequired.cmake
diff --git a/Tests/RunCMake/cmake_pkg_config/TestReroot-stderr.txt b/Tests/RunCMake/cmake_pkg_config/ExtractReroot-stderr.txt
similarity index 100%
rename from Tests/RunCMake/cmake_pkg_config/TestReroot-stderr.txt
rename to Tests/RunCMake/cmake_pkg_config/ExtractReroot-stderr.txt
diff --git a/Tests/RunCMake/cmake_pkg_config/TestReroot.cmake b/Tests/RunCMake/cmake_pkg_config/ExtractReroot.cmake
similarity index 100%
rename from Tests/RunCMake/cmake_pkg_config/TestReroot.cmake
rename to Tests/RunCMake/cmake_pkg_config/ExtractReroot.cmake
diff --git a/Tests/RunCMake/cmake_pkg_config/TestStrictness-BEST_EFFORT-stderr.txt b/Tests/RunCMake/cmake_pkg_config/ExtractStrictness-BEST_EFFORT-stderr.txt
similarity index 100%
rename from Tests/RunCMake/cmake_pkg_config/TestStrictness-BEST_EFFORT-stderr.txt
rename to Tests/RunCMake/cmake_pkg_config/ExtractStrictness-BEST_EFFORT-stderr.txt
diff --git a/Tests/RunCMake/cmake_pkg_config/TestStrictness-PERMISSIVE-stderr.txt b/Tests/RunCMake/cmake_pkg_config/ExtractStrictness-PERMISSIVE-stderr.txt
similarity index 69%
rename from Tests/RunCMake/cmake_pkg_config/TestStrictness-PERMISSIVE-stderr.txt
rename to Tests/RunCMake/cmake_pkg_config/ExtractStrictness-PERMISSIVE-stderr.txt
index 2f4a69c..b07571f 100644
--- a/Tests/RunCMake/cmake_pkg_config/TestStrictness-PERMISSIVE-stderr.txt
+++ b/Tests/RunCMake/cmake_pkg_config/ExtractStrictness-PERMISSIVE-stderr.txt
@@ -1,25 +1,25 @@
-CMake Warning at TestStrictness.cmake:[0-9]+ \(cmake_pkg_config\):
+CMake Warning at ExtractStrictness.cmake:[0-9]+ \(cmake_pkg_config\):
Resolution failed for file[^
]*(.)*/PackageRoot/no-name.pc'
Call Stack \(most recent call first\):
CMakeLists.txt:[0-9]+ \(include\)
-CMake Warning at TestStrictness.cmake:[0-9]+ \(cmake_pkg_config\):
+CMake Warning at ExtractStrictness.cmake:[0-9]+ \(cmake_pkg_config\):
Resolution failed for file[^
]*(.)*/PackageRoot/no-description.pc'
Call Stack \(most recent call first\):
CMakeLists.txt:[0-9]+ \(include\)
-CMake Warning at TestStrictness.cmake:[0-9]+ \(cmake_pkg_config\):
+CMake Warning at ExtractStrictness.cmake:[0-9]+ \(cmake_pkg_config\):
Resolution failed for file[^
]*(.)*/PackageRoot/no-version.pc'
Call Stack \(most recent call first\):
CMakeLists.txt:[0-9]+ \(include\)
-CMake Warning at TestStrictness.cmake:[0-9]+ \(cmake_pkg_config\):
+CMake Warning at ExtractStrictness.cmake:[0-9]+ \(cmake_pkg_config\):
Parsing failed for file[^
]*(.)*/PackageRoot/invalid.pc'
Call Stack \(most recent call first\):
diff --git a/Tests/RunCMake/cmake_pkg_config/TestStrictness-STRICT-stderr.txt b/Tests/RunCMake/cmake_pkg_config/ExtractStrictness-STRICT-stderr.txt
similarity index 68%
rename from Tests/RunCMake/cmake_pkg_config/TestStrictness-STRICT-stderr.txt
rename to Tests/RunCMake/cmake_pkg_config/ExtractStrictness-STRICT-stderr.txt
index 7329e8d..1ddc841 100644
--- a/Tests/RunCMake/cmake_pkg_config/TestStrictness-STRICT-stderr.txt
+++ b/Tests/RunCMake/cmake_pkg_config/ExtractStrictness-STRICT-stderr.txt
@@ -1,25 +1,25 @@
-CMake Warning at TestStrictness.cmake:[0-9]+ \(cmake_pkg_config\):
+CMake Warning at ExtractStrictness.cmake:[0-9]+ \(cmake_pkg_config\):
Resolution failed for file[^
]*(.)*/PackageRoot/no-name.pc'
Call Stack \(most recent call first\):
CMakeLists.txt:[0-9]+ \(include\)
-CMake Warning at TestStrictness.cmake:[0-9]+ \(cmake_pkg_config\):
+CMake Warning at ExtractStrictness.cmake:[0-9]+ \(cmake_pkg_config\):
Resolution failed for file[^
]*(.)*/PackageRoot/no-description.pc'
Call Stack \(most recent call first\):
CMakeLists.txt:[0-9]+ \(include\)
-CMake Warning at TestStrictness.cmake:[0-9]+ \(cmake_pkg_config\):
+CMake Warning at ExtractStrictness.cmake:[0-9]+ \(cmake_pkg_config\):
Resolution failed for file[^
]*(.)*/PackageRoot/no-version.pc'
Call Stack \(most recent call first\):
CMakeLists.txt:[0-9]+ \(include\)
-CMake Warning at TestStrictness.cmake:[0-9]+ \(cmake_pkg_config\):
+CMake Warning at ExtractStrictness.cmake:[0-9]+ \(cmake_pkg_config\):
Parsing failed for file[^
]*(.)*/PackageRoot/invalid.pc'
Call Stack \(most recent call first\):
@@ -28,7 +28,7 @@
Cflags: lowercase
CFlags: uppercase
-CMake Warning at TestStrictness.cmake:[0-9]+ \(cmake_pkg_config\):
+CMake Warning at ExtractStrictness.cmake:[0-9]+ \(cmake_pkg_config\):
Resolution failed for file[^
]*(.)*/PackageRoot/cflags-bothcase-f.pc'
Call Stack \(most recent call first\):
diff --git a/Tests/RunCMake/cmake_pkg_config/TestStrictness.cmake b/Tests/RunCMake/cmake_pkg_config/ExtractStrictness.cmake
similarity index 100%
rename from Tests/RunCMake/cmake_pkg_config/TestStrictness.cmake
rename to Tests/RunCMake/cmake_pkg_config/ExtractStrictness.cmake
diff --git a/Tests/RunCMake/cmake_pkg_config/TestUninstalled-stderr.txt b/Tests/RunCMake/cmake_pkg_config/ExtractUninstalled-stderr.txt
similarity index 100%
rename from Tests/RunCMake/cmake_pkg_config/TestUninstalled-stderr.txt
rename to Tests/RunCMake/cmake_pkg_config/ExtractUninstalled-stderr.txt
diff --git a/Tests/RunCMake/cmake_pkg_config/TestUninstalled.cmake b/Tests/RunCMake/cmake_pkg_config/ExtractUninstalled.cmake
similarity index 100%
rename from Tests/RunCMake/cmake_pkg_config/TestUninstalled.cmake
rename to Tests/RunCMake/cmake_pkg_config/ExtractUninstalled.cmake
diff --git a/Tests/RunCMake/cmake_pkg_config/TestVersion-stderr.txt b/Tests/RunCMake/cmake_pkg_config/ExtractVersion-stderr.txt
similarity index 69%
rename from Tests/RunCMake/cmake_pkg_config/TestVersion-stderr.txt
rename to Tests/RunCMake/cmake_pkg_config/ExtractVersion-stderr.txt
index 4b710d8..551efb2 100644
--- a/Tests/RunCMake/cmake_pkg_config/TestVersion-stderr.txt
+++ b/Tests/RunCMake/cmake_pkg_config/ExtractVersion-stderr.txt
@@ -1,103 +1,103 @@
-CMake Warning at TestVersion.cmake:[0-9]+ \(cmake_pkg_config\):
+CMake Warning at ExtractVersion.cmake:[0-9]+ \(cmake_pkg_config\):
Package 'a' version 'aa' does not meet version requirement '<a'
Call Stack \(most recent call first\):
CMakeLists.txt:[0-9]+ \(include\)
-CMake Warning at TestVersion.cmake:[0-9]+ \(cmake_pkg_config\):
+CMake Warning at ExtractVersion.cmake:[0-9]+ \(cmake_pkg_config\):
Package 'a' version 'aa' does not meet version requirement '>aaa'
Call Stack \(most recent call first\):
CMakeLists.txt:[0-9]+ \(include\)
-CMake Warning at TestVersion.cmake:[0-9]+ \(cmake_pkg_config\):
+CMake Warning at ExtractVersion.cmake:[0-9]+ \(cmake_pkg_config\):
Package 'a' version 'aa' does not meet version requirement '>bb'
Call Stack \(most recent call first\):
CMakeLists.txt:[0-9]+ \(include\)
-CMake Warning at TestVersion.cmake:[0-9]+ \(cmake_pkg_config\):
+CMake Warning at ExtractVersion.cmake:[0-9]+ \(cmake_pkg_config\):
Package 'a' version 'aa' does not meet version requirement '>1'
Call Stack \(most recent call first\):
CMakeLists.txt:[0-9]+ \(include\)
-CMake Warning at TestVersion.cmake:[0-9]+ \(cmake_pkg_config\):
+CMake Warning at ExtractVersion.cmake:[0-9]+ \(cmake_pkg_config\):
Package 'empty-key' version '' does not meet version requirement '!='
Call Stack \(most recent call first\):
CMakeLists.txt:[0-9]+ \(include\)
-CMake Warning at TestVersion.cmake:[0-9]+ \(cmake_pkg_config\):
+CMake Warning at ExtractVersion.cmake:[0-9]+ \(cmake_pkg_config\):
Package 'empty-key' version '' does not meet version requirement '=0'
Call Stack \(most recent call first\):
CMakeLists.txt:[0-9]+ \(include\)
-CMake Warning at TestVersion.cmake:[0-9]+ \(cmake_pkg_config\):
+CMake Warning at ExtractVersion.cmake:[0-9]+ \(cmake_pkg_config\):
Package 'one' version '11' does not meet version requirement '<1'
Call Stack \(most recent call first\):
CMakeLists.txt:[0-9]+ \(include\)
-CMake Warning at TestVersion.cmake:[0-9]+ \(cmake_pkg_config\):
+CMake Warning at ExtractVersion.cmake:[0-9]+ \(cmake_pkg_config\):
Package 'one' version '11' does not meet version requirement '>111'
Call Stack \(most recent call first\):
CMakeLists.txt:[0-9]+ \(include\)
-CMake Warning at TestVersion.cmake:[0-9]+ \(cmake_pkg_config\):
+CMake Warning at ExtractVersion.cmake:[0-9]+ \(cmake_pkg_config\):
Package 'one' version '11' does not meet version requirement '>22'
Call Stack \(most recent call first\):
CMakeLists.txt:[0-9]+ \(include\)
-CMake Warning at TestVersion.cmake:[0-9]+ \(cmake_pkg_config\):
+CMake Warning at ExtractVersion.cmake:[0-9]+ \(cmake_pkg_config\):
Package 'one' version '11' does not meet version requirement '<a'
Call Stack \(most recent call first\):
CMakeLists.txt:[0-9]+ \(include\)
-CMake Warning at TestVersion.cmake:[0-9]+ \(cmake_pkg_config\):
+CMake Warning at ExtractVersion.cmake:[0-9]+ \(cmake_pkg_config\):
Package 'onedot' version '1.1.1' does not meet version requirement '>1.2.1'
Call Stack \(most recent call first\):
CMakeLists.txt:[0-9]+ \(include\)
-CMake Warning at TestVersion.cmake:[0-9]+ \(cmake_pkg_config\):
+CMake Warning at ExtractVersion.cmake:[0-9]+ \(cmake_pkg_config\):
Package 'onedot' version '1.1.1' does not meet version requirement '>
1.2.1'
Call Stack \(most recent call first\):
CMakeLists.txt:[0-9]+ \(include\)
-CMake Warning at TestVersion.cmake:[0-9]+ \(cmake_pkg_config\):
+CMake Warning at ExtractVersion.cmake:[0-9]+ \(cmake_pkg_config\):
Package 'onedot' version '1.1.1' does not meet exact version requirement
'01.01.01'
Call Stack \(most recent call first\):
CMakeLists.txt:[0-9]+ \(include\)
-CMake Warning at TestVersion.cmake:[0-9]+ \(cmake_pkg_config\):
+CMake Warning at ExtractVersion.cmake:[0-9]+ \(cmake_pkg_config\):
Package 'pseudo-empty' version '~0' does not meet version requirement '=~'
Call Stack \(most recent call first\):
CMakeLists.txt:[0-9]+ \(include\)
-CMake Warning at TestVersion.cmake:[0-9]+ \(cmake_pkg_config\):
+CMake Warning at ExtractVersion.cmake:[0-9]+ \(cmake_pkg_config\):
Package 'pseudo-empty' version '~0' does not meet version requirement
'!=~0'
Call Stack \(most recent call first\):
CMakeLists.txt:[0-9]+ \(include\)
-CMake Warning at TestVersion.cmake:[0-9]+ \(cmake_pkg_config\):
+CMake Warning at ExtractVersion.cmake:[0-9]+ \(cmake_pkg_config\):
Package 'tilde' version '~~1' does not meet version requirement '>~1'
Call Stack \(most recent call first\):
CMakeLists.txt:[0-9]+ \(include\)
-CMake Warning at TestVersion.cmake:[0-9]+ \(cmake_pkg_config\):
+CMake Warning at ExtractVersion.cmake:[0-9]+ \(cmake_pkg_config\):
Package 'tilde' version '~~1' does not meet version requirement '<~~~1'
Call Stack \(most recent call first\):
CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/cmake_pkg_config/TestVersion.cmake b/Tests/RunCMake/cmake_pkg_config/ExtractVersion.cmake
similarity index 100%
rename from Tests/RunCMake/cmake_pkg_config/TestVersion.cmake
rename to Tests/RunCMake/cmake_pkg_config/ExtractVersion.cmake
diff --git a/Tests/RunCMake/cmake_pkg_config/ImportName.cmake b/Tests/RunCMake/cmake_pkg_config/ImportName.cmake
new file mode 100644
index 0000000..216a9b1
--- /dev/null
+++ b/Tests/RunCMake/cmake_pkg_config/ImportName.cmake
@@ -0,0 +1,13 @@
+set(CMAKE_PKG_CONFIG_PC_PATH ${CMAKE_CURRENT_LIST_DIR}/PackageRoot/RequiresPackages)
+
+cmake_pkg_config(IMPORT alpha REQUIRED
+ NAME moe
+)
+
+if(TARGET PkgConfig::alpha)
+ message("cmake_pkg_config target rename created PkgConfig::<package> target")
+endif()
+
+if(NOT TARGET PkgConfig::moe)
+ message("cmake_pkg_config target rename failed to create PkgConfig::<name> target")
+endif()
diff --git a/Tests/RunCMake/cmake_pkg_config/ImportPrefix-check.cmake b/Tests/RunCMake/cmake_pkg_config/ImportPrefix-check.cmake
new file mode 100644
index 0000000..5545c62
--- /dev/null
+++ b/Tests/RunCMake/cmake_pkg_config/ImportPrefix-check.cmake
@@ -0,0 +1,13 @@
+set(expected
+"larry: Alpha
+curly: Alpha
+moe: AltAlpha
+shemp: AltAlpha
+"
+)
+
+file(READ "${RunCMake_TEST_BINARY_DIR}/import-prefix.txt" actual)
+
+if(NOT(expected STREQUAL actual))
+ set(RunCMake_TEST_FAILED "cmake_pkg_config import-prefix.txt does not match expected:\n${actual}")
+endif()
diff --git a/Tests/RunCMake/cmake_pkg_config/ImportPrefix.cmake b/Tests/RunCMake/cmake_pkg_config/ImportPrefix.cmake
new file mode 100644
index 0000000..1bb7280
--- /dev/null
+++ b/Tests/RunCMake/cmake_pkg_config/ImportPrefix.cmake
@@ -0,0 +1,33 @@
+set(CMAKE_PKG_CONFIG_PC_PATH ${CMAKE_CURRENT_LIST_DIR}/PackageRoot/RequiresPackages)
+
+cmake_pkg_config(IMPORT alpha REQUIRED
+ NAME larry
+)
+
+set(CMAKE_PKG_CONFIG_PC_PATH ${CMAKE_CURRENT_LIST_DIR}/PackageRoot/AltRequiresPackages)
+
+cmake_pkg_config(IMPORT alpha REQUIRED
+ NAME curly
+)
+
+cmake_pkg_config(IMPORT alpha REQUIRED
+ NAME moe
+ PREFIX moe
+)
+
+set(CMAKE_PKG_CONFIG_PC_PATH ${CMAKE_CURRENT_LIST_DIR}/PackageRoot/RequiresPackages)
+
+cmake_pkg_config(IMPORT alpha REQUIRED
+ NAME shemp
+ PREFIX moe
+)
+
+file(GENERATE
+ OUTPUT import-prefix.txt
+ CONTENT
+"larry: $<TARGET_PROPERTY:PkgConfig::larry,INTERFACE_COMPILE_OPTIONS>
+curly: $<TARGET_PROPERTY:PkgConfig::curly,INTERFACE_COMPILE_OPTIONS>
+moe: $<TARGET_PROPERTY:PkgConfig::moe,INTERFACE_COMPILE_OPTIONS>
+shemp: $<TARGET_PROPERTY:PkgConfig::shemp,INTERFACE_COMPILE_OPTIONS>
+"
+)
diff --git a/Tests/RunCMake/cmake_pkg_config/ImportRequires-check.cmake b/Tests/RunCMake/cmake_pkg_config/ImportRequires-check.cmake
new file mode 100644
index 0000000..e098e6c
--- /dev/null
+++ b/Tests/RunCMake/cmake_pkg_config/ImportRequires-check.cmake
@@ -0,0 +1,14 @@
+set(expected
+ "alpha: Alpha
+bravo: Bravo;Alpha
+charlie: Charlie;Bravo;Alpha
+delta: Delta
+echo: Echo;Bravo;Alpha;Delta
+"
+)
+
+file(READ "${RunCMake_TEST_BINARY_DIR}/import-requires.txt" actual)
+
+if(NOT(expected STREQUAL actual))
+ set(RunCMake_TEST_FAILED "cmake_pkg_config import-requires.txt does not match expected:\n${actual}")
+endif()
diff --git a/Tests/RunCMake/cmake_pkg_config/ImportRequires.cmake b/Tests/RunCMake/cmake_pkg_config/ImportRequires.cmake
new file mode 100644
index 0000000..48e0b90
--- /dev/null
+++ b/Tests/RunCMake/cmake_pkg_config/ImportRequires.cmake
@@ -0,0 +1,18 @@
+set(CMAKE_PKG_CONFIG_PC_PATH ${CMAKE_CURRENT_LIST_DIR}/PackageRoot/RequiresPackages)
+
+cmake_pkg_config(IMPORT echo REQUIRED)
+cmake_pkg_config(IMPORT delta REQUIRED)
+cmake_pkg_config(IMPORT charlie REQUIRED)
+cmake_pkg_config(IMPORT bravo REQUIRED)
+cmake_pkg_config(IMPORT alpha REQUIRED)
+
+file(GENERATE
+ OUTPUT import-requires.txt
+ CONTENT
+ "alpha: $<TARGET_PROPERTY:PkgConfig::alpha,INTERFACE_COMPILE_OPTIONS>
+bravo: $<TARGET_PROPERTY:PkgConfig::bravo,INTERFACE_COMPILE_OPTIONS>
+charlie: $<TARGET_PROPERTY:PkgConfig::charlie,INTERFACE_COMPILE_OPTIONS>
+delta: $<TARGET_PROPERTY:PkgConfig::delta,INTERFACE_COMPILE_OPTIONS>
+echo: $<TARGET_PROPERTY:PkgConfig::echo,INTERFACE_COMPILE_OPTIONS>
+"
+)
diff --git a/Tests/RunCMake/cmake_pkg_config/ImportSimple-check.cmake b/Tests/RunCMake/cmake_pkg_config/ImportSimple-check.cmake
new file mode 100644
index 0000000..906cf10
--- /dev/null
+++ b/Tests/RunCMake/cmake_pkg_config/ImportSimple-check.cmake
@@ -0,0 +1,15 @@
+set(expected
+"Import Simple Found: TRUE
+Include Directories: ${RunCMake_SOURCE_DIR}/TestDirectories/Include
+Compile Options: TestCflag
+Link Directories: ${RunCMake_SOURCE_DIR}/TestDirectories/Library
+Link Libraries: @foreign_pkgcfg::import-simple
+Link Options: TestLinkOption
+"
+)
+
+file(READ "${RunCMake_TEST_BINARY_DIR}/import-simple.txt" actual)
+
+if(NOT(expected STREQUAL actual))
+ set(RunCMake_TEST_FAILED "cmake_pkg_config import-simple.txt does not match expected:\n${actual}")
+endif()
diff --git a/Tests/RunCMake/cmake_pkg_config/ImportSimple.cmake b/Tests/RunCMake/cmake_pkg_config/ImportSimple.cmake
new file mode 100644
index 0000000..fb1d973
--- /dev/null
+++ b/Tests/RunCMake/cmake_pkg_config/ImportSimple.cmake
@@ -0,0 +1,15 @@
+set(CMAKE_PKG_CONFIG_SYSROOT_DIR ${CMAKE_CURRENT_LIST_DIR})
+
+cmake_pkg_config(IMPORT import-simple REQUIRED)
+
+file(GENERATE
+ OUTPUT import-simple.txt
+ CONTENT
+"Import Simple Found: ${PKGCONFIG_import-simple_FOUND}
+Include Directories: $<TARGET_PROPERTY:PkgConfig::import-simple,INTERFACE_INCLUDE_DIRECTORIES>
+Compile Options: $<TARGET_PROPERTY:PkgConfig::import-simple,INTERFACE_COMPILE_OPTIONS>
+Link Directories: $<TARGET_PROPERTY:PkgConfig::import-simple,INTERFACE_LINK_DIRECTORIES>
+Link Libraries: $<TARGET_PROPERTY:PkgConfig::import-simple,INTERFACE_LINK_LIBRARIES>
+Link Options: $<TARGET_PROPERTY:PkgConfig::import-simple,INTERFACE_LINK_OPTIONS>
+"
+)
diff --git a/Tests/RunCMake/cmake_pkg_config/TestRequired-result.txt b/Tests/RunCMake/cmake_pkg_config/ImportTransitiveFail-result.txt
similarity index 100%
copy from Tests/RunCMake/cmake_pkg_config/TestRequired-result.txt
copy to Tests/RunCMake/cmake_pkg_config/ImportTransitiveFail-result.txt
diff --git a/Tests/RunCMake/cmake_pkg_config/ImportTransitiveFail-stderr.txt b/Tests/RunCMake/cmake_pkg_config/ImportTransitiveFail-stderr.txt
new file mode 100644
index 0000000..c80c227
--- /dev/null
+++ b/Tests/RunCMake/cmake_pkg_config/ImportTransitiveFail-stderr.txt
@@ -0,0 +1,11 @@
+CMake Warning at ImportTransitiveFail.cmake:[0-9]+ \(cmake_pkg_config\):
+ Could not find pkg-config: 'foxtrot' required by: 'golf'
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
+
+
+Import Golf Found: FALSE
+CMake Error at ImportTransitiveFail.cmake:[0-9]+ \(cmake_pkg_config\):
+ cmake_pkg_config Could not find pkg-config: 'foxtrot' required by: 'golf'
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/cmake_pkg_config/ImportTransitiveFail.cmake b/Tests/RunCMake/cmake_pkg_config/ImportTransitiveFail.cmake
new file mode 100644
index 0000000..7629244
--- /dev/null
+++ b/Tests/RunCMake/cmake_pkg_config/ImportTransitiveFail.cmake
@@ -0,0 +1,5 @@
+set(CMAKE_PKG_CONFIG_PC_PATH ${CMAKE_CURRENT_LIST_DIR}/PackageRoot/RequiresPackages)
+
+cmake_pkg_config(IMPORT golf)
+message("Import Golf Found: ${PKGCONFIG_golf_FOUND}")
+cmake_pkg_config(IMPORT golf REQUIRED)
diff --git a/Tests/RunCMake/cmake_pkg_config/ImportTransitiveVersion.cmake b/Tests/RunCMake/cmake_pkg_config/ImportTransitiveVersion.cmake
new file mode 100644
index 0000000..e5e641a
--- /dev/null
+++ b/Tests/RunCMake/cmake_pkg_config/ImportTransitiveVersion.cmake
@@ -0,0 +1,3 @@
+set(CMAKE_PKG_CONFIG_PC_PATH ${CMAKE_CURRENT_LIST_DIR}/PackageRoot/RequiresPackages)
+
+cmake_pkg_config(IMPORT india)
diff --git a/Tests/RunCMake/cmake_pkg_config/ImportTransitiveVersionFail-stderr.txt b/Tests/RunCMake/cmake_pkg_config/ImportTransitiveVersionFail-stderr.txt
new file mode 100644
index 0000000..a658b98
--- /dev/null
+++ b/Tests/RunCMake/cmake_pkg_config/ImportTransitiveVersionFail-stderr.txt
@@ -0,0 +1,5 @@
+CMake Warning at ImportTransitiveVersionFail.cmake:[0-9]+ \(cmake_pkg_config\):
+ Package 'alpha' version '1.0.0' does not meet version requirement '>=2.0.0'
+ of 'hotel'
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/cmake_pkg_config/ImportTransitiveVersionFail.cmake b/Tests/RunCMake/cmake_pkg_config/ImportTransitiveVersionFail.cmake
new file mode 100644
index 0000000..283c47a
--- /dev/null
+++ b/Tests/RunCMake/cmake_pkg_config/ImportTransitiveVersionFail.cmake
@@ -0,0 +1,4 @@
+set(CMAKE_PKG_CONFIG_PC_PATH ${CMAKE_CURRENT_LIST_DIR}/PackageRoot/RequiresPackages)
+
+cmake_pkg_config(POPULATE bravo)
+cmake_pkg_config(IMPORT hotel)
diff --git a/Tests/RunCMake/cmake_pkg_config/PackageRoot/AltRequiresPackages/alpha.pc b/Tests/RunCMake/cmake_pkg_config/PackageRoot/AltRequiresPackages/alpha.pc
new file mode 100644
index 0000000..08b6a72
--- /dev/null
+++ b/Tests/RunCMake/cmake_pkg_config/PackageRoot/AltRequiresPackages/alpha.pc
@@ -0,0 +1,5 @@
+Name: AltAlpha
+Description: AltAlpha
+Version: 1.0.0
+
+Cflags: AltAlpha
diff --git a/Tests/RunCMake/cmake_pkg_config/PackageRoot/RequiresPackages/alpha.pc b/Tests/RunCMake/cmake_pkg_config/PackageRoot/RequiresPackages/alpha.pc
new file mode 100644
index 0000000..f6b4610
--- /dev/null
+++ b/Tests/RunCMake/cmake_pkg_config/PackageRoot/RequiresPackages/alpha.pc
@@ -0,0 +1,5 @@
+Name: Alpha
+Description: Alpha
+Version: 1.0.0
+
+Cflags: Alpha
diff --git a/Tests/RunCMake/cmake_pkg_config/PackageRoot/RequiresPackages/bravo.pc b/Tests/RunCMake/cmake_pkg_config/PackageRoot/RequiresPackages/bravo.pc
new file mode 100644
index 0000000..075e887
--- /dev/null
+++ b/Tests/RunCMake/cmake_pkg_config/PackageRoot/RequiresPackages/bravo.pc
@@ -0,0 +1,6 @@
+Name: Bravo
+Description: Bravo
+Version: 1.0.0
+
+Cflags: Bravo
+Requires: alpha
diff --git a/Tests/RunCMake/cmake_pkg_config/PackageRoot/RequiresPackages/charlie.pc b/Tests/RunCMake/cmake_pkg_config/PackageRoot/RequiresPackages/charlie.pc
new file mode 100644
index 0000000..6a16d3e
--- /dev/null
+++ b/Tests/RunCMake/cmake_pkg_config/PackageRoot/RequiresPackages/charlie.pc
@@ -0,0 +1,6 @@
+Name: Charlie
+Description: Charlie
+Version: 1.0.0
+
+Cflags: Charlie
+Requires: bravo
diff --git a/Tests/RunCMake/cmake_pkg_config/PackageRoot/RequiresPackages/delta.pc b/Tests/RunCMake/cmake_pkg_config/PackageRoot/RequiresPackages/delta.pc
new file mode 100644
index 0000000..bb1486c
--- /dev/null
+++ b/Tests/RunCMake/cmake_pkg_config/PackageRoot/RequiresPackages/delta.pc
@@ -0,0 +1,5 @@
+Name: Delta
+Description: Delta
+Version: 1.0.0
+
+Cflags: Delta
diff --git a/Tests/RunCMake/cmake_pkg_config/PackageRoot/RequiresPackages/echo.pc b/Tests/RunCMake/cmake_pkg_config/PackageRoot/RequiresPackages/echo.pc
new file mode 100644
index 0000000..7b05d00
--- /dev/null
+++ b/Tests/RunCMake/cmake_pkg_config/PackageRoot/RequiresPackages/echo.pc
@@ -0,0 +1,6 @@
+Name: Echo
+Description: Echo
+Version: 1.0.0
+
+Cflags: Echo
+Requires: bravo delta
diff --git a/Tests/RunCMake/cmake_pkg_config/PackageRoot/RequiresPackages/golf.pc b/Tests/RunCMake/cmake_pkg_config/PackageRoot/RequiresPackages/golf.pc
new file mode 100644
index 0000000..c457194
--- /dev/null
+++ b/Tests/RunCMake/cmake_pkg_config/PackageRoot/RequiresPackages/golf.pc
@@ -0,0 +1,6 @@
+Name: Golf
+Description: Golf
+Version: 1.0.0
+
+Cflags: Golf
+Requires: foxtrot
diff --git a/Tests/RunCMake/cmake_pkg_config/PackageRoot/RequiresPackages/hotel.pc b/Tests/RunCMake/cmake_pkg_config/PackageRoot/RequiresPackages/hotel.pc
new file mode 100644
index 0000000..396491f
--- /dev/null
+++ b/Tests/RunCMake/cmake_pkg_config/PackageRoot/RequiresPackages/hotel.pc
@@ -0,0 +1,6 @@
+Name: Hotel
+Description: Hotel
+Version: 1.0.0
+
+Cflags: Hotel
+Requires: alpha >= 2.0.0
diff --git a/Tests/RunCMake/cmake_pkg_config/PackageRoot/RequiresPackages/india.pc b/Tests/RunCMake/cmake_pkg_config/PackageRoot/RequiresPackages/india.pc
new file mode 100644
index 0000000..7b5a5c5
--- /dev/null
+++ b/Tests/RunCMake/cmake_pkg_config/PackageRoot/RequiresPackages/india.pc
@@ -0,0 +1,6 @@
+Name: India
+Description: India
+Version: 1.0.0
+
+Cflags: India
+Requires: alpha = 1.0.0 bravo > 0.5.0
diff --git a/Tests/RunCMake/cmake_pkg_config/PackageRoot/RequiresPackages/juliet.pc b/Tests/RunCMake/cmake_pkg_config/PackageRoot/RequiresPackages/juliet.pc
new file mode 100644
index 0000000..b5ce5f1
--- /dev/null
+++ b/Tests/RunCMake/cmake_pkg_config/PackageRoot/RequiresPackages/juliet.pc
@@ -0,0 +1,6 @@
+Name: Juliet
+Description: Juliet
+Version: 1.0.0
+
+Cflags: Juliet
+Requires: golf
diff --git a/Tests/RunCMake/cmake_pkg_config/PackageRoot/import-simple.pc b/Tests/RunCMake/cmake_pkg_config/PackageRoot/import-simple.pc
new file mode 100644
index 0000000..fb13815
--- /dev/null
+++ b/Tests/RunCMake/cmake_pkg_config/PackageRoot/import-simple.pc
@@ -0,0 +1,6 @@
+Name: Import Simple
+Description: A simple import with no dependencies
+Version: 1.0.0
+
+Cflags: -I/TestDirectories/Include TestCflag
+Libs: -L/TestDirectories/Library -ldummy TestLinkOption
diff --git a/Tests/RunCMake/cmake_pkg_config/PopulateFoundVar-stderr.txt b/Tests/RunCMake/cmake_pkg_config/PopulateFoundVar-stderr.txt
new file mode 100644
index 0000000..bff5692
--- /dev/null
+++ b/Tests/RunCMake/cmake_pkg_config/PopulateFoundVar-stderr.txt
@@ -0,0 +1,8 @@
+Found Alpha: TRUE
+CMake Warning at PopulateFoundVar.cmake:[0-9]+ \(cmake_pkg_config\):
+ Could not find pkg-config: 'foxtrot'
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
+
+
+Found Foxtrot: FALSE
diff --git a/Tests/RunCMake/cmake_pkg_config/PopulateFoundVar.cmake b/Tests/RunCMake/cmake_pkg_config/PopulateFoundVar.cmake
new file mode 100644
index 0000000..7ff1ed8
--- /dev/null
+++ b/Tests/RunCMake/cmake_pkg_config/PopulateFoundVar.cmake
@@ -0,0 +1,7 @@
+set(CMAKE_PKG_CONFIG_PC_PATH ${CMAKE_CURRENT_LIST_DIR}/PackageRoot/RequiresPackages)
+
+cmake_pkg_config(POPULATE alpha)
+message("Found Alpha: ${PKGCONFIG_alpha_FOUND}")
+
+cmake_pkg_config(POPULATE foxtrot)
+message("Found Foxtrot: ${PKGCONFIG_foxtrot_FOUND}")
diff --git a/Tests/RunCMake/cmake_pkg_config/PopulateMissing-check.cmake b/Tests/RunCMake/cmake_pkg_config/PopulateMissing-check.cmake
new file mode 100644
index 0000000..9481a8f
--- /dev/null
+++ b/Tests/RunCMake/cmake_pkg_config/PopulateMissing-check.cmake
@@ -0,0 +1,10 @@
+set(expected
+ "juliet: Juliet;Golf;Foxtrot
+"
+)
+
+file(READ "${RunCMake_TEST_BINARY_DIR}/populate-missing.txt" actual)
+
+if(NOT(expected STREQUAL actual))
+ set(RunCMake_TEST_FAILED "cmake_pkg_config populate-missing.txt does not match expected:\n${actual}")
+endif()
diff --git a/Tests/RunCMake/cmake_pkg_config/PopulateMissing.cmake b/Tests/RunCMake/cmake_pkg_config/PopulateMissing.cmake
new file mode 100644
index 0000000..d7e035b
--- /dev/null
+++ b/Tests/RunCMake/cmake_pkg_config/PopulateMissing.cmake
@@ -0,0 +1,19 @@
+set(CMAKE_PKG_CONFIG_PC_PATH ${CMAKE_CURRENT_LIST_DIR}/PackageRoot/RequiresPackages)
+
+add_library(native-foxtrot INTERFACE)
+target_compile_options(native-foxtrot INTERFACE Foxtrot)
+
+cmake_pkg_config(
+ POPULATE golf
+ BIND_PC_REQUIRES
+ foxtrot=native-foxtrot
+)
+
+cmake_pkg_config(IMPORT juliet)
+
+file(GENERATE
+ OUTPUT populate-missing.txt
+ CONTENT
+ "juliet: $<TARGET_PROPERTY:PkgConfig::juliet,INTERFACE_COMPILE_OPTIONS>
+"
+)
diff --git a/Tests/RunCMake/cmake_pkg_config/RunCMakeTest.cmake b/Tests/RunCMake/cmake_pkg_config/RunCMakeTest.cmake
index 4f9200b..422a993 100644
--- a/Tests/RunCMake/cmake_pkg_config/RunCMakeTest.cmake
+++ b/Tests/RunCMake/cmake_pkg_config/RunCMakeTest.cmake
@@ -3,16 +3,25 @@
set(cmd ${CMAKE_COMMAND} ${CMAKE_CURRENT_LIST_DIR} -G ${RunCMake_GENERATOR})
foreach(strictness IN ITEMS STRICT PERMISSIVE BEST_EFFORT)
- run_cmake_command(TestStrictness-${strictness} ${cmd}
- -DRunCMake_TEST=TestStrictness -DSTRICTNESS=${strictness}
+ run_cmake_command(ExtractStrictness-${strictness} ${cmd}
+ -DRunCMake_TEST=ExtractStrictness -DSTRICTNESS=${strictness}
)
endforeach()
-run_cmake(TestEnv)
-run_cmake(TestExtract)
-run_cmake(TestMangle)
-run_cmake(TestQuiet)
-run_cmake(TestRequired)
-run_cmake(TestReroot)
-run_cmake(TestUninstalled)
-run_cmake(TestVersion)
+run_cmake(ExtractEnv)
+run_cmake(ExtractFields)
+run_cmake(ExtractMangle)
+run_cmake(ExtractQuiet)
+run_cmake(ExtractRequired)
+run_cmake(ExtractReroot)
+run_cmake(ExtractUninstalled)
+run_cmake(ExtractVersion)
+run_cmake(ImportName)
+run_cmake(ImportPrefix)
+run_cmake(ImportRequires)
+run_cmake(ImportSimple)
+run_cmake(ImportTransitiveFail)
+run_cmake(ImportTransitiveVersion)
+run_cmake(ImportTransitiveVersionFail)
+run_cmake(PopulateFoundVar)
+run_cmake(PopulateMissing)
diff --git a/Tests/RunCMake/cmake_pkg_config/TestDirectories/Include/dummy-header.h b/Tests/RunCMake/cmake_pkg_config/TestDirectories/Include/dummy-header.h
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/RunCMake/cmake_pkg_config/TestDirectories/Include/dummy-header.h
diff --git a/Tests/RunCMake/cmake_pkg_config/TestDirectories/Library/libdummy b/Tests/RunCMake/cmake_pkg_config/TestDirectories/Library/libdummy
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/RunCMake/cmake_pkg_config/TestDirectories/Library/libdummy
diff --git a/Tests/RunCMake/cmake_pkg_config/TestRequired-stderr.txt b/Tests/RunCMake/cmake_pkg_config/TestRequired-stderr.txt
deleted file mode 100644
index d7f5158..0000000
--- a/Tests/RunCMake/cmake_pkg_config/TestRequired-stderr.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-CMake Error at TestRequired.cmake:[0-9]+ \(cmake_pkg_config\):
- cmake_pkg_config Could not find 'does-not-exist'
-Call Stack \(most recent call first\):
- CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/ctest_exit/3-result.txt b/Tests/RunCMake/ctest_exit/3-result.txt
new file mode 100644
index 0000000..00750ed
--- /dev/null
+++ b/Tests/RunCMake/ctest_exit/3-result.txt
@@ -0,0 +1 @@
+3
diff --git a/Tests/RunCMake/ctest_exit/3-stderr.txt b/Tests/RunCMake/ctest_exit/3-stderr.txt
new file mode 100644
index 0000000..8b4ca5db5
--- /dev/null
+++ b/Tests/RunCMake/ctest_exit/3-stderr.txt
@@ -0,0 +1,3 @@
+^CMake Error at [^
+]*/Tests/RunCMake/ctest_exit/exit1.cmake:2 \(message\):
+ send error$
diff --git a/Tests/RunCMake/ctest_exit/7-result.txt b/Tests/RunCMake/ctest_exit/7-result.txt
new file mode 100644
index 0000000..7f8f011
--- /dev/null
+++ b/Tests/RunCMake/ctest_exit/7-result.txt
@@ -0,0 +1 @@
+7
diff --git a/Tests/RunCMake/ctest_exit/7-stderr.txt b/Tests/RunCMake/ctest_exit/7-stderr.txt
new file mode 100644
index 0000000..8b4ca5db5
--- /dev/null
+++ b/Tests/RunCMake/ctest_exit/7-stderr.txt
@@ -0,0 +1,3 @@
+^CMake Error at [^
+]*/Tests/RunCMake/ctest_exit/exit1.cmake:2 \(message\):
+ send error$
diff --git a/Tests/RunCMake/ctest_exit/RunCMakeTest.cmake b/Tests/RunCMake/ctest_exit/RunCMakeTest.cmake
new file mode 100644
index 0000000..936772a
--- /dev/null
+++ b/Tests/RunCMake/ctest_exit/RunCMakeTest.cmake
@@ -0,0 +1,45 @@
+include(RunCMake)
+
+message(STATUS "Multiple -S options:")
+
+run_cmake_command(3 ${CMAKE_CTEST_COMMAND} -V
+ -S ${RunCMake_SOURCE_DIR}/exit1.cmake
+ -S ${RunCMake_SOURCE_DIR}/exit2.cmake
+ )
+
+run_cmake_command(7 ${CMAKE_CTEST_COMMAND} -V
+ -S ${RunCMake_SOURCE_DIR}/exit4.cmake
+ -S ${RunCMake_SOURCE_DIR}/exit1.cmake
+ -S ${RunCMake_SOURCE_DIR}/exit2.cmake
+ )
+
+message(STATUS "Multiple -SP options:")
+
+run_cmake_command(3 ${CMAKE_CTEST_COMMAND} -V
+ -SP ${RunCMake_SOURCE_DIR}/exit1.cmake
+ -SP ${RunCMake_SOURCE_DIR}/exit2.cmake
+ )
+
+run_cmake_command(7 ${CMAKE_CTEST_COMMAND} -V
+ -SP ${RunCMake_SOURCE_DIR}/exit4.cmake
+ -SP ${RunCMake_SOURCE_DIR}/exit1.cmake
+ -SP ${RunCMake_SOURCE_DIR}/exit2.cmake
+ )
+
+message(STATUS "Mixed -S and -SP options:")
+
+run_cmake_command(7 ${CMAKE_CTEST_COMMAND} -V
+ -S ${RunCMake_SOURCE_DIR}/exit4.cmake
+ -SP ${RunCMake_SOURCE_DIR}/exit1.cmake
+ -S ${RunCMake_SOURCE_DIR}/exit2.cmake
+ )
+
+message(STATUS "ctest_run_script:")
+
+configure_file(
+ ${RunCMake_SOURCE_DIR}/test.cmake.in
+ ${RunCMake_BINARY_DIR}/test.cmake @ONLY)
+
+run_cmake_command(Script ${CMAKE_CTEST_COMMAND} -V
+ -S ${RunCMake_BINARY_DIR}/test.cmake
+ )
diff --git a/Tests/RunCMake/ctest_exit/Script-result.txt b/Tests/RunCMake/ctest_exit/Script-result.txt
new file mode 100644
index 0000000..b57e2de
--- /dev/null
+++ b/Tests/RunCMake/ctest_exit/Script-result.txt
@@ -0,0 +1 @@
+(-1|255)
diff --git a/Tests/RunCMake/ctest_exit/Script-stderr.txt b/Tests/RunCMake/ctest_exit/Script-stderr.txt
new file mode 100644
index 0000000..546a394
--- /dev/null
+++ b/Tests/RunCMake/ctest_exit/Script-stderr.txt
@@ -0,0 +1,8 @@
+^CMake Error at [^
+]*/Tests/RunCMake/ctest_exit/exit1.cmake:2 \(message\):
+ send error
+
+
+CMake Error at [^
+]*/Tests/RunCMake/ctest_exit/exit1.cmake:2 \(message\):
+ send error$
diff --git a/Tests/RunCMake/ctest_exit/exit1.cmake b/Tests/RunCMake/ctest_exit/exit1.cmake
new file mode 100644
index 0000000..4997ed3
--- /dev/null
+++ b/Tests/RunCMake/ctest_exit/exit1.cmake
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.10)
+message(SEND_ERROR "send error")
+cmake_language(EXIT 1)
diff --git a/Tests/RunCMake/ctest_exit/exit2.cmake b/Tests/RunCMake/ctest_exit/exit2.cmake
new file mode 100644
index 0000000..536ffd8
--- /dev/null
+++ b/Tests/RunCMake/ctest_exit/exit2.cmake
@@ -0,0 +1,2 @@
+cmake_minimum_required(VERSION 3.10)
+cmake_language(EXIT 2)
diff --git a/Tests/RunCMake/ctest_exit/exit4.cmake b/Tests/RunCMake/ctest_exit/exit4.cmake
new file mode 100644
index 0000000..696d014
--- /dev/null
+++ b/Tests/RunCMake/ctest_exit/exit4.cmake
@@ -0,0 +1,2 @@
+cmake_minimum_required(VERSION 3.10)
+cmake_language(EXIT 4)
diff --git a/Tests/RunCMake/ctest_exit/test.cmake.in b/Tests/RunCMake/ctest_exit/test.cmake.in
new file mode 100644
index 0000000..5a9cb19
--- /dev/null
+++ b/Tests/RunCMake/ctest_exit/test.cmake.in
@@ -0,0 +1,23 @@
+cmake_minimum_required(VERSION 3.10)
+
+ctest_run_script(
+ "@RunCMake_SOURCE_DIR@/exit1.cmake"
+ "@RunCMake_SOURCE_DIR@/exit4.cmake"
+ RETURN_VALUE ret
+ )
+
+if(NOT ret EQUAL 4)
+ message(FATAL_ERROR "Expected ret == 4, got ${ret}")
+endif()
+
+unset(ret)
+
+ctest_run_script(NEW_PROCESS
+ "@RunCMake_SOURCE_DIR@/exit1.cmake"
+ "@RunCMake_SOURCE_DIR@/exit4.cmake"
+ RETURN_VALUE ret
+ )
+
+if(NOT ret EQUAL 4)
+ message(FATAL_ERROR "Expected ret == 4, got ${ret}")
+endif()
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/file-DOWNLOAD/RunCMakeTest.cmake b/Tests/RunCMake/file-DOWNLOAD/RunCMakeTest.cmake
index 3fe2090..11fee2f 100644
--- a/Tests/RunCMake/file-DOWNLOAD/RunCMakeTest.cmake
+++ b/Tests/RunCMake/file-DOWNLOAD/RunCMakeTest.cmake
@@ -23,6 +23,13 @@
run_cmake(range)
run_cmake(SHOW_PROGRESS)
+foreach(file IN ITEMS /dev/full /dev/urandom)
+ if(IS_WRITABLE "${file}")
+ run_cmake_with_options(file-write-error -Dfile=${file})
+ break()
+ endif()
+endforeach()
+
if(NOT CMake_TEST_NO_NETWORK)
run_cmake(bad-hostname)
endif()
diff --git a/Tests/RunCMake/file-DOWNLOAD/common.cmake b/Tests/RunCMake/file-DOWNLOAD/common.cmake
index 6aa2fe6..d90c4d2 100644
--- a/Tests/RunCMake/file-DOWNLOAD/common.cmake
+++ b/Tests/RunCMake/file-DOWNLOAD/common.cmake
@@ -2,7 +2,9 @@
set(slash /)
endif()
set(url "file://${slash}${CMAKE_CURRENT_SOURCE_DIR}/input.png")
-set(file ${CMAKE_CURRENT_BINARY_DIR}/output.png)
+if (NOT file)
+ set(file ${CMAKE_CURRENT_BINARY_DIR}/output.png)
+endif ()
function(file_download)
file(DOWNLOAD "${url}"
diff --git a/Tests/RunCMake/file-DOWNLOAD/file-write-error-stdout.txt b/Tests/RunCMake/file-DOWNLOAD/file-write-error-stdout.txt
new file mode 100644
index 0000000..7d92af2
--- /dev/null
+++ b/Tests/RunCMake/file-DOWNLOAD/file-write-error-stdout.txt
@@ -0,0 +1 @@
+-- status='23;"Failed writing received data to disk/application"'
diff --git a/Tests/RunCMake/file-DOWNLOAD/file-write-error.cmake b/Tests/RunCMake/file-DOWNLOAD/file-write-error.cmake
new file mode 100644
index 0000000..1fd931c
--- /dev/null
+++ b/Tests/RunCMake/file-DOWNLOAD/file-write-error.cmake
@@ -0,0 +1,3 @@
+include(common.cmake)
+
+file_download()
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/if/FilePermissions.cmake b/Tests/RunCMake/if/FilePermissions.cmake
index 9edbddb..72dd11b 100644
--- a/Tests/RunCMake/if/FilePermissions.cmake
+++ b/Tests/RunCMake/if/FilePermissions.cmake
@@ -81,11 +81,13 @@
message(FATAL_ERROR "checks on \"${CMAKE_CURRENT_BINARY_DIR}/readable-dir\" failed")
endif()
- if(NOT IS_WRITABLE "${CMAKE_CURRENT_BINARY_DIR}/writable-dir"
- OR IS_READABLE "${CMAKE_CURRENT_BINARY_DIR}/writable-dir"
- OR IS_EXECUTABLE "${CMAKE_CURRENT_BINARY_DIR}/writable-dir")
- cleanup()
- message(FATAL_ERROR "checks on \"${CMAKE_CURRENT_BINARY_DIR}/writable-dir\" failed")
+ if(NOT NO_WRITABLE_DIR)
+ if(NOT IS_WRITABLE "${CMAKE_CURRENT_BINARY_DIR}/writable-dir"
+ OR IS_READABLE "${CMAKE_CURRENT_BINARY_DIR}/writable-dir"
+ OR IS_EXECUTABLE "${CMAKE_CURRENT_BINARY_DIR}/writable-dir")
+ cleanup()
+ message(FATAL_ERROR "checks on \"${CMAKE_CURRENT_BINARY_DIR}/writable-dir\" failed")
+ endif()
endif()
if(NOT IS_EXECUTABLE "${CMAKE_CURRENT_BINARY_DIR}/executable-dir"
@@ -161,11 +163,13 @@
message(FATAL_ERROR "checks on \"${CMAKE_CURRENT_BINARY_DIR}/link-to-readable-dir\" failed")
endif()
- if(NOT IS_WRITABLE "${CMAKE_CURRENT_BINARY_DIR}/link-to-writable-dir"
- OR IS_READABLE "${CMAKE_CURRENT_BINARY_DIR}/link-to-writable-dir"
- OR IS_EXECUTABLE "${CMAKE_CURRENT_BINARY_DIR}/link-to-writable-dir")
- cleanup()
- message(FATAL_ERROR "checks on \"${CMAKE_CURRENT_BINARY_DIR}/link-to-writable-dir\" failed")
+ if(NOT NO_WRITABLE_DIR)
+ if(NOT IS_WRITABLE "${CMAKE_CURRENT_BINARY_DIR}/link-to-writable-dir"
+ OR IS_READABLE "${CMAKE_CURRENT_BINARY_DIR}/link-to-writable-dir"
+ OR IS_EXECUTABLE "${CMAKE_CURRENT_BINARY_DIR}/link-to-writable-dir")
+ cleanup()
+ message(FATAL_ERROR "checks on \"${CMAKE_CURRENT_BINARY_DIR}/link-to-writable-dir\" failed")
+ endif()
endif()
if(NOT IS_EXECUTABLE "${CMAKE_CURRENT_BINARY_DIR}/link-to-executable-dir"
diff --git a/Tests/RunCMake/if/RunCMakeTest.cmake b/Tests/RunCMake/if/RunCMakeTest.cmake
index 43dfd3c..e3b9b2d 100644
--- a/Tests/RunCMake/if/RunCMakeTest.cmake
+++ b/Tests/RunCMake/if/RunCMakeTest.cmake
@@ -7,7 +7,7 @@
# if real user is root, tests are irrelevant
get_unix_uid(uid)
if(NOT uid STREQUAL "0")
- run_cmake(FilePermissions)
+ run_cmake_with_options(FilePermissions -DNO_WRITABLE_DIR=${CMake_TEST_NO_WRITE_ONLY_DIR})
endif()
endif()
run_cmake(IsDirectory)
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/Tests/SystemInformation/SystemInformation.in b/Tests/SystemInformation/SystemInformation.in
index f7e81e6..8abe60c 100644
--- a/Tests/SystemInformation/SystemInformation.in
+++ b/Tests/SystemInformation/SystemInformation.in
@@ -19,6 +19,7 @@
CMAKE_COMPILER_IS_GNUCXX == "${CMAKE_COMPILER_IS_GNUCXX}"
CMAKE_C_COMPILER_ID == "${CMAKE_C_COMPILER_ID}"
CMAKE_C_COMPILER_VERSION == "${CMAKE_C_COMPILER_VERSION}"
+CMAKE_C_COMPILER_ARCHITECTURE_ID == "${CMAKE_C_COMPILER_ARCHITECTURE_ID}"
CMAKE_C90_STANDARD_COMPILE_OPTION == "${CMAKE_C90_STANDARD_COMPILE_OPTION}"
CMAKE_C99_STANDARD_COMPILE_OPTION == "${CMAKE_C99_STANDARD_COMPILE_OPTION}"
CMAKE_C11_STANDARD_COMPILE_OPTION == "${CMAKE_C11_STANDARD_COMPILE_OPTION}"
@@ -31,6 +32,7 @@
CMAKE_C11_COMPILE_FEATURES == "${CMAKE_C11_COMPILE_FEATURES}"
CMAKE_CXX_COMPILER_ID == "${CMAKE_CXX_COMPILER_ID}"
CMAKE_CXX_COMPILER_VERSION == "${CMAKE_CXX_COMPILER_VERSION}"
+CMAKE_CXX_COMPILER_ARCHITECTURE_ID == "${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}"
CMAKE_CXX98_STANDARD_COMPILE_OPTION == "${CMAKE_CXX98_STANDARD_COMPILE_OPTION}"
CMAKE_CXX11_STANDARD_COMPILE_OPTION == "${CMAKE_CXX11_STANDARD_COMPILE_OPTION}"
CMAKE_CXX98_EXTENSION_COMPILE_OPTION == "${CMAKE_CXX98_EXTENSION_COMPILE_OPTION}"
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/Release/win/sign-package.ps1 b/Utilities/Release/win/sign-package.ps1
index 7465c21..2927108 100644
--- a/Utilities/Release/win/sign-package.ps1
+++ b/Utilities/Release/win/sign-package.ps1
@@ -6,24 +6,89 @@
param (
[string]$signtool = 'signtool',
[string]$cpack = 'bin\cpack',
- [switch]$trace
+ [string]$pass = $null
)
-if ($trace -eq $true) {
- Set-PSDebug -Trace 1
-}
-
$ErrorActionPreference = 'Stop'
+# Cleanup temporary file(s) on exit.
+$null = Register-EngineEvent PowerShell.Exiting -Action {
+ if ($certFile) {
+ Remove-Item $certFile -Force
+ }
+}
+
+# If the passphrase was not provided on the command-line,
+# check for a GitLab CI variable in the environment.
+if (-not $pass) {
+ $pass = $env:SIGNTOOL_PASS
+
+ # If the environment variable looks like a GitLab CI file-type variable,
+ # replace it with the content of the file.
+ if ($pass -and
+ $pass.EndsWith("SIGNTOOL_PASS") -and
+ (Test-Path -Path "$pass" -IsValid) -and
+ (Test-Path -Path "$pass" -PathType Leaf)) {
+ $pass = Get-Content -Path "$pass"
+ }
+}
+
+# Collect signtool arguments to specify a certificate.
+$cert = @()
+
+# Select a signing certificate to pass to signtool.
+if ($certX509 = Get-ChildItem -Recurse -Path "Cert:" -CodeSigningCert |
+ Where-Object { $_.PublicKey.Oid.FriendlyName -eq "RSA" } |
+ Select-Object -First 1) {
+ # Identify the private key provider name and container name.
+ if ($certRSA = [System.Security.Cryptography.X509Certificates.RSACertificateExtensions]::GetRSAPrivateKey($certX509)) {
+ # $certRSA -is [System.Security.Cryptography.RSACng]
+ # Cryptography Next Generation (CNG) implementation
+ $csp = $certRSA.Key.Provider
+ $kc = $certRSA.Key.KeyName
+ } elseif ($certRSA = $certX509.PrivateKey) {
+ # $certRSA -is [System.Security.Cryptography.RSACryptoServiceProvider]
+ $csp = $certRSA.CspKeyContainerInfo.ProviderName
+ $kc = $certRSA.CspKeyContainerInfo.KeyContainerName
+ }
+
+ # Pass the selected certificate to signtool.
+ $certFile = New-TemporaryFile
+ $certBase64 = [System.Convert]::ToBase64String($certX509.RawData, [System.Base64FormattingOptions]::InsertLineBreaks)
+ $certPEM = "-----BEGIN CERTIFICATE-----", $certBase64, "-----END CERTIFICATE-----" -join "`n"
+ $certPEM | Out-File -FilePath "$certFile" -Encoding Ascii
+ $cert += "-f","$certFile"
+
+ # Tell signtool how to find the certificate's private key.
+ if ($csp) {
+ $cert += "-csp","$csp"
+ }
+ if ($kc) {
+ if ($pass) {
+ # The provider offers a syntax to encode the token passphrase in the key container name.
+ # https://web.archive.org/web/20250315200813/https://stackoverflow.com/questions/17927895/automate-extended-validation-ev-code-signing-with-safenet-etoken
+ $cert += "-kc","[{{$pass}}]=$kc"
+ $pass = $null
+ } else {
+ $cert += "-kc","$kc"
+ }
+ }
+} else {
+ $cert += @("-a")
+}
+
# Sign binaries with SHA-1 for Windows 7 and below.
-& $signtool sign -v -a -t http://timestamp.digicert.com -fd sha1 bin\*.exe
+& $signtool sign -v $cert -t http://timestamp.digicert.com -fd sha1 bin\*.exe
+if (-not $?) { Exit $LastExitCode }
# Sign binaries with SHA-256 for Windows 8 and above.
-& $signtool sign -v -a -tr http://timestamp.digicert.com -fd sha256 -td sha256 -as bin\*.exe
+& $signtool sign -v $cert -tr http://timestamp.digicert.com -fd sha256 -td sha256 -as bin\*.exe
+if (-not $?) { Exit $LastExitCode }
# Create packages.
-& $cpack -G ZIP
-& $cpack -G WIX
+& $cpack -G "ZIP;WIX"
+if (-not $?) { Exit $LastExitCode }
# Sign installer with SHA-256.
-& $signtool sign -v -a -tr http://timestamp.digicert.com -fd sha256 -td sha256 -d "CMake Windows Installer" cmake-*-win*.msi
+& $signtool sign -v $cert -tr http://timestamp.digicert.com -fd sha256 -td sha256 -d "CMake Windows Installer" cmake-*-win*.msi
+if (-not $?) { Exit $LastExitCode }
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"
;;