11423 Commits

Author SHA1 Message Date
Brad King
c3046ea289 Merge topic 'link-feature-attributes-stabilization' into release-3.30
576567f028 Link feature attributes: stabilization
5617c34c31 Libraries processing: update configuration wording

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9607
2024-06-24 09:22:47 -04:00
Brad King
b1a804d616 Ninja Multi-Config: Fix crash if config list is changed in subdirectory
Look up the value of `CMAKE_CONFIGURATION_TYPES` only in the top level
directory.

Fixes: #26064
2024-06-21 12:21:36 -04:00
Marc Chevrier
576567f028 Link feature attributes: stabilization
* enhance OVERRIDE handling
* Update wording
2024-06-21 11:18:20 +02:00
Marc Chevrier
5617c34c31 Libraries processing: update configuration wording 2024-06-21 11:18:12 +02:00
Brad King
b243c19986 Tests: Update expected results for Xcode 16
In `Tests/RunCMake/LinkerSelection`, Xcode 16 warns when building the
AppleClassic case:

    ld: warning: -ld_classic is deprecated and will be removed
                 in a future release

Tolerate all build warnings.
2024-06-13 09:16:34 -04:00
Craig Scott
9299cbbdb4 FetchContent: Force cmake --fresh to re-execute direct population steps
Issue: #25468
2024-06-07 18:12:12 +10:00
Craig Scott
e82e2c38c1 Tests: RunCMake.FetchContent should not always force _deps removal
To properly test some functionality, tests may rely on not clearing
things like time stamps between cmake invocations. The RunCMake
infrastructure clears the build directory by default anyway, and
tests may individually ask for that to be disabled where needed.

The line being removed here was originally added to assist with
manually re-running individual tests locally outside the control of
RunCMake. That is no longer appropriate.
2024-06-07 17:58:55 +10:00
Craig Scott
f97b25ec4b Tests: Fix -direct variants of FetchContent tests using wrong files
The -direct variants of the RunCMake.FetchContent tests were
meant to be using the same result, stdout and stderr files as the
non-direct tests. The -direct tests were specified in the wrong way
for that and ended up using no files at all, so they weren't testing
the full set of expected conditions. Use the test variant feature
provided by the RunCMake infrastructure instead, which is the
proper way to handle this sort of scenario.
2024-06-07 17:58:55 +10:00
Brad King
a67bb7f488 Merge topic 'FindPython-free-threaded-python'
9a0dee7257 FindPython: Add support for free threaded python
4178ab928f FindPython: Fix spelling error

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9578
2024-06-05 09:34:03 -04:00
Brad King
0a219e4058 Merge topic 'FindMatlab-test-versions_checks'
bda14d99f5 Tests: Fix FindMatlab.versions_checks

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9583
2024-06-05 09:25:56 -04:00
Silvio Traversaro
bda14d99f5 Tests: Fix FindMatlab.versions_checks
`matlab_get_release_name_from_version("14.10" release_name)` does not
write the `release_name` variable if the `14.10` is not a known version,
so before checking for the variable to be empty, we should set it to an
empty value.
2024-06-04 14:02:09 -04:00
Silvio Traversaro
e265065ed6 Tests: Fix FindMatlab.no_implicit_link_checks
`matlab_add_mex` uses the plain signature of `target_link_libraries`,
so we need to use the plain signature also outside of `matlab_add_mex`
to avoid a configuration error.
2024-06-04 14:01:23 -04:00
Marc Chevrier
9a0dee7257 FindPython: Add support for free threaded python
Fixes: #26016
2024-06-04 18:14:35 +02:00
Marc Chevrier
4178ab928f FindPython: Fix spelling error 2024-06-04 16:12:55 +02:00
Brad King
57c6dd277e Merge topic 'cpack-nuget-dependency-groups'
0f4d3664a9 CPack/NuGet: Build dependencies in groups

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9544
2024-06-04 08:59:28 -04:00
Alex Opie
0f4d3664a9 CPack/NuGet: Build dependencies in groups
This allows particular frameworks to be targeted by
particular dependencies, and for empty dependency
groups to satisfy NuGet's framework-matching
requirements.
2024-06-03 11:28:49 -04:00
Brad King
1df18d5e54 Merge topic 'cmake-C-crash'
7330121467 Fix crash in target-specific commands called from initial cache script

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9571
2024-06-03 09:10:52 -04:00
Brad King
d1cf2a2206 Merge topic 'file-accept-empty-lists'
7c516f7e28 file(): TOUCH, TOUCH_NOCREATE and MAKE_DIRECTORY accept empty lists

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !9570
2024-06-03 09:08:52 -04:00
Brad King
640a167d03 Merge topic 'ep-disable-source-changes'
0cc1b550dd ExternalProject,FetchContent: Avoid CMAKE_DISABLE_SOURCE_CHANGES error

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !9569
2024-06-03 09:07:46 -04:00
Brad King
7330121467 Fix crash in target-specific commands called from initial cache script
Fixes: #26018
2024-06-01 06:28:26 -04:00
Brad King
719b461b9c Merge topic 'ci-msvc-14.40'
0070708ae1 gitlab-ci: Update Windows builds to MSVC 14.40 toolset
41e777274a Tests: Update BuildDepends test for VS 17.10
f26e8886b3 cmake-gui: Suppress MSVC deprecation warnings from Qt headers

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9560
2024-05-31 09:52:15 -04:00
Brad King
107d6336b3 Merge topic 'cpack-deb-shlibdeps'
27d161eac3 CPackDeb: dpkg-shlibdeps shall consider dependency components, too

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9531
2024-05-31 09:23:36 -04:00
Brad King
e0a11dfa24 Merge topic 'dep-provider-try_compile'
4cb5bb014d try_compile: Propagating top level includes into whole-project calls

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robertjmaynard@gmail.com>
Merge-request: !9532
2024-05-31 09:20:27 -04:00
Craig Scott
7c516f7e28 file(): TOUCH, TOUCH_NOCREATE and MAKE_DIRECTORY accept empty lists
Projects may be generating a list of files or directories to pass as arguments
to file(TOUCH), file(TOUCH_NOCREATE), or file(MAKE_DIRECTORY). Those
lists might end up being empty, so rather than requiring at least one item,
allow an empty list.

