New upstream version 3.24.2

ci/unstable
Timo Röhling 2 years ago
parent 2f24c7e23c
commit 0fcbd26aaf

@ -166,7 +166,8 @@ If ``NO_DEFAULT_PATH`` is not specified, the search process is as follows:
* |SYSTEM_ENVIRONMENT_PATH_WINDOWS_XXX| * |SYSTEM_ENVIRONMENT_PATH_WINDOWS_XXX|
6. Search cmake variables defined in the Platform files 6. Search cmake variables defined in the Platform files
for the current system. The searching of ``CMAKE_INSTALL_PREFIX`` can be for the current system. The searching of ``CMAKE_INSTALL_PREFIX`` and
``CMAKE_STAGING_PREFIX`` can be
skipped if ``NO_CMAKE_INSTALL_PREFIX`` is passed or by setting the skipped if ``NO_CMAKE_INSTALL_PREFIX`` is passed or by setting the
:variable:`CMAKE_FIND_USE_INSTALL_PREFIX` to ``FALSE``. All these locations :variable:`CMAKE_FIND_USE_INSTALL_PREFIX` to ``FALSE``. All these locations
can be skipped if ``NO_CMAKE_SYSTEM_PATH`` is passed or by setting the can be skipped if ``NO_CMAKE_SYSTEM_PATH`` is passed or by setting the

@ -1,15 +1,15 @@
Specify which registry views must be queried. This option is only meaningful Specify which registry views must be queried. This option is only meaningful
on ``Windows`` platform and will be ignored on other ones. When not on ``Windows`` platforms and will be ignored on other ones. When not
specified, |FIND_XXX_REGISTRY_VIEW_DEFAULT| view is used when :policy:`CMP0134` specified, the |FIND_XXX_REGISTRY_VIEW_DEFAULT| view is used when the
policy is ``NEW``. Refer to :policy:`CMP0134` policy for default view when :policy:`CMP0134` policy is ``NEW``. Refer to :policy:`CMP0134` for the
policy is ``OLD`` or undefined. default view when the policy is ``OLD``.
``64`` ``64``
Query the 64bit registry. On ``32bit Windows``, returns always the string Query the 64-bit registry. On 32-bit Windows, it always returns the string
``/REGISTRY-NOTFOUND``. ``/REGISTRY-NOTFOUND``.
``32`` ``32``
Query the 32bit registry. Query the 32-bit registry.
``64_32`` ``64_32``
Query both views (``64`` and ``32``) and generate a path for each. Query both views (``64`` and ``32``) and generate a path for each.
@ -18,24 +18,24 @@ policy is ``OLD`` or undefined.
Query both views (``32`` and ``64``) and generate a path for each. Query both views (``32`` and ``64``) and generate a path for each.
``HOST`` ``HOST``
Query the registry matching the architecture of the host: ``64`` on ``64bit Query the registry matching the architecture of the host: ``64`` on 64-bit
Windows`` and ``32`` on ``32bit Windows``. Windows and ``32`` on 32-bit Windows.
``TARGET`` ``TARGET``
Query the registry matching the architecture specified by Query the registry matching the architecture specified by the
:variable:`CMAKE_SIZEOF_VOID_P` variable. If not defined, fall back to :variable:`CMAKE_SIZEOF_VOID_P` variable. If not defined, fall back to
``HOST`` view. ``HOST`` view.
``BOTH`` ``BOTH``
Query both views (``32`` and ``64``). The order depends of the following Query both views (``32`` and ``64``). The order depends on the following
rules: If :variable:`CMAKE_SIZEOF_VOID_P` variable is defined. Use the rules: If the :variable:`CMAKE_SIZEOF_VOID_P` variable is defined, use the
following view depending of the content of this variable: following view depending on the content of this variable:
* ``8``: ``64_32`` * ``8``: ``64_32``
* ``4``: ``32_64`` * ``4``: ``32_64``
If :variable:`CMAKE_SIZEOF_VOID_P` variable is not defined, rely on If the :variable:`CMAKE_SIZEOF_VOID_P` variable is not defined, rely on the
architecture of the host: architecture of the host:
* ``64bit``: ``64_32`` * 64-bit: ``64_32``
* ``32bit``: ``32`` * 32-bit: ``32``

@ -174,7 +174,10 @@ The options are:
See also the :variable:`CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE`, See also the :variable:`CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE`,
:variable:`CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE` and :variable:`CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE` and
:variable:`CTEST_CUSTOM_TEST_OUTPUT_TRUNCATION` variables. :variable:`CTEST_CUSTOM_TEST_OUTPUT_TRUNCATION` variables, along with their
corresponding :manual:`ctest(1)` command line options
``--test-output-size-passed``, ``--test-output-size-failed``, and
``--test-output-truncation``.
.. _`Additional Test Measurements`: .. _`Additional Test Measurements`:
@ -236,7 +239,7 @@ The following example demonstrates how to upload test images to CDash.
"/dir/to/valid_img.gif</CTestMeasurementFile>" << std::endl; "/dir/to/valid_img.gif</CTestMeasurementFile>" << std::endl;
std::cout << std::cout <<
"<CTestMeasurementFile type=\"image/png\" name=\"AlgoResult\"> << "<CTestMeasurementFile type=\"image/png\" name=\"AlgoResult\">" <<
"/dir/to/img.png</CTestMeasurementFile>" "/dir/to/img.png</CTestMeasurementFile>"
<< std::endl; << std::endl;

@ -142,9 +142,9 @@ should find all components, no components or some well-defined subset of the
available components. available components.
.. versionadded:: 3.24 .. versionadded:: 3.24
The ``REGISTRY_VIEW`` keyword enables to specify which registry views must be The ``REGISTRY_VIEW`` keyword specifies which registry views should be
queried. This keyword is only meaningful on ``Windows`` platform and will be queried. This keyword is only meaningful on ``Windows`` platforms and will
ignored on all other ones. Formally, it is up to the target package how to be ignored on all others. Formally, it is up to the target package how to
interpret the registry view information given to it. interpret the registry view information given to it.
.. versionadded:: 3.24 .. versionadded:: 3.24
@ -412,7 +412,8 @@ enabled.
package registry. package registry.
7. Search cmake variables defined in the Platform files for the 7. Search cmake variables defined in the Platform files for the
current system. The searching of :variable:`CMAKE_INSTALL_PREFIX` can be current system. The searching of :variable:`CMAKE_INSTALL_PREFIX` and
:variable:`CMAKE_STAGING_PREFIX` can be
skipped if ``NO_CMAKE_INSTALL_PREFIX`` is passed or by setting the skipped if ``NO_CMAKE_INSTALL_PREFIX`` is passed or by setting the
:variable:`CMAKE_FIND_USE_INSTALL_PREFIX` to ``FALSE``. All these locations :variable:`CMAKE_FIND_USE_INSTALL_PREFIX` to ``FALSE``. All these locations
can be skipped if ``NO_CMAKE_SYSTEM_PATH`` is passed or by setting the can be skipped if ``NO_CMAKE_SYSTEM_PATH`` is passed or by setting the

@ -18,6 +18,85 @@ See https://cmake.org/get-involved/ to get involved in development of
CMake upstream. It includes links to contribution instructions, which CMake upstream. It includes links to contribution instructions, which
in turn link to developer guides for CMake itself. in turn link to developer guides for CMake itself.
Accessing Windows Registry
==========================
CMake offers some facilities to access the registry on ``Windows`` platforms.
Query Windows Registry
----------------------
.. versionadded:: 3.24
The :command:`cmake_host_system_information` command offers the possibility to
query the registry on the local computer. See
:ref:`cmake_host_system(QUERY_WINDOWS_REGISTRY) <Query Windows registry>` for
more information.
.. _`Find Using Windows Registry`:
Find Using Windows Registry
---------------------------
.. versionchanged:: 3.24
Options ``HINTS`` and ``PATHS`` of :command:`find_file`,
:command:`find_library`, :command:`find_path`, :command:`find_program`, and
:command:`find_package` commands offer the possibility, on ``Windows``
platform, to query the registry.
The formal syntax, as specified using
`BNF <https://en.wikipedia.org/wiki/Backus%E2%80%93Naur_form>`_ notation with
the regular extensions, for registry query is the following:
.. raw:: latex
\begin{small}
.. productionlist::
registry_query: '[' `sep_definition`? `root_key`
: ((`key_separator` `sub_key`)? (`value_separator` `value_name`_)?)? ']'
sep_definition: '{' `value_separator` '}'
root_key: 'HKLM' | 'HKEY_LOCAL_MACHINE' | 'HKCU' | 'HKEY_CURRENT_USER' |
: 'HKCR' | 'HKEY_CLASSES_ROOT' | 'HKCC' | 'HKEY_CURRENT_CONFIG' |
: 'HKU' | 'HKEY_USERS'
sub_key: `element` (`key_separator` `element`)*
key_separator: '/' | '\\'
value_separator: `element` | ';'
value_name: `element` | '(default)'
element: `character`\+
character: <any character except `key_separator` and `value_separator`>
.. raw:: latex
\end{small}
The :token:`sep_definition` optional item offers the possibility to specify
the string used to separate the :token:`sub_key` from the :token:`value_name`
item. If not specified, the character ``;`` is used. Multiple
:token:`registry_query` items can be specified as part of a path.
.. code-block:: cmake
# example using default separator
find_file(... PATHS "/root/[HKLM/Stuff;InstallDir]/lib[HKLM\\\\Stuff;Architecture]")
# example using different specified separators
find_library(... HINTS "/root/[{|}HKCU/Stuff|InstallDir]/lib[{@@}HKCU\\\\Stuff@@Architecture]")
If the :token:`value_name` item is not specified or has the special name
``(default)``, the content of the default value, if any, will be returned. The
supported types for the :token:`value_name` are:
* ``REG_SZ``.
* ``REG_EXPAND_SZ``. The returned data is expanded.
* ``REG_DWORD``.
* ``REG_QWORD``.
When the registry query failed, typically because the key does not exist or
the data type is not supported, the string ``/REGISTRY-NOTFOUND`` is substituted
to the ``[]`` query expression.
.. _`Find Modules`: .. _`Find Modules`:
Find Modules Find Modules
@ -242,70 +321,6 @@ backwards compatibility for any old names that were actually in use.
Make sure you comment them as deprecated, so that no-one starts using Make sure you comment them as deprecated, so that no-one starts using
them. them.
.. _`Find Using Windows Registry`:
Find Using Windows Registry
---------------------------
.. versionchanged:: 3.24
Options ``HINTS`` and ``PATHS`` of :command:`find_file`,
:command:`find_library`, :command:`find_path`, :command:`find_program`, and
:command:`find_package` commands offer the possibility, on ``Windows``
platform, to query the registry.
The formal syntax, as specified using
`BNF <https://en.wikipedia.org/wiki/Backus%E2%80%93Naur_form>`_ notation with
the regular extensions, for registry query is the following:
.. raw:: latex
\begin{small}
.. productionlist::
registry_query: '[' `sep_definition`? `root_key`
: ((`key_separator` `sub_key`)? (`value_separator` `value_name`_)?)? ']'
sep_definition: '{' `value_separator` '}'
root_key: 'HKLM' | 'HKEY_LOCAL_MACHINE' | 'HKCU' | 'HKEY_CURRENT_USER' |
: 'HKCR' | 'HKEY_CLASSES_ROOT' | 'HKCC' | 'HKEY_CURRENT_CONFIG' |
: 'HKU' | 'HKEY_USERS'
sub_key: `element` (`key_separator` `element`)*
key_separator: '/' | '\\'
value_separator: `element` | ';'
value_name: `element` | '(default)'
element: `character`\+
character: <any character except `key_separator` and `value_separator`>
.. raw:: latex
\end{small}
The :token:`sep_definition` optional item offers the possibility to specify
the string used to separate the :token:`sub_key` from the :token:`value_name`
item. If not specified, the character ``;`` is used. Multiple
:token:`registry_query` items can be specified as part of a path.
.. code-block:: cmake
# example using default separator
find_file(... PATHS "/root/[HKLM/Stuff;InstallDir]/lib[HKLM\\\\Stuff;Architecture]")
# example using different specified separators
find_library(... HINTS "/root/[{|}HKCU/Stuff|InstallDir]/lib[{@@}HKCU\\\\Stuff@@Architecture]")
If the :token:`value_name` item is not specified or has the special name
``(default)``, the content of the default value, if any, will be returned. The
supported types for the :token:`value_name` are:
* ``REG_SZ``.
* ``REG_EXPAND_SZ``. The returned data is expanded.
* ``REG_DWORD``.
* ``REG_QWORD``.
When the registry query failed, typically because the key does not exist or
the data type is not supported, the string ``/REGISTRY-NOTFOUND`` is substituted
to the ``[]`` query expression.
A Sample Find Module A Sample Find Module
-------------------- --------------------

