diff options
86 files changed, 696 insertions, 359 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d8d3a36..08fc107 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -59,7 +59,7 @@ p:doc-package: - .cmake_doc_artifacts - .run_only_for_package -u:source-package: +.u:source-package: extends: - .rsync_upload_binary - .run_only_for_package @@ -77,7 +77,7 @@ b:help:master: - .cmake_org_help - .run_only_for_continuous_master -u:help:master: +.u:help:master: extends: - .rsync_upload_help - .run_only_for_continuous_master @@ -93,7 +93,7 @@ b:help:stage: - .cmake_org_help - .run_only_for_continuous_stage -u:help:stage: +.u:help:stage: extends: - .rsync_upload_help - .run_only_for_continuous_stage @@ -529,7 +529,7 @@ b:linux-x86_64-package: needs: - p:doc-package -u:linux-x86_64-package: +.u:linux-x86_64-package: extends: - .rsync_upload_binary - .run_only_for_package @@ -553,7 +553,7 @@ b:linux-aarch64-package: needs: - p:doc-package -u:linux-aarch64-package: +.u:linux-aarch64-package: extends: - .rsync_upload_binary - .run_only_for_package @@ -694,7 +694,7 @@ b:macos-package: needs: - p:doc-package -u:macos-package: +.u:macos-package: extends: - .rsync_upload_binary - .run_only_for_package @@ -717,7 +717,7 @@ b:macos10.10-package: needs: - p:doc-package -u:macos10.10-package: +.u:macos10.10-package: extends: - .rsync_upload_binary - .run_only_for_package diff --git a/.gitlab/os-windows.yml b/.gitlab/os-windows.yml index e15bbe9..2bce8c8 100644 --- a/.gitlab/os-windows.yml +++ b/.gitlab/os-windows.yml @@ -21,7 +21,7 @@ # could run at the same time, so we drop it. GIT_CLONE_PATH: "$CI_BUILDS_DIR\\cmake ci" -.windows_ninja: +.windows_build_ninja: extends: .windows_build variables: @@ -39,7 +39,7 @@ .windows_vs2022_x64_ninja: extends: - - .windows_ninja + - .windows_build_ninja - .windows_vcvarsall_vs2022_x64 variables: diff --git a/Help/command/target_include_directories.rst b/Help/command/target_include_directories.rst index 3fc7926..9a99a7d 100644 --- a/Help/command/target_include_directories.rst +++ b/Help/command/target_include_directories.rst @@ -28,12 +28,15 @@ The following arguments specify include directories. Allow setting ``INTERFACE`` items on :ref:`IMPORTED targets <Imported Targets>`. Repeated calls for the same ``<target>`` append items in the order called. -If ``SYSTEM`` is specified, the compiler will be told the -directories are meant as system include directories on some platforms -(signalling this setting might achieve effects such as the compiler -skipping warnings, or these fixed-install system files not being -considered in dependency calculations - see compiler docs). If ``SYSTEM`` -is used together with ``PUBLIC`` or ``INTERFACE``, the + +If ``SYSTEM`` is specified, the compiler will be told the directories +are meant as system include directories on some platforms. This may +have effects such as suppressing warnings or skipping the contained +headers in dependency calculations (see compiler documentation). +Additionally, system include directories are searched after normal +include directories regardless of the order specified. + +If ``SYSTEM`` is used together with ``PUBLIC`` or ``INTERFACE``, the :prop_tgt:`INTERFACE_SYSTEM_INCLUDE_DIRECTORIES` target property will be populated with the specified directories. diff --git a/Help/dev/maint.rst b/Help/dev/maint.rst index 54d627d..151ea5a 100644 --- a/Help/dev/maint.rst +++ b/Help/dev/maint.rst @@ -270,8 +270,8 @@ Update ``Source/CMakeVersion.cmake`` to set the version to set(CMake_VERSION_PATCH 0) set(CMake_VERSION_RC 0) -Update uses of ``DEVEL_CMAKE_VERSION`` in the source tree to mention the -actual version number: +Replace uses of ``DEVEL_CMAKE_VERSION`` in the source tree with +the literal release version number string ``"$major.$minor.0"``: .. code-block:: shell diff --git a/Help/manual/cmake-buildsystem.7.rst b/Help/manual/cmake-buildsystem.7.rst index 2f43070..f48313a 100644 --- a/Help/manual/cmake-buildsystem.7.rst +++ b/Help/manual/cmake-buildsystem.7.rst @@ -675,7 +675,9 @@ listed in the :prop_tgt:`INTERFACE_SYSTEM_INCLUDE_DIRECTORIES` of the dependency. This can result in omission of compiler warnings for headers found in those directories. This behavior for :ref:`imported targets` may be controlled by setting the :prop_tgt:`NO_SYSTEM_FROM_IMPORTED` target -property on the *consumers* of imported targets. +property on the *consumers* of imported targets, or by setting the +:prop_tgt:`IMPORTED_NO_SYSTEM` target property on the imported targets +themselves. If a binary target is linked transitively to a macOS :prop_tgt:`FRAMEWORK`, the ``Headers`` directory of the framework is also treated as a usage requirement. diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst index 04c5a53..59566b5 100644 --- a/Help/manual/cmake-variables.7.rst +++ b/Help/manual/cmake-variables.7.rst @@ -212,6 +212,7 @@ Variables that Change Behavior /variable/CMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY /variable/CMAKE_FRAMEWORK_PATH /variable/CMAKE_IGNORE_PATH + /variable/CMAKE_IGNORE_PREFIX_PATH /variable/CMAKE_INCLUDE_DIRECTORIES_BEFORE /variable/CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE /variable/CMAKE_INCLUDE_PATH @@ -250,6 +251,7 @@ Variables that Change Behavior /variable/CMAKE_SYSTEM_APPBUNDLE_PATH /variable/CMAKE_SYSTEM_FRAMEWORK_PATH /variable/CMAKE_SYSTEM_IGNORE_PATH + /variable/CMAKE_SYSTEM_IGNORE_PREFIX_PATH /variable/CMAKE_SYSTEM_INCLUDE_PATH /variable/CMAKE_SYSTEM_LIBRARY_PATH /variable/CMAKE_SYSTEM_PREFIX_PATH diff --git a/Help/manual/cmake.1.rst b/Help/manual/cmake.1.rst index 1463f0a..c2b4d68 100644 --- a/Help/manual/cmake.1.rst +++ b/Help/manual/cmake.1.rst @@ -585,6 +585,8 @@ Run ``cmake -E`` or ``cmake -E help`` for a summary of commands. Available commands are: ``capabilities`` + .. versionadded:: 3.7 + Report cmake capabilities in JSON format. The output is a JSON object with the following keys: @@ -645,6 +647,8 @@ Available commands are: Always false since CMake 3.20. ``cat <files>...`` + .. versionadded:: 3.18 + Concatenate files and print on the standard output. ``chdir <dir> <cmd> [<arg>...]`` @@ -653,8 +657,11 @@ Available commands are: ``compare_files [--ignore-eol] <file1> <file2>`` Check if ``<file1>`` is same as ``<file2>``. If files are the same, then returns ``0``, if not it returns ``1``. In case of invalid - arguments, it returns 2. The ``--ignore-eol`` option - implies line-wise comparison and ignores LF/CRLF differences. + arguments, it returns 2. + + .. versionadded:: 3.14 + The ``--ignore-eol`` option implies line-wise comparison and ignores + LF/CRLF differences. ``copy <file>... <destination>`` Copy files to ``<destination>`` (either file or directory). @@ -663,11 +670,21 @@ Available commands are: ``copy`` does follow symlinks. That means it does not copy symlinks, but the files or directories it point to. + .. versionadded:: 3.5 + Support for multiple input files. + ``copy_directory <dir>... <destination>`` Copy content of ``<dir>...`` directories to ``<destination>`` directory. If ``<destination>`` directory does not exist it will be created. ``copy_directory`` does follow symlinks. + .. versionadded:: 3.5 + Support for multiple input directories. + + .. versionadded:: 3.15 + The command now fails when the source directory does not exist. + Previously it succeeded by creating an empty destination directory. + ``copy_if_different <file>... <destination>`` Copy files to ``<destination>`` (either file or directory) if they have changed. @@ -675,13 +692,21 @@ Available commands are: directory and it must exist. ``copy_if_different`` does follow symlinks. + .. versionadded:: 3.5 + Support for multiple input files. + ``create_symlink <old> <new>`` Create a symbolic link ``<new>`` naming ``<old>``. + .. versionadded:: 3.13 + Support for creating symlinks on Windows. + .. note:: Path to where ``<new>`` symbolic link will be created has to exist beforehand. ``create_hardlink <old> <new>`` + .. versionadded:: 3.19 + Create a hard link ``<new>`` naming ``<old>``. .. note:: @@ -695,12 +720,16 @@ Available commands are: Displays arguments as text but no new line. ``env [--unset=NAME]... [NAME=VALUE]... COMMAND [ARG]...`` + .. versionadded:: 3.1 + Run command in a modified environment. ``environment`` Display the current environment variables. ``false`` + .. versionadded:: 3.16 + Do nothing, with an exit code of 1. ``make_directory <dir>...`` @@ -708,6 +737,9 @@ Available commands are: directories too. If a directory already exists it will be silently ignored. + .. versionadded:: 3.5 + Support for multiple input directories. + ``md5sum <file>...`` Create MD5 checksum of files in ``md5sum`` compatible format:: @@ -715,30 +747,40 @@ Available commands are: 052f86c15bbde68af55c7f7b340ab639 file2.txt ``sha1sum <file>...`` + .. versionadded:: 3.10 + Create SHA1 checksum of files in ``sha1sum`` compatible format:: 4bb7932a29e6f73c97bb9272f2bdc393122f86e0 file1.txt 1df4c8f318665f9a5f2ed38f55adadb7ef9f559c file2.txt ``sha224sum <file>...`` + .. versionadded:: 3.10 + Create SHA224 checksum of files in ``sha224sum`` compatible format:: b9b9346bc8437bbda630b0b7ddfc5ea9ca157546dbbf4c613192f930 file1.txt 6dfbe55f4d2edc5fe5c9197bca51ceaaf824e48eba0cc453088aee24 file2.txt ``sha256sum <file>...`` + .. versionadded:: 3.10 + Create SHA256 checksum of files in ``sha256sum`` compatible format:: 76713b23615d31680afeb0e9efe94d47d3d4229191198bb46d7485f9cb191acc file1.txt 15b682ead6c12dedb1baf91231e1e89cfc7974b3787c1e2e01b986bffadae0ea file2.txt ``sha384sum <file>...`` + .. versionadded:: 3.10 + Create SHA384 checksum of files in ``sha384sum`` compatible format:: acc049fedc091a22f5f2ce39a43b9057fd93c910e9afd76a6411a28a8f2b8a12c73d7129e292f94fc0329c309df49434 file1.txt 668ddeb108710d271ee21c0f3acbd6a7517e2b78f9181c6a2ff3b8943af92b0195dcb7cce48aa3e17893173c0a39e23d file2.txt ``sha512sum <file>...`` + .. versionadded:: 3.10 + Create SHA512 checksum of files in ``sha512sum`` compatible format:: 2a78d7a6c5328cfb1467c63beac8ff21794213901eaadafd48e7800289afbc08e5fb3e86aa31116c945ee3d7bf2a6194489ec6101051083d1108defc8e1dba89 file1.txt @@ -761,16 +803,24 @@ Available commands are: .. deprecated:: 3.17 Remove ``<dir>`` directories and their contents. If a directory does - not exist it will be silently ignored. If ``<dir>`` is a symlink to - a directory, just the symlink will be removed. + not exist it will be silently ignored. Use ``rm`` instead. + .. versionadded:: 3.15 + Support for multiple directories. + + .. versionadded:: 3.16 + If ``<dir>`` is a symlink to a directory, just the symlink will be removed. + ``rename <oldname> <newname>`` Rename a file or directory (on one volume). If file with the ``<newname>`` name already exists, then it will be silently replaced. ``rm [-rRf] <file> <dir>...`` - Remove the files ``<file>`` or directories ``dir``. + .. versionadded:: 3.17 + + Remove the files ``<file>`` or directories ``<dir>``. + Use ``-r`` or ``-R`` to remove directories and their contents recursively. If any of the listed files/directories do not exist, the command returns a non-zero exit code, but no message is logged. The ``-f`` option changes @@ -781,6 +831,8 @@ Available commands are: Launch :manual:`cmake-server(7)` mode. ``sleep <number>...`` + .. versionadded:: 3.0 + Sleep for given number of seconds. ``tar [cxt][vf][zjJ] file.tar [<options>] [--] [<pathname>...]`` @@ -789,45 +841,85 @@ Available commands are: ``c`` Create a new archive containing the specified files. If used, the ``<pathname>...`` argument is mandatory. + ``x`` Extract to disk from the archive. - The ``<pathname>...`` argument could be used to extract only selected files - or directories. - When extracting selected files or directories, you must provide their exact - names including the path, as printed by list (``-t``). + + .. versionadded:: 3.15 + The ``<pathname>...`` argument could be used to extract only selected files + or directories. + When extracting selected files or directories, you must provide their exact + names including the path, as printed by list (``-t``). + ``t`` List archive contents. - The ``<pathname>...`` argument could be used to list only selected files - or directories. + + .. versionadded:: 3.15 + The ``<pathname>...`` argument could be used to list only selected files + or directories. + ``v`` Produce verbose output. + ``z`` Compress the resulting archive with gzip. + ``j`` Compress the resulting archive with bzip2. + ``J`` + .. versionadded:: 3.1 + Compress the resulting archive with XZ. + ``--zstd`` + .. versionadded:: 3.15 + Compress the resulting archive with Zstandard. + ``--files-from=<file>`` + .. versionadded:: 3.1 + Read file names from the given file, one per line. Blank lines are ignored. Lines may not start in ``-`` except for ``--add-file=<name>`` to add files whose names start in ``-``. + ``--format=<format>`` + .. versionadded:: 3.3 + Specify the format of the archive to be created. Supported formats are: ``7zip``, ``gnutar``, ``pax``, ``paxr`` (restricted pax, default), and ``zip``. + ``--mtime=<date>`` + .. versionadded:: 3.1 + Specify modification time recorded in tarball entries. + ``--`` + .. versionadded:: 3.1 + Stop interpreting options and treat all remaining arguments as file names, even if they start with ``-``. + .. versionadded:: 3.1 + LZMA (7zip) support. + + .. versionadded:: 3.15 + The command now continues adding files to an archive even if some of the + files are not readable. This behavior is more consistent with the classic + ``tar`` tool. The command now also parses all flags, and if an invalid flag + was provided, a warning is issued. ``time <command> [<args>...]`` Run command and display elapsed time. + .. versionadded:: 3.5 + The command now properly passes arguments with spaces or special characters + through to the child process. This may break scripts that worked around the + bug with their own extra quoting or escaping. + ``touch <file>...`` Creates ``<file>`` if file do not exist. If ``<file>`` exists, it is changing ``<file>`` access and modification times. @@ -837,6 +929,8 @@ Available commands are: not exist it will be silently ignored. ``true`` + .. versionadded:: 3.16 + Do nothing, with an exit code of 0. Windows-specific Command-Line Tools @@ -848,10 +942,14 @@ The following ``cmake -E`` commands are available only on Windows: Delete Windows registry value. ``env_vs8_wince <sdkname>`` + .. versionadded:: 3.2 + Displays a batch file which sets the environment for the provided Windows CE SDK installed in VS2005. ``env_vs9_wince <sdkname>`` + .. versionadded:: 3.2 + Displays a batch file which sets the environment for the provided Windows CE SDK installed in VS2008. diff --git a/Help/prop_tgt/IMPORTED_NO_SYSTEM.rst b/Help/prop_tgt/IMPORTED_NO_SYSTEM.rst index cc726d1..ee22d6f 100644 --- a/Help/prop_tgt/IMPORTED_NO_SYSTEM.rst +++ b/Help/prop_tgt/IMPORTED_NO_SYSTEM.rst @@ -1,12 +1,16 @@ IMPORTED_NO_SYSTEM ------------------ +.. versionadded:: 3.23 + Specifies that an :ref:`Imported Target <Imported Targets>` is not a ``SYSTEM`` library. This has the following effects: * Entries of :prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES` are not treated as ``SYSTEM`` include directories when compiling consumers, as they - would be by default. + would be by default. Entries of + :prop_tgt:`INTERFACE_SYSTEM_INCLUDE_DIRECTORIES` are not affected, + and will always be treated as ``SYSTEM`` include directories. This property can also be enabled on a non-imported target. Doing so does not affect the build system, but does tell the :command:`install(EXPORT)` and diff --git a/Help/prop_tgt/INTERFACE_LINK_LIBRARIES_DIRECT.rst b/Help/prop_tgt/INTERFACE_LINK_LIBRARIES_DIRECT.rst index 1a6ebd1..0507261 100644 --- a/Help/prop_tgt/INTERFACE_LINK_LIBRARIES_DIRECT.rst +++ b/Help/prop_tgt/INTERFACE_LINK_LIBRARIES_DIRECT.rst @@ -1,6 +1,8 @@ INTERFACE_LINK_LIBRARIES_DIRECT ------------------------------- +.. versionadded:: 3.23 + List of libraries that consumers of this library should treat as direct link dependencies. diff --git a/Help/prop_tgt/INTERFACE_LINK_LIBRARIES_DIRECT_EXCLUDE.rst b/Help/prop_tgt/INTERFACE_LINK_LIBRARIES_DIRECT_EXCLUDE.rst index ecab8a0..c92f142 100644 --- a/Help/prop_tgt/INTERFACE_LINK_LIBRARIES_DIRECT_EXCLUDE.rst +++ b/Help/prop_tgt/INTERFACE_LINK_LIBRARIES_DIRECT_EXCLUDE.rst @@ -1,6 +1,8 @@ INTERFACE_LINK_LIBRARIES_DIRECT_EXCLUDE --------------------------------------- +.. versionadded:: 3.23 + List of libraries that consumers of this library should *not* treat as direct link dependencies. diff --git a/Help/prop_tgt/INTERFACE_SYSTEM_INCLUDE_DIRECTORIES.rst b/Help/prop_tgt/INTERFACE_SYSTEM_INCLUDE_DIRECTORIES.rst index a0a97ad..b37bb0c 100644 --- a/Help/prop_tgt/INTERFACE_SYSTEM_INCLUDE_DIRECTORIES.rst +++ b/Help/prop_tgt/INTERFACE_SYSTEM_INCLUDE_DIRECTORIES.rst @@ -5,9 +5,12 @@ List of public system include directories for a library. Targets may populate this property to publish the include directories which contain system headers, and therefore should not result in -compiler warnings. The :command:`target_include_directories(SYSTEM)` -command signature populates this property with values given to the -``PUBLIC`` and ``INTERFACE`` keywords. +compiler warnings. Additionally, system include directories are searched +after normal include directories regardless of the order specified. + +The :command:`target_include_directories(SYSTEM)` command signature +populates this property with values given to the ``PUBLIC`` and +``INTERFACE`` keywords. Projects may also get and set the property directly, but must be aware that adding directories to this property does not make those directories used diff --git a/Help/prop_tgt/NO_SYSTEM_FROM_IMPORTED.rst b/Help/prop_tgt/NO_SYSTEM_FROM_IMPORTED.rst index e5cc09b..39a13ee 100644 --- a/Help/prop_tgt/NO_SYSTEM_FROM_IMPORTED.rst +++ b/Help/prop_tgt/NO_SYSTEM_FROM_IMPORTED.rst @@ -8,7 +8,9 @@ The contents of the :prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES` target property of imported targets are treated as ``SYSTEM`` includes by default. If this property is enabled on a target, compilation of sources in that target will not treat the contents of the ``INTERFACE_INCLUDE_DIRECTORIES`` of consumed -imported targets as system includes. +imported targets as system includes. Either way, entries of +:prop_tgt:`INTERFACE_SYSTEM_INCLUDE_DIRECTORIES` are not affected, +and will always be treated as ``SYSTEM`` include directories. This property is initialized by the value of the :variable:`CMAKE_NO_SYSTEM_FROM_IMPORTED` variable if it is set when a target diff --git a/Help/release/3.23.rst b/Help/release/3.23.rst new file mode 100644 index 0000000..14fa47c --- /dev/null +++ b/Help/release/3.23.rst @@ -0,0 +1,253 @@ +CMake 3.23 Release Notes +************************ + +.. only:: html + + .. contents:: + +Changes made since CMake 3.22 include the following. + +New Features +============ + +Presets +------- + +* :manual:`cmake-presets(7)` files now support schema version ``4``. + +* :manual:`cmake-presets(7)` files now have an optional ``include`` field, + which allows the files to include other files. + +* :manual:`cmake-presets(7)` gained support for specifying the + ``resolvePackageReferences`` command line option in a build preset. + +Generators +---------- + +* The :ref:`Visual Studio Generators` for VS 2019 and above learned to + support .NET SDK-style project files (``.csproj``) for C# projects. + See the :prop_tgt:`DOTNET_SDK` target property and corresponding + :variable:`CMAKE_DOTNET_SDK` variable. :command:`add_custom_command` + is not yet supported in .NET SDK-style projects. + +* The :ref:`Visual Studio Generators` for VS 2017 and above learned to + use portable instances of Visual Studio not known to the VS installer. + See the :variable:`CMAKE_GENERATOR_INSTANCE` variable. + +Command-Line +------------ + +* The :manual:`cmake(1)` ``--build`` command, when used with + :ref:`Visual Studio Generators` on projects that set the + :prop_tgt:`VS_PACKAGE_REFERENCES` target property, now automatically + restores package references from NuGet. The cache variable + :variable:`CMAKE_VS_NUGET_PACKAGE_RESTORE` may be set to toggle this behavior + in a build tree. Use the ``--resolve-package-references=<on|off|only>`` + command-line option to control the behavior on one invocation. + +* The :manual:`cmake(1)` command line tool gained a ``--debug-find-pkg=`` + option to enable debug messages under specific :command:`find_package` + calls. + +* The :manual:`cmake(1)` command line tool gained a ``--debug-find-var=`` + option to enable debug messages for ``find_*`` calls that use specific + result variables. + +Compilers +--------- + +* The IBM Open XL C/C++ compiler, based on LLVM, is now supported with + compiler id ``IBMClang``. + +* The MCST LCC compiler is now supported with compiler id ``LCC``. + See policy :policy:`CMP0129`. + +File-Based API +-------------- + +* The :manual:`cmake-file-api(7)` "codemodel" version 2 ``version`` field + has been updated to ``2.4``. + +* The :manual:`cmake-file-api(7)` "codemodel" version 2 ``directory`` + object ``installers`` field gained a new ``fileSet`` installer type. + +Commands +-------- + +* The :command:`define_property` command gained a new + ``INITIALIZE_FROM_VARIABLE`` option to cause a target property to be + initialized from a variable when a target is created. + +* The :command:`install(TARGETS)` command gained a new ``FILE_SET`` argument, + which can be used to install header file sets associated with a target. + +* The :command:`string(TIMESTAMP)` and :command:`file(TIMESTAMP)` commands now + support the ``%f`` specifier for microseconds. + +* The :command:`target_sources` command gained a new ``FILE_SET`` mode, which + can be used to add headers as header-only source files of a target. + +Variables +--------- + +* The :variable:`CMAKE_CUDA_ARCHITECTURES` variable and associated + :prop_tgt:`CUDA_ARCHITECTURES` target property now support the + ``all``, and ``all-major`` values for CUDA toolkit 7.0+. + +* The :variable:`CMAKE_IGNORE_PREFIX_PATH` and + :variable:`CMAKE_SYSTEM_IGNORE_PREFIX_PATH` variables were added + to tell the :command:`find_package`, :command:`find_program`, + :command:`find_library`, :command:`find_path`, and :command:`find_file` + commands to ignore specified prefixes. + +* The :variable:`CMAKE_LINK_LIBRARIES_ONLY_TARGETS` variable and + corresponding :prop_tgt:`LINK_LIBRARIES_ONLY_TARGETS` target + property were added to optionally require that all link items + that can be target names are actually names of existing targets. + +Properties +---------- + +* The :prop_tgt:`HEADER_SETS` and :prop_tgt:`INTERFACE_HEADER_SETS` target + properties were added to list header sets associated with a target. + +* The :prop_tgt:`HEADER_SET` and :prop_tgt:`HEADER_SET_<NAME>` target + properties were added to list files in the default header set + and named header sets, respectively. + +* The :prop_tgt:`HEADER_DIRS` and :prop_tgt:`HEADER_DIRS_<NAME>` target + properties were added to specify the base directories of the default + header set and named header sets, respectively. + +* The :prop_tgt:`IMPORTED_NO_SYSTEM` target property was added to + specify that an :ref:`Imported Target <Imported Targets>` should + not be treated as a system library (i.e. its include directories + are not automatically ``SYSTEM``). + +* The :prop_tgt:`INTERFACE_LINK_LIBRARIES_DIRECT` and + :prop_tgt:`INTERFACE_LINK_LIBRARIES_DIRECT_EXCLUDE` target properties + were added to express usage requirements affecting a consumer's + direct link dependencies. + +* The :prop_tgt:`XCODE_EMBED_PLUGINS <XCODE_EMBED_<type>>` target property + was added to tell the :generator:`Xcode` generator what targets to put in + the ``Embed PlugIns`` build phase. + +* The :prop_tgt:`XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE` target property + and supporting :variable:`CMAKE_XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE` + variable were added to tell the :generator:`Xcode` generator to enable + specifying the Xcode scheme option property ``GPU Frame Capture``. + +Modules +------- + +* The :module:`CheckPIESupported` module now supports the ``OBJC``, + ``OBJCXX``, ``CUDA``, and ``HIP`` languages. It also now honors + :variable:`CMAKE_SYSROOT` and :variable:`CMAKE_OSX_SYSROOT`. + +* The :module:`FindCUDAToolkit` module now provides a target for + ``libcufft_static_nocallback``, if found. + +* The :module:`FindGLUT` module now provides the ``GLUT_INCLUDE_DIRS`` + result variable to conform with naming conventions documented in the + :manual:`cmake-developer(7)` manual. This supersedes the legacy + ``GLUT_INCLUDE_DIR`` variable. + +* The :module:`FindGTest` module now provides a target for GMock, if found. + +* The :module:`FindVulkan` module now provides a ``Vulkan_VERSION`` result + variable reporting the version number. + +CTest +----- + +* :manual:`ctest(1)` gained a new :variable:`CTEST_SUBMIT_INACTIVITY_TIMEOUT` + variable, which can be used to specify a timeout for submission inactivity. + +CPack +----- + +* The :cpack_gen:`CPack productbuild Generator` gained the new + :variable:`CPACK_PRODUCTBUILD_DOMAINS`, + :variable:`CPACK_PRODUCTBUILD_DOMAINS_ANYWHERE`, + :variable:`CPACK_PRODUCTBUILD_DOMAINS_USER`, and + :variable:`CPACK_PRODUCTBUILD_DOMAINS_ROOT` variables for + adding the domains element to the Distribution XML. + +* The :cpack_gen:`CPack productbuild Generator` gained a new variable, + :variable:`CPACK_PRODUCTBUILD_IDENTIFIER`, used to customize the unique + product identifier associated with the product. + +* The :cpack_gen:`CPack IFW Generator` gained the new + :variable:`CPACK_IFW_ARCHIVE_FORMAT` and + :variable:`CPACK_IFW_ARCHIVE_COMPRESSION` variables for setting the + format used when packaging new component data archives, and choosing + the compression level used. + These features are available for QtIFW 4.2 and newer. + +* The :cpack_gen:`CPack IFW Generator` gained new + :variable:`CPACK_IFW_PACKAGE_DISABLE_COMMAND_LINE_INTERFACE` variable to + prevent the user from passing any consumer command to the installer, like + ``install``, ``update``, and ``remove``. + This feature is available for QtIFW 4.0 and newer. + +* The :cpack_gen:`CPack IFW Generator` gained the new + :variable:`CPACK_IFW_PACKAGE_PRODUCT_IMAGES` variable for adding a + list of images to be shown on the ``PerformInstallationPage``. + This feature is available for QtIFW 4.0 and newer. + +* The :cpack_gen:`CPack IFW Generator` gained the new + :variable:`CPACK_IFW_PACKAGE_RUN_PROGRAM`, + :variable:`CPACK_IFW_PACKAGE_RUN_PROGRAM_ARGUMENTS`, and + :variable:`CPACK_IFW_PACKAGE_RUN_PROGRAM_DESCRIPTION` variables for + executing a command after the installer is done if the user accepts + the action. This feature is available for QtIFW 4.0 and newer. + +* The :cpack_gen:`CPack IFW Generator` gained the new + :variable:`CPACK_IFW_PACKAGE_SIGNING_IDENTITY` variable for specifying a + code signing identity to be used for signing the generated app bundle. + This feature is available on macOS only, and for QtIFW 3.0 and newer. + +* The :cpack_gen:`CPack WIX Generator` gained a new variable, + :variable:`CPACK_WIX_SKIP_WIX_UI_EXTENSION`, to skip the inclusion + of WixUIExtensions. + +Deprecated and Removed Features +=============================== + +* The :manual:`cpack(1)` undocumented ``OSXX11`` generator has been removed. + +Other Changes +============= + +* The :cpack_gen:`CPack DragNDrop Generator` no longer attaches + :variable:`CPACK_RESOURCE_FILE_LICENSE` as the license agreement in + the generated ``.dmg`` unless explicitly activated by a + :variable:`CPACK_DMG_SLA_USE_RESOURCE_FILE_LICENSE` option. + In CMake projects, the :module:`CPack` module enables the option + by default for compatibility. + +* ``CUDA`` targets may now enable both :prop_tgt:`CUDA_SEPARABLE_COMPILATION` + and :prop_tgt:`CUDA_PTX_COMPILATION`. + +* ``CUDA`` compiler detection now: + + * issues an error in all cases when it's unable to compute the default + architecture(s) if required (see :policy:`CMP0104`), + + * handles ``OFF`` for :variable:`CMAKE_CUDA_ARCHITECTURES` on Clang, + + * supports the theoretical case of multiple default architectures, and + + * tries to detect invalid architectures and issue an error. + +* ``CUDA`` with Clang now implements policy :policy:`CMP0105` and + the ``$<DEVICE_LINK:...>`` and ``$<HOST_LINK:...>`` + :manual:`generator expressions <cmake-generator-expressions(7)>`. + +* The :command:`define_property` command's ``BRIEF_DOCS`` and ``FULL_DOCS`` + arguments are now optional. + +* :manual:`ccmake(1)` may now be enabled on Windows when building + CMake from source. This is experimental, and so is not included + in official distributions. diff --git a/Help/release/dev/0-sample-topic.rst b/Help/release/dev/0-sample-topic.rst deleted file mode 100644 index e4cc01e..0000000 --- a/Help/release/dev/0-sample-topic.rst +++ /dev/null @@ -1,7 +0,0 @@ -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/CheckPIESupported-supports-SYSROOT.rst b/Help/release/dev/CheckPIESupported-supports-SYSROOT.rst deleted file mode 100644 index 0f7f7de..0000000 --- a/Help/release/dev/CheckPIESupported-supports-SYSROOT.rst +++ /dev/null @@ -1,6 +0,0 @@ -CheckPIESupported-supports-SYSROOT ----------------------------------- - -* The :module:`CheckPIESupported` module now takes care of any ``SYSROOT`` - settings and gains the support of ``OBJC``, ``OBJCXX``, ``CUDA``, and ``HIP`` - languages. diff --git a/Help/release/dev/FindCUDAToolkit-target-for-cufft_static_nocallback.rst b/Help/release/dev/FindCUDAToolkit-target-for-cufft_static_nocallback.rst deleted file mode 100644 index 91c3feb..0000000 --- a/Help/release/dev/FindCUDAToolkit-target-for-cufft_static_nocallback.rst +++ /dev/null @@ -1,5 +0,0 @@ -FindCUDAToolkit-target-for-cufft_static_nocallback --------------------------------------------------- - -* The :module:`FindCUDAToolkit` module now provides a target for - ``libcufft_static_nocallback``, if found. diff --git a/Help/release/dev/FindGLUT-include-dirs.rst b/Help/release/dev/FindGLUT-include-dirs.rst deleted file mode 100644 index 9528892..0000000 --- a/Help/release/dev/FindGLUT-include-dirs.rst +++ /dev/null @@ -1,7 +0,0 @@ -FindGLUT-include-dirs ---------------------- - -* The :module:`FindGLUT` module now provides the ``GLUT_INCLUDE_DIRS`` - result variable to conform with naming conventions documented in the - :manual:`cmake-developer(7)` manual. This supersedes the legacy - ``GLUT_INCLUDE_DIR`` variable. diff --git a/Help/release/dev/FindGTest-target-for-gmock.rst b/Help/release/dev/FindGTest-target-for-gmock.rst deleted file mode 100644 index f78242c..0000000 --- a/Help/release/dev/FindGTest-target-for-gmock.rst +++ /dev/null @@ -1,4 +0,0 @@ -FindGTest-target-for-gmock --------------------------- - -* The :module:`FindGTest` module now provides a target for GMock, if found. diff --git a/Help/release/dev/FindVulkan-version.rst b/Help/release/dev/FindVulkan-version.rst deleted file mode 100644 index 4e9f121..0000000 --- a/Help/release/dev/FindVulkan-version.rst +++ /dev/null @@ -1,5 +0,0 @@ -FindVulkan-version ------------------- - -* The :module:`FindVulkan` module gained a ``Vulkan_VERSION`` result - variable reporting the version number. diff --git a/Help/release/dev/ccmake-windows.rst b/Help/release/dev/ccmake-windows.rst deleted file mode 100644 index acb6d29..0000000 --- a/Help/release/dev/ccmake-windows.rst +++ /dev/null @@ -1,6 +0,0 @@ -ccmake-windows --------------- - -* :manual:`ccmake(1)` may now be enabled on Windows when building - CMake from source. This is experimental, and so is not included - in official distributions. diff --git a/Help/release/dev/cmake-presets-include.rst b/Help/release/dev/cmake-presets-include.rst deleted file mode 100644 index 51219bd..0000000 --- a/Help/release/dev/cmake-presets-include.rst +++ /dev/null @@ -1,6 +0,0 @@ -cmake-presets-include ---------------------- - -* :manual:`cmake-presets(7)` files now support schema version ``4``. -* :manual:`cmake-presets(7)` files now have an optional ``include`` field, - which allows the files to include other files. diff --git a/Help/release/dev/cpack-dmg-sla.rst b/Help/release/dev/cpack-dmg-sla.rst deleted file mode 100644 index c6a3596..0000000 --- a/Help/release/dev/cpack-dmg-sla.rst +++ /dev/null @@ -1,9 +0,0 @@ -cpack-dmg-sla -------------- - -* The :cpack_gen:`CPack DragNDrop Generator` no longer attaches - :variable:`CPACK_RESOURCE_FILE_LICENSE` as the license agreement in - the generated ``.dmg`` unless explicitly activated by a - :variable:`CPACK_DMG_SLA_USE_RESOURCE_FILE_LICENSE` option. - In CMake projects, the :module:`CPack` module enables the option - by default for compatibility. diff --git a/Help/release/dev/cpack-drop-osxx11.rst b/Help/release/dev/cpack-drop-osxx11.rst deleted file mode 100644 index c8dfaff..0000000 --- a/Help/release/dev/cpack-drop-osxx11.rst +++ /dev/null @@ -1,4 +0,0 @@ -cpack-drop-osxx11 ------------------ - -* The :manual:`cpack(1)` undocumented ``OSXX11`` generator has been removed. diff --git a/Help/release/dev/cpack-productbuild-domains.rst b/Help/release/dev/cpack-productbuild-domains.rst deleted file mode 100644 index 32a2eee..0000000 --- a/Help/release/dev/cpack-productbuild-domains.rst +++ /dev/null @@ -1,9 +0,0 @@ -cpack-productbuild-domains ------------------------------ - -* The :cpack_gen:`CPack productbuild Generator` gained the new - :variable:`CPACK_PRODUCTBUILD_DOMAINS`, - :variable:`CPACK_PRODUCTBUILD_DOMAINS_ANYWHERE`, - :variable:`CPACK_PRODUCTBUILD_DOMAINS_USER`, and - :variable:`CPACK_PRODUCTBUILD_DOMAINS_ROOT` variables for - adding the domains element to the Distribution XML. diff --git a/Help/release/dev/cpack-productbuild-identifier.rst b/Help/release/dev/cpack-productbuild-identifier.rst deleted file mode 100644 index bfa0dd9..0000000 --- a/Help/release/dev/cpack-productbuild-identifier.rst +++ /dev/null @@ -1,6 +0,0 @@ -cpack-productbuild-identifier ------------------------------ - -* The :cpack_gen:`CPack productbuild Generator` gained a new variable, - :variable:`CPACK_PRODUCTBUILD_IDENTIFIER`, used to customize the unique - product identifier associated with the product. diff --git a/Help/release/dev/cpack-wix-skip-ui-ext.rst b/Help/release/dev/cpack-wix-skip-ui-ext.rst deleted file mode 100644 index e139469..0000000 --- a/Help/release/dev/cpack-wix-skip-ui-ext.rst +++ /dev/null @@ -1,5 +0,0 @@ -cpack-wix-skip-ui-ext ---------------------- - -* An option to the WiX Generator was added to be able to skip - the inclusion of the WixUIExtensions diff --git a/Help/release/dev/cpackifw-archive-format.rst b/Help/release/dev/cpackifw-archive-format.rst deleted file mode 100644 index 8884d74..0000000 --- a/Help/release/dev/cpackifw-archive-format.rst +++ /dev/null @@ -1,9 +0,0 @@ - -cpackifw-archive-format ------------------------ - -* The :cpack_gen:`CPack IFW Generator` gained the new - :variable:`CPACK_IFW_ARCHIVE_FORMAT` and - :variable:`CPACK_IFW_ARCHIVE_COMPRESSION` variables for setting the format - used when packaging new component data archives, and choosing the compression - level used. These features are available for QtIFW 4.2 and newer. diff --git a/Help/release/dev/cpackifw-package-disable-command-line-interface.rst b/Help/release/dev/cpackifw-package-disable-command-line-interface.rst deleted file mode 100644 index 2de222e..0000000 --- a/Help/release/dev/cpackifw-package-disable-command-line-interface.rst +++ /dev/null @@ -1,8 +0,0 @@ -cpackifw-package-disable-command-line-interface ------------------------------------------------ - -* The :cpack_gen:`CPack IFW Generator` gained new - :variable:`CPACK_IFW_PACKAGE_DISABLE_COMMAND_LINE_INTERFACE` variable to - prevents the user from passing any consumer command to installer, like - ``install``, ``update``, and ``remove``. - This feature is available for QtIFW 4.0 and newer. diff --git a/Help/release/dev/cpackifw-package-product-images.rst b/Help/release/dev/cpackifw-package-product-images.rst deleted file mode 100644 index 3a02534..0000000 --- a/Help/release/dev/cpackifw-package-product-images.rst +++ /dev/null @@ -1,8 +0,0 @@ - -cpackifw-package-product-images -------------------------------- - -* The :cpack_gen:`CPack IFW Generator` gained the new - :variable:`CPACK_IFW_PACKAGE_PRODUCT_IMAGES` variable for adding a list of - images to be shown on the ``PerformInstallationPage``. - This feature is available for QtIFW 4.0 and newer. diff --git a/Help/release/dev/cpackifw-package-run-program.rst b/Help/release/dev/cpackifw-package-run-program.rst deleted file mode 100644 index 5d6f1b2..0000000 --- a/Help/release/dev/cpackifw-package-run-program.rst +++ /dev/null @@ -1,10 +0,0 @@ - -cpackifw-package-run-program ----------------------------- - -* The :cpack_gen:`CPack IFW Generator` gained the new - :variable:`CPACK_IFW_PACKAGE_RUN_PROGRAM`, - :variable:`CPACK_IFW_PACKAGE_RUN_PROGRAM_ARGUMENTS`, and - :variable:`CPACK_IFW_PACKAGE_RUN_PROGRAM_DESCRIPTION` variables for executing - a command after the installer is done if the user accepts the action. - This feature is available for QtIFW 4.0 and newer. diff --git a/Help/release/dev/cpackifw-signing-identity.rst b/Help/release/dev/cpackifw-signing-identity.rst deleted file mode 100644 index 58f5030..0000000 --- a/Help/release/dev/cpackifw-signing-identity.rst +++ /dev/null @@ -1,7 +0,0 @@ -cpackifw-signing-identity -------------------------- - -* The :cpack_gen:`CPack IFW Generator` gained the new - :variable:`CPACK_IFW_PACKAGE_SIGNING_IDENTITY` variable for specifying a code - signing identity to be used for signing the generated app bundle. - This feature is available on macOS only, and for QtIFW 3.0 and newer. diff --git a/Help/release/dev/ctest_submit-inactivity-timeout.rst b/Help/release/dev/ctest_submit-inactivity-timeout.rst deleted file mode 100644 index 3d4c408..0000000 --- a/Help/release/dev/ctest_submit-inactivity-timeout.rst +++ /dev/null @@ -1,5 +0,0 @@ -ctest_submit-inactivity-timeout -------------------------------- - -* :manual:`ctest(1)` gained a new :variable:`CTEST_SUBMIT_INACTIVITY_TIMEOUT` - variable, which can be used to specify a timeout for submission inactivity. diff --git a/Help/release/dev/cuda-clang-device-link-flags.rst b/Help/release/dev/cuda-clang-device-link-flags.rst deleted file mode 100644 index 2f4f16e..0000000 --- a/Help/release/dev/cuda-clang-device-link-flags.rst +++ /dev/null @@ -1,7 +0,0 @@ -cuda-clang-device-link-flags ----------------------------- - -* Policy :policy:`CMP0105` and the ``$<DEVICE_LINK:...>`` and - ``$<HOST_LINK:...>`` - :manual:`generator expressions <cmake-generator-expressions(7)>` - are now supported for Clang. diff --git a/Help/release/dev/cuda-compiler-detection-robustness.rst b/Help/release/dev/cuda-compiler-detection-robustness.rst deleted file mode 100644 index cc49a8d..0000000 --- a/Help/release/dev/cuda-compiler-detection-robustness.rst +++ /dev/null @@ -1,11 +0,0 @@ -cuda-compiler-detection-robustness ----------------------------------- - -* CUDA compiler detection now issues an error in all cases when it's unable to - compute the default architecture(s) if required (see :policy:`CMP0104`). - -* CUDA compiler detection now correctly handles ``OFF`` for - :variable:`CMAKE_CUDA_ARCHITECTURES` on Clang. - -* CUDA compiler detection now supports the theoretical case of multiple default - architectures. diff --git a/Help/release/dev/cuda-invalid-architectures.rst b/Help/release/dev/cuda-invalid-architectures.rst deleted file mode 100644 index 3313dbb..0000000 --- a/Help/release/dev/cuda-invalid-architectures.rst +++ /dev/null @@ -1,5 +0,0 @@ -cuda-invalid-architectures --------------------------- - -* CUDA compiler detection now tries to detect invalid architectures and issue - an error. diff --git a/Help/release/dev/cuda-new-arch-modes.rst b/Help/release/dev/cuda-new-arch-modes.rst deleted file mode 100644 index fcfd8f1..0000000 --- a/Help/release/dev/cuda-new-arch-modes.rst +++ /dev/null @@ -1,8 +0,0 @@ -cuda-new-arch-modes -------------------- - -* The :prop_tgt:`CUDA_ARCHITECTURES` target property now supports the - `all`, and `all-major` values for CUDA toolkit 7.0+. - -* The :variable:`CMAKE_CUDA_ARCHITECTURES` variable now supports the - `all`, and `all-major` values for CUDA toolkit 7.0+. diff --git a/Help/release/dev/cuda-ptx-separable-compilation.rst b/Help/release/dev/cuda-ptx-separable-compilation.rst deleted file mode 100644 index 49c66c0..0000000 --- a/Help/release/dev/cuda-ptx-separable-compilation.rst +++ /dev/null @@ -1,5 +0,0 @@ -cuda-ptx-separable-compilation ------------------------------- - -* ``CUDA`` targets can now enable both :prop_tgt:`CUDA_SEPARABLE_COMPILATION` and - :prop_tgt:`CUDA_PTX_COMPILATION`. diff --git a/Help/release/dev/define-property-optional-args.rst b/Help/release/dev/define-property-optional-args.rst deleted file mode 100644 index b1cbf5e..0000000 --- a/Help/release/dev/define-property-optional-args.rst +++ /dev/null @@ -1,5 +0,0 @@ -define-property-optional-args ------------------------------ - -* The :command:`define_property` ``BRIEF_DOCS`` and ``FULL_DOCS`` arguments are - now optional. diff --git a/Help/release/dev/filter-debug-find.rst b/Help/release/dev/filter-debug-find.rst deleted file mode 100644 index 8bdb61e..0000000 --- a/Help/release/dev/filter-debug-find.rst +++ /dev/null @@ -1,10 +0,0 @@ -filter-debug-find ------------------ - -* The :manual:`cmake(1)` command line tool's gained a - ``--debug-find-pkg=`` option to enable debug messages under specific - :command:`find_package` calls. - -* The :manual:`cmake(1)` command line tool gained a ``--debug-find-var=`` - option to enable debug messages for ``find_*`` calls that use specific - result variables. diff --git a/Help/release/dev/ibmclang-compiler.rst b/Help/release/dev/ibmclang-compiler.rst deleted file mode 100644 index 2a9b5ad..0000000 --- a/Help/release/dev/ibmclang-compiler.rst +++ /dev/null @@ -1,5 +0,0 @@ -ibmclang-compiler ------------------ - -* The IBM Open XL C/C++ compiler, based on LLVM, is now supported with - compiler id ``IBMClang``. diff --git a/Help/release/dev/imported-no-system.rst b/Help/release/dev/imported-no-system.rst deleted file mode 100644 index a35e8bb..0000000 --- a/Help/release/dev/imported-no-system.rst +++ /dev/null @@ -1,7 +0,0 @@ -imported-no-system ------------------- - -* The :prop_tgt:`IMPORTED_NO_SYSTEM` target property was added to - specify that an :ref:`Imported Target <Imported Targets>` should - not be treated as a system library (i.e. its include directories - are not automatically ``SYSTEM``). diff --git a/Help/release/dev/lcc-compiler.rst b/Help/release/dev/lcc-compiler.rst deleted file mode 100644 index 719611d..0000000 --- a/Help/release/dev/lcc-compiler.rst +++ /dev/null @@ -1,5 +0,0 @@ -lcc-compiler ------------- - -* The MCST LCC compiler is now supported with compiler id ``LCC``. - See policy :policy:`CMP0129`. diff --git a/Help/release/dev/link-interface-direct.rst b/Help/release/dev/link-interface-direct.rst deleted file mode 100644 index 2e9a59e..0000000 --- a/Help/release/dev/link-interface-direct.rst +++ /dev/null @@ -1,7 +0,0 @@ -link-interface-direct ---------------------- - -* The :prop_tgt:`INTERFACE_LINK_LIBRARIES_DIRECT` and - :prop_tgt:`INTERFACE_LINK_LIBRARIES_DIRECT_EXCLUDE` target properties - were added to express usage requirements affecting a consumer's - direct link dependencies. diff --git a/Help/release/dev/link-only-targets.rst b/Help/release/dev/link-only-targets.rst deleted file mode 100644 index 7901a25..0000000 --- a/Help/release/dev/link-only-targets.rst +++ /dev/null @@ -1,7 +0,0 @@ -link-only-targets ------------------ - -* The :variable:`CMAKE_LINK_LIBRARIES_ONLY_TARGETS` variable and - corresponding :prop_tgt:`LINK_LIBRARIES_ONLY_TARGETS` target - property were added to optionally require that all link items - that can be target names are actually names of existing targets. diff --git a/Help/release/dev/target-properties-from-variables.rst b/Help/release/dev/target-properties-from-variables.rst deleted file mode 100644 index 99857c4..0000000 --- a/Help/release/dev/target-properties-from-variables.rst +++ /dev/null @@ -1,5 +0,0 @@ -target-properties-from-variables --------------------------------- - -* The :command:`define_property` command gained a new - ``INITIALIZE_FROM_VARIABLE`` argument. diff --git a/Help/release/dev/target-sources-file-set.rst b/Help/release/dev/target-sources-file-set.rst deleted file mode 100644 index bd28efa..0000000 --- a/Help/release/dev/target-sources-file-set.rst +++ /dev/null @@ -1,18 +0,0 @@ -target-headers --------------- - -* The :command:`target_sources` command gained a new ``FILE_SET`` mode, which - can be used to add headers as header-only source files of a target. -* New :prop_tgt:`HEADER_SETS` and :prop_tgt:`INTERFACE_HEADER_SETS` properties - were added, which list the header file sets associated with a target. -* New :prop_tgt:`HEADER_SET` and :prop_tgt:`HEADER_SET_<NAME>` properties were - added, which list the files in the associated header file set. -* New :prop_tgt:`HEADER_DIRS` and :prop_tgt:`HEADER_DIRS_<NAME>` properties - were added, which specify the base directories of the associated header file - set. -* The :command:`install(TARGETS)` command gained a new ``FILE_SET`` argument, - which can be used to install header file sets associated with a target. -* The :manual:`File API <cmake-file-api(7)>` ``codemodel-v2`` minor version has - been bumped to ``4``. -* The :manual:`File API <cmake-file-api(7)>` ``codemodel-v2`` ``directory`` - object gained a new installer type of ``fileSet``. diff --git a/Help/release/dev/timestamp-microseconds.rst b/Help/release/dev/timestamp-microseconds.rst deleted file mode 100644 index 0c95eb4..0000000 --- a/Help/release/dev/timestamp-microseconds.rst +++ /dev/null @@ -1,5 +0,0 @@ -timestamp-microseconds ----------------------- - -* The :command:`string(TIMESTAMP)` and :command:`file(TIMESTAMP)` commands now - support the ``%f`` specifier for microseconds. diff --git a/Help/release/dev/vs-csharp-dotnet-sdk.rst b/Help/release/dev/vs-csharp-dotnet-sdk.rst deleted file mode 100644 index cc0ebe4..0000000 --- a/Help/release/dev/vs-csharp-dotnet-sdk.rst +++ /dev/null @@ -1,9 +0,0 @@ -vs-csharp-dotnet-sdk --------------------- - -* The :ref:`Visual Studio Generators` for VS 2019 and above learned to - support .NET SDK-style project files (``.csproj``) for C# projects. - See the :prop_tgt:`DOTNET_SDK` target property and corresponding - :variable:`CMAKE_DOTNET_SDK` variable. - However, this version of CMake does not yet support using - :command:`add_custom_command` in .NET SDK-style projects. diff --git a/Help/release/dev/vs-instance.rst b/Help/release/dev/vs-instance.rst deleted file mode 100644 index 0b9ff4b..0000000 --- a/Help/release/dev/vs-instance.rst +++ /dev/null @@ -1,6 +0,0 @@ -vs-instance ------------ - -* The :ref:`Visual Studio Generators` for VS 2017 and above learned to - use portable instances of Visual Studio not known to the VS installer. - See the :variable:`CMAKE_GENERATOR_INSTANCE` variable. diff --git a/Help/release/dev/vs-package-restore.rst b/Help/release/dev/vs-package-restore.rst deleted file mode 100644 index e8b5f0c..0000000 --- a/Help/release/dev/vs-package-restore.rst +++ /dev/null @@ -1,13 +0,0 @@ -vs-package-restore ------------------- - -* Targets with :prop_tgt:`VS_PACKAGE_REFERENCES` will now automatically attempt - to restore the package references from NuGet. The cache variable - :variable:`CMAKE_VS_NUGET_PACKAGE_RESTORE` was added to toggle automatic - package restore off. - -* :manual:`cmake(1)` gained the ``--resolve-package-references=<on|off|only>`` - command-line option to control automatic package restoration. - -* :manual:`cmake-presets(7)` gained support for specifying the - ``resolvePackageReferences`` command line option in a build preset. diff --git a/Help/release/dev/xcode-embed-plugins.rst b/Help/release/dev/xcode-embed-plugins.rst deleted file mode 100644 index 10f91f6..0000000 --- a/Help/release/dev/xcode-embed-plugins.rst +++ /dev/null @@ -1,6 +0,0 @@ -xcode-embed-plugins -------------------- - -* The :prop_tgt:`XCODE_EMBED_PLUGINS <XCODE_EMBED_<type>>` target property - was added to tell the :generator:`Xcode` generator what targets to put in - the ``Embed PlugIns`` build phase. diff --git a/Help/release/dev/xcode-scheme-enable-gpu-frame-capture-mode.rst b/Help/release/dev/xcode-scheme-enable-gpu-frame-capture-mode.rst deleted file mode 100644 index a93e4e9..0000000 --- a/Help/release/dev/xcode-scheme-enable-gpu-frame-capture-mode.rst +++ /dev/null @@ -1,4 +0,0 @@ -xcode-scheme-enable-gpu-frame-capture-mode ------------------------------------------- - -* The Xcode project generation learned the variable `XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE` to enable specifying the Xcode scheme option property `GPU Frame Capture`. diff --git a/Help/release/index.rst b/Help/release/index.rst index 131595a..ee677a3 100644 --- a/Help/release/index.rst +++ b/Help/release/index.rst @@ -7,14 +7,13 @@ CMake Release Notes This file should include the adjacent "dev.txt" file in development versions but not in release versions. -.. include:: dev.txt - Releases ======== .. toctree:: :maxdepth: 1 + 3.23 <3.23> 3.22 <3.22> 3.21 <3.21> 3.20 <3.20> diff --git a/Help/variable/CMAKE_IGNORE_PREFIX_PATH.rst b/Help/variable/CMAKE_IGNORE_PREFIX_PATH.rst new file mode 100644 index 0000000..317c771 --- /dev/null +++ b/Help/variable/CMAKE_IGNORE_PREFIX_PATH.rst @@ -0,0 +1,19 @@ +CMAKE_IGNORE_PREFIX_PATH +------------------------ + +.. versionadded:: 3.23 + +:ref:`Semicolon-separated list <CMake Language Lists>` of prefixes to be +*ignored* by the :command:`find_program`, :command:`find_library`, +:command:`find_file`, :command:`find_path`, and :command:`find_package` +commands. This is useful in cross-compiling environments where some +system directories contain incompatible but possibly linkable libraries. +For example, on cross-compiled cluster environments, this allows a user +to ignore directories containing libraries meant for the front-end machine. + +By default this is empty; it is intended to be set by the project and/or +the end user. Note that ``CMAKE_IGNORE_PREFIX_PATH`` takes a list of +prefixes, *not* a list of directory names. + +See also the :variable:`CMAKE_PREFIX_PATH`, :variable:`CMAKE_LIBRARY_PATH`, +:variable:`CMAKE_INCLUDE_PATH`, and :variable:`CMAKE_PROGRAM_PATH` variables. diff --git a/Help/variable/CMAKE_SYSTEM_IGNORE_PREFIX_PATH.rst b/Help/variable/CMAKE_SYSTEM_IGNORE_PREFIX_PATH.rst new file mode 100644 index 0000000..ce52f5a --- /dev/null +++ b/Help/variable/CMAKE_SYSTEM_IGNORE_PREFIX_PATH.rst @@ -0,0 +1,20 @@ +CMAKE_SYSTEM_IGNORE_PREFIX_PATH +------------------------------- + +.. versionadded:: 3.23 + +:ref:`Semicolon-separated list <CMake Language Lists>` of prefixes to be +*ignored* by the :command:`find_program`, :command:`find_library`, +:command:`find_file`, :command:`find_path`, and :command:`find_package` +commands. This is useful in cross-compiling environments where some +system directories contain incompatible but possibly linkable libraries. +For example, on cross-compiled cluster environments, this allows a user +to ignore directories containing libraries meant for the front-end machine. + +By default this contains a list of directories containing incompatible +binaries for the host system. See the :variable:`CMAKE_IGNORE_PREFIX_PATH` +variable that is intended to be set by the project and/or the end user. + +See also the :variable:`CMAKE_SYSTEM_PREFIX_PATH`, +:variable:`CMAKE_SYSTEM_LIBRARY_PATH`, :variable:`CMAKE_SYSTEM_INCLUDE_PATH`, +and :variable:`CMAKE_SYSTEM_PROGRAM_PATH` variables. diff --git a/Help/variable/CTEST_SUBMIT_INACTIVITY_TIMEOUT.rst b/Help/variable/CTEST_SUBMIT_INACTIVITY_TIMEOUT.rst index 65976fa..175885a 100644 --- a/Help/variable/CTEST_SUBMIT_INACTIVITY_TIMEOUT.rst +++ b/Help/variable/CTEST_SUBMIT_INACTIVITY_TIMEOUT.rst @@ -1,5 +1,7 @@ CTEST_SUBMIT_INACTIVITY_TIMEOUT ------------------------------- +.. versionadded:: 3.23 + Specify the CTest ``SubmitInactivityTimeout`` setting in a :manual:`ctest(1)` dashboard client script. diff --git a/Modules/CheckPIESupported.cmake b/Modules/CheckPIESupported.cmake index 5919d4b..6424472 100644 --- a/Modules/CheckPIESupported.cmake +++ b/Modules/CheckPIESupported.cmake @@ -23,10 +23,15 @@ property for executables will be honored at link time. ``OUTPUT_VARIABLE <output>`` Set ``<output>`` variable with details about any error. + ``LANGUAGES <lang>...`` Check the linkers used for each of the specified languages. - Supported languages are ``C``, ``CXX``, ``OBJC``, ``OBJCXX``, ``Fortran``, - ``CUDA``, and ``HIP``. + + ``C``, ``CXX``, ``Fortran`` are supported. + + .. versionadded:: 3.23 + + ``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` diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index a661c20..c599863 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,8 +1,8 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) -set(CMake_VERSION_MINOR 22) -set(CMake_VERSION_PATCH 20220202) -#set(CMake_VERSION_RC 0) +set(CMake_VERSION_MINOR 23) +set(CMake_VERSION_PATCH 0) +set(CMake_VERSION_RC 0) set(CMake_VERSION_IS_DIRTY 0) # Start with the full version number used in tags. It has no dev info. diff --git a/Source/cmCMakePresetsGraph.cxx b/Source/cmCMakePresetsGraph.cxx index 79e8191..705e2b0 100644 --- a/Source/cmCMakePresetsGraph.cxx +++ b/Source/cmCMakePresetsGraph.cxx @@ -108,7 +108,7 @@ ReadFileResult VisitPreset( auto& parentPreset = parent->second.Unexpanded; if (!preset.OriginFile->ReachableFiles.count(parentPreset.OriginFile)) { - return ReadFileResult::PRESET_UNREACHABLE_FROM_FILE; + return ReadFileResult::INHERITED_PRESET_UNREACHABLE_FROM_FILE; } auto result = VisitPreset(parentPreset, presets, cycleStatus, graph); @@ -925,6 +925,10 @@ cmCMakePresetsGraph::ReadProjectPresetsInternal(bool allowNoFiles) if (configurePreset == this->ConfigurePresets.end()) { return ReadFileResult::INVALID_CONFIGURE_PRESET; } + if (!it.second.Unexpanded.OriginFile->ReachableFiles.count( + configurePreset->second.Unexpanded.OriginFile)) { + return ReadFileResult::CONFIGURE_PRESET_UNREACHABLE_FROM_FILE; + } if (it.second.Unexpanded.InheritConfigureEnvironment.value_or(true)) { it.second.Unexpanded.Environment.insert( @@ -945,6 +949,10 @@ cmCMakePresetsGraph::ReadProjectPresetsInternal(bool allowNoFiles) if (configurePreset == this->ConfigurePresets.end()) { return ReadFileResult::INVALID_CONFIGURE_PRESET; } + if (!it.second.Unexpanded.OriginFile->ReachableFiles.count( + configurePreset->second.Unexpanded.OriginFile)) { + return ReadFileResult::CONFIGURE_PRESET_UNREACHABLE_FROM_FILE; + } if (it.second.Unexpanded.InheritConfigureEnvironment.value_or(true)) { it.second.Unexpanded.Environment.insert( @@ -992,8 +1000,10 @@ const char* cmCMakePresetsGraph::ResultToString(ReadFileResult result) return "Duplicate presets"; case ReadFileResult::CYCLIC_PRESET_INHERITANCE: return "Cyclic preset inheritance"; - case ReadFileResult::PRESET_UNREACHABLE_FROM_FILE: + case ReadFileResult::INHERITED_PRESET_UNREACHABLE_FROM_FILE: return "Inherited preset is unreachable from preset's file"; + case ReadFileResult::CONFIGURE_PRESET_UNREACHABLE_FROM_FILE: + return "Configure preset is unreachable from preset's file"; case ReadFileResult::INVALID_MACRO_EXPANSION: return "Invalid macro expansion"; case ReadFileResult::BUILD_TEST_PRESETS_UNSUPPORTED: diff --git a/Source/cmCMakePresetsGraph.h b/Source/cmCMakePresetsGraph.h index d3a5cfc..9d6c61a 100644 --- a/Source/cmCMakePresetsGraph.h +++ b/Source/cmCMakePresetsGraph.h @@ -35,7 +35,8 @@ public: INVALID_VARIABLE, DUPLICATE_PRESETS, CYCLIC_PRESET_INHERITANCE, - PRESET_UNREACHABLE_FROM_FILE, + INHERITED_PRESET_UNREACHABLE_FROM_FILE, + CONFIGURE_PRESET_UNREACHABLE_FROM_FILE, INVALID_MACRO_EXPANSION, BUILD_TEST_PRESETS_UNSUPPORTED, INCLUDE_UNSUPPORTED, diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx index 412d104..2d80f0e 100644 --- a/Source/cmExportFileGenerator.cxx +++ b/Source/cmExportFileGenerator.cxx @@ -1272,8 +1272,7 @@ void cmExportFileGenerator::GenerateTargetFileSets(cmGeneratorTarget* gte, auto interfaceFileSets = gte->Target->GetAllInterfaceFileSets(); if (!interfaceFileSets.empty()) { std::string targetName = cmStrCat(this->Namespace, gte->GetExportName()); - os << "if(NOT CMAKE_VERSION VERSION_LESS \"" << DEVEL_CMAKE_VERSION(3, 23) - << "\")\n" + os << "if(NOT CMAKE_VERSION VERSION_LESS \"3.23.0\")\n" " target_sources(" << targetName << "\n"; diff --git a/Source/cmFindCommon.cxx b/Source/cmFindCommon.cxx index c58db1e..1bb98ea 100644 --- a/Source/cmFindCommon.cxx +++ b/Source/cmFindCommon.cxx @@ -262,11 +262,13 @@ void cmFindCommon::RerootPaths(std::vector<std::string>& paths) (stagePrefix && isSameDirectoryOrSubDirectory(up, *stagePrefix))) { rootedDir = up; } else if (!up.empty() && up[0] != '~') { - // Start with the new root. - rootedDir = cmStrCat(r, '/'); - - // Append the original path with its old root removed. - rootedDir += cmSystemTools::SplitPathRootComponent(up); + auto const* split = cmSystemTools::SplitPathRootComponent(up); + if (split && *split) { + // Start with the new root. + rootedDir = cmStrCat(r, '/', split); + } else { + rootedDir = r; + } } // Store the new path. @@ -306,6 +308,31 @@ void cmFindCommon::GetIgnoredPaths(std::set<std::string>& ignore) ignore.insert(ignoreVec.begin(), ignoreVec.end()); } +void cmFindCommon::GetIgnoredPrefixPaths(std::vector<std::string>& ignore) +{ + static constexpr const char* paths[] = { + "CMAKE_SYSTEM_IGNORE_PREFIX_PATH", + "CMAKE_IGNORE_PREFIX_PATH", + }; + + // Construct the list of path roots with no trailing slashes. + for (const char* pathName : paths) { + // Get the list of paths to ignore from the variable. + this->Makefile->GetDefExpandList(pathName, ignore); + } + + for (std::string& i : ignore) { + cmSystemTools::ConvertToUnixSlashes(i); + } +} + +void cmFindCommon::GetIgnoredPrefixPaths(std::set<std::string>& ignore) +{ + std::vector<std::string> ignoreVec; + this->GetIgnoredPrefixPaths(ignoreVec); + ignore.insert(ignoreVec.begin(), ignoreVec.end()); +} + bool cmFindCommon::CheckCommonArgument(std::string const& arg) { if (arg == "NO_DEFAULT_PATH") { @@ -369,16 +396,19 @@ static void AddTrailingSlash(std::string& s) void cmFindCommon::ComputeFinalPaths(IgnorePaths ignorePaths) { // Filter out ignored paths from the prefix list - std::set<std::string> ignored; + std::set<std::string> ignoredPaths; + std::set<std::string> ignoredPrefixes; if (ignorePaths == IgnorePaths::Yes) { - this->GetIgnoredPaths(ignored); + this->GetIgnoredPaths(ignoredPaths); + this->GetIgnoredPrefixPaths(ignoredPrefixes); } // Combine the separate path types, filtering out ignores this->SearchPaths.clear(); std::vector<PathLabel>& allLabels = this->PathGroupLabelMap[PathGroup::All]; for (PathLabel const& l : allLabels) { - this->LabeledPaths[l].ExtractWithout(ignored, this->SearchPaths); + this->LabeledPaths[l].ExtractWithout(ignoredPaths, ignoredPrefixes, + this->SearchPaths); } // Expand list of paths inside all search roots. diff --git a/Source/cmFindCommon.h b/Source/cmFindCommon.h index 49d64e4..5d9b3e1 100644 --- a/Source/cmFindCommon.h +++ b/Source/cmFindCommon.h @@ -86,6 +86,10 @@ protected: void GetIgnoredPaths(std::vector<std::string>& ignore); void GetIgnoredPaths(std::set<std::string>& ignore); + /** Get ignored paths from CMAKE_[SYSTEM_]IGNORE_PREFIX_PATH variables. */ + void GetIgnoredPrefixPaths(std::vector<std::string>& ignore); + void GetIgnoredPrefixPaths(std::set<std::string>& ignore); + /** Compute final search path list (reroot + trailing slash). */ enum class IgnorePaths { @@ -135,7 +139,7 @@ protected: std::map<PathLabel, cmSearchPath> LabeledPaths; std::vector<std::string> SearchPaths; - std::set<std::string> SearchPathsEmitted; + std::set<cmSearchPath::PathWithPrefix> SearchPathsEmitted; bool SearchFrameworkFirst; bool SearchFrameworkOnly; diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index c468a3c..fac0e08 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -665,6 +665,16 @@ bool cmFindPackageCommand::FindPackageUsingConfigMode() this->IgnoredPaths.clear(); this->IgnoredPaths.insert(ignored.begin(), ignored.end()); + // get igonored prefix paths from vars and reroot them. + std::vector<std::string> ignoredPrefixes; + this->GetIgnoredPrefixPaths(ignoredPrefixes); + this->RerootPaths(ignoredPrefixes); + + // Construct a set of ignored prefix paths + this->IgnoredPrefixPaths.clear(); + this->IgnoredPrefixPaths.insert(ignoredPrefixes.begin(), + ignoredPrefixes.end()); + // Find and load the package. return this->HandlePackageMode(HandlePackageModeType::Config); } @@ -1309,7 +1319,7 @@ inline std::size_t collectPathsForDebug(std::string& buffer, return 0; } for (std::size_t i = startIndex; i < paths.size(); i++) { - buffer += " " + paths[i] + "\n"; + buffer += " " + paths[i].Path + "\n"; } return paths.size(); } @@ -2291,7 +2301,8 @@ bool cmFindPackageCommand::SearchPrefix(std::string const& prefix_in) if (prefixWithoutSlash != "/" && prefixWithoutSlash.back() == '/') { prefixWithoutSlash.erase(prefixWithoutSlash.length() - 1); } - if (this->IgnoredPaths.count(prefixWithoutSlash)) { + if (this->IgnoredPaths.count(prefixWithoutSlash) || + this->IgnoredPrefixPaths.count(prefixWithoutSlash)) { return false; } diff --git a/Source/cmFindPackageCommand.h b/Source/cmFindPackageCommand.h index 9d6eddf..439d934 100644 --- a/Source/cmFindPackageCommand.h +++ b/Source/cmFindPackageCommand.h @@ -205,6 +205,7 @@ private: std::vector<std::string> Names; std::vector<std::string> Configs; std::set<std::string> IgnoredPaths; + std::set<std::string> IgnoredPrefixPaths; std::string DebugBuffer; /*! the selected sortOrder (None by default)*/ diff --git a/Source/cmSearchPath.cxx b/Source/cmSearchPath.cxx index 1bb459c..bfee64c 100644 --- a/Source/cmSearchPath.cxx +++ b/Source/cmSearchPath.cxx @@ -19,23 +19,25 @@ cmSearchPath::cmSearchPath(cmFindCommon* findCmd) cmSearchPath::~cmSearchPath() = default; -void cmSearchPath::ExtractWithout(const std::set<std::string>& ignore, +void cmSearchPath::ExtractWithout(const std::set<std::string>& ignorePaths, + const std::set<std::string>& ignorePrefixes, std::vector<std::string>& outPaths, bool clear) const { if (clear) { outPaths.clear(); } - for (std::string const& path : this->Paths) { - if (ignore.count(path) == 0) { - outPaths.push_back(path); + for (auto const& path : this->Paths) { + if (ignorePaths.count(path.Path) == 0 && + ignorePrefixes.count(path.Prefix) == 0) { + outPaths.push_back(path.Path); } } } void cmSearchPath::AddPath(const std::string& path) { - this->AddPathInternal(path); + this->AddPathInternal(path, ""); } void cmSearchPath::AddUserPath(const std::string& path) @@ -69,7 +71,7 @@ void cmSearchPath::AddUserPath(const std::string& path) // Process them all from the current directory for (std::string const& p : outPaths) { this->AddPathInternal( - p, this->FC->Makefile->GetCurrentSourceDirectory().c_str()); + p, "", this->FC->Makefile->GetCurrentSourceDirectory().c_str()); } } @@ -83,7 +85,7 @@ void cmSearchPath::AddCMakePath(const std::string& variable) for (std::string const& p : expanded) { this->AddPathInternal( - p, this->FC->Makefile->GetCurrentSourceDirectory().c_str()); + p, "", this->FC->Makefile->GetCurrentSourceDirectory().c_str()); } } } @@ -93,7 +95,7 @@ void cmSearchPath::AddEnvPath(const std::string& variable) std::vector<std::string> expanded; cmSystemTools::GetPath(expanded, variable.c_str()); for (std::string const& p : expanded) { - this->AddPathInternal(p); + this->AddPathInternal(p, ""); } } @@ -132,24 +134,25 @@ void cmSearchPath::AddEnvPrefixPath(const std::string& variable, bool stripBin) void cmSearchPath::AddSuffixes(const std::vector<std::string>& suffixes) { - std::vector<std::string> inPaths; + std::vector<PathWithPrefix> inPaths; inPaths.swap(this->Paths); this->Paths.reserve(inPaths.size() * (suffixes.size() + 1)); - for (std::string& inPath : inPaths) { - cmSystemTools::ConvertToUnixSlashes(inPath); + for (PathWithPrefix& inPath : inPaths) { + cmSystemTools::ConvertToUnixSlashes(inPath.Path); + cmSystemTools::ConvertToUnixSlashes(inPath.Prefix); // if *i is only / then do not add a // // this will get incorrectly considered a network // path on windows and cause huge delays. - std::string p = inPath; + std::string p = inPath.Path; if (!p.empty() && p.back() != '/') { p += "/"; } // Combine with all the suffixes for (std::string const& suffix : suffixes) { - this->Paths.push_back(p + suffix); + this->Paths.push_back(PathWithPrefix{ p + suffix, inPath.Prefix }); } // And now the original w/o any suffix @@ -178,6 +181,10 @@ void cmSearchPath::AddPrefixPaths(const std::vector<std::string>& paths, if (!subdir.empty() && !dir.empty() && dir.back() != '/') { dir += "/"; } + std::string prefix = dir; + if (!prefix.empty() && prefix != "/") { + prefix.erase(prefix.size() - 1); + } if (subdir == "include" || subdir == "lib") { cmValue arch = this->FC->Makefile->GetDefinition("CMAKE_LIBRARY_ARCHITECTURE"); @@ -185,37 +192,47 @@ void cmSearchPath::AddPrefixPaths(const std::vector<std::string>& paths, if (this->FC->Makefile->IsDefinitionSet("CMAKE_SYSROOT") && this->FC->Makefile->IsDefinitionSet( "CMAKE_PREFIX_LIBRARY_ARCHITECTURE")) { - this->AddPathInternal(cmStrCat('/', *arch, dir, subdir), base); + this->AddPathInternal(cmStrCat('/', *arch, dir, subdir), + cmStrCat('/', *arch, prefix), base); } else { - this->AddPathInternal(cmStrCat(dir, subdir, '/', *arch), base); + this->AddPathInternal(cmStrCat(dir, subdir, '/', *arch), prefix, + base); } } } std::string add = dir + subdir; if (add != "/") { - this->AddPathInternal(add, base); + this->AddPathInternal(add, prefix, base); } if (subdir == "bin") { - this->AddPathInternal(dir + "sbin", base); + this->AddPathInternal(dir + "sbin", prefix, base); } if (!subdir.empty() && path != "/") { - this->AddPathInternal(path, base); + this->AddPathInternal(path, prefix, base); } } } -void cmSearchPath::AddPathInternal(const std::string& path, const char* base) +void cmSearchPath::AddPathInternal(const std::string& path, + const std::string& prefix, const char* base) { assert(this->FC != nullptr); - std::string collapsed = cmSystemTools::CollapseFullPath(path, base); + std::string collapsedPath = cmSystemTools::CollapseFullPath(path, base); - if (collapsed.empty()) { + if (collapsedPath.empty()) { return; } + std::string collapsedPrefix; + if (!prefix.empty()) { + collapsedPrefix = cmSystemTools::CollapseFullPath(prefix, base); + } + // Insert the path if has not already been emitted. - if (this->FC->SearchPathsEmitted.insert(collapsed).second) { - this->Paths.push_back(std::move(collapsed)); + PathWithPrefix pathWithPrefix{ std::move(collapsedPath), + std::move(collapsedPrefix) }; + if (this->FC->SearchPathsEmitted.insert(pathWithPrefix).second) { + this->Paths.emplace_back(std::move(pathWithPrefix)); } } diff --git a/Source/cmSearchPath.h b/Source/cmSearchPath.h index 09f9722..4c0cabb 100644 --- a/Source/cmSearchPath.h +++ b/Source/cmSearchPath.h @@ -29,10 +29,22 @@ public: cmSearchPath(const cmSearchPath&) = default; cmSearchPath& operator=(const cmSearchPath&) = default; - const std::vector<std::string>& GetPaths() const { return this->Paths; } + struct PathWithPrefix + { + std::string Path; + std::string Prefix; + + bool operator<(const PathWithPrefix& other) const + { + return this->Path < other.Path || + (this->Path == other.Path && this->Prefix < other.Prefix); + } + }; + const std::vector<PathWithPrefix>& GetPaths() const { return this->Paths; } std::size_t size() const { return this->Paths.size(); } - void ExtractWithout(const std::set<std::string>& ignore, + void ExtractWithout(const std::set<std::string>& ignorePaths, + const std::set<std::string>& ignorePrefixes, std::vector<std::string>& outPaths, bool clear = false) const; @@ -47,8 +59,9 @@ public: const char* base = nullptr); protected: - void AddPathInternal(const std::string& path, const char* base = nullptr); + void AddPathInternal(const std::string& path, const std::string& prefix, + const char* base = nullptr); cmFindCommon* FC; - std::vector<std::string> Paths; + std::vector<PathWithPrefix> Paths; }; diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index e12ffba..1d7e632 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -913,6 +913,7 @@ endif() add_RunCMake_test("CTestCommandExpandLists") add_RunCMake_test(PrecompileHeaders -DCMAKE_C_COMPILER_ID=${CMAKE_C_COMPILER_ID} + -DCMAKE_C_SIMULATE_ID=${CMAKE_C_SIMULATE_ID} -DCMAKE_C_COMPILER_VERSION=${CMAKE_C_COMPILER_VERSION}) add_RunCMake_test("UnityBuild") diff --git a/Tests/RunCMake/CMakePresetsBuild/ConfigurePresetUnreachable-build-x-result.txt b/Tests/RunCMake/CMakePresetsBuild/ConfigurePresetUnreachable-build-x-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresetsBuild/ConfigurePresetUnreachable-build-x-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresetsBuild/ConfigurePresetUnreachable-build-x-stderr.txt b/Tests/RunCMake/CMakePresetsBuild/ConfigurePresetUnreachable-build-x-stderr.txt new file mode 100644 index 0000000..05695d9 --- /dev/null +++ b/Tests/RunCMake/CMakePresetsBuild/ConfigurePresetUnreachable-build-x-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: Could not read presets from [^ +]*/Tests/RunCMake/CMakePresetsBuild/ConfigurePresetUnreachable: Configure preset is unreachable from preset's file$ diff --git a/Tests/RunCMake/CMakePresetsBuild/ConfigurePresetUnreachable.json.in b/Tests/RunCMake/CMakePresetsBuild/ConfigurePresetUnreachable.json.in new file mode 100644 index 0000000..f1db4fb --- /dev/null +++ b/Tests/RunCMake/CMakePresetsBuild/ConfigurePresetUnreachable.json.in @@ -0,0 +1,9 @@ +{ + "version": 4, + "buildPresets": [ + { + "name": "x", + "configurePreset": "x" + } + ] +} diff --git a/Tests/RunCMake/CMakePresetsBuild/ConfigurePresetUnreachableUser.json.in b/Tests/RunCMake/CMakePresetsBuild/ConfigurePresetUnreachableUser.json.in new file mode 100644 index 0000000..5319af0 --- /dev/null +++ b/Tests/RunCMake/CMakePresetsBuild/ConfigurePresetUnreachableUser.json.in @@ -0,0 +1,8 @@ +{ + "version": 4, + "configurePresets": [ + { + "name": "x" + } + ] +} diff --git a/Tests/RunCMake/CMakePresetsBuild/RunCMakeTest.cmake b/Tests/RunCMake/CMakePresetsBuild/RunCMakeTest.cmake index 2fe0407..1ededc1 100644 --- a/Tests/RunCMake/CMakePresetsBuild/RunCMakeTest.cmake +++ b/Tests/RunCMake/CMakePresetsBuild/RunCMakeTest.cmake @@ -83,4 +83,6 @@ set(CMakePresets_SCHEMA_EXPECTED_RESULT 1) run_cmake_build_presets(PresetsUnsupported "x" "x") run_cmake_build_presets(ConditionFuture "x" "conditionFuture") set(CMakePresets_SCHEMA_EXPECTED_RESULT 0) + +run_cmake_build_presets(ConfigurePresetUnreachable "x" "x") set(CMakePresetsBuild_BUILD_ONLY 0) diff --git a/Tests/RunCMake/CMakePresetsTest/ConfigurePresetUnreachable-test-x-result.txt b/Tests/RunCMake/CMakePresetsTest/ConfigurePresetUnreachable-test-x-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresetsTest/ConfigurePresetUnreachable-test-x-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresetsTest/ConfigurePresetUnreachable-test-x-stderr.txt b/Tests/RunCMake/CMakePresetsTest/ConfigurePresetUnreachable-test-x-stderr.txt new file mode 100644 index 0000000..d49148d --- /dev/null +++ b/Tests/RunCMake/CMakePresetsTest/ConfigurePresetUnreachable-test-x-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: Could not read presets from [^ +]*/Tests/RunCMake/CMakePresetsTest/ConfigurePresetUnreachable: Configure preset is unreachable from preset's file$ diff --git a/Tests/RunCMake/CMakePresetsTest/ConfigurePresetUnreachable.json.in b/Tests/RunCMake/CMakePresetsTest/ConfigurePresetUnreachable.json.in new file mode 100644 index 0000000..cc2f149 --- /dev/null +++ b/Tests/RunCMake/CMakePresetsTest/ConfigurePresetUnreachable.json.in @@ -0,0 +1,9 @@ +{ + "version": 4, + "testPresets": [ + { + "name": "x", + "configurePreset": "x" + } + ] +} diff --git a/Tests/RunCMake/CMakePresetsTest/ConfigurePresetUnreachableUser.json.in b/Tests/RunCMake/CMakePresetsTest/ConfigurePresetUnreachableUser.json.in new file mode 100644 index 0000000..5319af0 --- /dev/null +++ b/Tests/RunCMake/CMakePresetsTest/ConfigurePresetUnreachableUser.json.in @@ -0,0 +1,8 @@ +{ + "version": 4, + "configurePresets": [ + { + "name": "x" + } + ] +} diff --git a/Tests/RunCMake/CMakePresetsTest/RunCMakeTest.cmake b/Tests/RunCMake/CMakePresetsTest/RunCMakeTest.cmake index 70d25d4..bec0dd94 100644 --- a/Tests/RunCMake/CMakePresetsTest/RunCMakeTest.cmake +++ b/Tests/RunCMake/CMakePresetsTest/RunCMakeTest.cmake @@ -106,6 +106,7 @@ set(CMakePresets_SCHEMA_EXPECTED_RESULT 1) run_cmake_test_presets(PresetsUnsupported "" "" "x") run_cmake_test_presets(ConditionFuture "" "" "x") set(CMakePresets_SCHEMA_EXPECTED_RESULT 0) +run_cmake_test_presets(ConfigurePresetUnreachable "" "" "x") set(CMakePresetsTest_NO_CONFIGURE 0) set(CMakePresetsTest_NO_BUILD 0) diff --git a/Tests/RunCMake/PrecompileHeaders/RunCMakeTest.cmake b/Tests/RunCMake/PrecompileHeaders/RunCMakeTest.cmake index ca5b52e..a7b3126 100644 --- a/Tests/RunCMake/PrecompileHeaders/RunCMakeTest.cmake +++ b/Tests/RunCMake/PrecompileHeaders/RunCMakeTest.cmake @@ -23,7 +23,8 @@ if(RunCMake_GENERATOR MATCHES "Make|Ninja") run_cmake(PchWarnInvalid) if(CMAKE_C_COMPILER_ID STREQUAL "Clang" AND - CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 11.0.0) + CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 11.0.0 AND + NOT CMAKE_C_SIMULATE_ID STREQUAL "MSVC") run_cmake(PchInstantiateTemplates) endif() endif() diff --git a/Tests/RunCMake/find_package/IgnorePrefixPath.cmake b/Tests/RunCMake/find_package/IgnorePrefixPath.cmake new file mode 100644 index 0000000..65709a2 --- /dev/null +++ b/Tests/RunCMake/find_package/IgnorePrefixPath.cmake @@ -0,0 +1,26 @@ +set(CMAKE_PREFIX_PATH + ${CMAKE_SOURCE_DIR}/PackageRoot/foo/cmake_root + ${CMAKE_SOURCE_DIR}/PackageRoot/foo/env_root + ) +set(CMAKE_IGNORE_PREFIX_PATH + ${CMAKE_SOURCE_DIR}/PackageRoot//foo/cmake_root// # Test double slashes + ) +set(CMAKE_SYSTEM_IGNORE_PREFIX_PATH + ${CMAKE_SOURCE_DIR}/PackageRoot/foo/env_root + ) +find_package(Bar QUIET CONFIG) +if(Bar_FOUND) + message(SEND_ERROR "Bar should not be found, was found in ${Bar_DIR}") +endif() + +set(CMAKE_PREFIX_PATH) +set(CMAKE_FIND_ROOT_PATH + ${CMAKE_SOURCE_DIR}/PackageRoot/foo/cmake_root + ${CMAKE_SOURCE_DIR}/PackageRoot/foo/env_root + ) +set(CMAKE_IGNORE_PREFIX_PATH /) +set(CMAKE_SYSTEM_IGNORE_PREFIX_PATH) +find_package(Bar2 NAMES Bar QUIET CONFIG) +if(Bar2_FOUND) + message(SEND_ERROR "Bar2 should not be found, was found in ${Bar2_DIR}") +endif() diff --git a/Tests/RunCMake/find_package/RunCMakeTest.cmake b/Tests/RunCMake/find_package/RunCMakeTest.cmake index 12701dc..037502f 100644 --- a/Tests/RunCMake/find_package/RunCMakeTest.cmake +++ b/Tests/RunCMake/find_package/RunCMakeTest.cmake @@ -45,6 +45,7 @@ run_cmake(VersionRangeConfig02) run_cmake(VersionRangeConfigStd) run_cmake(VersionRangeConfigStd2) run_cmake(IgnorePath) +run_cmake(IgnorePrefixPath) if(UNIX AND NOT MSYS # FIXME: This works on CYGWIN but not on MSYS ) diff --git a/Tests/RunCMake/find_program/IgnorePrefixPath.cmake b/Tests/RunCMake/find_program/IgnorePrefixPath.cmake new file mode 100644 index 0000000..5f0dba9 --- /dev/null +++ b/Tests/RunCMake/find_program/IgnorePrefixPath.cmake @@ -0,0 +1,30 @@ +function(assert_eq var value) + if(NOT "${${var}}" STREQUAL "${value}") + message(SEND_ERROR "Expected value of ${var}:\n ${value}\nActual value:\n ${${var}}") + endif() +endfunction() + +set(CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH FALSE) + +set(CMAKE_PREFIX_PATH ${CMAKE_SOURCE_DIR}/Prefix) +set(_old_CMAKE_SYSTEM_PREFIX_PATH ${CMAKE_SYSTEM_PREFIX_PATH}) +set(CMAKE_SYSTEM_PREFIX_PATH ${CMAKE_SOURCE_DIR}/SystemPrefix) +set(prog_ROOT + ${CMAKE_SOURCE_DIR}/Prefix + ${CMAKE_SOURCE_DIR}/SystemPrefix + ) + +set(CMAKE_IGNORE_PREFIX_PATH ${CMAKE_SOURCE_DIR}/Prefix) +set(CMAKE_SYSTEM_IGNORE_PREFIX_PATH ${CMAKE_SOURCE_DIR}/SystemPrefix) +find_program(prog prog) +assert_eq(prog "prog-NOTFOUND") + +set(CMAKE_PREFIX_PATH) +set(CMAKE_SYSTEM_PREFIX_PATH ${_old_CMAKE_SYSTEM_PREFIX_PATH}) +set(CMAKE_IGNORE_PREFIX_PATH /) +set(CMAKE_FIND_ROOT_PATH + ${CMAKE_SOURCE_DIR}/Prefix + ${CMAKE_SOURCE_DIR}/SystemPrefix + ) +find_program(prog2 prog) +assert_eq(prog2 "prog2-NOTFOUND") diff --git a/Tests/RunCMake/find_program/Prefix/bin/prog b/Tests/RunCMake/find_program/Prefix/bin/prog new file mode 100755 index 0000000..1a24852 --- /dev/null +++ b/Tests/RunCMake/find_program/Prefix/bin/prog @@ -0,0 +1 @@ +#!/bin/sh diff --git a/Tests/RunCMake/find_program/RunCMakeTest.cmake b/Tests/RunCMake/find_program/RunCMakeTest.cmake index 2a1dae4..c2c07af 100644 --- a/Tests/RunCMake/find_program/RunCMakeTest.cmake +++ b/Tests/RunCMake/find_program/RunCMakeTest.cmake @@ -6,6 +6,7 @@ run_cmake(NamesPerDir) run_cmake(RelAndAbsPath) run_cmake(Required) run_cmake(NO_CACHE) +run_cmake(IgnorePrefixPath) if(CMAKE_SYSTEM_NAME MATCHES "^(Windows|CYGWIN|MSYS)$") run_cmake(WindowsCom) diff --git a/Tests/RunCMake/find_program/SystemPrefix/bin/prog b/Tests/RunCMake/find_program/SystemPrefix/bin/prog new file mode 100755 index 0000000..1a24852 --- /dev/null +++ b/Tests/RunCMake/find_program/SystemPrefix/bin/prog @@ -0,0 +1 @@ +#!/bin/sh diff --git a/Tests/RunCMake/pseudo_llvm-rc.c b/Tests/RunCMake/pseudo_llvm-rc.c index 7acb2a3..65f0a9e 100644 --- a/Tests/RunCMake/pseudo_llvm-rc.c +++ b/Tests/RunCMake/pseudo_llvm-rc.c @@ -1,3 +1,7 @@ +#ifndef _CRT_SECURE_NO_WARNINGS +# define _CRT_SECURE_NO_WARNINGS +#endif + #include <stdio.h> #include <string.h> |