Fixes: #24897
2024-05-31 22:55:20 +10:00
Craig Scott
0cc1b550dd ExternalProject,FetchContent: Avoid CMAKE_DISABLE_SOURCE_CHANGES error
The file(MAKE_DIRECTORY) implementation checks whether a path is
allowed to be written to before it checks if it already exists. For the
scenario where a SOURCE_DIR is an existing directory within the main
project's source directory, this triggers a fatal error if
CMAKE_DISABLE_SOURCE_CHANGES is set to true for ExternalProject,
and some FetchContent scenarios. Therefore, add an explicit check for
existence first to avoid making such error-triggering calls.

Fixes: #21872
2024-05-31 18:01:27 +10:00
Brad King
41e777274a Tests: Update BuildDepends test for VS 17.10
The test project now rebuilds `link_depends_no_shared_exe` in `Debug`
builds.  MSBuild `-v:diag` shows:

    Source compilation required:
    input C:\...\DEBUG\LINK_DEPENDS_NO_SHARED_LIB.PDB is newer
    than output C:\...\DEBUG\LINK_DEPENDS_NO_SHARED_EXE.EXE.

Use the `Release` configuration instead.
2024-05-30 14:23:47 -04:00
Brad King
f26e8886b3 cmake-gui: Suppress MSVC deprecation warnings from Qt headers
MSVC 14.38+ toolsets deprecate `stdext::checked_array_iterator`.
Support building with versions of Qt that have not been updated
to avoid the deprecated API.

Qt-Issue: https://bugreports.qt.io/browse/QTBUG-118993
2024-05-30 14:23:47 -04:00
Deniz Bahadir
27d161eac3 CPackDeb: dpkg-shlibdeps shall consider dependency components, too
When using `dpkg-shlibdeps` to automatically determine package
dependencies it considers the RUNPATH/RPATH of executables in order to
find all required shared libraries of such executables.

If the RUNPATH/RPATH contains a verbatim `$ORIGIN` (respective
`${ORIGIN}`), it will now be substituted by the packaging-paths of other
components that are marked as dependency and those paths will then be
used as additional search directories for `dpkg-shlibdeps`.

Associated tests were added as well.

Fixes: #21838
2024-05-30 16:13:46 +02:00
Brad King
679a3d9e6c Merge topic 'enforce-fc-fully-disconnected-requirements'
f588421b58 FetchContent: Enforce FETCHCONTENT_FULLY_DISCONNECTED requirements

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !9556
2024-05-30 10:13:29 -04:00
Brad King
c024b5cf9a Merge topic 'CUDAToolkit_search_non_activated_compiler_paths'
eed16fbc00 FindCUDAToolkit: Use CUDA compiler path even when CUDA lang not enabled

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9558
2024-05-30 10:12:39 -04:00
Craig Scott
4cb5bb014d try_compile: Propagating top level includes into whole-project calls
Fixes: #24151
2024-05-30 19:01:03 +10:00
Robert Maynard
eed16fbc00 FindCUDAToolkit: Use CUDA compiler path even when CUDA lang not enabled
Fixes: #25567
2024-05-29 14:39:29 -04:00
Brad King
54c9185b33 Merge topic 'deprecate-fetchcontent_populate'
4370fcf750 FetchContent: Deprecate FetchContent_Populate(depName)
bc70b458ad Help: Minor grammar improvements for FetchContent

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9552
2024-05-29 08:41:57 -04:00
Brad King
a5269e0693 Merge topic 'hip-std'
c299fd8266 Tests/CompileFeatures: Cover hip_std_## meta-features
5d93c421f1 HIP: Populate CMAKE_HIP_KNOWN_FEATURES global property

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9555
2024-05-29 08:35:26 -04:00
Brad King
ad90d891f8 Merge topic 'swift-multi-config'
5bb7f8a4dd Swift: Use per-config module file locations in multi-config generators
b2e042d77a cmGeneratorTarget: Adopt Swift-related methods from the Ninja generator
45b3387c50 Tests/RunCMake/Swift: Enable more cases with Ninja Multi-Config

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9501
2024-05-29 08:34:21 -04:00
Craig Scott
f588421b58 FetchContent: Enforce FETCHCONTENT_FULLY_DISCONNECTED requirements
FETCHCONTENT_FULLY_DISCONNECTED should only be set to true if
each dependency's source directory has already been populated.
Previously, this wasn't being checked, but now it is (subject to a new
policy).
2024-05-29 20:39:17 +10:00
Craig Scott
4370fcf750 FetchContent: Deprecate FetchContent_Populate(depName)
Projects should use FetchContent_MakeAvailable(depName)
instead. Policy CMP0169 provides backward compatibility.
2024-05-29 18:52:24 +10:00
Brad King
c299fd8266 Tests/CompileFeatures: Cover hip_std_## meta-features 2024-05-28 14:36:50 -04:00
Brad King
374716a47a Merge topic 'execute_process-child-startup-info'
fa8c04b421 Tests/RunCMake/execute_process: Check STARTUPINFOW reserved members
d98df689ab Merge branch 'libuv-win-process-no-extra-stdio'
a590382850 libuv: win/spawn: disable extra-file-descriptor support not needed by CMake

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9541
2024-05-28 08:56:42 -04:00
Craig Scott
2efceb290e FetchContent: Make FetchContent_Populate() honor CMP0168 2024-05-25 19:01:10 +10:00
Dave Abrahams
5bb7f8a4dd Swift: Use per-config module file locations in multi-config generators
Place `.swiftmodule` files a subdirectory named after the configuration.