@ -391,8 +391,8 @@ Variable References
A *variable reference* has the form ``${<variable>}`` and is A *variable reference* has the form ``${<variable>}`` and is
evaluated inside a `Quoted Argument`_ or an `Unquoted Argument`_. evaluated inside a `Quoted Argument`_ or an `Unquoted Argument`_.
A variable reference is replaced by the value of the variable, A variable reference is replaced by the value of the specified
or by the empty string if the variable is not set. variable or cache entry, or if neither is set, by the empty string.
Variable references can nest and are evaluated from the Variable references can nest and are evaluated from the
inside out, e.g. ``${outer_${inner_variable}_variable}``. inside out, e.g. ``${outer_${inner_variable}_variable}``.
@ -408,14 +408,16 @@ and how their values are set.
An *environment variable reference* has the form ``$ENV{<variable>}``. An *environment variable reference* has the form ``$ENV{<variable>}``.
See the `Environment Variables`_ section for more information. See the `Environment Variables`_ section for more information.
A *cache variable reference* has the form ``$CACHE{<variable>}``. A *cache variable reference* has the form ``$CACHE{<variable>}``,
and is replaced by the value of the specified cache entry without
checking for a normal variable of the same name. If the cache
entry does not exist, it is replaced by the empty string.
See :variable:`CACHE` for more information. See :variable:`CACHE` for more information.
The :command:`if` command has a special condition syntax that The :command:`if` command has a special condition syntax that
allows for variable references in the short form ``<variable>`` allows for variable references in the short form ``<variable>``
instead of ``${<variable>}``. instead of ``${<variable>}``. However, environment variables
However, environment and cache variables always need to be always need to be referenced as ``$ENV{<variable>}``.
referenced as ``$ENV{<variable>}`` or ``$CACHE{<variable>}``.
Comments Comments
-------- --------

@ -63,7 +63,7 @@ Policies Introduced by CMake 3.24
CMP0137: try_compile() passes platform variables in project mode. </policy/CMP0137> CMP0137: try_compile() passes platform variables in project mode. </policy/CMP0137>
CMP0136: Watcom runtime library flags are selected by an abstraction. </policy/CMP0136> CMP0136: Watcom runtime library flags are selected by an abstraction. </policy/CMP0136>
CMP0135: ExternalProject ignores timestamps in archives by default for the URL download method. </policy/CMP0135> CMP0135: ExternalProject ignores timestamps in archives by default for the URL download method. </policy/CMP0135>
CMP0134: Fallback to \"HOST\" Windows registry view when \"TARGET\" view is not usable. </policy/CMP0134> CMP0134: Fallback to "HOST" Windows registry view when "TARGET" view is not usable. </policy/CMP0134>
CMP0133: The CPack module disables SLA by default in the CPack DragNDrop Generator. </policy/CMP0133> CMP0133: The CPack module disables SLA by default in the CPack DragNDrop Generator. </policy/CMP0133>
CMP0132: Do not set compiler environment variables on first run. </policy/CMP0132> CMP0132: Do not set compiler environment variables on first run. </policy/CMP0132>
CMP0131: LINK_LIBRARIES supports the LINK_ONLY generator expression. </policy/CMP0131> CMP0131: LINK_LIBRARIES supports the LINK_ONLY generator expression. </policy/CMP0131>

@ -31,9 +31,6 @@ The ``NEW`` behavior for this policy is to use registry views ``TARGET`` and
This policy was introduced in CMake version 3.24. Use the This policy was introduced in CMake version 3.24. Use the
:command:`cmake_policy` command to set this policy to ``OLD`` or ``NEW`` :command:`cmake_policy` command to set this policy to ``OLD`` or ``NEW``
explicitly. Unlike many policies, CMake version |release| does *not* warn explicitly. Unlike many policies, CMake version |release| does *not* warn
by default when this policy is not set and simply uses ``OLD`` behavior. when this policy is not set and simply uses ``OLD`` behavior.
See documentation of the
:variable:`CMAKE_POLICY_WARNING_CMP0133 <CMAKE_POLICY_WARNING_CMP<NNNN>>`
variable to control the warning.
.. include:: DEPRECATED.txt .. include:: DEPRECATED.txt

@ -359,9 +359,9 @@ Updates
Changes made since CMake 3.24.0 include the following. Changes made since CMake 3.24.0 include the following.
3.24.1 3.24.1, 3.24.2
------ --------------
* This version made no changes to documented features or interfaces. * These versions made no changes to documented features or interfaces.
Some implementation updates were made to support ecosystem changes Some implementation updates were made to support ecosystem changes
and/or fix regressions. and/or fix regressions.

@ -4,7 +4,8 @@ CMAKE_FIND_USE_INSTALL_PREFIX
.. versionadded:: 3.24 .. versionadded:: 3.24
Controls the default behavior of the following commands for whether or not to Controls the default behavior of the following commands for whether or not to
search the install location: search the locations in the :variable:`CMAKE_INSTALL_PREFIX` and
:variable:`CMAKE_STAGING_PREFIX` variables.
* :command:`find_program` * :command:`find_program`
* :command:`find_library` * :command:`find_library`

@ -19,13 +19,19 @@ set(WIN32 )
function(_cmake_record_install_prefix ) function(_cmake_record_install_prefix )
set(_CMAKE_SYSTEM_PREFIX_PATH_INSTALL_PREFIX_VALUE "${CMAKE_INSTALL_PREFIX}" PARENT_SCOPE) set(_CMAKE_SYSTEM_PREFIX_PATH_INSTALL_PREFIX_VALUE "${CMAKE_INSTALL_PREFIX}" PARENT_SCOPE)
set(count 0) set(_CMAKE_SYSTEM_PREFIX_PATH_STAGING_PREFIX_VALUE "${CMAKE_STAGING_PREFIX}" PARENT_SCOPE)
set(icount 0)
set(scount 0)
foreach(value IN LISTS CMAKE_SYSTEM_PREFIX_PATH) foreach(value IN LISTS CMAKE_SYSTEM_PREFIX_PATH)
if(value STREQUAL CMAKE_INSTALL_PREFIX) if(value STREQUAL CMAKE_INSTALL_PREFIX)
math(EXPR count "${count}+1") math(EXPR icount "${icount}+1")
endif()
if(value STREQUAL CMAKE_STAGING_PREFIX)
math(EXPR scount "${scount}+1")
endif() endif()
endforeach() endforeach()
set(_CMAKE_SYSTEM_PREFIX_PATH_INSTALL_PREFIX_COUNT "${count}" PARENT_SCOPE) set(_CMAKE_SYSTEM_PREFIX_PATH_INSTALL_PREFIX_COUNT "${icount}" PARENT_SCOPE)
set(_CMAKE_SYSTEM_PREFIX_PATH_STAGING_PREFIX_COUNT "${scount}" PARENT_SCOPE)
endfunction() endfunction()
# include Generic system information # include Generic system information

@ -301,6 +301,9 @@ External Project Definition
If ``GIT_SHALLOW`` is enabled then ``GIT_TAG`` works only with If ``GIT_SHALLOW`` is enabled then ``GIT_TAG`` works only with
branch names and tags. A commit hash is not allowed. branch names and tags. A commit hash is not allowed.
Note that if not provided, ``GIT_TAG`` defaults to ``master``, not the
default Git branch name.
``GIT_REMOTE_NAME <name>`` ``GIT_REMOTE_NAME <name>``
The optional name of the remote. If this option is not specified, it The optional name of the remote. If this option is not specified, it
defaults to ``origin``. defaults to ``origin``.

