diff options
62 files changed, 839 insertions, 302 deletions
diff --git a/.gitlab/ci/cmake.ps1 b/.gitlab/ci/cmake.ps1 index 9d7f317..e7b4de7 100755 --- a/.gitlab/ci/cmake.ps1 +++ b/.gitlab/ci/cmake.ps1 @@ -7,6 +7,7 @@ $tarball = "$filename.zip" $outdir = $pwd.Path $outdir = "$outdir\.gitlab" +$ProgressPreference = 'SilentlyContinue' Invoke-WebRequest -Uri "https://github.com/Kitware/CMake/releases/download/v$version/$tarball" -OutFile "$outdir\$tarball" $hash = Get-FileHash "$outdir\$tarball" -Algorithm SHA256 if ($hash.Hash -ne $sha256sum) { diff --git a/.gitlab/ci/ninja.ps1 b/.gitlab/ci/ninja.ps1 index 4cc6bcb..4c5333a 100755 --- a/.gitlab/ci/ninja.ps1 +++ b/.gitlab/ci/ninja.ps1 @@ -7,6 +7,7 @@ $tarball = "$filename.zip" $outdir = $pwd.Path $outdir = "$outdir\.gitlab" +$ProgressPreference = 'SilentlyContinue' Invoke-WebRequest -Uri "https://github.com/ninja-build/ninja/releases/download/v$version/$tarball" -OutFile "$outdir\$tarball" $hash = Get-FileHash "$outdir\$tarball" -Algorithm SHA256 if ($hash.Hash -ne $sha256sum) { diff --git a/.gitlab/ci/wix.ps1 b/.gitlab/ci/wix.ps1 new file mode 100755 index 0000000..a9322b6 --- /dev/null +++ b/.gitlab/ci/wix.ps1 @@ -0,0 +1,18 @@ +$erroractionpreference = "stop" + +$release = "wix3112rtm" +$sha256sum = "2C1888D5D1DBA377FC7FA14444CF556963747FF9A0A289A3599CF09DA03B9E2E" +$filename = "wix311-binaries" +$tarball = "$filename.zip" + +$outdir = $pwd.Path +$outdir = "$outdir\.gitlab" +$ProgressPreference = 'SilentlyContinue' +Invoke-WebRequest -Uri "https://github.com/wixtoolset/wix3/releases/download/$release/$tarball" -OutFile "$outdir\$tarball" +$hash = Get-FileHash "$outdir\$tarball" -Algorithm SHA256 +if ($hash.Hash -ne $sha256sum) { + exit 1 +} + +Add-Type -AssemblyName System.IO.Compression.FileSystem +[System.IO.Compression.ZipFile]::ExtractToDirectory("$outdir\$tarball", "$outdir\wix\bin") diff --git a/.gitlab/os-windows.yml b/.gitlab/os-windows.yml index 2e21fdf..1fff2bb 100644 --- a/.gitlab/os-windows.yml +++ b/.gitlab/os-windows.yml @@ -74,9 +74,12 @@ ## Windows-specific scripts .before_script_windows: &before_script_windows + - Invoke-Expression -Command .gitlab/ci/wix.ps1 - Invoke-Expression -Command .gitlab/ci/cmake.ps1 - Invoke-Expression -Command .gitlab/ci/ninja.ps1 - $pwdpath = $pwd.Path + - Set-Item -Force -Path "env:WIX" -Value "$pwdpath\.gitlab\wix" + - (& "$env:WIX\bin\light.exe" -help) | Select -First 1 - Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab;$pwdpath\.gitlab\cmake\bin;$env:PATH" - cmake --version - ninja --version diff --git a/Help/dev/documentation.rst b/Help/dev/documentation.rst index c302790..29fc880 100644 --- a/Help/dev/documentation.rst +++ b/Help/dev/documentation.rst @@ -123,10 +123,23 @@ documentation: ``command`` A CMake language command. +``cpack_gen`` + A CPack package generator. + See the `cpack(1)`_ command-line tool's ``-G`` option. + +``envvar`` + An environment variable. + See the `cmake-env-variables(7)`_ manual + and the `set()`_ command. + ``generator`` A CMake native build system generator. See the `cmake(1)`_ command-line tool's ``-G`` option. +``genex`` + A CMake generator expression. + See the `cmake-generator-expressions(7)`_ manual. + ``manual`` A CMake manual page, like the `cmake(1)`_ manual. @@ -160,10 +173,12 @@ which is expected to be of the form:: ------------- and to appear at or near the top of the ``.rst`` file before any other -lines starting in a letter, digit, or ``<``. If no such title appears +lines starting in a letter, digit, ``<``, or ``$``. If no such title appears literally in the ``.rst`` file, the object name is the ``<file-name>``. If a title does appear, it is expected that ``<file-name>`` is equal -to ``<object-name>`` with any ``<`` and ``>`` characters removed. +to ``<object-name>`` with any ``<`` and ``>`` characters removed, +or in the case of a ``$<genex-name>`` or ``$<genex-name:...>``, the +``genex-name``. Second, the CMake Domain provides directives to define objects inside other documents: @@ -174,6 +189,14 @@ other documents: This indented block documents <command-name>. + .. envvar:: <envvar-name> + + This indented block documents <envvar-name>. + + .. genex:: <genex-name> + + This indented block documents <genex-name>. + .. variable:: <variable-name> This indented block documents <variable-name>. @@ -183,11 +206,14 @@ the first approach above. .. _`Sphinx Domain`: http://sphinx-doc.org/domains.html .. _`cmake(1)`: https://cmake.org/cmake/help/latest/manual/cmake.1.html +.. _`cmake-env-variables(7)`: https://cmake.org/cmake/help/latest/manual/cmake-env-variables.7.html +.. _`cmake-generator-expressions(7)`: https://cmake.org/cmake/help/latest/manual/cmake-generator-expressions.7.html .. _`cmake-modules(7)`: https://cmake.org/cmake/help/latest/manual/cmake-modules.7.html .. _`cmake-policies(7)`: https://cmake.org/cmake/help/latest/manual/cmake-policies.7.html .. _`cmake-properties(7)`: https://cmake.org/cmake/help/latest/manual/cmake-properties.7.html .. _`cmake-variables(7)`: https://cmake.org/cmake/help/latest/manual/cmake-variables.7.html .. _`cmake_policy()`: https://cmake.org/cmake/help/latest/command/cmake_policy.html +.. _`cpack(1)`: https://cmake.org/cmake/help/latest/manual/cpack.1.html .. _`include()`: https://cmake.org/cmake/help/latest/command/include.html .. _`set()`: https://cmake.org/cmake/help/latest/command/set.html .. _`set_property()`: https://cmake.org/cmake/help/latest/command/set_property.html diff --git a/Help/manual/cmake-generator-expressions.7.rst b/Help/manual/cmake-generator-expressions.7.rst index c949ce1..ca4ea3e 100644 --- a/Help/manual/cmake-generator-expressions.7.rst +++ b/Help/manual/cmake-generator-expressions.7.rst @@ -46,7 +46,8 @@ Available boolean expressions are: Logical Operators ----------------- -``$<BOOL:string>`` +.. genex:: $<BOOL:string> + Converts ``string`` to ``0`` or ``1``. Evaluates to ``0`` if any of the following is true: @@ -57,23 +58,27 @@ Logical Operators Otherwise evaluates to ``1``. -``$<AND:conditions>`` +.. genex:: $<AND:conditions> + where ``conditions`` is a comma-separated list of boolean expressions. Evaluates to ``1`` if all conditions are ``1``. Otherwise evaluates to ``0``. -``$<OR:conditions>`` +.. genex:: $<OR:conditions> + where ``conditions`` is a comma-separated list of boolean expressions. Evaluates to ``1`` if at least one of the conditions is ``1``. Otherwise evaluates to ``0``. -``$<NOT:condition>`` +.. genex:: $<NOT:condition> + ``0`` if ``condition`` is ``1``, else ``1``. String Comparisons ------------------ -``$<STREQUAL:string1,string2>`` +.. genex:: $<STREQUAL:string1,string2> + ``1`` if ``string1`` and ``string2`` are equal, else ``0``. The comparison is case-sensitive. For a case-insensitive comparison, combine with a :ref:`string transforming generator expression @@ -83,101 +88,150 @@ String Comparisons $<STREQUAL:$<UPPER_CASE:${foo}>,"BAR"> # "1" if ${foo} is any of "BAR", "Bar", "bar", ... -``$<EQUAL:value1,value2>`` +.. genex:: $<EQUAL:value1,value2> + ``1`` if ``value1`` and ``value2`` are numerically equal, else ``0``. -``$<IN_LIST:string,list>`` + +.. genex:: $<IN_LIST:string,list> + ``1`` if ``string`` is member of the semicolon-separated ``list``, else ``0``. Uses case-sensitive comparisons. -``$<VERSION_LESS:v1,v2>`` + +.. genex:: $<VERSION_LESS:v1,v2> + ``1`` if ``v1`` is a version less than ``v2``, else ``0``. -``$<VERSION_GREATER:v1,v2>`` + +.. genex:: $<VERSION_GREATER:v1,v2> + ``1`` if ``v1`` is a version greater than ``v2``, else ``0``. -``$<VERSION_EQUAL:v1,v2>`` + +.. genex:: $<VERSION_EQUAL:v1,v2> + ``1`` if ``v1`` is the same version as ``v2``, else ``0``. -``$<VERSION_LESS_EQUAL:v1,v2>`` + +.. genex:: $<VERSION_LESS_EQUAL:v1,v2> + ``1`` if ``v1`` is a version less than or equal to ``v2``, else ``0``. -``$<VERSION_GREATER_EQUAL:v1,v2>`` - ``1`` if ``v1`` is a version greater than or equal to ``v2``, else ``0``. +.. genex:: $<VERSION_GREATER_EQUAL:v1,v2> + + ``1`` if ``v1`` is a version greater than or equal to ``v2``, else ``0``. Variable Queries ---------------- -``$<TARGET_EXISTS:target>`` +.. genex:: $<TARGET_EXISTS:target> + ``1`` if ``target`` exists, else ``0``. -``$<CONFIG:cfgs>`` + +.. genex:: $<CONFIG:cfgs> + ``1`` if config is any one of the entries in ``cfgs``, else ``0``. This is a case-insensitive comparison. The mapping in :prop_tgt:`MAP_IMPORTED_CONFIG_<CONFIG>` is also considered by this expression when it is evaluated on a property on an :prop_tgt:`IMPORTED` target. -``$<PLATFORM_ID:platform_ids>`` + +.. genex:: $<PLATFORM_ID:platform_ids> + where ``platform_ids`` is a comma-separated list. ``1`` if the CMake's platform id matches any one of the entries in ``platform_ids``, otherwise ``0``. See also the :variable:`CMAKE_SYSTEM_NAME` variable. -``$<C_COMPILER_ID:compiler_ids>`` + +.. genex:: $<C_COMPILER_ID:compiler_ids> + where ``compiler_ids`` is a comma-separated list. ``1`` if the CMake's compiler id of the C compiler matches any one of the entries in ``compiler_ids``, otherwise ``0``. See also the :variable:`CMAKE_<LANG>_COMPILER_ID` variable. -``$<CXX_COMPILER_ID:compiler_ids>`` + +.. genex:: $<CXX_COMPILER_ID:compiler_ids> + where ``compiler_ids`` is a comma-separated list. ``1`` if the CMake's compiler id of the CXX compiler matches any one of the entries in ``compiler_ids``, otherwise ``0``. See also the :variable:`CMAKE_<LANG>_COMPILER_ID` variable. -``$<CUDA_COMPILER_ID:compiler_ids>`` + +.. genex:: $<CUDA_COMPILER_ID:compiler_ids> + where ``compiler_ids`` is a comma-separated list. ``1`` if the CMake's compiler id of the CUDA compiler matches any one of the entries in ``compiler_ids``, otherwise ``0``. See also the :variable:`CMAKE_<LANG>_COMPILER_ID` variable. -``$<OBJC_COMPILER_ID:compiler_ids>`` + +.. genex:: $<OBJC_COMPILER_ID:compiler_ids> + where ``compiler_ids`` is a comma-separated list. ``1`` if the CMake's compiler id of the Objective-C compiler matches any one of the entries in ``compiler_ids``, otherwise ``0``. See also the :variable:`CMAKE_<LANG>_COMPILER_ID` variable. -``$<OBJCXX_COMPILER_ID:compiler_ids>`` + +.. genex:: $<OBJCXX_COMPILER_ID:compiler_ids> + where ``compiler_ids`` is a comma-separated list. ``1`` if the CMake's compiler id of the Objective-C++ compiler matches any one of the entries in ``compiler_ids``, otherwise ``0``. See also the :variable:`CMAKE_<LANG>_COMPILER_ID` variable. -``$<Fortran_COMPILER_ID:compiler_ids>`` + +.. genex:: $<Fortran_COMPILER_ID:compiler_ids> + where ``compiler_ids`` is a comma-separated list. ``1`` if the CMake's compiler id of the Fortran compiler matches any one of the entries in ``compiler_ids``, otherwise ``0``. See also the :variable:`CMAKE_<LANG>_COMPILER_ID` variable. -``$<ISPC_COMPILER_ID:compiler_ids>`` + +.. genex:: $<ISPC_COMPILER_ID:compiler_ids> + where ``compiler_ids`` is a comma-separated list. ``1`` if the CMake's compiler id of the ISPC compiler matches any one of the entries in ``compiler_ids``, otherwise ``0``. See also the :variable:`CMAKE_<LANG>_COMPILER_ID` variable. -``$<C_COMPILER_VERSION:version>`` + +.. genex:: $<C_COMPILER_VERSION:version> + ``1`` if the version of the C compiler matches ``version``, otherwise ``0``. See also the :variable:`CMAKE_<LANG>_COMPILER_VERSION` variable. -``$<CXX_COMPILER_VERSION:version>`` + +.. genex:: $<CXX_COMPILER_VERSION:version> + ``1`` if the version of the CXX compiler matches ``version``, otherwise ``0``. See also the :variable:`CMAKE_<LANG>_COMPILER_VERSION` variable. -``$<CUDA_COMPILER_VERSION:version>`` + +.. genex:: $<CUDA_COMPILER_VERSION:version> + ``1`` if the version of the CXX compiler matches ``version``, otherwise ``0``. See also the :variable:`CMAKE_<LANG>_COMPILER_VERSION` variable. -``$<OBJC_COMPILER_VERSION:version>`` + +.. genex:: $<OBJC_COMPILER_VERSION:version> + ``1`` if the version of the OBJC compiler matches ``version``, otherwise ``0``. See also the :variable:`CMAKE_<LANG>_COMPILER_VERSION` variable. -``$<OBJCXX_COMPILER_VERSION:version>`` + +.. genex:: $<OBJCXX_COMPILER_VERSION:version> + ``1`` if the version of the OBJCXX compiler matches ``version``, otherwise ``0``. See also the :variable:`CMAKE_<LANG>_COMPILER_VERSION` variable. -``$<Fortran_COMPILER_VERSION:version>`` + +.. genex:: $<Fortran_COMPILER_VERSION:version> + ``1`` if the version of the Fortran compiler matches ``version``, otherwise ``0``. See also the :variable:`CMAKE_<LANG>_COMPILER_VERSION` variable. -``$<ISPC_COMPILER_VERSION:version>`` + +.. genex:: $<ISPC_COMPILER_VERSION:version> + ``1`` if the version of the ISPC compiler matches ``version``, otherwise ``0``. See also the :variable:`CMAKE_<LANG>_COMPILER_VERSION` variable. -``$<TARGET_POLICY:policy>`` + +.. genex:: $<TARGET_POLICY:policy> + ``1`` if the ``policy`` was NEW when the 'head' target was created, else ``0``. If the ``policy`` was not set, the warning message for the policy will be emitted. This generator expression only works for a subset of policies. -``$<COMPILE_FEATURES:features>`` + +.. genex:: $<COMPILE_FEATURES:features> + where ``features`` is a comma-spearated list. Evaluates to ``1`` if all of the ``features`` are available for the 'head' target, and ``0`` otherwise. If this expression is used while evaluating @@ -189,7 +243,8 @@ Variable Queries .. _`Boolean COMPILE_LANGUAGE Generator Expression`: -``$<COMPILE_LANG_AND_ID:language,compiler_ids>`` +.. genex:: $<COMPILE_LANG_AND_ID:language,compiler_ids> + ``1`` when the language used for compilation unit matches ``language`` and the CMake's compiler id of the language compiler matches any one of the entries in ``compiler_ids``, otherwise ``0``. This expression is a short form @@ -225,7 +280,8 @@ Variable Queries $<$<AND:$<COMPILE_LANGUAGE:C>,$<C_COMPILER_ID:Clang>>:COMPILING_C_WITH_CLANG> ) -``$<COMPILE_LANGUAGE:languages>`` +.. genex:: $<COMPILE_LANGUAGE:languages> + ``1`` when the language used for compilation unit matches any of the entries in ``languages``, otherwise ``0``. This expression may be used to specify compile options, compile definitions, and include directories for source files of a @@ -270,7 +326,8 @@ Variable Queries .. _`Boolean LINK_LANGUAGE Generator Expression`: -``$<LINK_LANG_AND_ID:language,compiler_ids>`` +.. genex:: $<LINK_LANG_AND_ID:language,compiler_ids> + ``1`` when the language used for link step matches ``language`` and the CMake's compiler id of the language linker matches any one of the entries in ``compiler_ids``, otherwise ``0``. This expression is a short form for the @@ -309,7 +366,8 @@ Variable Queries ``$<LINK_LANGUAGE:language>`` for constraints about the usage of this generator expression. -``$<LINK_LANGUAGE:languages>`` +.. genex:: $<LINK_LANGUAGE:languages> + ``1`` when the language used for link step matches any of the entries in ``languages``, otherwise ``0``. This expression may be used to specify link libraries, link options, link directories and link dependencies of a @@ -371,14 +429,16 @@ Variable Queries evaluation will give ``C`` as link language, so the second pass will correctly add target ``libother`` as link dependency. -``$<DEVICE_LINK:list>`` +.. genex:: $<DEVICE_LINK:list> + Returns the list if it is the device link step, an empty list otherwise. The device link step is controlled by :prop_tgt:`CUDA_SEPARABLE_COMPILATION` and :prop_tgt:`CUDA_RESOLVE_DEVICE_SYMBOLS` properties and policy :policy:`CMP0105`. This expression can only be used to specify link options. -``$<HOST_LINK:list>`` +.. genex:: $<HOST_LINK:list> + Returns the list if it is the normal link step, an empty list otherwise. This expression is mainly useful when a device link step is also involved (see ``$<DEVICE_LINK:list>`` generator expression). This expression can only @@ -434,11 +494,16 @@ Escaped Characters String literals to escape the special meaning a character would otherwise have: -``$<ANGLE-R>`` +.. genex:: $<ANGLE-R> + A literal ``>``. Used for example to compare strings that contain a ``>``. -``$<COMMA>`` + +.. genex:: $<COMMA> + A literal ``,``. Used for example to compare strings which contain a ``,``. -``$<SEMICOLON>`` + +.. genex:: $<SEMICOLON> + A literal ``;``. Used to prevent list expansion on an argument with ``;``. .. _`Conditional Generator Expressions`: @@ -449,11 +514,13 @@ Conditional Expressions Conditional generator expressions depend on a boolean condition that must be ``0`` or ``1``. -``$<condition:true_string>`` +.. genex:: $<condition:true_string> + Evaluates to ``true_string`` if ``condition`` is ``1``. Otherwise evaluates to the empty string. -``$<IF:condition,true_string,false_string>`` +.. genex:: $<IF:condition,true_string,false_string> + Evaluates to ``true_string`` if ``condition`` is ``1``. Otherwise evaluates to ``false_string``. @@ -472,22 +539,34 @@ otherwise expands to the empty string. String Transformations ---------------------- -``$<JOIN:list,string>`` +.. genex:: $<JOIN:list,string> + Joins the list with the content of ``string``. -``$<REMOVE_DUPLICATES:list>`` + +.. genex:: $<REMOVE_DUPLICATES:list> + Removes duplicated items in the given ``list``. -``$<FILTER:list,INCLUDE|EXCLUDE,regex>`` + +.. genex:: $<FILTER:list,INCLUDE|EXCLUDE,regex> + Includes or removes items from ``list`` that match the regular expression ``regex``. -``$<LOWER_CASE:string>`` + +.. genex:: $<LOWER_CASE:string> + Content of ``string`` converted to lower case. -``$<UPPER_CASE:string>`` + +.. genex:: $<UPPER_CASE:string> + Content of ``string`` converted to upper case. -``$<GENEX_EVAL:expr>`` +.. genex:: $<GENEX_EVAL:expr> + Content of ``expr`` evaluated as a generator expression in the current context. This enables consumption of generator expressions whose evaluation results itself in generator expressions. -``$<TARGET_GENEX_EVAL:tgt,expr>`` + +.. genex:: $<TARGET_GENEX_EVAL:tgt,expr> + Content of ``expr`` evaluated as a generator expression in the context of ``tgt`` target. This enables consumption of custom target properties that themselves contain generator expressions. @@ -526,62 +605,99 @@ String Transformations Variable Queries ---------------- -``$<CONFIG>`` +.. genex:: $<CONFIG> + Configuration name. -``$<CONFIGURATION>`` + +.. genex:: $<CONFIGURATION> + Configuration name. Deprecated since CMake 3.0. Use ``CONFIG`` instead. -``$<PLATFORM_ID>`` + +.. genex:: $<PLATFORM_ID> + The current system's CMake platform id. See also the :variable:`CMAKE_SYSTEM_NAME` variable. -``$<C_COMPILER_ID>`` + +.. genex:: $<C_COMPILER_ID> + The CMake's compiler id of the C compiler used. See also the :variable:`CMAKE_<LANG>_COMPILER_ID` variable. -``$<CXX_COMPILER_ID>`` + +.. genex:: $<CXX_COMPILER_ID> + The CMake's compiler id of the CXX compiler used. See also the :variable:`CMAKE_<LANG>_COMPILER_ID` variable. -``$<CUDA_COMPILER_ID>`` + +.. genex:: $<CUDA_COMPILER_ID> + The CMake's compiler id of the CUDA compiler used. See also the :variable:`CMAKE_<LANG>_COMPILER_ID` variable. -``$<OBJC_COMPILER_ID>`` + +.. genex:: $<OBJC_COMPILER_ID> + The CMake's compiler id of the OBJC compiler used. See also the :variable:`CMAKE_<LANG>_COMPILER_ID` variable. -``$<OBJCXX_COMPILER_ID>`` + +.. genex:: $<OBJCXX_COMPILER_ID> + The CMake's compiler id of the OBJCXX compiler used. See also the :variable:`CMAKE_<LANG>_COMPILER_ID` variable. -``$<Fortran_COMPILER_ID>`` + +.. genex:: $<Fortran_COMPILER_ID> + The CMake's compiler id of the Fortran compiler used. See also the :variable:`CMAKE_<LANG>_COMPILER_ID` variable. -``$<ISPC_COMPILER_ID>`` + +.. genex:: $<ISPC_COMPILER_ID> + The CMake's compiler id of the ISPC compiler used. See also the :variable:`CMAKE_<LANG>_COMPILER_ID` variable. -``$<C_COMPILER_VERSION>`` + +.. genex:: $<C_COMPILER_VERSION> + The version of the C compiler used. See also the :variable:`CMAKE_<LANG>_COMPILER_VERSION` variable. -``$<CXX_COMPILER_VERSION>`` + +.. genex:: $<CXX_COMPILER_VERSION> + The version of the CXX compiler used. See also the :variable:`CMAKE_<LANG>_COMPILER_VERSION` variable. -``$<CUDA_COMPILER_VERSION>`` + +.. genex:: $<CUDA_COMPILER_VERSION> + The version of the CUDA compiler used. See also the :variable:`CMAKE_<LANG>_COMPILER_VERSION` variable. -``$<OBJC_COMPILER_VERSION>`` + +.. genex:: $<OBJC_COMPILER_VERSION> + The version of the OBJC compiler used. See also the :variable:`CMAKE_<LANG>_COMPILER_VERSION` variable. -``$<OBJCXX_COMPILER_VERSION>`` + +.. genex:: $<OBJCXX_COMPILER_VERSION> + The version of the OBJCXX compiler used. See also the :variable:`CMAKE_<LANG>_COMPILER_VERSION` variable. -``$<Fortran_COMPILER_VERSION>`` + +.. genex:: $<Fortran_COMPILER_VERSION> + The version of the Fortran compiler used. See also the :variable:`CMAKE_<LANG>_COMPILER_VERSION` variable. -``$<ISPC_COMPILER_VERSION>`` + +.. genex:: $<ISPC_COMPILER_VERSION> + The version of the ISPC compiler used. See also the :variable:`CMAKE_<LANG>_COMPILER_VERSION` variable. -``$<COMPILE_LANGUAGE>`` + +.. genex:: $<COMPILE_LANGUAGE> + The compile language of source files when evaluating compile options. See :ref:`the related boolean expression <Boolean COMPILE_LANGUAGE Generator Expression>` ``$<COMPILE_LANGUAGE:language>`` for notes about the portability of this generator expression. -``$<LINK_LANGUAGE>`` + +.. genex:: $<LINK_LANGUAGE> + The link language of target when evaluating link options. See :ref:`the related boolean expression <Boolean LINK_LANGUAGE Generator Expression>` ``$<LINK_LANGUAGE:language>`` @@ -608,14 +724,19 @@ In the following, "the ``tgt`` filename" means the name of the ``tgt`` binary file. This has to be distinguished from "the target name", which is just the string ``tgt``. -``$<TARGET_NAME_IF_EXISTS:tgt>`` +.. genex:: $<TARGET_NAME_IF_EXISTS:tgt> + The target name ``tgt`` if the target exists, an empty string otherwise. Note that ``tgt`` is not added as a dependency of the target this expression is evaluated on. -``$<TARGET_FILE:tgt>`` + +.. genex:: $<TARGET_FILE:tgt> + Full path to the ``tgt`` binary file. -``$<TARGET_FILE_BASE_NAME:tgt>`` + +.. genex:: $<TARGET_FILE_BASE_NAME:tgt> + Base name of ``tgt``, i.e. ``$<TARGET_FILE_NAME:tgt>`` without prefix and suffix. For example, if the ``tgt`` filename is ``libbase.so``, the base name is ``base``. @@ -632,36 +753,48 @@ which is just the string ``tgt``. Note that ``tgt`` is not added as a dependency of the target this expression is evaluated on. -``$<TARGET_FILE_PREFIX:tgt>`` + +.. genex:: $<TARGET_FILE_PREFIX:tgt> + Prefix of the ``tgt`` filename (such as ``lib``). See also the :prop_tgt:`PREFIX` target property. Note that ``tgt`` is not added as a dependency of the target this expression is evaluated on. -``$<TARGET_FILE_SUFFIX:tgt>`` + +.. genex:: $<TARGET_FILE_SUFFIX:tgt> + Suffix of the ``tgt`` filename (extension such as ``.so`` or ``.exe``). See also the :prop_tgt:`SUFFIX` target property. Note that ``tgt`` is not added as a dependency of the target this expression is evaluated on. -``$<TARGET_FILE_NAME:tgt>`` + +.. genex:: $<TARGET_FILE_NAME:tgt> + The ``tgt`` filename. Note that ``tgt`` is not added as a dependency of the target this expression is evaluated on (see policy :policy:`CMP0112`). -``$<TARGET_FILE_DIR:tgt>`` + +.. genex:: $<TARGET_FILE_DIR:tgt> + Directory of the ``tgt`` binary file. Note that ``tgt`` is not added as a dependency of the target this expression is evaluated on (see policy :policy:`CMP0112`). -``$<TARGET_LINKER_FILE:tgt>`` + +.. genex:: $<TARGET_LINKER_FILE:tgt> + File used when linking to the ``tgt`` target. This will usually be the library that ``tgt`` represents (``.a``, ``.lib``, ``.so``), but for a shared library on DLL platforms, it would be the ``.lib`` import library associated with the DLL. -``$<TARGET_LINKER_FILE_BASE_NAME:tgt>`` + +.. genex:: $<TARGET_LINKER_FILE_BASE_NAME:tgt> + Base name of file used to link the target ``tgt``, i.e. ``$<TARGET_LINKER_FILE_NAME:tgt>`` without prefix and suffix. For example, if target file name is ``libbase.a``, the base name is ``base``. @@ -677,7 +810,9 @@ which is just the string ``tgt``. Note that ``tgt`` is not added as a dependency of the target this expression is evaluated on. -``$<TARGET_LINKER_FILE_PREFIX:tgt>`` + +.. genex:: $<TARGET_LINKER_FILE_PREFIX:tgt> + Prefix of file used to link target ``tgt``. See also the :prop_tgt:`PREFIX` and :prop_tgt:`IMPORT_PREFIX` target @@ -685,7 +820,9 @@ which is just the string ``tgt``. Note that ``tgt`` is not added as a dependency of the target this expression is evaluated on. -``$<TARGET_LINKER_FILE_SUFFIX:tgt>`` + +.. genex:: $<TARGET_LINKER_FILE_SUFFIX:tgt> + Suffix of file used to link where ``tgt`` is the name of a target. The suffix corresponds to the file extension (such as ".so" or ".lib"). @@ -695,36 +832,49 @@ which is just the string ``tgt``. Note that ``tgt`` is not added as a dependency of the target this expression is evaluated on. -``$<TARGET_LINKER_FILE_NAME:tgt>`` + +.. genex:: $<TARGET_LINKER_FILE_NAME:tgt> + Name of file used to link target ``tgt``. Note that ``tgt`` is not added as a dependency of the target this expression is evaluated on (see policy :policy:`CMP0112`). -``$<TARGET_LINKER_FILE_DIR:tgt>`` + +.. genex:: $<TARGET_LINKER_FILE_DIR:tgt> + Directory of file used to link target ``tgt``. Note that ``tgt`` is not added as a dependency of the target this expression is evaluated on (see policy :policy:`CMP0112`). -``$<TARGET_SONAME_FILE:tgt>`` + +.. genex:: $<TARGET_SONAME_FILE:tgt> + File with soname (``.so.3``) where ``tgt`` is the name of a target. -``$<TARGET_SONAME_FILE_NAME:tgt>`` +.. genex:: $<TARGET_SONAME_FILE_NAME:tgt> + Name of file with soname (``.so.3``). Note that ``tgt`` is not added as a dependency of the target this expression is evaluated on (see policy :policy:`CMP0112`). -``$<TARGET_SONAME_FILE_DIR:tgt>`` + +.. genex:: $<TARGET_SONAME_FILE_DIR:tgt> + Directory of with soname (``.so.3``). Note that ``tgt`` is not added as a dependency of the target this expression is evaluated on (see policy :policy:`CMP0112`). -``$<TARGET_PDB_FILE:tgt>`` + +.. genex:: $<TARGET_PDB_FILE:tgt> + Full path to the linker generated program database file (.pdb) where ``tgt`` is the name of a target. See also the :prop_tgt:`PDB_NAME` and :prop_tgt:`PDB_OUTPUT_DIRECTORY` target properties and their configuration specific variants :prop_tgt:`PDB_NAME_<CONFIG>` and :prop_tgt:`PDB_OUTPUT_DIRECTORY_<CONFIG>`. -``$<TARGET_PDB_FILE_BASE_NAME:tgt>`` + +.. genex:: $<TARGET_PDB_FILE_BASE_NAME:tgt> + Base name of the linker generated program database file (.pdb) where ``tgt`` is the name of a target. @@ -740,23 +890,31 @@ which is just the string ``tgt``. Note that ``tgt`` is not added as a dependency of the target this expression is evaluated on. -``$<TARGET_PDB_FILE_NAME:tgt>`` + +.. genex:: $<TARGET_PDB_FILE_NAME:tgt> + Name of the linker generated program database file (.pdb). Note that ``tgt`` is not added as a dependency of the target this expression is evaluated on (see policy :policy:`CMP0112`). -``$<TARGET_PDB_FILE_DIR:tgt>`` + +.. genex:: $<TARGET_PDB_FILE_DIR:tgt> + Directory of the linker generated program database file (.pdb). Note that ``tgt`` is not added as a dependency of the target this expression is evaluated on (see policy :policy:`CMP0112`). -``$<TARGET_BUNDLE_DIR:tgt>`` + +.. genex:: $<TARGET_BUNDLE_DIR:tgt> + Full path to the bundle directory (``my.app``, ``my.framework``, or ``my.bundle``) where ``tgt`` is the name of a target. Note that ``tgt`` is not added as a dependency of the target this expression is evaluated on (see policy :policy:`CMP0112`). -``$<TARGET_BUNDLE_CONTENT_DIR:tgt>`` + +.. genex:: $<TARGET_BUNDLE_CONTENT_DIR:tgt> + Full path to the bundle content directory where ``tgt`` is the name of a target. For the macOS SDK it leads to ``my.app/Contents``, ``my.framework``, or ``my.bundle/Contents``. For all other SDKs (e.g. iOS) it leads to @@ -765,17 +923,23 @@ which is just the string ``tgt``. Note that ``tgt`` is not added as a dependency of the target this expression is evaluated on (see policy :policy:`CMP0112`). -``$<TARGET_PROPERTY:tgt,prop>`` + +.. genex:: $<TARGET_PROPERTY:tgt,prop> + Value of the property ``prop`` on the target ``tgt``. Note that ``tgt`` is not added as a dependency of the target this expression is evaluated on. -``$<TARGET_PROPERTY:prop>`` + +.. genex:: $<TARGET_PROPERTY:prop> + Value of the property ``prop`` on the target for which the expression is being evaluated. Note that for generator expressions in :ref:`Target Usage Requirements` this is the consuming target rather than the target specifying the requirement. -``$<INSTALL_PREFIX>`` + +.. genex:: $<INSTALL_PREFIX> + Content of the install prefix when the target is exported via :command:`install(EXPORT)`, or when evaluated in :prop_tgt:`INSTALL_NAME_DIR`, and empty otherwise. @@ -783,30 +947,43 @@ which is just the string ``tgt``. Output-Related Expressions -------------------------- -``$<TARGET_NAME:...>`` +.. genex:: $<TARGET_NAME:...> + Marks ``...`` as being the name of a target. This is required if exporting targets to multiple dependent export sets. The ``...`` must be a literal name of a target- it may not contain generator expressions. -``$<LINK_ONLY:...>`` + +.. genex:: $<LINK_ONLY:...> + Content of ``...`` except when evaluated in a link interface while propagating :ref:`Target Usage Requirements`, in which case it is the empty string. Intended for use only in an :prop_tgt:`INTERFACE_LINK_LIBRARIES` target property, perhaps via the :command:`target_link_libraries` command, to specify private link dependencies without other usage requirements. -``$<INSTALL_INTERFACE:...>`` + +.. genex:: $<INSTALL_INTERFACE:...> + Content of ``...`` when the property is exported using :command:`install(EXPORT)`, and empty otherwise. -``$<BUILD_INTERFACE:...>`` + +.. genex:: $<BUILD_INTERFACE:...> + Content of ``...`` when the property is exported using :command:`export`, or when the target is used by another target in the same buildsystem. Expands to the empty string otherwise. -``$<MAKE_C_IDENTIFIER:...>`` + +.. genex:: $<MAKE_C_IDENTIFIER:...> + Content of ``...`` converted to a C identifier. The conversion follows the same behavior as :command:`string(MAKE_C_IDENTIFIER)`. -``$<TARGET_OBJECTS:objLib>`` + +.. genex:: $<TARGET_OBJECTS:objLib> + List of objects resulting from build of ``objLib``. -``$<SHELL_PATH:...>`` + +.. genex:: $<SHELL_PATH:...> + Content of ``...`` converted to shell path style. For example, slashes are converted to backslashes in Windows shells and drive letters are converted to posix paths in MSYS shells. The ``...`` must be an absolute path. @@ -816,7 +993,8 @@ Output-Related Expressions ``;`` on Windows). Be sure to enclose the argument containing this genex in double quotes in CMake source code so that ``;`` does not split arguments. -``$<OUTPUT_CONFIG:...>`` +.. genex:: $<OUTPUT_CONFIG:...> + .. versionadded:: 3.20 Only valid in :command:`add_custom_command` and :command:`add_custom_target` @@ -825,7 +1003,8 @@ Output-Related Expressions in ``...`` are evaluated using the custom command's "output config". With other generators, the content of ``...`` is evaluated normally. -``$<COMMAND_CONFIG:...>`` +.. genex:: $<COMMAND_CONFIG:...> + .. versionadded:: 3.20 Only valid in :command:`add_custom_command` and :command:`add_custom_target` diff --git a/Help/prop_tgt/XCODE_ATTRIBUTE_an-attribute.rst b/Help/prop_tgt/XCODE_ATTRIBUTE_an-attribute.rst index 71858c5..fbe7608 100644 --- a/Help/prop_tgt/XCODE_ATTRIBUTE_an-attribute.rst +++ b/Help/prop_tgt/XCODE_ATTRIBUTE_an-attribute.rst @@ -3,9 +3,15 @@ XCODE_ATTRIBUTE_<an-attribute> Set Xcode target attributes directly. -Tell the :generator:`Xcode` generator to set '<an-attribute>' to a given +Tell the :generator:`Xcode` generator to set ``<an-attribute>`` to a given value in the generated Xcode project. Ignored on other generators. +This offers low-level control over the generated Xcode project file. +It is meant as a last resort for specifying settings that CMake does +not otherwise have a way to control. Although this can override a +setting CMake normally produces on its own, doing so bypasses CMake's +model of the project and can break things. + See the :variable:`CMAKE_XCODE_ATTRIBUTE_<an-attribute>` variable to set attributes on all targets in a directory tree. diff --git a/Help/release/3.19.rst b/Help/release/3.19.rst index 7ad27c8..d819e8c 100644 --- a/Help/release/3.19.rst +++ b/Help/release/3.19.rst @@ -400,3 +400,11 @@ Changes made since CMake 3.19.0 include the following. * The naming pattern ``cmake-$ver-macos10.10-universal`` is a universal binary with ``x86_64`` and ``arm64`` architectures. It requires macOS 10.10 or newer. + +3.19.4 +------ + +* The :variable:`CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION_MAXIMUM` + variable introduced in 3.19.0 previously worked only with the + :generator:`Visual Studio 14 2015` generator. It has now been fixed to + work with :ref:`Visual Studio Generators` for later VS versions too. diff --git a/Help/release/dev/UseSWIG-dependencies.rst b/Help/release/dev/UseSWIG-dependencies.rst new file mode 100644 index 0000000..805ac8a --- /dev/null +++ b/Help/release/dev/UseSWIG-dependencies.rst @@ -0,0 +1,6 @@ +UseSWIG-dependencies +-------------------- + +* :module:`UseSWIG` module gained the capability, for + :ref:`Makefile <Makefile Generators>` and :ref:`Ninja <Ninja Generators>` + generators, to use ``swig`` tool to generate implicit dependencies. diff --git a/Help/variable/CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION_MAXIMUM.rst b/Help/variable/CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION_MAXIMUM.rst index 591ea91..d9f136c 100644 --- a/Help/variable/CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION_MAXIMUM.rst +++ b/Help/variable/CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION_MAXIMUM.rst @@ -3,7 +3,7 @@ CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION_MAXIMUM .. versionadded:: 3.19 -Override the :ref:`Windows 10 SDK Maximum Version for VS 2015`. +Override the :ref:`Windows 10 SDK Maximum Version for VS 2015` and beyond. The :variable:`CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION_MAXIMUM` variable may be set to a false value (e.g. ``OFF``, ``FALSE``, or ``0``) or the SDK version diff --git a/Help/variable/CMAKE_XCODE_ATTRIBUTE_an-attribute.rst b/Help/variable/CMAKE_XCODE_ATTRIBUTE_an-attribute.rst index 90e4c0e..ffa0a4c 100644 --- a/Help/variable/CMAKE_XCODE_ATTRIBUTE_an-attribute.rst +++ b/Help/variable/CMAKE_XCODE_ATTRIBUTE_an-attribute.rst @@ -5,8 +5,14 @@ CMAKE_XCODE_ATTRIBUTE_<an-attribute> Set Xcode target attributes directly. -Tell the :generator:`Xcode` generator to set '<an-attribute>' to a given value -in the generated Xcode project. Ignored on other generators. +Tell the :generator:`Xcode` generator to set ``<an-attribute>`` to a given +value in the generated Xcode project. Ignored on other generators. + +This offers low-level control over the generated Xcode project file. +It is meant as a last resort for specifying settings that CMake does +not otherwise have a way to control. Although this can override a +setting CMake normally produces on its own, doing so bypasses CMake's +model of the project and can break things. See the :prop_tgt:`XCODE_ATTRIBUTE_<an-attribute>` target property to set attributes on a specific target. diff --git a/Modules/CMakePlatformId.h.in b/Modules/CMakePlatformId.h.in index 0b81c88..c0cab71 100644 --- a/Modules/CMakePlatformId.h.in +++ b/Modules/CMakePlatformId.h.in @@ -116,6 +116,9 @@ # if defined(_M_IA64) # define ARCHITECTURE_ID "IA64" +# elif defined(_M_ARM64EC) +# define ARCHITECTURE_ID "ARM64EC" + # elif defined(_M_X64) || defined(_M_AMD64) # define ARCHITECTURE_ID "x64" diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake index bb3684a..29cfba9 100644 --- a/Modules/ExternalProject.cmake +++ b/Modules/ExternalProject.cmake @@ -2633,10 +2633,13 @@ function(_ep_add_download_command name) --non-interactive ${svn_trust_cert_args} ${svn_user_pw_args} ${src_name}) list(APPEND depends ${stamp_dir}/${name}-svninfo.txt) elseif(git_repository) - unset(CMAKE_MODULE_PATH) # Use CMake builtin find module - find_package(Git QUIET) - if(NOT GIT_EXECUTABLE) - message(FATAL_ERROR "error: could not find git for clone of ${name}") + # FetchContent gives us these directly, so don't try to recompute them + if(NOT GIT_EXECUTABLE OR NOT GIT_VERSION_STRING) + unset(CMAKE_MODULE_PATH) # Use CMake builtin find module + find_package(Git QUIET) + if(NOT GIT_EXECUTABLE) + message(FATAL_ERROR "error: could not find git for clone of ${name}") + endif() endif() _ep_get_git_submodules_recurse(git_submodules_recurse) @@ -2954,10 +2957,13 @@ function(_ep_add_update_command name) --non-interactive ${svn_trust_cert_args} ${svn_user_pw_args}) set(always 1) elseif(git_repository) - unset(CMAKE_MODULE_PATH) # Use CMake builtin find module - find_package(Git QUIET) - if(NOT GIT_EXECUTABLE) - message(FATAL_ERROR "error: could not find git for fetch of ${name}") + # FetchContent gives us these directly, so don't try to recompute them + if(NOT GIT_EXECUTABLE OR NOT GIT_VERSION_STRING) + unset(CMAKE_MODULE_PATH) # Use CMake builtin find module + find_package(Git QUIET) + if(NOT GIT_EXECUTABLE) + message(FATAL_ERROR "error: could not find git for fetch of ${name}") + endif() endif() set(work_dir ${source_dir}) set(comment "Performing update step for '${name}'") diff --git a/Modules/FetchContent.cmake b/Modules/FetchContent.cmake index ba2acfc..8adef47 100644 --- a/Modules/FetchContent.cmake +++ b/Modules/FetchContent.cmake @@ -964,6 +964,22 @@ ExternalProject_Add_Step(${contentName}-populate copyfile "-DCMAKE_EP_GIT_REMOTE_UPDATE_STRATEGY=${CMAKE_EP_GIT_REMOTE_UPDATE_STRATEGY}") endif() + # Avoid using if(... IN_LIST ...) so we don't have to alter policy settings + set(__FETCHCONTENT_CACHED_INFO "") + list(FIND ARG_UNPARSED_ARGUMENTS GIT_REPOSITORY indexResult) + if(indexResult GREATER_EQUAL 0) + find_package(Git QUIET) + set(__FETCHCONTENT_CACHED_INFO +"# Pass through things we've already detected in the main project to avoid +# paying the cost of redetecting them again in ExternalProject_Add() +set(GIT_EXECUTABLE [==[${GIT_EXECUTABLE}]==]) +set(GIT_VERSION_STRING [==[${GIT_VERSION_STRING}]==]) +set_property(GLOBAL PROPERTY _CMAKE_FindGit_GIT_EXECUTABLE_VERSION + [==[${GIT_EXECUTABLE};${GIT_VERSION_STRING}]==] +) +") + endif() + # Create and build a separate CMake project to carry out the population. # If we've already previously done these steps, they will not cause # anything to be updated, so extra rebuilds of the project won't occur. diff --git a/Modules/FetchContent/CMakeLists.cmake.in b/Modules/FetchContent/CMakeLists.cmake.in index 45e4df0..5ebb12f 100644 --- a/Modules/FetchContent/CMakeLists.cmake.in +++ b/Modules/FetchContent/CMakeLists.cmake.in @@ -9,6 +9,8 @@ cmake_minimum_required(VERSION ${CMAKE_VERSION}) project(${contentName}-populate NONE) +@__FETCHCONTENT_CACHED_INFO@ + include(ExternalProject) ExternalProject_Add(${contentName}-populate ${ARG_EXTRA} diff --git a/Modules/FindCUDA/select_compute_arch.cmake b/Modules/FindCUDA/select_compute_arch.cmake index 9351288..a35b3f8 100644 --- a/Modules/FindCUDA/select_compute_arch.cmake +++ b/Modules/FindCUDA/select_compute_arch.cmake @@ -25,44 +25,26 @@ if(CMAKE_CUDA_COMPILER_LOADED) # CUDA as a language endif() # See: https://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html#gpu-feature-list +# Additions, deprecations, and removals can be found in the release notes: +# https://developer.nvidia.com/cuda-toolkit-archive -# This list will be used for CUDA_ARCH_NAME = All option -set(CUDA_KNOWN_GPU_ARCHITECTURES "Fermi" "Kepler" "Maxwell") +# The initial status here is for CUDA 7.0 +set(CUDA_KNOWN_GPU_ARCHITECTURES "Fermi" "Kepler" "Maxwell" "Kepler+Tegra" "Kepler+Tesla" "Maxwell+Tegra") +set(CUDA_COMMON_GPU_ARCHITECTURES "2.0" "2.1" "3.0" "3.5" "5.0" "5.3") +set(CUDA_LIMIT_GPU_ARCHITECTURE "6.0") +set(CUDA_ALL_GPU_ARCHITECTURES "2.0" "2.1" "3.0" "3.2" "3.5" "3.7" "5.0" "5.2" "5.3") +set(_CUDA_MAX_COMMON_ARCHITECTURE "5.2+PTX") -# This list will be used for CUDA_ARCH_NAME = Common option (enabled by default) -set(CUDA_COMMON_GPU_ARCHITECTURES "3.5" "5.0") -# 3.0 is removed in CUDA 11, see: -# https://docs.nvidia.com/cuda/cuda-toolkit-release-notes/index.html#deprecated-features -if(CUDA_VERSION VERSION_LESS "11.0") - list(APPEND CUDA_COMMON_GPU_ARCHITECTURES "3.0") -endif() - -if(CUDA_VERSION VERSION_LESS "7.0") - set(CUDA_LIMIT_GPU_ARCHITECTURE "5.2") -endif() - -# This list is used to filter CUDA archs when autodetecting -set(CUDA_ALL_GPU_ARCHITECTURES "3.0" "3.2" "3.5" "5.0") - -if(CUDA_VERSION VERSION_GREATER_EQUAL "7.0") - list(APPEND CUDA_KNOWN_GPU_ARCHITECTURES "Kepler+Tegra" "Kepler+Tesla" "Maxwell+Tegra") - list(APPEND CUDA_COMMON_GPU_ARCHITECTURES "5.2") - - if(CUDA_VERSION VERSION_LESS "8.0") - list(APPEND CUDA_COMMON_GPU_ARCHITECTURES "5.2+PTX") - set(CUDA_LIMIT_GPU_ARCHITECTURE "6.0") - endif() -endif() if(CUDA_VERSION VERSION_GREATER_EQUAL "8.0") list(APPEND CUDA_KNOWN_GPU_ARCHITECTURES "Pascal") list(APPEND CUDA_COMMON_GPU_ARCHITECTURES "6.0" "6.1") list(APPEND CUDA_ALL_GPU_ARCHITECTURES "6.0" "6.1" "6.2") - if(CUDA_VERSION VERSION_LESS "9.0") - list(APPEND CUDA_COMMON_GPU_ARCHITECTURES "6.2+PTX") - set(CUDA_LIMIT_GPU_ARCHITECTURE "7.0") - endif() + set(_CUDA_MAX_COMMON_ARCHITECTURE "6.2+PTX") + set(CUDA_LIMIT_GPU_ARCHITECTURE "7.0") + + list(REMOVE_ITEM CUDA_COMMON_GPU_ARCHITECTURES "2.0" "2.1") endif () if(CUDA_VERSION VERSION_GREATER_EQUAL "9.0") @@ -70,10 +52,11 @@ if(CUDA_VERSION VERSION_GREATER_EQUAL "9.0") list(APPEND CUDA_COMMON_GPU_ARCHITECTURES "7.0") list(APPEND CUDA_ALL_GPU_ARCHITECTURES "7.0" "7.2") - if(CUDA_VERSION VERSION_LESS "10.0") - list(APPEND CUDA_COMMON_GPU_ARCHITECTURES "7.2+PTX") - set(CUDA_LIMIT_GPU_ARCHITECTURE "8.0") - endif() + set(_CUDA_MAX_COMMON_ARCHITECTURE "7.2+PTX") + set(CUDA_LIMIT_GPU_ARCHITECTURE "8.0") + + list(REMOVE_ITEM CUDA_KNOWN_GPU_ARCHITECTURES "Fermi") + list(REMOVE_ITEM CUDA_ALL_GPU_ARCHITECTURES "2.0" "2.1") endif() if(CUDA_VERSION VERSION_GREATER_EQUAL "10.0") @@ -81,32 +64,46 @@ if(CUDA_VERSION VERSION_GREATER_EQUAL "10.0") list(APPEND CUDA_COMMON_GPU_ARCHITECTURES "7.5") list(APPEND CUDA_ALL_GPU_ARCHITECTURES "7.5") - if(CUDA_VERSION VERSION_LESS "11.0") - list(APPEND CUDA_COMMON_GPU_ARCHITECTURES "7.5+PTX") - set(CUDA_LIMIT_GPU_ARCHITECTURE "8.0") - endif() + set(_CUDA_MAX_COMMON_ARCHITECTURE "7.5+PTX") + set(CUDA_LIMIT_GPU_ARCHITECTURE "8.0") + + list(REMOVE_ITEM CUDA_COMMON_GPU_ARCHITECTURES "3.0") endif() +# https://docs.nvidia.com/cuda/archive/11.0/cuda-toolkit-release-notes/index.html#cuda-general-new-features +# https://docs.nvidia.com/cuda/archive/11.0/cuda-toolkit-release-notes/index.html#deprecated-features if(CUDA_VERSION VERSION_GREATER_EQUAL "11.0") list(APPEND CUDA_KNOWN_GPU_ARCHITECTURES "Ampere") list(APPEND CUDA_COMMON_GPU_ARCHITECTURES "8.0") list(APPEND CUDA_ALL_GPU_ARCHITECTURES "8.0") - if(CUDA_VERSION VERSION_LESS "11.1") - list(APPEND CUDA_COMMON_GPU_ARCHITECTURES "8.0+PTX") - set(CUDA_LIMIT_GPU_ARCHITECTURE "8.6") - endif() + set(_CUDA_MAX_COMMON_ARCHITECTURE "8.0+PTX") + set(CUDA_LIMIT_GPU_ARCHITECTURE "8.6") + + list(REMOVE_ITEM CUDA_COMMON_GPU_ARCHITECTURES "3.5" "5.0") + list(REMOVE_ITEM CUDA_ALL_GPU_ARCHITECTURES "3.0" "3.2") endif() if(CUDA_VERSION VERSION_GREATER_EQUAL "11.1") - list(APPEND CUDA_COMMON_GPU_ARCHITECTURES "8.6" "8.6+PTX") + list(APPEND CUDA_COMMON_GPU_ARCHITECTURES "8.6") list(APPEND CUDA_ALL_GPU_ARCHITECTURES "8.6") - if(CUDA_VERSION VERSION_LESS "12.0") - set(CUDA_LIMIT_GPU_ARCHITECTURE "9.0") - endif() + set(_CUDA_MAX_COMMON_ARCHITECTURE "8.6+PTX") + set(CUDA_LIMIT_GPU_ARCHITECTURE "9.0") endif() +list(APPEND CUDA_COMMON_GPU_ARCHITECTURES "${_CUDA_MAX_COMMON_ARCHITECTURE}") + +# Check with: cmake -DCUDA_VERSION=7.0 -P select_compute_arch.cmake +if(DEFINED CMAKE_SCRIPT_MODE_FILE) + include(CMakePrintHelpers) + cmake_print_variables(CUDA_KNOWN_GPU_ARCHITECTURES) + cmake_print_variables(CUDA_COMMON_GPU_ARCHITECTURES) + cmake_print_variables(CUDA_LIMIT_GPU_ARCHITECTURE) + cmake_print_variables(CUDA_ALL_GPU_ARCHITECTURES) +endif() + + ################################################################################################ # A function for automatic detection of GPUs installed (if autodetection is enabled) # Usage: diff --git a/Modules/FindGit.cmake b/Modules/FindGit.cmake index f8346b6..83da707 100644 --- a/Modules/FindGit.cmake +++ b/Modules/FindGit.cmake @@ -77,14 +77,44 @@ unset(git_names) unset(_git_sourcetree_path) if(GIT_EXECUTABLE) - execute_process(COMMAND ${GIT_EXECUTABLE} --version - OUTPUT_VARIABLE git_version - ERROR_QUIET - OUTPUT_STRIP_TRAILING_WHITESPACE) - if (git_version MATCHES "^git version [0-9]") - string(REPLACE "git version " "" GIT_VERSION_STRING "${git_version}") + # Avoid querying the version if we've already done that this run. For + # projects that use things like ExternalProject or FetchContent heavily, + # this saving can be measurable on some platforms. + set(__doGitVersionCheck YES) + if(DEFINED GIT_VERSION_STRING) + # This is an internal property, projects must not try to use it. + # We don't want this stored in the cache because it might still change + # between CMake runs, but it shouldn't change during a run. + get_property(__gitVersionProp GLOBAL + PROPERTY _CMAKE_FindGit_GIT_EXECUTABLE_VERSION + ) + if(__gitVersionProp) + list(GET __gitVersionProp 0 __gitExe) + list(GET __gitVersionProp 1 __gitVersion) + if("${__gitExe}" STREQUAL "${GIT_EXECUTABLE}" AND + "${__gitVersion}" STREQUAL "${GIT_VERSION_STRING}") + set(__doGitVersionCheck NO) + endif() + endif() + unset(__gitVersionProp) + unset(__gitExe) + unset(__gitVersion) + endif() + + if(__doGitVersionCheck) + execute_process(COMMAND ${GIT_EXECUTABLE} --version + OUTPUT_VARIABLE git_version + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE) + if (git_version MATCHES "^git version [0-9]") + string(REPLACE "git version " "" GIT_VERSION_STRING "${git_version}") + set_property(GLOBAL PROPERTY _CMAKE_FindGit_GIT_EXECUTABLE_VERSION + "${GIT_EXECUTABLE};${GIT_VERSION_STRING}" + ) + endif() + unset(git_version) endif() - unset(git_version) + unset(__doGitVersionCheck) get_property(_findgit_role GLOBAL PROPERTY CMAKE_ROLE) if(_findgit_role STREQUAL "PROJECT" AND NOT TARGET Git::Git) diff --git a/Modules/FindHDF5.cmake b/Modules/FindHDF5.cmake index a69a585..16bf279 100644 --- a/Modules/FindHDF5.cmake +++ b/Modules/FindHDF5.cmake @@ -361,9 +361,11 @@ function( _HDF5_invoke_compiler language output_var return_value_var version_var execute_process( COMMAND ${HDF5_${language}_COMPILER_EXECUTABLE} ${test_file} WORKING_DIRECTORY ${scratch_dir} + OUTPUT_VARIABLE output + ERROR_VARIABLE output RESULT_VARIABLE return_value ) - if(return_value) + if(return_value AND NOT HDF5_FIND_QUIETLY) message(STATUS "HDF5 ${language} compiler wrapper is unable to compile a minimal HDF5 program.") else() @@ -375,7 +377,7 @@ function( _HDF5_invoke_compiler language output_var return_value_var version_var RESULT_VARIABLE return_value OUTPUT_STRIP_TRAILING_WHITESPACE ) - if(return_value) + if(return_value AND NOT HDF5_FIND_QUIETLY) message(STATUS "Unable to determine HDF5 ${language} flags from HDF5 wrapper.") endif() @@ -386,7 +388,7 @@ function( _HDF5_invoke_compiler language output_var return_value_var version_var RESULT_VARIABLE return_value OUTPUT_STRIP_TRAILING_WHITESPACE ) - if(return_value) + if(return_value AND NOT HDF5_FIND_QUIETLY) message(STATUS "Unable to determine HDF5 ${language} version_var from HDF5 wrapper.") endif() diff --git a/Modules/GetPrerequisites.cmake b/Modules/GetPrerequisites.cmake index f325cfb..ed5c38b 100644 --- a/Modules/GetPrerequisites.cmake +++ b/Modules/GetPrerequisites.cmake @@ -736,7 +736,7 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa set(gp_regex_cmp_count 1) elseif(gp_tool MATCHES "otool$") set(gp_cmd_args "-L") - set(gp_regex "^\t([^\t]+) \\(compatibility version ([0-9]+.[0-9]+.[0-9]+), current version ([0-9]+.[0-9]+.[0-9]+)\\)${eol_char}$") + set(gp_regex "^\t([^\t]+) \\(compatibility version ([0-9]+.[0-9]+.[0-9]+), current version ([0-9]+.[0-9]+.[0-9]+)(, weak)?\\)${eol_char}$") set(gp_regex_error "") set(gp_regex_fallback "") set(gp_regex_cmp_count 3) diff --git a/Modules/Platform/Windows-MSVC.cmake b/Modules/Platform/Windows-MSVC.cmake index 08afd61..e384af4 100644 --- a/Modules/Platform/Windows-MSVC.cmake +++ b/Modules/Platform/Windows-MSVC.cmake @@ -154,7 +154,9 @@ set(CMAKE_BUILD_TYPE_INIT Debug) # Compute an architecture family from the architecture id. foreach(lang C CXX) set(_MSVC_${lang}_ARCHITECTURE_FAMILY "${MSVC_${lang}_ARCHITECTURE_ID}") - if(_MSVC_${lang}_ARCHITECTURE_FAMILY MATCHES "^ARM64") + if(_MSVC_${lang}_ARCHITECTURE_FAMILY MATCHES "^ARM64EC") + set(_MSVC_${lang}_ARCHITECTURE_FAMILY "ARM64EC") + elseif(_MSVC_${lang}_ARCHITECTURE_FAMILY MATCHES "^ARM64") set(_MSVC_${lang}_ARCHITECTURE_FAMILY "ARM64") elseif(_MSVC_${lang}_ARCHITECTURE_FAMILY MATCHES "^ARM") set(_MSVC_${lang}_ARCHITECTURE_FAMILY "ARM") @@ -224,7 +226,9 @@ elseif(WINDOWS_PHONE OR WINDOWS_STORE) endif() else() set(_PLATFORM_DEFINES "/DWIN32") - + if((_MSVC_C_ARCHITECTURE_FAMILY STREQUAL "ARM64EC") OR (_MSVC_CXX_ARCHITECTURE_FAMILY STREQUAL "ARM64EC")) + set(_PLATFORM_DEFINES "${_PLATFORM_DEFINES} /D_AMD64_ /DAMD64 /D_ARM64EC_ /DARM64EC /D_ARM64EC_WORKAROUND_") + endif() if(_MSVC_C_ARCHITECTURE_FAMILY STREQUAL "ARM" OR _MSVC_CXX_ARCHITECTURE_FAMILY STREQUAL "ARM") set(CMAKE_C_STANDARD_LIBRARIES_INIT "kernel32.lib user32.lib") elseif(MSVC_VERSION GREATER 1310) @@ -261,6 +265,8 @@ if(MSVC_C_ARCHITECTURE_ID) set(_MACHINE_ARCH_FLAG "/machine:THUMB") elseif(_MSVC_C_ARCHITECTURE_FAMILY STREQUAL "ARM64") set(_MACHINE_ARCH_FLAG "/machine:ARM64") + elseif(_MSVC_C_ARCHITECTURE_FAMILY STREQUAL "ARM64EC") + set(_MACHINE_ARCH_FLAG "/machine:ARM64EC") elseif(_MSVC_C_ARCHITECTURE_FAMILY STREQUAL "ARM") set(_MACHINE_ARCH_FLAG "/machine:ARM") else() @@ -271,6 +277,8 @@ elseif(MSVC_CXX_ARCHITECTURE_ID) set(_MACHINE_ARCH_FLAG "/machine:THUMB") elseif(_MSVC_CXX_ARCHITECTURE_FAMILY STREQUAL "ARM64") set(_MACHINE_ARCH_FLAG "/machine:ARM64") + elseif(_MSVC_CXX_ARCHITECTURE_FAMILY STREQUAL "ARM64EC") + set(_MACHINE_ARCH_FLAG "/machine:ARM64EC") elseif(_MSVC_CXX_ARCHITECTURE_FAMILY STREQUAL "ARM") set(_MACHINE_ARCH_FLAG "/machine:ARM") else() @@ -305,7 +313,11 @@ foreach(t EXE SHARED MODULE) string(APPEND CMAKE_${t}_LINKER_FLAGS_RELEASE_INIT " /INCREMENTAL:NO") endforeach() -string(APPEND CMAKE_STATIC_LINKER_FLAGS_INIT " ${_MACHINE_ARCH_FLAG}") +if((_MSVC_C_ARCHITECTURE_FAMILY STREQUAL "ARM64EC") OR (_MSVC_CXX_ARCHITECTURE_FAMILY STREQUAL "ARM64EC")) + string(APPEND CMAKE_STATIC_LINKER_FLAGS_INIT " /machine:ARM64X") +else() + string(APPEND CMAKE_STATIC_LINKER_FLAGS_INIT " ${_MACHINE_ARCH_FLAG}") +endif() unset(_MACHINE_ARCH_FLAG) cmake_policy(GET CMP0091 __WINDOWS_MSVC_CMP0091) diff --git a/Modules/UseSWIG.cmake b/Modules/UseSWIG.cmake index 9b0025a..7d7f737 100644 --- a/Modules/UseSWIG.cmake +++ b/Modules/UseSWIG.cmake @@ -48,11 +48,12 @@ Defines the following command for use with ``SWIG``: .. note:: - For Make-based generators, ``swig_add_library`` does not track file - dependencies, so depending on the ``<name>_swig_compilation`` custom target - is required for targets which require the ``swig``-generated files to - exist. Other generators may depend on the source files that would be - generated by SWIG. + For :ref:`Makefile Generators`, if, for some sources, the + ``USE_SWIG_DEPENDENCIES`` property is ``FALSE``, ``swig_add_library`` does + not track file dependencies, so depending on the ``<name>_swig_compilation`` + custom target is required for targets which require the ``swig``-generated + files to exist. Other generators may depend on the source files that would + be generated by SWIG. ``TYPE`` ``SHARED``, ``MODULE`` and ``STATIC`` have the same semantic as for the @@ -179,6 +180,14 @@ ensure generated files will receive the required settings. Specify additional dependencies to the source file. +``USE_SWIG_DEPENDENCIES`` + .. versionadded:: 3.20 + + If set to ``TRUE``, implicit dependencies are generated by the ``swig`` tool + itself. This property is only meaningful for + :ref:`Makefile <Makefile Generators>` and + :ref:`Ninja <Ninja Generators>` generators. Default value is ``FALSE``. + ``SWIG_MODULE_NAME`` Specify the actual import name of the module in the target language. This is required if it cannot be scanned automatically from source @@ -316,6 +325,17 @@ as well as ``SWIG``: .. code-block:: cmake set(SWIG_SOURCE_FILE_EXTENSIONS ".i" ".swg") + +``SWIG_USE_SWIG_DEPENDENCIES`` + .. versionadded:: 3.20 + + If set to ``TRUE``, implicit dependencies are generated by the ``swig`` tool + itself. This property is only meaningful for + :ref:`Makefile <Makefile Generators>` and + :ref:`Ninja <Ninja Generators>` generators. Default value is ``FALSE``. + + Source file property ``USE_SWIG_DEPENDENCIES``, if not defined, will be + initialized with the value of this variable. #]=======================================================================] cmake_policy(GET CMP0078 target_name_policy) @@ -486,6 +506,14 @@ function(SWIG_ADD_SOURCE_TO_MODULE name outfiles infile) set(target_name ${name}) endif() + set (use_swig_dependencies ${SWIG_USE_SWIG_DEPENDENCIES}) + if (CMAKE_GENERATOR MATCHES "Make|Ninja") + get_property(use_swig_dependencies_set SOURCE "${infile}" PROPERTY USE_SWIG_DEPENDENCIES SET) + if (use_swig_dependencies_set) + get_property(use_swig_dependencies SOURCE "${infile}" PROPERTY USE_SWIG_DEPENDENCIES) + endif() + endif() + set (swig_source_file_flags ${CMAKE_SWIG_FLAGS}) # handle various swig compile flags properties get_source_file_property (include_directories "${infile}" INCLUDE_DIRECTORIES) @@ -591,7 +619,7 @@ function(SWIG_ADD_SOURCE_TO_MODULE name outfiles infile) list (APPEND swig_extra_flags ${SWIG_MODULE_${name}_EXTRA_FLAGS}) # dependencies - set (swig_dependencies ${SWIG_MODULE_${name}_EXTRA_DEPS} $<TARGET_PROPERTY:${target_name},SWIG_DEPENDS>) + set (swig_dependencies DEPENDS ${SWIG_MODULE_${name}_EXTRA_DEPS} $<TARGET_PROPERTY:${target_name},SWIG_DEPENDS>) get_source_file_property(file_depends "${infile}" DEPENDS) if (file_depends) list (APPEND swig_dependencies ${file_depends}) @@ -609,10 +637,11 @@ function(SWIG_ADD_SOURCE_TO_MODULE name outfiles infile) unset (swig_copy_command) endif() - # IMPLICIT_DEPENDS below can not handle situations where a dependent file is - # removed. We need an extra step with timestamp and custom target, see #16830 - # As this is needed only for Makefile generator do it conditionally - if(CMAKE_GENERATOR MATCHES "Make") + set(swig_depends_flags) + if(NOT use_swig_dependencies AND CMAKE_GENERATOR MATCHES "Make") + # IMPLICIT_DEPENDS can not handle situations where a dependent file is + # removed. We need an extra step with timestamp and custom target, see #16830 + # As this is needed only for Makefile generator do it conditionally __swig_compute_timestamp(${name} ${SWIG_MODULE_${name}_LANGUAGE} "${infile}" "${workingdir}" swig_generated_timestamp) set(swig_custom_output "${swig_generated_timestamp}") @@ -620,11 +649,19 @@ function(SWIG_ADD_SOURCE_TO_MODULE name outfiles infile) BYPRODUCTS "${swig_generated_file_fullname}" ${swig_extra_generated_files}) set(swig_timestamp_command COMMAND ${CMAKE_COMMAND} -E touch "${swig_generated_timestamp}") + list(APPEND swig_dependencies IMPLICIT_DEPENDS CXX "${swig_source_file_fullname}") else() + set(swig_generated_timestamp) set(swig_custom_output "${swig_generated_file_fullname}" ${swig_extra_generated_files}) set(swig_custom_products) set(swig_timestamp_command) + if (use_swig_dependencies) + cmake_path(GET infile FILENAME swig_depends_filename) + set(swig_depends_filename "${workingdir}/${swig_depends_filename}.d") + list(APPEND swig_dependencies DEPFILE "${swig_depends_filename}") + set(swig_depends_flags -MF "${swig_depends_filename}" -MD) + endif() endif() add_custom_command( OUTPUT ${swig_custom_output} @@ -639,13 +676,13 @@ function(SWIG_ADD_SOURCE_TO_MODULE name outfiles infile) -outdir "${swig_file_outdir}" ${swig_special_flags} ${swig_extra_flags} + ${swig_depends_flags} "${swig_include_dirs}" -o "${swig_generated_file_fullname}" "${swig_source_file_fullname}" ${swig_copy_command} MAIN_DEPENDENCY "${swig_source_file_fullname}" - DEPENDS ${swig_dependencies} - IMPLICIT_DEPENDS CXX "${swig_source_file_fullname}" + ${swig_dependencies} COMMENT "Swig compile ${infile} for ${SWIG_MODULE_${name}_SWIG_LANGUAGE_FLAG}" COMMAND_EXPAND_LISTS) set_source_files_properties("${swig_generated_file_fullname}" ${swig_extra_generated_files} @@ -666,6 +703,7 @@ function(SWIG_ADD_SOURCE_TO_MODULE name outfiles infile) endif() set(${outfiles} "${swig_generated_file_fullname}" ${swig_extra_generated_files} PARENT_SCOPE) + set(swig_timestamp "${swig_generated_timestamp}" PARENT_SCOPE) # legacy support set (swig_generated_file_fullname "${swig_generated_file_fullname}" PARENT_SCOPE) @@ -794,6 +832,15 @@ function(SWIG_ADD_LIBRARY name) set(SWIG_SOURCE_FILE_EXTENSIONS ".i") endif() + if (CMAKE_GENERATOR MATCHES "Make|Ninja") + # For Makefiles and Ninja generators, use SWIG generated dependencies + if (NOT DEFINED SWIG_USE_SWIG_DEPENDENCIES) + set (SWIG_USE_SWIG_DEPENDENCIES OFF) + endif() + else() + set (SWIG_USE_SWIG_DEPENDENCIES OFF) + endif() + # Generate a regex out of file extensions. string(REGEX REPLACE "([$^.*+?|()-])" "\\\\\\1" swig_source_ext_regex "${SWIG_SOURCE_FILE_EXTENSIONS}") list (JOIN swig_source_ext_regex "|" swig_source_ext_regex) @@ -821,9 +868,7 @@ function(SWIG_ADD_LIBRARY name) foreach(swig_it IN LISTS swig_dot_i_sources) SWIG_ADD_SOURCE_TO_MODULE(${name} swig_generated_source "${swig_it}") list (APPEND swig_generated_sources "${swig_generated_source}") - if(CMAKE_GENERATOR MATCHES "Make") - __swig_compute_timestamp(${name} ${SWIG_MODULE_${name}_LANGUAGE} "${swig_it}" - "${workingdir}" swig_timestamp) + if(swig_timestamp) list (APPEND swig_generated_timestamps "${swig_timestamp}") endif() get_source_file_property(swig_source_file_outdir "${swig_it}" OUTPUT_DIR) @@ -842,7 +887,7 @@ function(SWIG_ADD_LIBRARY name) ${_SAM_TYPE} ${swig_generated_sources} ${swig_other_sources}) - if(CMAKE_GENERATOR MATCHES "Make") + if(swig_generated_timestamps) # see IMPLICIT_DEPENDS above add_custom_target(${name}_swig_compilation DEPENDS ${swig_generated_timestamps}) add_dependencies(${target_name} ${name}_swig_compilation) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index ce9ea6c..113a9d8 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,7 +1,7 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 19) -set(CMake_VERSION_PATCH 20210119) +set(CMake_VERSION_PATCH 20210125) #set(CMake_VERSION_RC 0) set(CMake_VERSION_IS_DIRTY 0) diff --git a/Source/Checks/cm_cxx_features.cmake b/Source/Checks/cm_cxx_features.cmake index 663d89a..7917d41 100644 --- a/Source/Checks/cm_cxx_features.cmake +++ b/Source/Checks/cm_cxx_features.cmake @@ -81,7 +81,13 @@ if(CMake_HAVE_CXX_MAKE_UNIQUE) endif() cm_check_cxx_feature(unique_ptr) if (NOT CMAKE_CXX_STANDARD LESS "17") - cm_check_cxx_feature(filesystem TRY_RUN) + if (NOT CMAKE_CROSSCOMPILING OR CMAKE_CROSSCOMPILING_EMULATOR) + cm_check_cxx_feature(filesystem TRY_RUN) + else() + # In cross-compiling mode, it is not possible to check implementation bugs + # so rely only on conformance done by compilation + cm_check_cxx_feature(filesystem) + endif() else() set(CMake_HAVE_CXX_FILESYSTEM FALSE) endif() diff --git a/Source/cmBinUtilsMacOSMachOOToolGetRuntimeDependenciesTool.cxx b/Source/cmBinUtilsMacOSMachOOToolGetRuntimeDependenciesTool.cxx index 351d92a..6d97720 100644 --- a/Source/cmBinUtilsMacOSMachOOToolGetRuntimeDependenciesTool.cxx +++ b/Source/cmBinUtilsMacOSMachOOToolGetRuntimeDependenciesTool.cxx @@ -44,7 +44,7 @@ bool cmBinUtilsMacOSMachOOToolGetRuntimeDependenciesTool::GetFileInfo( std::string line; static const cmsys::RegularExpression rpathRegex("^ *cmd LC_RPATH$"); static const cmsys::RegularExpression loadDylibRegex( - "^ *cmd LC_LOAD_DYLIB$"); + "^ *cmd LC_LOAD(_WEAK)?_DYLIB$"); static const cmsys::RegularExpression pathRegex( "^ *path (.*) \\(offset [0-9]+\\)$"); static const cmsys::RegularExpression nameRegex( diff --git a/Source/cmCustomCommandGenerator.cxx b/Source/cmCustomCommandGenerator.cxx index c67497a..4329caf 100644 --- a/Source/cmCustomCommandGenerator.cxx +++ b/Source/cmCustomCommandGenerator.cxx @@ -200,6 +200,7 @@ cmCustomCommandGenerator::cmCustomCommandGenerator( argv.push_back(cmSystemTools::GetCMakeCommand()); argv.emplace_back("-E"); argv.emplace_back("cmake_transform_depfile"); + argv.push_back(this->LG->GetGlobalGenerator()->GetName()); switch (*this->LG->GetGlobalGenerator()->DepfileFormat()) { case cmDepfileFormat::GccDepfile: argv.emplace_back("gccdepfile"); @@ -208,15 +209,10 @@ cmCustomCommandGenerator::cmCustomCommandGenerator( argv.emplace_back("vstlog"); break; } - if (this->LG->GetCurrentBinaryDirectory() == - this->LG->GetBinaryDirectory()) { - argv.emplace_back("./"); - } else { - argv.push_back(cmStrCat(this->LG->MaybeConvertToRelativePath( - this->LG->GetBinaryDirectory(), - this->LG->GetCurrentBinaryDirectory()), - '/')); - } + argv.push_back(this->LG->GetSourceDirectory()); + argv.push_back(this->LG->GetCurrentSourceDirectory()); + argv.push_back(this->LG->GetBinaryDirectory()); + argv.push_back(this->LG->GetCurrentBinaryDirectory()); argv.push_back(this->GetFullDepfile()); argv.push_back(this->GetInternalDepfile()); diff --git a/Source/cmDependsCompiler.cxx b/Source/cmDependsCompiler.cxx index ec31f68..2b48df9 100644 --- a/Source/cmDependsCompiler.cxx +++ b/Source/cmDependsCompiler.cxx @@ -97,17 +97,8 @@ bool cmDependsCompiler::CheckDependencies( std::vector<std::string> depends; if (format == "custom"_s) { - std::string prefix; - if (this->LocalGenerator->GetCurrentBinaryDirectory() != - this->LocalGenerator->GetBinaryDirectory()) { - prefix = - cmStrCat(this->LocalGenerator->MaybeConvertToRelativePath( - this->LocalGenerator->GetBinaryDirectory(), - this->LocalGenerator->GetCurrentBinaryDirectory()), - '/'); - } - - auto deps = cmReadGccDepfile(depFile.c_str(), prefix); + auto deps = cmReadGccDepfile( + depFile.c_str(), this->LocalGenerator->GetCurrentBinaryDirectory()); if (!deps) { continue; } diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx index 0b9b183..3c69c50 100644 --- a/Source/cmExportInstallFileGenerator.cxx +++ b/Source/cmExportInstallFileGenerator.cxx @@ -290,6 +290,7 @@ bool cmExportInstallFileGenerator::GenerateImportFileConfig( cmSystemTools::Error(e.str()); return false; } + exportFileStream.SetCopyIfDifferent(true); std::ostream& os = exportFileStream; // Start with the import file header. diff --git a/Source/cmGccDepfileReader.cxx b/Source/cmGccDepfileReader.cxx index 8253375..6436baa 100644 --- a/Source/cmGccDepfileReader.cxx +++ b/Source/cmGccDepfileReader.cxx @@ -24,7 +24,7 @@ cm::optional<cmGccDepfileContent> cmReadGccDepfile(const char* filePath, for (auto& dep : *deps) { for (auto& rule : dep.rules) { if (!prefix.empty() && !cmSystemTools::FileIsFullPath(rule)) { - rule = cmStrCat(prefix, rule); + rule = cmStrCat(prefix, '/', rule); } if (cmSystemTools::FileIsFullPath(rule)) { rule = cmSystemTools::CollapseFullPath(rule); @@ -33,7 +33,7 @@ cm::optional<cmGccDepfileContent> cmReadGccDepfile(const char* filePath, } for (auto& path : dep.paths) { if (!prefix.empty() && !cmSystemTools::FileIsFullPath(path)) { - path = cmStrCat(prefix, path); + path = cmStrCat(prefix, '/', path); } if (cmSystemTools::FileIsFullPath(path)) { path = cmSystemTools::CollapseFullPath(path); diff --git a/Source/cmGlobalVisualStudio14Generator.cxx b/Source/cmGlobalVisualStudio14Generator.cxx index e17c6d7..b46f1b9 100644 --- a/Source/cmGlobalVisualStudio14Generator.cxx +++ b/Source/cmGlobalVisualStudio14Generator.cxx @@ -253,6 +253,12 @@ std::string cmGlobalVisualStudio14Generator::GetWindows10SDKMaxVersion( // If value is an invalid pointer, leave result unchanged. } + return this->GetWindows10SDKMaxVersionDefault(mf); +} + +std::string cmGlobalVisualStudio14Generator::GetWindows10SDKMaxVersionDefault( + cmMakefile*) const +{ // The last Windows 10 SDK version that VS 2015 can target is 10.0.14393.0. // // "VS 2015 Users: The Windows 10 SDK (15063, 16299, 17134, 17763) is diff --git a/Source/cmGlobalVisualStudio14Generator.h b/Source/cmGlobalVisualStudio14Generator.h index 1ccd4c7..7804b83 100644 --- a/Source/cmGlobalVisualStudio14Generator.h +++ b/Source/cmGlobalVisualStudio14Generator.h @@ -40,9 +40,13 @@ protected: // of the toolset is installed bool IsWindowsStoreToolsetInstalled() const; + // Used to adjust the max-SDK-version calculation to accommodate user + // configuration. + std::string GetWindows10SDKMaxVersion(cmMakefile* mf) const; + // Used to make sure that the Windows 10 SDK selected can work with the // version of the toolset. - virtual std::string GetWindows10SDKMaxVersion(cmMakefile* mf) const; + virtual std::string GetWindows10SDKMaxVersionDefault(cmMakefile* mf) const; virtual bool SelectWindows10SDK(cmMakefile* mf, bool required); diff --git a/Source/cmGlobalVisualStudioVersionedGenerator.cxx b/Source/cmGlobalVisualStudioVersionedGenerator.cxx index 95357e7..e6c65bb 100644 --- a/Source/cmGlobalVisualStudioVersionedGenerator.cxx +++ b/Source/cmGlobalVisualStudioVersionedGenerator.cxx @@ -200,6 +200,7 @@ public: platforms.emplace_back("Win32"); platforms.emplace_back("ARM"); platforms.emplace_back("ARM64"); + platforms.emplace_back("ARM64EC"); return platforms; } @@ -540,7 +541,8 @@ bool cmGlobalVisualStudioVersionedGenerator::IsWin81SDKInstalled() const return false; } -std::string cmGlobalVisualStudioVersionedGenerator::GetWindows10SDKMaxVersion( +std::string +cmGlobalVisualStudioVersionedGenerator::GetWindows10SDKMaxVersionDefault( cmMakefile*) const { return std::string(); diff --git a/Source/cmGlobalVisualStudioVersionedGenerator.h b/Source/cmGlobalVisualStudioVersionedGenerator.h index af09cbd..46a5f40 100644 --- a/Source/cmGlobalVisualStudioVersionedGenerator.h +++ b/Source/cmGlobalVisualStudioVersionedGenerator.h @@ -56,7 +56,7 @@ protected: // Check for a Win 8 SDK known to the registry or VS installer tool. bool IsWin81SDKInstalled() const; - std::string GetWindows10SDKMaxVersion(cmMakefile*) const override; + std::string GetWindows10SDKMaxVersionDefault(cmMakefile*) const override; std::string FindMSBuildCommand() override; std::string FindDevEnvCommand() override; diff --git a/Source/cmRST.cxx b/Source/cmRST.cxx index 26e93bb..fce6e80 100644 --- a/Source/cmRST.cxx +++ b/Source/cmRST.cxx @@ -25,7 +25,7 @@ cmRST::cmRST(std::ostream& os, std::string docroot) , Markup(MarkupNone) , Directive(DirectiveNone) , CMakeDirective("^.. (cmake:)?(" - "command|variable" + "command|envvar|genex|variable" ")::[ \t]+([^ \t\n]+)$") , CMakeModuleDirective("^.. cmake-module::[ \t]+([^ \t\n]+)$") , ParsedLiteralDirective("^.. parsed-literal::[ \t]*(.*)$") @@ -37,7 +37,8 @@ cmRST::cmRST(std::ostream& os, std::string docroot) , NoteDirective("^.. note::[ \t]*(.*)$") , ModuleRST(R"(^#\[(=*)\[\.rst:$)") , CMakeRole("(:cmake)?:(" - "command|cpack_gen|generator|variable|envvar|module|policy|" + "command|cpack_gen|generator|genex|" + "variable|envvar|module|policy|" "prop_cache|prop_dir|prop_gbl|prop_inst|prop_sf|" "prop_test|prop_tgt|" "manual" diff --git a/Source/cmTransformDepfile.cxx b/Source/cmTransformDepfile.cxx index b91e1ce..78aa4b2 100644 --- a/Source/cmTransformDepfile.cxx +++ b/Source/cmTransformDepfile.cxx @@ -13,6 +13,7 @@ #include "cmGccDepfileReader.h" #include "cmGccDepfileReaderTypes.h" +#include "cmLocalGenerator.h" #include "cmSystemTools.h" namespace { @@ -33,8 +34,11 @@ void WriteFilenameGcc(cmsys::ofstream& fout, const std::string& filename) } } -void WriteGccDepfile(cmsys::ofstream& fout, const cmGccDepfileContent& content) +void WriteGccDepfile(cmsys::ofstream& fout, const cmLocalGenerator& lg, + const cmGccDepfileContent& content) { + const auto& binDir = lg.GetBinaryDirectory(); + for (auto const& dep : content) { bool first = true; for (auto const& rule : dep.rules) { @@ -42,19 +46,32 @@ void WriteGccDepfile(cmsys::ofstream& fout, const cmGccDepfileContent& content) fout << " \\\n "; } first = false; - WriteFilenameGcc(fout, rule); + WriteFilenameGcc(fout, lg.MaybeConvertToRelativePath(binDir, rule)); } fout << ':'; for (auto const& path : dep.paths) { fout << " \\\n "; - WriteFilenameGcc(fout, path); + WriteFilenameGcc(fout, lg.MaybeConvertToRelativePath(binDir, path)); } fout << '\n'; } } -void WriteVsTlog(cmsys::ofstream& fout, const cmGccDepfileContent& content) +// tlog format : always windows paths on Windows regardless the generator +std::string ConvertToTLogOutputPath(const std::string& path) { +#if defined(_WIN32) && !defined(__CYGWIN__) + return cmSystemTools::ConvertToWindowsOutputPath(path); +#else + return cmSystemTools::ConvertToOutputPath(path); +#endif +} + +void WriteVsTlog(cmsys::ofstream& fout, const cmLocalGenerator& lg, + const cmGccDepfileContent& content) +{ + const auto& binDir = lg.GetBinaryDirectory(); + for (auto const& dep : content) { fout << '^'; bool first = true; @@ -63,22 +80,26 @@ void WriteVsTlog(cmsys::ofstream& fout, const cmGccDepfileContent& content) fout << '|'; } first = false; - fout << cmSystemTools::ConvertToOutputPath(rule); + fout << ConvertToTLogOutputPath( + lg.MaybeConvertToRelativePath(binDir, rule)); } fout << "\r\n"; for (auto const& path : dep.paths) { - fout << cmSystemTools::ConvertToOutputPath(path) << "\r\n"; + fout << ConvertToTLogOutputPath( + lg.MaybeConvertToRelativePath(binDir, path)) + << "\r\n"; } } } } -bool cmTransformDepfile(cmDepfileFormat format, const std::string& prefix, +bool cmTransformDepfile(cmDepfileFormat format, const cmLocalGenerator& lg, const std::string& infile, const std::string& outfile) { cmGccDepfileContent content; if (cmSystemTools::FileExists(infile)) { - auto result = cmReadGccDepfile(infile.c_str(), prefix); + auto result = + cmReadGccDepfile(infile.c_str(), lg.GetCurrentBinaryDirectory()); if (!result) { return false; } @@ -91,10 +112,10 @@ bool cmTransformDepfile(cmDepfileFormat format, const std::string& prefix, } switch (format) { case cmDepfileFormat::GccDepfile: - WriteGccDepfile(fout, content); + WriteGccDepfile(fout, lg, content); break; case cmDepfileFormat::VsTlog: - WriteVsTlog(fout, content); + WriteVsTlog(fout, lg, content); break; } return true; diff --git a/Source/cmTransformDepfile.h b/Source/cmTransformDepfile.h index 792c1aa..c43a45f 100644 --- a/Source/cmTransformDepfile.h +++ b/Source/cmTransformDepfile.h @@ -10,5 +10,7 @@ enum class cmDepfileFormat VsTlog, }; -bool cmTransformDepfile(cmDepfileFormat format, const std::string& prefix, +class cmLocalGenerator; + +bool cmTransformDepfile(cmDepfileFormat format, const cmLocalGenerator& lg, const std::string& infile, const std::string& outfile); diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index 851205e..f6d8901 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -1522,20 +1522,42 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string> const& args, #endif // Internal depfile transformation - if (args[1] == "cmake_transform_depfile" && args.size() == 6) { + if (args[1] == "cmake_transform_depfile" && args.size() == 10) { auto format = cmDepfileFormat::GccDepfile; - if (args[2] == "gccdepfile") { + if (args[3] == "gccdepfile") { format = cmDepfileFormat::GccDepfile; - } else if (args[2] == "vstlog") { + } else if (args[3] == "vstlog") { format = cmDepfileFormat::VsTlog; } else { return 1; } - std::string prefix = args[3]; - if (prefix == "./") { - prefix.clear(); + // Create a cmake object instance to process dependencies. + // All we need is the `set` command. + cmake cm(cmake::RoleScript, cmState::Unknown); + std::string homeDir; + std::string startDir; + std::string homeOutDir; + std::string startOutDir; + homeDir = cmSystemTools::CollapseFullPath(args[4]); + startDir = cmSystemTools::CollapseFullPath(args[5]); + homeOutDir = cmSystemTools::CollapseFullPath(args[6]); + startOutDir = cmSystemTools::CollapseFullPath(args[7]); + cm.SetHomeDirectory(homeDir); + cm.SetHomeOutputDirectory(homeOutDir); + cm.GetCurrentSnapshot().SetDefaultDefinitions(); + if (auto ggd = cm.CreateGlobalGenerator(args[2])) { + cm.SetGlobalGenerator(std::move(ggd)); + cmStateSnapshot snapshot = cm.GetCurrentSnapshot(); + snapshot.GetDirectory().SetCurrentBinary(startOutDir); + snapshot.GetDirectory().SetCurrentSource(startDir); + snapshot.GetDirectory().SetRelativePathTopSource(homeDir.c_str()); + snapshot.GetDirectory().SetRelativePathTopBinary(homeOutDir.c_str()); + cmMakefile mf(cm.GetGlobalGenerator(), snapshot); + auto lgd = cm.GetGlobalGenerator()->CreateLocalGenerator(&mf); + + return cmTransformDepfile(format, *lgd, args[8], args[9]) ? 0 : 2; } - return cmTransformDepfile(format, prefix, args[4], args[5]) ? 0 : 1; + return 1; } } diff --git a/Templates/MSBuild/FlagTables/v142_Link.json b/Templates/MSBuild/FlagTables/v142_Link.json index 66ee76f..110dcc2 100644 --- a/Templates/MSBuild/FlagTables/v142_Link.json +++ b/Templates/MSBuild/FlagTables/v142_Link.json @@ -352,6 +352,13 @@ }, { "name": "TargetMachine", + "switch": "MACHINE:ARM64EC", + "comment": "MachineARM64EC", + "value": "MachineARM64EC", + "flags": [] + }, + { + "name": "TargetMachine", "switch": "MACHINE:EBC", "comment": "MachineEBC", "value": "MachineEBC", diff --git a/Templates/MSBuild/FlagTables/v14_LIB.json b/Templates/MSBuild/FlagTables/v14_LIB.json index 5990ed1..a0e85b2 100644 --- a/Templates/MSBuild/FlagTables/v14_LIB.json +++ b/Templates/MSBuild/FlagTables/v14_LIB.json @@ -43,6 +43,13 @@ }, { "name": "TargetMachine", + "switch": "MACHINE:ARM64X", + "comment": "MachineARM64X", + "value": "MachineARM64X", + "flags": [] + }, + { + "name": "TargetMachine", "switch": "MACHINE:EBC", "comment": "MachineEBC", "value": "MachineEBC", diff --git a/Tests/CMakeLib/testRST.expect b/Tests/CMakeLib/testRST.expect index 970adaa..4870f65 100644 --- a/Tests/CMakeLib/testRST.expect +++ b/Tests/CMakeLib/testRST.expect @@ -20,6 +20,12 @@ Environment variable ``SOME_ENV_VAR``. Environment variable ``some env var`` with space and target. Generator ``Some Generator`` with space. Generator ``Some Generator`` with space. +Generator expression ``SOME_GENEX``. +Generator expression ``$<SOME_GENEX>`` with brackets. +Generator expression ``$<SOME_GENEX:...>`` with brackets and parameter. +Generator expression ``some genex`` with space and target. +Generator expression ``$<SOME_GENEX>`` with brackets, space, and target. +Generator expression ``$<SOME_GENEX:...>`` with brackets, parameter, space, and target. Inline literal ``~!@#$%^&*( )_+-=\\[]{}'":;,<>.?/``. Inline link Link Text. Inline link Link Text <With \-escaped Brackets>. @@ -48,6 +54,22 @@ Bracket Comment Content Command other_cmd description. +.. cmake:envvar:: some_var + + Environment variable some_var description. + +.. envvar:: other_var + + Environment variable other_var description. + +.. cmake:genex:: SOME_GENEX + + Generator expression SOME_GENEX description. + +.. genex:: $<OTHER_GENEX> + + Generator expression $<OTHER_GENEX> description. + .. cmake:variable:: some_var Variable some_var description. diff --git a/Tests/CMakeLib/testRST.rst b/Tests/CMakeLib/testRST.rst index 6462f1b..44931a7 100644 --- a/Tests/CMakeLib/testRST.rst +++ b/Tests/CMakeLib/testRST.rst @@ -27,6 +27,12 @@ Environment variable :envvar:`SOME_ENV_VAR`. Environment variable :envvar:`some env var <SOME_ENV_VAR>` with space and target. Generator :generator:`Some Generator` with space. Generator :cpack_gen:`Some Generator` with space. +Generator expression :genex:`SOME_GENEX`. +Generator expression :genex:`$<SOME_GENEX>` with brackets. +Generator expression :genex:`$<SOME_GENEX:...>` with brackets and parameter. +Generator expression :genex:`some genex <SOME_GENEX>` with space and target. +Generator expression :genex:`$<SOME_GENEX> <SOME_GENEX>` with brackets, space, and target. +Generator expression :genex:`$<SOME_GENEX:...> <SOME_GENEX>` with brackets, parameter, space, and target. Inline literal ``~!@#$%^&*( )_+-=\\[]{}'":;,<>.?/``. Inline link `Link Text <ExternalDest>`_. Inline link `Link Text \<With \\-escaped Brackets\> <ExternalDest>`_. @@ -51,6 +57,22 @@ Inline literal ``__`` followed by inline link `Link Text <InternalDest_>`_. Command other_cmd description. +.. cmake:envvar:: some_var + + Environment variable some_var description. + +.. envvar:: other_var + + Environment variable other_var description. + +.. cmake:genex:: SOME_GENEX + + Generator expression SOME_GENEX description. + +.. genex:: $<OTHER_GENEX> + + Generator expression $<OTHER_GENEX> description. + .. cmake:variable:: some_var Variable some_var description. diff --git a/Tests/ExternalProject/CMakeLists.txt b/Tests/ExternalProject/CMakeLists.txt index a1130dc..8fd44b4 100644 --- a/Tests/ExternalProject/CMakeLists.txt +++ b/Tests/ExternalProject/CMakeLists.txt @@ -298,15 +298,9 @@ set(do_git_tests 0) if(GIT_EXECUTABLE) set(do_git_tests 1) - execute_process( - COMMAND "${GIT_EXECUTABLE}" --version - OUTPUT_VARIABLE ov - OUTPUT_STRIP_TRAILING_WHITESPACE - ) - string(REGEX REPLACE "^git version (.+)$" "\\1" git_version "${ov}") - message(STATUS "git_version='${git_version}'") + message(STATUS "GIT_VERSION_STRING='${GIT_VERSION_STRING}'") - if(git_version VERSION_LESS 1.6.5) + if("${GIT_VERSION_STRING}" VERSION_LESS 1.6.5) message(STATUS "No ExternalProject git tests with git client less than version 1.6.5") set(do_git_tests 0) endif() diff --git a/Tests/ExternalProjectUpdate/CMakeLists.txt b/Tests/ExternalProjectUpdate/CMakeLists.txt index fc10c67..b31a38b 100644 --- a/Tests/ExternalProjectUpdate/CMakeLists.txt +++ b/Tests/ExternalProjectUpdate/CMakeLists.txt @@ -51,15 +51,9 @@ set(do_git_tests 0) if(GIT_EXECUTABLE) set(do_git_tests 1) - execute_process( - COMMAND "${GIT_EXECUTABLE}" --version - OUTPUT_VARIABLE ov - OUTPUT_STRIP_TRAILING_WHITESPACE - ) - string(REGEX REPLACE "^git version (.+)$" "\\1" git_version "${ov}") - message(STATUS "git_version='${git_version}'") - - if(git_version VERSION_LESS 1.6.5) + message(STATUS "GIT_VERSION_STRING='${GIT_VERSION_STRING}'") + + if("${GIT_VERSION_STRING}" VERSION_LESS 1.6.5) message(STATUS "No ExternalProject git tests with git client less than version 1.6.5") set(do_git_tests 0) endif() diff --git a/Tests/ExternalProjectUpdate/ExternalProjectUpdateTest.cmake b/Tests/ExternalProjectUpdate/ExternalProjectUpdateTest.cmake index d300e8b..aaa05d7 100644 --- a/Tests/ExternalProjectUpdate/ExternalProjectUpdateTest.cmake +++ b/Tests/ExternalProjectUpdate/ExternalProjectUpdateTest.cmake @@ -167,15 +167,9 @@ set(do_git_tests 0) if(GIT_EXECUTABLE) set(do_git_tests 1) - execute_process( - COMMAND "${GIT_EXECUTABLE}" --version - OUTPUT_VARIABLE ov - OUTPUT_STRIP_TRAILING_WHITESPACE - ) - string(REGEX REPLACE "^git version (.+)$" "\\1" git_version "${ov}") - message(STATUS "git_version='${git_version}'") + message(STATUS "GIT_VERSION_STRING='${GIT_VERSION_STRING}'") - if(git_version VERSION_LESS 1.6.5) + if("${GIT_VERSION_STRING}" VERSION_LESS 1.6.5) message(STATUS "No ExternalProject git tests with git client less than version 1.6.5") set(do_git_tests 0) endif() diff --git a/Tests/RunCMake/BuildDepends/CMakeLists.txt b/Tests/RunCMake/BuildDepends/CMakeLists.txt index 74b3ff8..99f238b 100644 --- a/Tests/RunCMake/BuildDepends/CMakeLists.txt +++ b/Tests/RunCMake/BuildDepends/CMakeLists.txt @@ -1,3 +1,3 @@ cmake_minimum_required(VERSION 3.3) project(${RunCMake_TEST} NONE) -include(${RunCMake_TEST}.cmake) +include(${RunCMake_TEST}.cmake NO_POLICY_SCOPE) diff --git a/Tests/RunCMake/BuildDepends/CustomCommandDepfile.cmake b/Tests/RunCMake/BuildDepends/CustomCommandDepfile.cmake index 6ac1291..01eac91 100644 --- a/Tests/RunCMake/BuildDepends/CustomCommandDepfile.cmake +++ b/Tests/RunCMake/BuildDepends/CustomCommandDepfile.cmake @@ -4,7 +4,7 @@ enable_language(C) add_custom_command( OUTPUT topcc.c DEPFILE topcc.c.d - COMMAND ${CMAKE_COMMAND} -DOUTFILE=topcc.c -DINFILE=topccdep.txt -DDEPFILE=topcc.c.d -P "${CMAKE_CURRENT_LIST_DIR}/WriteDepfile.cmake" + COMMAND ${CMAKE_COMMAND} -DOUTFILE=${CMAKE_CURRENT_BINARY_DIR}/topcc.c -DINFILE=topccdep.txt -DDEPFILE=topcc.c.d -P "${CMAKE_CURRENT_LIST_DIR}/WriteDepfile.cmake" ) add_custom_target(topcc ALL DEPENDS topcc.c) diff --git a/Tests/RunCMake/BuildDepends/DepfileSubdir/CMakeLists.txt b/Tests/RunCMake/BuildDepends/DepfileSubdir/CMakeLists.txt index 06db47c..f131751 100644 --- a/Tests/RunCMake/BuildDepends/DepfileSubdir/CMakeLists.txt +++ b/Tests/RunCMake/BuildDepends/DepfileSubdir/CMakeLists.txt @@ -3,7 +3,7 @@ cmake_policy(SET CMP0116 NEW) add_custom_command( OUTPUT subcc.c DEPFILE subcc.c.d - COMMAND ${CMAKE_COMMAND} -DOUTFILE=subcc.c -DINFILE=subccdep.txt -DDEPFILE=subcc.c.d -P "${CMAKE_CURRENT_LIST_DIR}/../WriteDepfile.cmake" + COMMAND ${CMAKE_COMMAND} -DOUTFILE=${CMAKE_CURRENT_BINARY_DIR}/subcc.c -DINFILE=subccdep.txt -DDEPFILE=subcc.c.d -P "${CMAKE_CURRENT_LIST_DIR}/../WriteDepfile.cmake" ) add_custom_target(subcc ALL DEPENDS subcc.c) diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 540a718..d1122d0 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -796,7 +796,10 @@ add_RunCMake_test(PrecompileHeaders -DCMAKE_C_COMPILER_ID=${CMAKE_C_COMPILER_ID} add_RunCMake_test("UnityBuild") add_RunCMake_test(CMakePresets -DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE} -DCMake_TEST_JSON_SCHEMA=${CMake_TEST_JSON_SCHEMA}) -add_RunCMake_test(TransformDepfile) + +if(${CMAKE_GENERATOR} MATCHES "Make|Ninja") + add_RunCMake_test(TransformDepfile) +endif() if(WIN32) add_RunCMake_test(Win32GenEx) diff --git a/Tests/RunCMake/TransformDepfile/RunCMakeTest.cmake b/Tests/RunCMake/TransformDepfile/RunCMakeTest.cmake index cb75eb0..9a38b95 100644 --- a/Tests/RunCMake/TransformDepfile/RunCMakeTest.cmake +++ b/Tests/RunCMake/TransformDepfile/RunCMakeTest.cmake @@ -3,11 +3,11 @@ include(RunCMake) function(run_transform_depfile name) set(RunCMake-check-file gccdepfile.cmake) run_cmake_command(${name}-gcc - ${CMAKE_COMMAND} -E cmake_transform_depfile gccdepfile ../ ${CMAKE_CURRENT_LIST_DIR}/${name}.d out.d + ${CMAKE_COMMAND} -E cmake_transform_depfile "${RunCMake_GENERATOR}" gccdepfile "${RunCMake_SOURCE_DIR}" "${RunCMake_SOURCE_DIR}/subdir" "${RunCMake_BINARY_DIR}" "${RunCMake_BINARY_DIR}/subdir" "${CMAKE_CURRENT_LIST_DIR}/${name}.d" out.d ) set(RunCMake-check-file vstlog.cmake) run_cmake_command(${name}-tlog - ${CMAKE_COMMAND} -E cmake_transform_depfile vstlog ../ ${CMAKE_CURRENT_LIST_DIR}/${name}.d out.tlog + ${CMAKE_COMMAND} -E cmake_transform_depfile "${RunCMake_GENERATOR}" vstlog "${RunCMake_SOURCE_DIR}" "${RunCMake_SOURCE_DIR}/subdir" "${RunCMake_BINARY_DIR}" "${RunCMake_BINARY_DIR}/subdir" "${CMAKE_CURRENT_LIST_DIR}/${name}.d" out.tlog ) endfunction() diff --git a/Tests/RunCMake/TransformDepfile/deps-unix.d.txt b/Tests/RunCMake/TransformDepfile/deps-unix.d.txt index 58770f2..fbdecc0 100644 --- a/Tests/RunCMake/TransformDepfile/deps-unix.d.txt +++ b/Tests/RunCMake/TransformDepfile/deps-unix.d.txt @@ -1,8 +1,8 @@ -../out1 \ +subdir/out1 \ /home/build/out2: \ - ../in1 \ + subdir/in1 \ /home/build/in2 -../out3 \ +subdir/out3 \ /home/build/out4: \ - ../in3 \ + subdir/in3 \ /home/build/in4 diff --git a/Tests/RunCMake/TransformDepfile/deps-unix.tlog.txt b/Tests/RunCMake/TransformDepfile/deps-unix.tlog.txt index 2a26edf..70bac5d 100644 --- a/Tests/RunCMake/TransformDepfile/deps-unix.tlog.txt +++ b/Tests/RunCMake/TransformDepfile/deps-unix.tlog.txt @@ -1,6 +1,6 @@ -^../out1|/home/build/out2 -../in1 +^subdir/out1|/home/build/out2 +subdir/in1 /home/build/in2 -^../out3|/home/build/out4 -../in3 +^subdir/out3|/home/build/out4 +subdir/in3 /home/build/in4 diff --git a/Tests/RunCMake/TransformDepfile/deps-windows.d.txt b/Tests/RunCMake/TransformDepfile/deps-windows.d.txt index 47b3ebf..e09ae37 100644 --- a/Tests/RunCMake/TransformDepfile/deps-windows.d.txt +++ b/Tests/RunCMake/TransformDepfile/deps-windows.d.txt @@ -1,8 +1,8 @@ -../out1 \ +subdir/out1 \ C:/build/out2: \ - ../in1 \ + subdir/in1 \ C:/build/in2 -../out3 \ +subdir/out3 \ C:/build/out4: \ - ../in3 \ + subdir/in3 \ C:/build/in4 diff --git a/Tests/RunCMake/TransformDepfile/deps-windows.tlog.txt b/Tests/RunCMake/TransformDepfile/deps-windows.tlog.txt index 1e6024d..09f9e97 100644 --- a/Tests/RunCMake/TransformDepfile/deps-windows.tlog.txt +++ b/Tests/RunCMake/TransformDepfile/deps-windows.tlog.txt @@ -1,6 +1,6 @@ -^..\out1|C:\build\out2 -..\in1 +^subdir\out1|C:\build\out2 +subdir\in1 C:\build\in2 -^..\out3|C:\build\out4 -..\in3 +^subdir\out3|C:\build\out4 +subdir\in3 C:\build\in4 diff --git a/Tests/RunCMake/TransformDepfile/invalid-gcc-result.txt b/Tests/RunCMake/TransformDepfile/invalid-gcc-result.txt index d00491f..0cfbf08 100644 --- a/Tests/RunCMake/TransformDepfile/invalid-gcc-result.txt +++ b/Tests/RunCMake/TransformDepfile/invalid-gcc-result.txt @@ -1 +1 @@ -1 +2 diff --git a/Tests/RunCMake/TransformDepfile/invalid-tlog-result.txt b/Tests/RunCMake/TransformDepfile/invalid-tlog-result.txt index d00491f..0cfbf08 100644 --- a/Tests/RunCMake/TransformDepfile/invalid-tlog-result.txt +++ b/Tests/RunCMake/TransformDepfile/invalid-tlog-result.txt @@ -1 +1 @@ -1 +2 diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-all-check.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-all-check.cmake index e6f2623..e7cdbf6 100644 --- a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-all-check.cmake +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-all-check.cmake @@ -148,6 +148,27 @@ set(_check ) check_contents(deps/udeps6.txt "^${_check}$") +# Weak library reference should have exactly the same dependencies as a regular library reference (test 1) +set_with_libsystem(_check + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/bin/../lib/executable_path/libexecutable_path\.dylib]] + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/bin/../lib/rpath_executable_path/librpath_executable_path\.dylib]] + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/lib/libtestlib\.dylib]] + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/lib/loader_path/libloader_path\.dylib]] + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/lib/normal/../rpath/librpath\.dylib]] + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/lib/normal/libnormal\.dylib]] + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/lib/rpath_loader_path/librpath_loader_path\.dylib]] + ) +check_contents(deps/deps7.txt "^${_check}$") + +set(_check + [[@executable_path/../lib/executable_path_bundle/libexecutable_path_bundle\.dylib]] + [[@loader_path/loader_path_unresolved/libloader_path_unresolved\.dylib]] + [[@rpath/librpath_executable_path_bundle\.dylib]] + [[@rpath/librpath_loader_path_unresolved\.dylib]] + [[@rpath/librpath_unresolved\.dylib]] + ) +check_contents(deps/udeps7.txt "^${_check}$") + set(_check "^libconflict\\.dylib:[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/lib/conflict/libconflict\\.dylib;[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/lib/conflict2/libconflict\\.dylib\n$" ) @@ -157,3 +178,4 @@ check_contents(deps/cdeps3.txt "${_check}") check_contents(deps/cdeps4.txt "${_check}") check_contents(deps/cdeps5.txt "${_check}") check_contents(deps/cdeps6.txt "${_check}") +check_contents(deps/cdeps7.txt "${_check}") diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos.cmake index c56a14b..aab19b7 100644 --- a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos.cmake +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos.cmake @@ -128,16 +128,19 @@ endforeach() target_link_libraries(testlib PRIVATE ${testlib_names}) add_executable(topexe macos/topexe.c) +add_executable(topexe_weak macos/topexe.c) add_library(toplib SHARED macos/toplib.c) add_library(topmod MODULE macos/toplib.c) target_link_libraries(topexe PRIVATE testlib) +target_link_libraries(topexe_weak PRIVATE "-weak_library" testlib) target_link_libraries(toplib PRIVATE testlib) target_link_libraries(topmod PRIVATE testlib) set_property(TARGET topexe toplib topmod PROPERTY INSTALL_RPATH "${CMAKE_BINARY_DIR}/root-all/executable/lib") +set_property(TARGET topexe_weak toplib topmod PROPERTY INSTALL_RPATH "${CMAKE_BINARY_DIR}/root-all/executable/lib") -install(TARGETS topexe toplib topmod testlib testlib_conflict RUNTIME DESTINATION executable/bin LIBRARY DESTINATION executable/lib) -install(TARGETS topexe toplib topmod testlib testlib_conflict RUNTIME DESTINATION bundle_executable/bin LIBRARY DESTINATION bundle_executable/lib) +install(TARGETS topexe topexe_weak toplib topmod testlib testlib_conflict RUNTIME DESTINATION executable/bin LIBRARY DESTINATION executable/lib) +install(TARGETS topexe topexe_weak toplib topmod testlib testlib_conflict RUNTIME DESTINATION bundle_executable/bin LIBRARY DESTINATION bundle_executable/lib) install(CODE [[ function(exec_get_runtime_dependencies depsfile udepsfile cdepsfile) @@ -213,4 +216,12 @@ install(CODE [[ "${CMAKE_INSTALL_PREFIX}/executable/lib/$<TARGET_FILE_NAME:testlib_conflict>" BUNDLE_EXECUTABLE "${CMAKE_INSTALL_PREFIX}/bundle_executable/bin/$<TARGET_FILE_NAME:topexe>" ) + + exec_get_runtime_dependencies( + deps7.txt udeps7.txt cdeps7.txt + EXECUTABLES + "${CMAKE_INSTALL_PREFIX}/executable/bin/$<TARGET_FILE_NAME:topexe_weak>" + LIBRARIES + "${CMAKE_INSTALL_PREFIX}/executable/lib/$<TARGET_FILE_NAME:testlib_conflict>" + ) ]]) diff --git a/Tests/UseSWIG/BasicPerl/CMakeLists.txt b/Tests/UseSWIG/BasicPerl/CMakeLists.txt index cf02de7..671d529 100644 --- a/Tests/UseSWIG/BasicPerl/CMakeLists.txt +++ b/Tests/UseSWIG/BasicPerl/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1...3.13) +cmake_minimum_required(VERSION 3.1...3.20) project(TestBasicPerl CXX) diff --git a/Tests/UseSWIG/BasicPython/CMakeLists.txt b/Tests/UseSWIG/BasicPython/CMakeLists.txt index 8bbd1cb..a1163a2 100644 --- a/Tests/UseSWIG/BasicPython/CMakeLists.txt +++ b/Tests/UseSWIG/BasicPython/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1...3.13) +cmake_minimum_required(VERSION 3.1...3.20) project(TestBasicPython CXX) diff --git a/Tests/UseSWIG/CMakeLists.txt b/Tests/UseSWIG/CMakeLists.txt index e150223..d08c59c 100644 --- a/Tests/UseSWIG/CMakeLists.txt +++ b/Tests/UseSWIG/CMakeLists.txt @@ -1,3 +1,5 @@ +find_package(SWIG QUIET) + add_test(NAME UseSWIG.LegacyPython COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> --build-and-test @@ -64,6 +66,28 @@ add_test(NAME UseSWIG.BasicPerl COMMAND --build-options ${build_options} --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> ) +if(SWIG_FOUND AND NOT SWIG_VERSION VERSION_LESS "4.0.2") + add_test(NAME UseSWIG.Depfile.BasicPython COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/UseSWIG/BasicPython" + "${CMake_BINARY_DIR}/Tests/UseSWIG/BasicPython.Depfile" + ${build_generator_args} + --build-project TestBasicPython + --build-options ${build_options} -DSWIG_USE_SWIG_DEPENDENCIES=ON + --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> + ) + add_test(NAME UseSWIG.Depfile.BasicPerl COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/UseSWIG/BasicPerl" + "${CMake_BINARY_DIR}/Tests/UseSWIG/BasicPerl.Depfile" + ${build_generator_args} + --build-project TestBasicPerl + --build-options ${build_options} -DSWIG_USE_SWIG_DEPENDENCIES=ON + --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> + ) +endif() if (CMake_TEST_UseSWIG_Fortran) check_language(Fortran) diff --git a/Utilities/Sphinx/cmake.py b/Utilities/Sphinx/cmake.py index e175d0d..ece4bf5 100644 --- a/Utilities/Sphinx/cmake.py +++ b/Utilities/Sphinx/cmake.py @@ -191,6 +191,7 @@ _cmake_index_objs = { 'cpack_gen': _cmake_index_entry('cpack generator'), 'envvar': _cmake_index_entry('envvar'), 'generator': _cmake_index_entry('generator'), + 'genex': _cmake_index_entry('genex'), 'guide': _cmake_index_entry('guide'), 'manual': _cmake_index_entry('manual'), 'module': _cmake_index_entry('module'), @@ -224,7 +225,7 @@ class CMakeTransform(Transform): self.titles = {} def parse_title(self, docname): - """Parse a document title as the first line starting in [A-Za-z0-9<] + """Parse a document title as the first line starting in [A-Za-z0-9<$] or fall back to the document basename if no such line exists. The cmake --help-*-list commands also depend on this convention. Return the title or False if the document file does not exist. @@ -239,7 +240,7 @@ class CMakeTransform(Transform): title = False else: for line in f: - if len(line) > 0 and (line[0].isalnum() or line[0] == '<'): + if len(line) > 0 and (line[0].isalnum() or line[0] == '<' or line[0] == '$'): title = line.rstrip() break f.close() @@ -260,6 +261,10 @@ class CMakeTransform(Transform): if objtype == 'command': targetname = title.lower() else: + if objtype == 'genex': + m = CMakeXRefRole._re_genex.match(title) + if m: + title = m.group(1) targetname = title targetid = '%s:%s' % (objtype, targetname) targetnode = nodes.target('', '', ids=[targetid]) @@ -277,6 +282,10 @@ class CMakeObject(ObjectDescription): def handle_signature(self, sig, signode): # called from sphinx.directives.ObjectDescription.run() signode += addnodes.desc_name(sig, sig) + if self.objtype == 'genex': + m = CMakeXRefRole._re_genex.match(sig) + if m: + sig = m.group(1) return sig def add_target_and_index(self, name, sig, signode): @@ -302,6 +311,7 @@ class CMakeXRefRole(XRefRole): # See sphinx.util.nodes.explicit_title_re; \x00 escapes '<'. _re = re.compile(r'^(.+?)(\s*)(?<!\x00)<(.*?)>$', re.DOTALL) _re_sub = re.compile(r'^([^()\s]+)\s*\(([^()]*)\)$', re.DOTALL) + _re_genex = re.compile(r'^\$<([^<>:]+)(:[^<>]+)?>$', re.DOTALL) def __call__(self, typ, rawtext, text, *args, **keys): # Translate CMake command cross-references of the form: @@ -312,6 +322,10 @@ class CMakeXRefRole(XRefRole): m = CMakeXRefRole._re_sub.match(text) if m: text = '%s <%s>' % (text, m.group(1)) + elif typ == 'cmake:genex': + m = CMakeXRefRole._re_genex.match(text) + if m: + text = '%s <%s>' % (text, m.group(1)) # CMake cross-reference targets frequently contain '<' so escape # any explicit `<target>` with '<' not preceded by whitespace. while True: @@ -374,6 +388,7 @@ class CMakeDomain(Domain): 'cpack_gen': ObjType('cpack_gen', 'cpack_gen'), 'envvar': ObjType('envvar', 'envvar'), 'generator': ObjType('generator', 'generator'), + 'genex': ObjType('genex', 'genex'), 'guide': ObjType('guide', 'guide'), 'variable': ObjType('variable', 'variable'), 'module': ObjType('module', 'module'), @@ -390,6 +405,7 @@ class CMakeDomain(Domain): directives = { 'command': CMakeObject, 'envvar': CMakeObject, + 'genex': CMakeObject, 'variable': CMakeObject, # Other object types cannot be created except by the CMakeTransform # 'generator': CMakeObject, @@ -409,6 +425,7 @@ class CMakeDomain(Domain): 'cpack_gen': CMakeXRefRole(), 'envvar': CMakeXRefRole(), 'generator': CMakeXRefRole(), + 'genex': CMakeXRefRole(), 'guide': CMakeXRefRole(), 'variable': CMakeXRefRole(), 'module': CMakeXRefRole(), diff --git a/Utilities/Sphinx/create_identifiers.py b/Utilities/Sphinx/create_identifiers.py index e35f127..0ff39a0 100755 --- a/Utilities/Sphinx/create_identifiers.py +++ b/Utilities/Sphinx/create_identifiers.py @@ -25,6 +25,7 @@ for line in lines: ("envvar", "envvar"), ("variable", "variable"), ("generator", "generator"), + ("genex", "genex"), ("guide", "guide"), ("target property", "prop_tgt"), ("test property", "prop_test"), @@ -1195,8 +1195,8 @@ for std in 11 99 90; do for compiler in ${cmake_c_compilers}; do for std_flag in '' $std_flags; do for thread_flag in '' $thread_flags; do - echo "Checking whether '${compiler} ${cmake_c_flags} ${std_flag} ${thread_flag}' works." >> cmake_bootstrap.log 2>&1 - if cmake_try_run "${compiler}" "${cmake_c_flags} ${std_flag} ${thread_flag}" \ + echo "Checking whether '${compiler} ${cmake_c_flags} ${cmake_ld_flags} ${std_flag} ${thread_flag}' works." >> cmake_bootstrap.log 2>&1 + if cmake_try_run "${compiler}" "${cmake_c_flags} ${cmake_ld_flags} ${std_flag} ${thread_flag}" \ "${TMPFILE}.c" >> cmake_bootstrap.log 2>&1; then cmake_c_compiler="${compiler}" cmake_c_flags="${cmake_c_flags} ${std_flag} ${thread_flag}" @@ -1316,8 +1316,8 @@ for std in 17 14 11; do for compiler in ${cmake_cxx_compilers}; do for std_flag in '' $std_flags; do for thread_flag in '' $thread_flags; do - echo "Checking whether '${compiler} ${cmake_cxx_flags} ${std_flag} ${thread_flag}' works." >> cmake_bootstrap.log 2>&1 - if cmake_try_run "${compiler}" "${cmake_cxx_flags} ${std_flag} ${thread_flag}" \ + echo "Checking whether '${compiler} ${cmake_cxx_flags} ${cmake_ld_flags} ${std_flag} ${thread_flag}' works." >> cmake_bootstrap.log 2>&1 + if cmake_try_run "${compiler}" "${cmake_cxx_flags} ${cmake_ld_flags} ${std_flag} ${thread_flag}" \ "${TMPFILE}.cxx" >> cmake_bootstrap.log 2>&1; then cmake_cxx_compiler="${compiler}" cmake_cxx_flags="${cmake_cxx_flags} ${std_flag} ${thread_flag} " @@ -1345,8 +1345,8 @@ cmake_cxx_features="make_unique filesystem" for feature in ${cmake_cxx_features}; do eval "cmake_have_cxx_${feature}=0" - echo "Checking whether '${cmake_cxx_compiler} ${cmake_cxx_flags}' supports '${feature}'." >> cmake_bootstrap.log 2>&1 - if cmake_try_run "${cmake_cxx_compiler}" "${cmake_cxx_flags}" \ + echo "Checking whether '${cmake_cxx_compiler} ${cmake_cxx_flags} ${cmake_ld_flags}' supports '${feature}'." >> cmake_bootstrap.log 2>&1 + if cmake_try_run "${cmake_cxx_compiler}" "${cmake_cxx_flags} ${cmake_ld_flags}" \ "${cmake_source_dir}/Source/Checks/cm_cxx_${feature}.cxx" >> cmake_bootstrap.log 2>&1; then eval "cmake_have_cxx_${feature}=1" fi |