Fixes: #25864
Fixes: #25997

- Swift/RunCMakeTest.cmake:
  - CMP0157-OLD was enabled for Xcode, where it works.
  - A test was added that verifies .swiftmodule's are generated into
    separate directories with multi-config generators.

- Tests/SwiftOnly/CMakeLists.txt: tests were added that validate that
  cross-subdirectory module dependencies (via target_link_libraries)
  work.
2024-05-24 15:23:41 -07:00
Dave Abrahams
45b3387c50 Tests/RunCMake/Swift: Enable more cases with Ninja Multi-Config
Also factor out testing that's common across Xcode and Ninja.* generators.

- Ninja expected output files were extended to accept directories named
  after the configuration in paths.
- Tests that previously ran with Ninja were allowed to run with Ninja
  Multi-Config.
- Swift/RunCMakeTest.cmake:
  - Checks for conditions where little or no testing could be done
    were moved to the top of the file, with return()s to limit nesting
    of the remainder of the code ("Early bailouts").
  - CMP0157 tests, which were being performed for all generators, were
    factored out into a block at the top of the file.
  - RunCMake_TEST_OPTIONS is set initially for all multi-config
    generators and list(APPEND)'ed-to in each block() where it was previously
    set() and unset().
2024-05-24 13:41:01 -07:00
Brad King
5427884f01 Merge topic 'doc-test-RunCMake'
0dbf2c24bf Tests/RunCMake: Document how to write multi-step test cases
61a08b0856 Tests/RunCMake: Document commands/variables available to RunCMakeTest scripts
aebf6b8b29 Tests/RunCMake: Clarify documentation of platform-specific output matching
c2f8a6729f Tests/RunCMake: Rename "sub-test" terminology to "case"
0add7a802f Tests/RunCMake: Organize README as multiple sections
aff4dc47c4 Tests/RunCMake: Cross-reference README from main Tests/README

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9548
2024-05-24 10:34:57 -04:00
Brad King
7b38a1dee7 Merge topic 'genex-compiler-frontend-variant'
af81b8667e GenEx: Add generator expr. for CMAKE_<LANG>_COMPILER_FRONTEND_VARIANT
8a11a39c51 Help: Use correct programming language names in docs of generator expr.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9538
2024-05-24 10:31:52 -04:00
Brad King
1d519cf796 Merge topic 'ninja-parallel'
0e5250e63c Ninja: Add option for parallel install
daeb8fffa2 Help: Add Builtin Targets section to Ninja help

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9505
2024-05-24 10:29:57 -04:00
Brad King
fa8c04b421 Tests/RunCMake/execute_process: Check STARTUPINFOW reserved members
Verify that `execute_process` launches processes on Windows such that
`GetStartupInfoW` in the child does not populate `STARTUPINFOW` members
reserved for the MSVC C run-time.

Issue: #25996
2024-05-24 10:12:27 -04:00
Brad King
0dbf2c24bf Tests/RunCMake: Document how to write multi-step test cases 2024-05-23 16:11:46 -04:00
Brad King
61a08b0856 Tests/RunCMake: Document commands/variables available to RunCMakeTest scripts 2024-05-23 16:11:40 -04:00
Brad King
aebf6b8b29 Tests/RunCMake: Clarify documentation of platform-specific output matching 2024-05-23 15:51:34 -04:00
Brad King
c2f8a6729f Tests/RunCMake: Rename "sub-test" terminology to "case"
We've long used the latter term in commit messages and comments.
2024-05-23 15:19:36 -04:00