@ -303,13 +303,16 @@ Commands
``<lowercaseName>-extra.cmake`` or ``<name>Extra.cmake`` file with the ``<lowercaseName>-extra.cmake`` or ``<name>Extra.cmake`` file with the
``OPTIONAL`` flag (so the files can be missing and won't generate a ``OPTIONAL`` flag (so the files can be missing and won't generate a
warning). Similarly, if no config version file exists, a very simple warning). Similarly, if no config version file exists, a very simple
one will be written which sets ``PACKAGE_VERSION_COMPATIBLE`` to true. one will be written which sets ``PACKAGE_VERSION_COMPATIBLE`` and
``PACKAGE_VERSION_EXACT`` to true. This ensures all future calls to
:command:`find_package()` for the dependency will use the redirected
config file, regardless of any version requirements.
CMake cannot automatically determine an arbitrary dependency's version, CMake cannot automatically determine an arbitrary dependency's version,
so it cannot set ``PACKAGE_VERSION`` or ``PACKAGE_VERSION_EXACT``. so it cannot set ``PACKAGE_VERSION``.
When a dependency is pulled in via :command:`add_subdirectory` in the When a dependency is pulled in via :command:`add_subdirectory` in the
next step, it may choose to overwrite the generated config version file next step, it may choose to overwrite the generated config version file
in :variable:`CMAKE_FIND_PACKAGE_REDIRECTS_DIR` with one that also sets in :variable:`CMAKE_FIND_PACKAGE_REDIRECTS_DIR` with one that also sets
``PACKAGE_VERSION``, and if appropriate, ``PACKAGE_VERSION_EXACT``. ``PACKAGE_VERSION``.
The dependency may also write a ``<lowercaseName>-extra.cmake`` or The dependency may also write a ``<lowercaseName>-extra.cmake`` or
``<name>Extra.cmake`` file to perform custom processing or define any ``<name>Extra.cmake`` file to perform custom processing or define any
variables that their normal (installed) package config file would variables that their normal (installed) package config file would
@ -772,7 +775,7 @@ to the declared details and leaving
googletest googletest
GIT_REPOSITORY https://github.com/google/googletest.git GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG 703bd9caab50b139428cea1aaff9974ebee5742e # release-1.10.0 GIT_TAG 703bd9caab50b139428cea1aaff9974ebee5742e # release-1.10.0
FIND_PACKAGE_ARGS NAMES gtest FIND_PACKAGE_ARGS NAMES GTest
) )
FetchContent_Declare( FetchContent_Declare(
Catch2 Catch2
@ -786,7 +789,7 @@ to the declared details and leaving
For ``Catch2``, no additional arguments to :command:`find_package` are needed, For ``Catch2``, no additional arguments to :command:`find_package` are needed,
so no additional arguments are provided after the ``FIND_PACKAGE_ARGS`` so no additional arguments are provided after the ``FIND_PACKAGE_ARGS``
keyword. For ``googletest``, its package is more commonly called ``gtest``, keyword. For ``googletest``, its package is more commonly called ``GTest``,
so arguments are added to support it being found by that name. so arguments are added to support it being found by that name.
If the user wanted to disable :command:`FetchContent_MakeAvailable` from If the user wanted to disable :command:`FetchContent_MakeAvailable` from
@ -822,7 +825,7 @@ details:
CMake provides a FindGTest module which defines some variables that older CMake provides a FindGTest module which defines some variables that older
projects may use instead of linking to the imported targets. To support projects may use instead of linking to the imported targets. To support
those cases, we can provide an extras file. In keeping with the those cases, we can provide an extra file. In keeping with the
"first to define, wins" philosophy of ``FetchContent``, we only write out "first to define, wins" philosophy of ``FetchContent``, we only write out
that file if something else hasn't already done so. that file if something else hasn't already done so.
@ -830,9 +833,9 @@ that file if something else hasn't already done so.
FetchContent_MakeAvailable(googletest) FetchContent_MakeAvailable(googletest)
if(NOT EXISTS ${CMAKE_FIND_PACKAGE_REDIRECTS_DIR}/googletest-extras.cmake AND if(NOT EXISTS ${CMAKE_FIND_PACKAGE_REDIRECTS_DIR}/googletest-extra.cmake AND
NOT EXISTS ${CMAKE_FIND_PACKAGE_REDIRECTS_DIR}/googletestExtras.cmake) NOT EXISTS ${CMAKE_FIND_PACKAGE_REDIRECTS_DIR}/googletestExtra.cmake)
file(WRITE ${CMAKE_FIND_PACKAGE_REDIRECTS_DIR}/googletest-extras.cmake file(WRITE ${CMAKE_FIND_PACKAGE_REDIRECTS_DIR}/googletest-extra.cmake
[=[ [=[
if("${GTEST_LIBRARIES}" STREQUAL "" AND TARGET GTest::gtest) if("${GTEST_LIBRARIES}" STREQUAL "" AND TARGET GTest::gtest)
set(GTEST_LIBRARIES GTest::gtest) set(GTEST_LIBRARIES GTest::gtest)
@ -1893,13 +1896,13 @@ macro(FetchContent_MakeAvailable)
set(__cmake_fcProvider_${__cmake_contentNameLower} YES) set(__cmake_fcProvider_${__cmake_contentNameLower} YES)
cmake_language(EVAL CODE "${__cmake_providerCommand}(${__cmake_providerArgs})") cmake_language(EVAL CODE "${__cmake_providerCommand}(${__cmake_providerArgs})")
unset(__cmake_fcProvider_${__cmake_contentNameLower})
list(POP_BACK __cmake_fcCurrentVarsStack list(POP_BACK __cmake_fcCurrentVarsStack
__cmake_contentNameLower __cmake_contentNameLower
__cmake_contentName __cmake_contentName
) )
unset(__cmake_fcProvider_${__cmake_contentNameLower})
unset(__cmake_providerArgs) unset(__cmake_providerArgs)
unset(__cmake_addfpargs) unset(__cmake_addfpargs)
unset(__cmake_fpargs) unset(__cmake_fpargs)

@ -1,5 +1,8 @@
# Automatically generated by CMake's FetchContent module. # Automatically generated by CMake's FetchContent module.
# Do not edit this file, it will be regenerated every time CMake runs. # Do not edit this file, it will be regenerated every time CMake runs.
# Version not available, assuming it is compatible # Version not available, assuming it is compatible. We must also say it is an
# exact match to ensure find_package() calls with the EXACT keyword still get
# redirected.
set(PACKAGE_VERSION_COMPATIBLE TRUE) set(PACKAGE_VERSION_COMPATIBLE TRUE)
set(PACKAGE_VERSION_EXACT TRUE)

@ -1380,7 +1380,7 @@ function(_Boost_COMPONENT_DEPENDENCIES component _ret)
set(_Boost_TIMER_DEPENDENCIES chrono) set(_Boost_TIMER_DEPENDENCIES chrono)
set(_Boost_WAVE_DEPENDENCIES filesystem serialization thread chrono atomic) set(_Boost_WAVE_DEPENDENCIES filesystem serialization thread chrono atomic)
set(_Boost_WSERIALIZATION_DEPENDENCIES serialization) set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
if(Boost_VERSION_STRING VERSION_GREATER_EQUAL 1.80.0 AND NOT Boost_NO_WARN_NEW_VERSIONS) if(Boost_VERSION_STRING VERSION_GREATER_EQUAL 1.81.0 AND NOT Boost_NO_WARN_NEW_VERSIONS)
message(WARNING "New Boost version may have incorrect or missing dependencies and imported targets") message(WARNING "New Boost version may have incorrect or missing dependencies and imported targets")
endif() endif()
endif() endif()
@ -1653,7 +1653,7 @@ else()
# _Boost_COMPONENT_HEADERS. See the instructions at the top of # _Boost_COMPONENT_HEADERS. See the instructions at the top of
# _Boost_COMPONENT_DEPENDENCIES. # _Boost_COMPONENT_DEPENDENCIES.
set(_Boost_KNOWN_VERSIONS ${Boost_ADDITIONAL_VERSIONS} set(_Boost_KNOWN_VERSIONS ${Boost_ADDITIONAL_VERSIONS}
"1.79.0" "1.79" "1.80.0" "1.80" "1.79.0" "1.79"
"1.78.0" "1.78" "1.77.0" "1.77" "1.76.0" "1.76" "1.75.0" "1.75" "1.74.0" "1.74" "1.78.0" "1.78" "1.77.0" "1.77" "1.76.0" "1.76" "1.75.0" "1.75" "1.74.0" "1.74"
"1.73.0" "1.73" "1.72.0" "1.72" "1.71.0" "1.71" "1.70.0" "1.70" "1.69.0" "1.69" "1.73.0" "1.73" "1.72.0" "1.72" "1.71.0" "1.71" "1.70.0" "1.70" "1.69.0" "1.69"
"1.68.0" "1.68" "1.67.0" "1.67" "1.66.0" "1.66" "1.65.1" "1.65.0" "1.65" "1.68.0" "1.68" "1.67.0" "1.67" "1.66.0" "1.66" "1.65.1" "1.65.0" "1.65"

@ -927,7 +927,7 @@ if(CUDAToolkit_FOUND)
endif() endif()
_CUDAToolkit_find_and_add_import_lib(culibos) # it's a static library _CUDAToolkit_find_and_add_import_lib(culibos) # it's a static library
foreach (cuda_lib cublasLt cublas cufft curand cusparse nppc nvjpeg) foreach (cuda_lib cublasLt cufft curand cusparse nppc nvjpeg)
_CUDAToolkit_find_and_add_import_lib(${cuda_lib}) _CUDAToolkit_find_and_add_import_lib(${cuda_lib})
_CUDAToolkit_find_and_add_import_lib(${cuda_lib}_static DEPS culibos) _CUDAToolkit_find_and_add_import_lib(${cuda_lib}_static DEPS culibos)
endforeach() endforeach()
@ -935,8 +935,11 @@ if(CUDAToolkit_FOUND)
if(CUDAToolkit_VERSION VERSION_GREATER_EQUAL 11.0.0) if(CUDAToolkit_VERSION VERSION_GREATER_EQUAL 11.0.0)
# cublas depends on cublasLt # cublas depends on cublasLt
# https://docs.nvidia.com/cuda/archive/11.0/cublas/index.html#static-library # https://docs.nvidia.com/cuda/archive/11.0/cublas/index.html#static-library
_CUDAToolkit_find_and_add_import_lib(cublas DEPS cublasLt) _CUDAToolkit_find_and_add_import_lib(cublas DEPS cublasLt culibos)
_CUDAToolkit_find_and_add_import_lib(cublas_static DEPS cublasLt_static) _CUDAToolkit_find_and_add_import_lib(cublas_static DEPS cublasLt_static culibos)
else()
_CUDAToolkit_find_and_add_import_lib(cublas DEPS culibos)
_CUDAToolkit_find_and_add_import_lib(cublas_static DEPS culibos)
endif() endif()
# cuFFTW depends on cuFFT # cuFFTW depends on cuFFT
@ -947,25 +950,25 @@ if(CUDAToolkit_FOUND)
endif() endif()
# cuSOLVER depends on cuBLAS, and cuSPARSE # cuSOLVER depends on cuBLAS, and cuSPARSE
_CUDAToolkit_find_and_add_import_lib(cusolver DEPS cublas cusparse) set(cusolver_deps cublas cusparse)
_CUDAToolkit_find_and_add_import_lib(cusolver_static DEPS cublas_static cusparse_static culibos) set(cusolver_static_deps cublas_static cusparse_static culibos)
if(CUDAToolkit_VERSION VERSION_GREATER_EQUAL 10.1.2)
# cusolver depends on liblapack_static.a starting with CUDA 10.1 update 2,
# https://docs.nvidia.com/cuda/archive/11.5.0/cusolver/index.html#static-link-lapack
_CUDAToolkit_find_and_add_import_lib(cusolver_lapack_static ALT lapack_static) # implementation detail static lib
_CUDAToolkit_find_and_add_import_lib(cusolver_static DEPS cusolver_lapack_static)
endif()
if(CUDAToolkit_VERSION VERSION_GREATER 11.2.1) if(CUDAToolkit_VERSION VERSION_GREATER 11.2.1)
# cusolver depends on libcusolver_metis and cublasLt # cusolver depends on libcusolver_metis and cublasLt
# https://docs.nvidia.com/cuda/archive/11.2.2/cusolver/index.html#link-dependency # https://docs.nvidia.com/cuda/archive/11.2.2/cusolver/index.html#link-dependency
_CUDAToolkit_find_and_add_import_lib(cusolver DEPS cublasLt) list(APPEND cusolver_deps cublasLt)
_CUDAToolkit_find_and_add_import_lib(cusolver_metis_static ALT metis_static) # implementation detail static lib _CUDAToolkit_find_and_add_import_lib(cusolver_metis_static ALT metis_static) # implementation detail static lib
_CUDAToolkit_find_and_add_import_lib(cusolver_static DEPS cusolver_metis_static cublasLt_static) list(APPEND cusolver_static_deps cusolver_metis_static cublasLt_static)
endif()
if(CUDAToolkit_VERSION VERSION_GREATER_EQUAL 10.1.2)
# cusolver depends on liblapack_static.a starting with CUDA 10.1 update 2,
# https://docs.nvidia.com/cuda/archive/11.5.0/cusolver/index.html#static-link-lapack
_CUDAToolkit_find_and_add_import_lib(cusolver_lapack_static ALT lapack_static) # implementation detail static lib
list(APPEND cusolver_static_deps cusolver_lapack_static)
endif() endif()
_CUDAToolkit_find_and_add_import_lib(cusolver DEPS ${cusolver_deps})
_CUDAToolkit_find_and_add_import_lib(cusolver_static DEPS ${cusolver_static_deps})
unset(cusolver_deps)
unset(cusolver_static_deps)
# nvGRAPH depends on cuRAND, and cuSOLVER. # nvGRAPH depends on cuRAND, and cuSOLVER.
_CUDAToolkit_find_and_add_import_lib(nvgraph DEPS curand cusolver) _CUDAToolkit_find_and_add_import_lib(nvgraph DEPS curand cusolver)
@ -980,7 +983,7 @@ if(CUDAToolkit_FOUND)
find_path(CUDAToolkit_CUPTI_INCLUDE_DIR cupti.h PATHS find_path(CUDAToolkit_CUPTI_INCLUDE_DIR cupti.h PATHS
"${CUDAToolkit_ROOT_DIR}/extras/CUPTI/include" "${CUDAToolkit_ROOT_DIR}/extras/CUPTI/include"
"${CUDAToolkit_INCLUDE_DIR}/../extras/CUPTI/include" "${CUDAToolkit_INCLUDE_DIR}/../extras/CUPTI/include"
"${CUDATookit_INCLUDE_DIR}" "${CUDAToolkit_INCLUDE_DIR}"
NO_DEFAULT_PATH) NO_DEFAULT_PATH)
if(CUDAToolkit_CUPTI_INCLUDE_DIR) if(CUDAToolkit_CUPTI_INCLUDE_DIR)

@ -121,13 +121,16 @@ foreach(suffix ${PostgreSQL_KNOWN_VERSIONS})
if(UNIX) if(UNIX)
list(APPEND PostgreSQL_LIBRARY_ADDITIONAL_SEARCH_SUFFIXES list(APPEND PostgreSQL_LIBRARY_ADDITIONAL_SEARCH_SUFFIXES
"postgresql${suffix}" "postgresql${suffix}"
"postgresql@${suffix}"
"pgsql-${suffix}/lib") "pgsql-${suffix}/lib")
list(APPEND PostgreSQL_INCLUDE_ADDITIONAL_SEARCH_SUFFIXES list(APPEND PostgreSQL_INCLUDE_ADDITIONAL_SEARCH_SUFFIXES
"postgresql${suffix}" "postgresql${suffix}"
"postgresql@${suffix}"
"postgresql/${suffix}" "postgresql/${suffix}"
"pgsql-${suffix}/include") "pgsql-${suffix}/include")
list(APPEND PostgreSQL_TYPE_ADDITIONAL_SEARCH_SUFFIXES list(APPEND PostgreSQL_TYPE_ADDITIONAL_SEARCH_SUFFIXES
"postgresql${suffix}/server" "postgresql${suffix}/server"
"postgresql@${suffix}/server"
"postgresql/${suffix}/server" "postgresql/${suffix}/server"
"pgsql-${suffix}/include/server") "pgsql-${suffix}/include/server")
endif() endif()

@ -92,8 +92,16 @@ endforeach()
# Allow ZLIB_LIBRARY to be set manually, as the location of the zlib library # Allow ZLIB_LIBRARY to be set manually, as the location of the zlib library
if(NOT ZLIB_LIBRARY) if(NOT ZLIB_LIBRARY)
set(_zlib_ORIG_CMAKE_FIND_LIBRARY_PREFIXES ${CMAKE_FIND_LIBRARY_PREFIXES}) if(DEFINED CMAKE_FIND_LIBRARY_PREFIXES)
set(_zlib_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES}) set(_zlib_ORIG_CMAKE_FIND_LIBRARY_PREFIXES "${CMAKE_FIND_LIBRARY_PREFIXES}")
else()
set(_zlib_ORIG_CMAKE_FIND_LIBRARY_PREFIXES)
endif()
if(DEFINED CMAKE_FIND_LIBRARY_SUFFIXES)
set(_zlib_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES "${CMAKE_FIND_LIBRARY_SUFFIXES}")
else()
set(_zlib_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES)
endif()
# Prefix/suffix of the win32/Makefile.gcc build # Prefix/suffix of the win32/Makefile.gcc build
if(WIN32) if(WIN32)
list(APPEND CMAKE_FIND_LIBRARY_PREFIXES "" "lib") list(APPEND CMAKE_FIND_LIBRARY_PREFIXES "" "lib")
@ -114,8 +122,16 @@ if(NOT ZLIB_LIBRARY)
endforeach() endforeach()
# Restore the original find library ordering # Restore the original find library ordering
set(CMAKE_FIND_LIBRARY_SUFFIXES ${_zlib_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES}) if(DEFINED _zlib_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES)
set(CMAKE_FIND_LIBRARY_PREFIXES ${_zlib_ORIG_CMAKE_FIND_LIBRARY_PREFIXES}) set(CMAKE_FIND_LIBRARY_SUFFIXES "${_zlib_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES}")
else()
set(CMAKE_FIND_LIBRARY_SUFFIXES)
endif()
if(DEFINED _zlib_ORIG_CMAKE_FIND_LIBRARY_PREFIXES)
set(CMAKE_FIND_LIBRARY_PREFIXES "${_zlib_ORIG_CMAKE_FIND_LIBRARY_PREFIXES}")
else()
set(CMAKE_FIND_LIBRARY_PREFIXES)
endif()
include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake) include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
select_library_configurations(ZLIB) select_library_configurations(ZLIB)

@ -43,6 +43,8 @@ set(module_symbols
MYMODULE_mp_MYSUB # Intel on Windows MYMODULE_mp_MYSUB # Intel on Windows
mymodule_mysub_ # PGI mymodule_mysub_ # PGI
mymodule_MP_mysub # NAG mymodule_MP_mysub # NAG
_QMmy_modulePmy_sub # LLVMFlang
_QMmymodulePmysub # LLVMFlang
${FortranCInterface_MODULE_SYMBOLS} ${FortranCInterface_MODULE_SYMBOLS}
) )
list(REMOVE_DUPLICATES module_symbols) list(REMOVE_DUPLICATES module_symbols)

@ -95,8 +95,8 @@ set(_case_MYSUB "UPPER")
set(_case_MY_SUB "UPPER") set(_case_MY_SUB "UPPER")
set(_global_regex "^(_*)(mysub|MYSUB)([_$]*)$") set(_global_regex "^(_*)(mysub|MYSUB)([_$]*)$")
set(_global__regex "^(_*)(my_sub|MY_SUB)([_$]*)$") set(_global__regex "^(_*)(my_sub|MY_SUB)([_$]*)$")
set(_module_regex "^(_*)(mymodule|MYMODULE)([A-Za-z_$]*)(mysub|MYSUB)([_$]*)$") set(_module_regex "^(_*)([A-Za-z$]*)(mymodule|MYMODULE)([A-Za-z_$]*)(mysub|MYSUB)([_$]*)$")
set(_module__regex "^(_*)(my_module|MY_MODULE)([A-Za-z_$]*)(my_sub|MY_SUB)([_$]*)$") set(_module__regex "^(_*)([A-Za-z$]*)(my_module|MY_MODULE)([A-Za-z_$]*)(my_sub|MY_SUB)([_$]*)$")
# Parse the symbol names. # Parse the symbol names.
foreach(symbol ${FortranCInterface_SYMBOLS}) foreach(symbol ${FortranCInterface_SYMBOLS})
@ -115,7 +115,7 @@ foreach(symbol ${FortranCInterface_SYMBOLS})
# Look for module symbols. # Look for module symbols.
string(REGEX REPLACE "${_module_${form}regex}" string(REGEX REPLACE "${_module_${form}regex}"
"\\1;\\2;\\3;\\4;\\5" pieces "${symbol}") "\\1\\2;\\3;\\4;\\5;\\6" pieces "${symbol}")
list(LENGTH pieces len) list(LENGTH pieces len)
if(len EQUAL 5) if(len EQUAL 5)
set(FortranCInterface_MODULE_${form}SYMBOL "${symbol}") set(FortranCInterface_MODULE_${form}SYMBOL "${symbol}")

@ -1,7 +1,7 @@
# CMake version number components. # CMake version number components.
set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MAJOR 3)
set(CMake_VERSION_MINOR 24) set(CMake_VERSION_MINOR 24)
set(CMake_VERSION_PATCH 1) set(CMake_VERSION_PATCH 2)
#set(CMake_VERSION_RC 0) #set(CMake_VERSION_RC 0)
set(CMake_VERSION_IS_DIRTY 0) set(CMake_VERSION_IS_DIRTY 0)
@ -21,7 +21,7 @@ endif()
if(NOT CMake_VERSION_NO_GIT) if(NOT CMake_VERSION_NO_GIT)
# If this source was exported by 'git archive', use its commit info. # If this source was exported by 'git archive', use its commit info.
set(git_info [==[c3793b4157 CMake 3.24.1]==]) set(git_info [==[31f835410e CMake 3.24.2]==])
# Otherwise, try to identify the current development source version. # Otherwise, try to identify the current development source version.
if(NOT git_info MATCHES "^([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]?[0-9a-f]?)[0-9a-f]* " if(NOT git_info MATCHES "^([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]?[0-9a-f]?)[0-9a-f]* "

@ -363,7 +363,11 @@ void cmCTestTestHandler::PopulateCustomVectors(cmMakefile* mf)
cmValue dval = mf->GetDefinition("CTEST_CUSTOM_TEST_OUTPUT_TRUNCATION"); cmValue dval = mf->GetDefinition("CTEST_CUSTOM_TEST_OUTPUT_TRUNCATION");
if (dval) { if (dval) {
this->SetTestOutputTruncation(dval); if (!this->SetTestOutputTruncation(dval)) {
cmCTestLog(this->CTest, ERROR_MESSAGE,
"Invalid value for CTEST_CUSTOM_TEST_OUTPUT_TRUNCATION: "
<< dval << std::endl);
}
} }
} }

@ -278,6 +278,43 @@ void cmFindBase::FillSystemEnvironmentPath()
paths.AddSuffixes(this->SearchPathSuffixes); paths.AddSuffixes(this->SearchPathSuffixes);
} }
namespace {
struct entry_to_remove
{
entry_to_remove(std::string const& name, cmMakefile* makefile)
: value()
{
if (cmValue to_skip = makefile->GetDefinition(
cmStrCat("_CMAKE_SYSTEM_PREFIX_PATH_", name, "_PREFIX_COUNT"))) {
cmStrToLong(to_skip, &count);
}
if (cmValue prefix_value = makefile->GetDefinition(
cmStrCat("_CMAKE_SYSTEM_PREFIX_PATH_", name, "_PREFIX_VALUE"))) {
value = *prefix_value;
}
}
bool valid() const { return count > 0 && !value.empty(); }
void remove_self(std::vector<std::string>& entries) const
{
if (this->valid()) {
long to_skip = this->count;
long index_to_remove = 0;
for (const auto& path : entries) {
if (path == this->value && --to_skip == 0) {
break;
}
++index_to_remove;
}
entries.erase(entries.begin() + index_to_remove);
}
}
long count = -1;
std::string value;
};
}
void cmFindBase::FillCMakeSystemVariablePath() void cmFindBase::FillCMakeSystemVariablePath()
{ {
cmSearchPath& paths = this->LabeledPaths[PathLabel::CMakeSystem]; cmSearchPath& paths = this->LabeledPaths[PathLabel::CMakeSystem];
@ -298,38 +335,25 @@ void cmFindBase::FillCMakeSystemVariablePath()
// computed by `CMakeSystemSpecificInformation.cmake` while constructing // computed by `CMakeSystemSpecificInformation.cmake` while constructing
// `CMAKE_SYSTEM_PREFIX_PATH`. This ensures that if projects / toolchains // `CMAKE_SYSTEM_PREFIX_PATH`. This ensures that if projects / toolchains
// have removed `CMAKE_INSTALL_PREFIX` from the list, we don't remove // have removed `CMAKE_INSTALL_PREFIX` from the list, we don't remove
// some other entry by mistake // some other entry by mistake ( likewise for `CMAKE_STAGING_PREFIX` )
long install_prefix_count = -1; entry_to_remove install_entry("INSTALL", this->Makefile);
std::string install_path_to_remove; entry_to_remove staging_entry("STAGING", this->Makefile);
if (cmValue to_skip = this->Makefile->GetDefinition(
"_CMAKE_SYSTEM_PREFIX_PATH_INSTALL_PREFIX_COUNT")) {
cmStrToLong(to_skip, &install_prefix_count);
}
if (cmValue install_value = this->Makefile->GetDefinition(
"_CMAKE_SYSTEM_PREFIX_PATH_INSTALL_PREFIX_VALUE")) {
install_path_to_remove = *install_value;
}
if (remove_install_prefix && install_prefix_in_list && if (remove_install_prefix && install_prefix_in_list &&
install_prefix_count > 0 && !install_path_to_remove.empty()) { (install_entry.valid() || staging_entry.valid())) {
cmValue prefix_paths = cmValue prefix_paths =
this->Makefile->GetDefinition("CMAKE_SYSTEM_PREFIX_PATH"); this->Makefile->GetDefinition("CMAKE_SYSTEM_PREFIX_PATH");
// remove entry from CMAKE_SYSTEM_PREFIX_PATH // remove entries from CMAKE_SYSTEM_PREFIX_PATH
std::vector<std::string> expanded = cmExpandedList(*prefix_paths); std::vector<std::string> expanded = cmExpandedList(*prefix_paths);
long index_to_remove = 0; install_entry.remove_self(expanded);
for (const auto& path : expanded) { staging_entry.remove_self(expanded);
if (path == install_path_to_remove && --install_prefix_count == 0) {
break;
}
++index_to_remove;
}
expanded.erase(expanded.begin() + index_to_remove);
paths.AddPrefixPaths(expanded, paths.AddPrefixPaths(expanded,
this->Makefile->GetCurrentSourceDirectory().c_str()); this->Makefile->GetCurrentSourceDirectory().c_str());
} else if (add_install_prefix && !install_prefix_in_list) { } else if (add_install_prefix && !install_prefix_in_list) {
paths.AddCMakePrefixPath("CMAKE_INSTALL_PREFIX"); paths.AddCMakePrefixPath("CMAKE_INSTALL_PREFIX");
paths.AddCMakePrefixPath("CMAKE_STAGING_PREFIX");
paths.AddCMakePrefixPath("CMAKE_SYSTEM_PREFIX_PATH"); paths.AddCMakePrefixPath("CMAKE_SYSTEM_PREFIX_PATH");
} else { } else {
// Otherwise the current setup of `CMAKE_SYSTEM_PREFIX_PATH` is correct // Otherwise the current setup of `CMAKE_SYSTEM_PREFIX_PATH` is correct

@ -1702,7 +1702,7 @@ void addFileSetEntry(cmGeneratorTarget const* headTarget,
} }
bool found = false; bool found = false;
for (auto const& sg : headTarget->Makefile->GetSourceGroups()) { for (auto const& sg : headTarget->Makefile->GetSourceGroups()) {
if (sg.MatchesFiles(path)) { if (sg.MatchChildrenFiles(path)) {
found = true; found = true;
break; break;
} }
@ -8622,7 +8622,7 @@ bool cmGeneratorTarget::AddHeaderSetVerification()
verifyTarget->SetProperty("UNITY_BUILD", "OFF"); verifyTarget->SetProperty("UNITY_BUILD", "OFF");
cm::optional<std::map<std::string, cmValue>> cm::optional<std::map<std::string, cmValue>>
perConfigCompileDefinitions; perConfigCompileDefinitions;
verifyTarget->FinalizeTargetCompileInfo( verifyTarget->FinalizeTargetConfiguration(
this->Makefile->GetCompileDefinitionsEntries(), this->Makefile->GetCompileDefinitionsEntries(),
perConfigCompileDefinitions); perConfigCompileDefinitions);

@ -1501,7 +1501,7 @@ bool cmGlobalGenerator::Compute()
if (!this->CheckALLOW_DUPLICATE_CUSTOM_TARGETS()) { if (!this->CheckALLOW_DUPLICATE_CUSTOM_TARGETS()) {
return false; return false;
} }
this->FinalizeTargetCompileInfo(); this->FinalizeTargetConfiguration();
this->CreateGenerationObjects(); this->CreateGenerationObjects();
@ -1825,7 +1825,7 @@ cmGlobalGenerator::CreateMSVC60LinkLineComputer(
cm::make_unique<cmMSVC60LinkLineComputer>(outputConverter, stateDir)); cm::make_unique<cmMSVC60LinkLineComputer>(outputConverter, stateDir));
} }
void cmGlobalGenerator::FinalizeTargetCompileInfo() void cmGlobalGenerator::FinalizeTargetConfiguration()
{ {
std::vector<std::string> const langs = std::vector<std::string> const langs =
this->CMakeInstance->GetState()->GetEnabledLanguages(); this->CMakeInstance->GetState()->GetEnabledLanguages();
@ -1838,7 +1838,7 @@ void cmGlobalGenerator::FinalizeTargetCompileInfo()
for (auto& target : mf->GetTargets()) { for (auto& target : mf->GetTargets()) {
cmTarget* t = &target.second; cmTarget* t = &target.second;
t->FinalizeTargetCompileInfo(noConfigCompileDefinitions, t->FinalizeTargetConfiguration(noConfigCompileDefinitions,
perConfigCompileDefinitions); perConfigCompileDefinitions);
} }

@ -694,7 +694,7 @@ private:
void WriteSummary(); void WriteSummary();
void WriteSummary(cmGeneratorTarget* target); void WriteSummary(cmGeneratorTarget* target);
void FinalizeTargetCompileInfo(); void FinalizeTargetConfiguration();
virtual void ForceLinkerLanguages(); virtual void ForceLinkerLanguages();

@ -3622,6 +3622,7 @@ void cmGlobalXCodeGenerator::AddDependAndLinkInformation(cmXCodeObject* target)
} }
} }
} else { } else {
linkDir = cmSystemTools::GetParentDirectory(linkDir);
if (std::find(linkSearchPaths.begin(), linkSearchPaths.end(), linkDir) == if (std::find(linkSearchPaths.begin(), linkSearchPaths.end(), linkDir) ==
linkSearchPaths.end()) { linkSearchPaths.end()) {
linkSearchPaths.push_back(linkDir); linkSearchPaths.push_back(linkDir);

@ -35,7 +35,5 @@ bool cmLinkLibrariesCommand(std::vector<std::string> const& args,
mf.AppendProperty("LINK_LIBRARIES", *i); mf.AppendProperty("LINK_LIBRARIES", *i);
} }
mf.CheckProperty("LINK_LIBRARIES");
return true; return true;
} }

@ -3987,31 +3987,6 @@ std::vector<std::string> cmMakefile::GetPropertyKeys() const
return this->StateSnapshot.GetDirectory().GetPropertyKeys(); return this->StateSnapshot.GetDirectory().GetPropertyKeys();
} }
void cmMakefile::CheckProperty(const std::string& prop) const
{
// Certain properties need checking.
if (prop == "LINK_LIBRARIES") {
if (cmValue value = this->GetProperty(prop)) {
// Look for <LINK_LIBRARY:> internal pattern
static cmsys::RegularExpression linkPattern(
"(^|;)(</?LINK_(LIBRARY|GROUP):[^;>]*>)(;|$)");
if (!linkPattern.find(value)) {
return;
}
// Report an error.
this->IssueMessage(
MessageType::FATAL_ERROR,
cmStrCat("Property ", prop, " contains the invalid item \"",
linkPattern.match(2), "\". The ", prop,
" property may contain the generator-expression \"$<LINK_",
linkPattern.match(3),
":...>\" which may be used to specify how the libraries are "
"linked."));
}
}
}
cmTarget* cmMakefile::FindLocalNonAliasTarget(const std::string& name) const cmTarget* cmMakefile::FindLocalNonAliasTarget(const std::string& name) const
{ {
auto i = this->Targets.find(name); auto i = this->Targets.find(name);

@ -794,7 +794,6 @@ public:
cmValue GetProperty(const std::string& prop, bool chain) const; cmValue GetProperty(const std::string& prop, bool chain) const;
bool GetPropertyAsBool(const std::string& prop) const; bool GetPropertyAsBool(const std::string& prop) const;
std::vector<std::string> GetPropertyKeys() const; std::vector<std::string> GetPropertyKeys() const;
void CheckProperty(const std::string& prop) const;
//! Initialize a makefile from its parent //! Initialize a makefile from its parent
void InitializeFromParent(cmMakefile* parent); void InitializeFromParent(cmMakefile* parent);

@ -2175,15 +2175,9 @@ void cmQtAutoMocUicT::JobMocsCompilationT::Process()
if (this->MocEval().CompFiles.empty()) { if (this->MocEval().CompFiles.empty()) {
// Placeholder content // Placeholder content
cmCryptoHash hash(cmCryptoHash::AlgoSHA256);
const std::string hashedPath = hash.HashString(compAbs);
const std::string functionName =
"cmake_automoc_silence_linker_warning" + hashedPath;
content += "// No files found that require moc or the moc files are " content += "// No files found that require moc or the moc files are "
"included\n" "included\n"
"void " + "enum some_compilers { need_more_than_nothing };\n";
functionName + "() {}\n";
} else { } else {
// Valid content // Valid content
const bool mc = this->BaseConst().MultiConfig; const bool mc = this->BaseConst().MultiConfig;

@ -124,6 +124,21 @@ cmSourceGroup* cmSourceGroup::MatchChildrenFiles(const std::string& name)
return nullptr; return nullptr;
} }
const cmSourceGroup* cmSourceGroup::MatchChildrenFiles(
const std::string& name) const
{
if (this->MatchesFiles(name)) {
return this;
}
for (const cmSourceGroup& group : this->Internal->GroupChildren) {
const cmSourceGroup* result = group.MatchChildrenFiles(name);
if (result) {
return result;
}
}
return nullptr;
}
cmSourceGroup* cmSourceGroup::MatchChildrenRegex(const std::string& name) cmSourceGroup* cmSourceGroup::MatchChildrenRegex(const std::string& name)
{ {
for (cmSourceGroup& group : this->Internal->GroupChildren) { for (cmSourceGroup& group : this->Internal->GroupChildren) {

@ -79,6 +79,12 @@ public:
*/ */
cmSourceGroup* MatchChildrenFiles(const std::string& name); cmSourceGroup* MatchChildrenFiles(const std::string& name);
/**
* Check if the given name matches this group's explicit file list
* in children.
*/
const cmSourceGroup* MatchChildrenFiles(const std::string& name) const;
/** /**
* Check if the given name matches this group's regex in children. * Check if the given name matches this group's regex in children.
*/ */

@ -1881,7 +1881,41 @@ void cmTarget::AppendBuildInterfaceIncludes()
} }
} }
void cmTarget::FinalizeTargetCompileInfo( namespace {
bool CheckLinkLibraryPattern(cm::string_view property,
const std::vector<BT<std::string>>& value,
cmake* context)
{
// Look for <LINK_LIBRARY:> and </LINK_LIBRARY:> internal tags
static cmsys::RegularExpression linkPattern(
"(^|;)(</?LINK_(LIBRARY|GROUP):[^;>]*>)(;|$)");
bool isValid = true;
for (const auto& item : value) {
if (!linkPattern.find(item.Value)) {
continue;
}
isValid = false;
// Report an error.
context->IssueMessage(
MessageType::FATAL_ERROR,
cmStrCat(
"Property ", property, " contains the invalid item \"",
linkPattern.match(2), "\". The ", property,
" property may contain the generator-expression \"$<LINK_",
linkPattern.match(3),
":...>\" which may be used to specify how the libraries are linked."),
item.Backtrace);
}
return isValid;
}
}
void cmTarget::FinalizeTargetConfiguration(
const cmBTStringRange& noConfigCompileDefinitions, const cmBTStringRange& noConfigCompileDefinitions,
cm::optional<std::map<std::string, cmValue>>& perConfigCompileDefinitions) cm::optional<std::map<std::string, cmValue>>& perConfigCompileDefinitions)
{ {
@ -1889,6 +1923,18 @@ void cmTarget::FinalizeTargetCompileInfo(
return; return;
} }
if (!CheckLinkLibraryPattern("LINK_LIBRARIES"_s,
this->impl->LinkImplementationPropertyEntries,
this->GetMakefile()->GetCMakeInstance()) ||
!CheckLinkLibraryPattern("INTERFACE_LINK_LIBRARIES"_s,
this->impl->LinkInterfacePropertyEntries,
this->GetMakefile()->GetCMakeInstance()) ||
!CheckLinkLibraryPattern("INTERFACE_LINK_LIBRARIES_DIRECT"_s,
this->impl->LinkInterfaceDirectPropertyEntries,
this->GetMakefile()->GetCMakeInstance())) {
return;
}
this->AppendBuildInterfaceIncludes(); this->AppendBuildInterfaceIncludes();
if (this->GetType() == cmStateEnums::INTERFACE_LIBRARY) { if (this->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
@ -1969,27 +2015,6 @@ void cmTarget::InsertPrecompileHeader(BT<std::string> const& entry)
} }
namespace { namespace {
void CheckLinkLibraryPattern(const std::string& property,
const std::string& value, cmMakefile* context)
{
// Look for <LINK_LIBRARY:> and </LINK_LIBRARY:> internal tags
static cmsys::RegularExpression linkPattern(
"(^|;)(</?LINK_(LIBRARY|GROUP):[^;>]*>)(;|$)");
if (!linkPattern.find(value)) {
return;
}
// Report an error.
context->IssueMessage(
MessageType::FATAL_ERROR,
cmStrCat(
"Property ", property, " contains the invalid item \"",
linkPattern.match(2), "\". The ", property,
" property may contain the generator-expression \"$<LINK_",
linkPattern.match(3),
":...>\" which may be used to specify how the libraries are linked."));
}
void CheckLINK_INTERFACE_LIBRARIES(const std::string& prop, void CheckLINK_INTERFACE_LIBRARIES(const std::string& prop,
const std::string& value, const std::string& value,
cmMakefile* context, bool imported) cmMakefile* context, bool imported)
@ -2024,13 +2049,6 @@ void CheckLINK_INTERFACE_LIBRARIES(const std::string& prop,
} }
context->IssueMessage(MessageType::FATAL_ERROR, e.str()); context->IssueMessage(MessageType::FATAL_ERROR, e.str());
} }
CheckLinkLibraryPattern(base, value, context);
}
void CheckLINK_LIBRARIES(const std::string& value, cmMakefile* context)
{
CheckLinkLibraryPattern("LINK_LIBRARIES", value, context);
} }
void CheckINTERFACE_LINK_LIBRARIES(const std::string& value, void CheckINTERFACE_LINK_LIBRARIES(const std::string& value,
@ -2051,8 +2069,6 @@ void CheckINTERFACE_LINK_LIBRARIES(const std::string& value,
context->IssueMessage(MessageType::FATAL_ERROR, e.str()); context->IssueMessage(MessageType::FATAL_ERROR, e.str());
} }
CheckLinkLibraryPattern("INTERFACE_LINK_LIBRARIES", value, context);
} }
void CheckIMPORTED_GLOBAL(const cmTarget* target, cmMakefile* context) void CheckIMPORTED_GLOBAL(const cmTarget* target, cmMakefile* context)
@ -2085,10 +2101,6 @@ void cmTarget::CheckProperty(const std::string& prop,
if (cmValue value = this->GetProperty(prop)) { if (cmValue value = this->GetProperty(prop)) {
CheckLINK_INTERFACE_LIBRARIES(prop, *value, context, true); CheckLINK_INTERFACE_LIBRARIES(prop, *value, context, true);
} }
} else if (prop == "LINK_LIBRARIES") {
if (cmValue value = this->GetProperty(prop)) {
CheckLINK_LIBRARIES(*value, context);
}
} else if (prop == "INTERFACE_LINK_LIBRARIES") { } else if (prop == "INTERFACE_LINK_LIBRARIES") {
if (cmValue value = this->GetProperty(prop)) { if (cmValue value = this->GetProperty(prop)) {
CheckINTERFACE_LINK_LIBRARIES(*value, context); CheckINTERFACE_LINK_LIBRARIES(*value, context);

@ -236,7 +236,7 @@ public:
void InsertPrecompileHeader(BT<std::string> const& entry); void InsertPrecompileHeader(BT<std::string> const& entry);
void AppendBuildInterfaceIncludes(); void AppendBuildInterfaceIncludes();
void FinalizeTargetCompileInfo( void FinalizeTargetConfiguration(
const cmBTStringRange& noConfigCompileDefinitions, const cmBTStringRange& noConfigCompileDefinitions,
cm::optional<std::map<std::string, cmValue>>& perConfigCompileDefinitions); cm::optional<std::map<std::string, cmValue>>& perConfigCompileDefinitions);

@ -379,9 +379,6 @@ bool cmTargetLinkLibrariesCommand(std::vector<std::string> const& args,
target->SetProperty("LINK_INTERFACE_LIBRARIES", ""); target->SetProperty("LINK_INTERFACE_LIBRARIES", "");
} }
target->CheckProperty("LINK_LIBRARIES", &mf);
target->CheckProperty("INTERFACE_LINK_LIBRARIES", &mf);
return true; return true;
} }

@ -284,7 +284,7 @@ function(run_TestOutputTruncation mode expected)
file(WRITE "${RunCMake_TEST_BINARY_DIR}/CTestTestfile.cmake" " file(WRITE "${RunCMake_TEST_BINARY_DIR}/CTestTestfile.cmake" "
add_test(Truncation_${mode} \"${CMAKE_COMMAND}\" -E echo 123456789) add_test(Truncation_${mode} \"${CMAKE_COMMAND}\" -E echo 123456789)
") ")
run_cmake_command(TestOutputTruncation run_cmake_command(TestOutputTruncation_${mode}
${CMAKE_CTEST_COMMAND} -M Experimental -T Test ${CMAKE_CTEST_COMMAND} -M Experimental -T Test
--no-compress-output --no-compress-output
--test-output-size-passed 5 --test-output-size-passed 5
@ -294,6 +294,7 @@ endfunction()
run_TestOutputTruncation("head" "\\.\\.\\.6789") run_TestOutputTruncation("head" "\\.\\.\\.6789")
run_TestOutputTruncation("middle" "12\\.\\.\\..*\\.\\.\\.89") run_TestOutputTruncation("middle" "12\\.\\.\\..*\\.\\.\\.89")
run_TestOutputTruncation("tail" "12345\\.\\.\\.") run_TestOutputTruncation("tail" "12345\\.\\.\\.")
run_TestOutputTruncation("bad" "")
# Test --stop-on-failure # Test --stop-on-failure
function(run_stop_on_failure) function(run_stop_on_failure)

@ -0,0 +1 @@
^CMake Error: Invalid value for '--test-output-truncation': bad$

@ -0,0 +1 @@
include(${RunCMake_SOURCE_DIR}/TestOutputTruncation-check.cmake)

@ -0,0 +1 @@
include(${RunCMake_SOURCE_DIR}/TestOutputTruncation-check.cmake)

@ -0,0 +1 @@
^Cannot find file: .*/Tests/RunCMake/CTestCommandLine/TestOutputTruncation.*/DartConfiguration.tcl

@ -0,0 +1 @@
include(${RunCMake_SOURCE_DIR}/TestOutputTruncation-check.cmake)

@ -0,0 +1 @@
^Cannot find file: .*/Tests/RunCMake/CTestCommandLine/TestOutputTruncation.*/DartConfiguration.tcl

@ -18,3 +18,7 @@ message(STATUS "Lowercase extra file was read")
# This is expected to be re-routed to a FetchContent_MakeAvailable() call # This is expected to be re-routed to a FetchContent_MakeAvailable() call
find_package(AddedProject REQUIRED) find_package(AddedProject REQUIRED)
# Verify that find_package() version constraints are fully ignored by the
# default-generated config version file
find_package(AddedProject 1.2.3 EXACT REQUIRED)

@ -1,6 +1,6 @@
CMake Error at forbidden-arguments.cmake:[0-9]+ \(link_libraries\): CMake Error at forbidden-arguments.cmake:[0-9]+ \(add_library\):
Property LINK_LIBRARIES contains the invalid item "<LINK_GROUP:feat>". The Property LINK_LIBRARIES contains the invalid item "</LINK_GROUP:feat>".
LINK_LIBRARIES property may contain the generator-expression The LINK_LIBRARIES property may contain the generator-expression
"\$<LINK_GROUP:...>" which may be used to specify how the libraries are "\$<LINK_GROUP:...>" which may be used to specify how the libraries are
linked. linked.
Call Stack \(most recent call first\): Call Stack \(most recent call first\):

@ -1,5 +1,5 @@
CMake Error at forbidden-arguments.cmake:[0-9]+ \(link_libraries\): CMake Error at forbidden-arguments.cmake:[0-9]+ \(add_library\):
Property LINK_LIBRARIES contains the invalid item "<LINK_LIBRARY:feat>". Property LINK_LIBRARIES contains the invalid item "</LINK_LIBRARY:feat>".
The LINK_LIBRARIES property may contain the generator-expression The LINK_LIBRARIES property may contain the generator-expression
"\$<LINK_LIBRARY:...>" which may be used to specify how the libraries are "\$<LINK_LIBRARY:...>" which may be used to specify how the libraries are
linked. linked.

@ -1,5 +1,8 @@
include(RunCMake) include(RunCMake)
# Do not let ccache modify paths checked by the test cases.
unset(ENV{CCACHE_BASEDIR})
function(run_symlink_test_case) function(run_symlink_test_case)
file(REMOVE_RECURSE file(REMOVE_RECURSE
"${RunCMake_TEST_BINARY_DIR}/CMakeCache.txt" "${RunCMake_TEST_BINARY_DIR}/CMakeCache.txt"

@ -16,6 +16,7 @@ run_cmake(NoImpLib)
run_cmake(RuntimeLibrary) run_cmake(RuntimeLibrary)
run_cmake(SourceGroupCMakeLists) run_cmake(SourceGroupCMakeLists)
run_cmake(SourceGroupTreeCMakeLists) run_cmake(SourceGroupTreeCMakeLists)
run_cmake(SourceGroupFileSet)
run_cmake(VsConfigurationType) run_cmake(VsConfigurationType)
run_cmake(VsTargetsFileReferences) run_cmake(VsTargetsFileReferences)
run_cmake(VsCustomProps) run_cmake(VsCustomProps)

@ -0,0 +1,13 @@
cmake_policy(SET CMP0011 NEW)
set(vcFiltersFile "${RunCMake_TEST_BINARY_DIR}/SourceGroupFileSet.vcxproj.filters")
if(NOT EXISTS "${vcFiltersFile}")
set(RunCMake_TEST_FAILED "Filters file ${vcFiltersFile} does not exist.")
return()
endif()
file(STRINGS "${vcFiltersFile}" lines)
include(${RunCMake_TEST_SOURCE_DIR}/SourceGroupHelpers.cmake)
find_source_group("${lines}" "Header Files\\SourceGroupFileSet")

@ -0,0 +1,3 @@
add_library(SourceGroupFileSet INTERFACE)
target_sources(SourceGroupFileSet PUBLIC FILE_SET HEADERS FILES iface.h)
source_group("Header Files/SourceGroupFileSet" FILES iface.h)

@ -1,8 +1,9 @@
function(find_source_group LINES NAME) function(find_source_group LINES NAME)
set(foundFileFilter 0) set(foundFileFilter 0)
set(foundFilter 0) set(foundFilter 0)
string(REPLACE "\\" "\\\\" regexName "${NAME}")
foreach(line IN LISTS LINES) foreach(line IN LISTS LINES)
if(line MATCHES "<Filter>${NAME}</Filter>") if(line MATCHES "<Filter>${regexName}</Filter>")
if(foundFileFilter) if(foundFileFilter)
set(RunCMake_TEST_FAILED "Multiple files listed with filter for ${NAME}." PARENT_SCOPE) set(RunCMake_TEST_FAILED "Multiple files listed with filter for ${NAME}." PARENT_SCOPE)
set(FILTER_FOUND 0 PARENT_SCOPE) set(FILTER_FOUND 0 PARENT_SCOPE)
@ -10,7 +11,7 @@ function(find_source_group LINES NAME)
endif() endif()
set(foundFileFilter 1) set(foundFileFilter 1)
endif() endif()
if(line MATCHES "<Filter.*Include=\"${NAME}\"") if(line MATCHES "<Filter.*Include=\"${regexName}\"")
if(foundFilter) if(foundFilter)
set(RunCMake_TEST_FAILED "Multiple copies of ${NAME} filter listed." PARENT_SCOPE) set(RunCMake_TEST_FAILED "Multiple copies of ${NAME} filter listed." PARENT_SCOPE)
set(FILTER_FOUND 0 PARENT_SCOPE) set(FILTER_FOUND 0 PARENT_SCOPE)

@ -18,9 +18,9 @@ set(SOURCE_GROUPS_TO_FIND
"SourcesPrefix\\PrefixedNested" "SourcesPrefix\\PrefixedNested"
) )
foreach(GROUP_NAME IN LISTS ${SOURCE_GROUPS_TO_FIND}) foreach(GROUP_NAME IN LISTS SOURCE_GROUPS_TO_FIND)
find_source_group("${lines}" ${GROUP_NAME}) find_source_group("${lines}" ${GROUP_NAME})
if(NOT ${FILTER_FOUND}) if(NOT FILTER_FOUND)
return() return()
endif() endif()
endforeach() endforeach()

@ -0,0 +1,14 @@
cmake_minimum_required(VERSION 3.23)
project(BundleLinkBundle CXX)
add_subdirectory(lib_bundle)
add_executable(MainBundle MACOSX_BUNDLE main_bundle.cpp)
target_link_libraries(MainBundle PRIVATE LibBundle)
set_target_properties(MainBundle PROPERTIES
MACOSX_BUNDLE "YES"
XCODE_LINK_BUILD_PHASE_MODE BUILT_ONLY
)

@ -151,6 +151,16 @@ endfunction()
XcodeXCConfig() XcodeXCConfig()
function(BundleLinkBundle)
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/BundleLinkBundle-build)
run_cmake(BundleLinkBundle)
set(RunCMake_TEST_NO_CLEAN 1)
run_cmake_command(BundleLinkBundle-build ${CMAKE_COMMAND} --build .)
endfunction()
BundleLinkBundle()
# Isolate device tests from host architecture selection. # Isolate device tests from host architecture selection.
unset(ENV{CMAKE_OSX_ARCHITECTURES}) unset(ENV{CMAKE_OSX_ARCHITECTURES})

@ -0,0 +1,5 @@
add_library(LibBundle lib_bundle.cpp)
set_target_properties(LibBundle PROPERTIES
MACOSX_BUNDLE YES)

@ -0,0 +1,6 @@
#include <iostream>
void foo()
{
std::cout << "foobar" << std::endl;
}

@ -0,0 +1,9 @@
extern void foo();
int main()
{
foo();
return 0;
}

@ -84,18 +84,18 @@ run_TestOutputSize()
function(run_TestOutputTruncation mode expected) function(run_TestOutputTruncation mode expected)
set(CASE_CTEST_TEST_ARGS EXCLUDE RunCMakeVersion) set(CASE_CTEST_TEST_ARGS EXCLUDE RunCMakeVersion)
set(TRUNCATED_OUTPUT ${expected}) # used in TestOutputTruncation-check.cmake set(TRUNCATED_OUTPUT ${expected}) # used in TestOutputTruncation-check.cmake
set(CASE_TEST_PREFIX_CODE [[ string(CONCAT CASE_TEST_PREFIX_CODE "
set( CTEST_CUSTOM_TEST_OUTPUT_TRUNCATION${mode}) set(CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE 5)
]]) set(CTEST_CUSTOM_TEST_OUTPUT_TRUNCATION ${mode})" )
set(CASE_CMAKELISTS_SUFFIX_CODE [[ set(CASE_CMAKELISTS_SUFFIX_CODE "
add_test(NAME Truncation_${mode} COMMAND ${CMAKE_COMMAND} -E echo 123456789) add_test(NAME Truncation_${mode} COMMAND \${CMAKE_COMMAND} -E echo 123456789)")
]])
run_ctest(TestOutputTruncation) run_ctest(TestOutputTruncation_${mode})
endfunction() endfunction()
run_TestOutputTruncation("head" "...6789") run_TestOutputTruncation("head" "\\.\\.\\.6789")
run_TestOutputTruncation("middle" "12....*...89") run_TestOutputTruncation("middle" "12\\.\\.\\..*\\.\\.\\.89")
run_TestOutputTruncation("tail" "12345...") run_TestOutputTruncation("tail" "12345\\.\\.\\.")
run_TestOutputTruncation("bad" "")
run_ctest_test(TestRepeatBad1 REPEAT UNKNOWN:3) run_ctest_test(TestRepeatBad1 REPEAT UNKNOWN:3)
run_ctest_test(TestRepeatBad2 REPEAT UNTIL_FAIL:-1) run_ctest_test(TestRepeatBad2 REPEAT UNTIL_FAIL:-1)

@ -0,0 +1,4 @@
file(GLOB test_xml_file "${RunCMake_TEST_BINARY_DIR}/Testing/*/Test.xml")
if(test_xml_file)
set(RunCMake_TEST_FAILED "Test.xml should not exist:\n ${test_xml_file}")
endif()

@ -0,0 +1 @@
^Invalid value for CTEST_CUSTOM_TEST_OUTPUT_TRUNCATION: bad$

@ -0,0 +1 @@
include(${RunCMake_SOURCE_DIR}/TestOutputTruncation-check.cmake)

@ -0,0 +1 @@
include(${RunCMake_SOURCE_DIR}/TestOutputTruncation-check.cmake)

@ -0,0 +1 @@
include(${RunCMake_SOURCE_DIR}/TestOutputTruncation-check.cmake)

@ -0,0 +1,43 @@
find_library called with the following settings:.*
VAR: CREATED_LIBRARY
NAMES: \"created\"
Documentation.*
Framework.*
AppBundle.*
CMAKE_FIND_USE_CMAKE_PATH: 1
CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: 1
CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: 1
CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: 1
CMAKE_FIND_USE_INSTALL_PREFIX: 0
find_library considered the following locations:.*
The item was not found.*
find_library called with the following settings:.*
VAR: CREATED_LIBRARY
NAMES: \"created\"
Documentation.*
Framework.*
AppBundle.*
CMAKE_FIND_USE_CMAKE_PATH: 1
CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: 1
CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: 1
CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: 1
CMAKE_FIND_USE_INSTALL_PREFIX: 1
find_library considered the following locations:.*
The item was found at.*
.*IgnoreStagingAndInstallPrefix-build/lib.*
find_library called with the following settings:.*
VAR: CREATED_LIBRARY
NAMES: \"created\"
Documentation.*
Framework.*
AppBundle.*
CMAKE_FIND_USE_CMAKE_PATH: 1
CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: 1
CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: 1
CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: 1
CMAKE_FIND_USE_INSTALL_PREFIX: 0
find_library considered the following locations:.*
The item was not found.*

@ -0,0 +1,3 @@
-- CREATED_LIBRARY='CREATED_LIBRARY-NOTFOUND'
-- CREATED_LIBRARY='[^']*/Tests/RunCMake/find_library/IgnoreStagingAndInstallPrefix-build/lib/libcreated.a'
-- CREATED_LIBRARY='CREATED_LIBRARY-NOTFOUND'

@ -0,0 +1,43 @@
find_library called with the following settings:.*
VAR: CREATED_LIBRARY
NAMES: \"created\"
Documentation.*
Framework.*
AppBundle.*
CMAKE_FIND_USE_CMAKE_PATH: 1
CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: 1
CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: 1
CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: 1
CMAKE_FIND_USE_INSTALL_PREFIX: 0
find_library considered the following locations:.*
The item was not found.*
find_library called with the following settings:.*
VAR: CREATED_LIBRARY
NAMES: \"created\"
Documentation.*
Framework.*
AppBundle.*
CMAKE_FIND_USE_CMAKE_PATH: 1
CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: 1
CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: 1
CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: 1
CMAKE_FIND_USE_INSTALL_PREFIX: 1
find_library considered the following locations:.*
The item was found at.*
.*IgnoreStagingPrefix-build/lib.*
find_library called with the following settings:.*
VAR: CREATED_LIBRARY
NAMES: \"created\"
Documentation.*
Framework.*
AppBundle.*
CMAKE_FIND_USE_CMAKE_PATH: 1
CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: 1
CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: 1
CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: 1
CMAKE_FIND_USE_INSTALL_PREFIX: 0
find_library considered the following locations:.*
The item was not found.*

@ -0,0 +1,3 @@
-- CREATED_LIBRARY='CREATED_LIBRARY-NOTFOUND'
-- CREATED_LIBRARY='[^']*/Tests/RunCMake/find_library/IgnoreStagingPrefix-build/lib/libcreated.a'
-- CREATED_LIBRARY='CREATED_LIBRARY-NOTFOUND'

@ -0,0 +1 @@
include(IgnoreInstallPrefix.cmake)

@ -4,6 +4,8 @@ run_cmake(Created)
run_cmake(FromPrefixPath) run_cmake(FromPrefixPath)
run_cmake(FromPATHEnv) run_cmake(FromPATHEnv)
run_cmake_with_options(IgnoreInstallPrefix "-DCMAKE_INSTALL_PREFIX=${RunCMake_BINARY_DIR}/IgnoreInstallPrefix-build/") run_cmake_with_options(IgnoreInstallPrefix "-DCMAKE_INSTALL_PREFIX=${RunCMake_BINARY_DIR}/IgnoreInstallPrefix-build/")
run_cmake_with_options(IgnoreStagingPrefix "-DCMAKE_STAGING_PREFIX=${RunCMake_BINARY_DIR}/IgnoreStagingPrefix-build/")
run_cmake_with_options(IgnoreStagingAndInstallPrefix "-DCMAKE_STAGING_PREFIX=${RunCMake_BINARY_DIR}/IgnoreStagingAndInstallPrefix-build/" "-DCMAKE_INSTALL_PREFIX=${RunCMake_BINARY_DIR}/IgnoreStagingAndInstallPrefix-build/")
if(UNIX AND NOT CYGWIN) if(UNIX AND NOT CYGWIN)
run_cmake(LibArchLink) run_cmake(LibArchLink)
run_cmake(LibSymLink) run_cmake(LibSymLink)

Loading…
Cancel
Save