Commit Graph

12253 Commits

Author SHA1 Message Date
Ben Boeckel
7ca4ac8e13 cmBuildDatabase: fix language comparison for visibility
Only C++ sources need checked for `CXX_MODULES` file set types, not the
other way around.
2025-03-03 22:00:23 +01:00
Ben Boeckel
0122e02293 Ninja: Add COMMENT to custom command and target descriptions
Fixes: #15461
2025-03-03 11:58:21 -05:00
Kitware Robot
1772622772 LICENSE: Replace references to Copyright.txt with LICENSE.rst
```
git grep -lz 'Copyright.txt or https://cmake.org/licensing ' |
  while IFS= read -r -d $'\0' f ; do
    sed -i '/Copyright.txt or https:\/\/cmake.org\/licensing / {
              s/Copyright.txt/LICENSE.rst/
            }' "$f" ; done
```
2025-03-03 10:43:35 -05:00
Brad King
67b6964efa Merge branch 'backport-license-rst' (early part) into license-rst 2025-03-03 10:42:50 -05:00
Kitware Robot
de273b2e11 LICENSE: Replace references to Copyright.txt with LICENSE.rst
```
git grep -lz 'Copyright.txt or https://cmake.org/licensing ' |
  while IFS= read -r -d $'\0' f ; do
    sed -i '/Copyright.txt or https:\/\/cmake.org\/licensing / {
              s/Copyright.txt/LICENSE.rst/
            }' "$f" ; done
```
2025-03-03 09:56:07 -05:00
Brad King
2d42a5444f LICENSE: Rename Copyright.txt to LICENSE.rst
The name `LICENSE` is now more conventional.
Format as reStructuredText to improve rendering.
2025-03-03 09:55:56 -05:00
Balazs Kosaras
14baa13ab8 CPack/RPM: Add support for all weak dependency tags
Co-authored-by: Brad King <brad.king@kitware.com>
2025-03-03 09:09:15 -05:00
Brad King
847f515934 Tests: Simplify RunCMake.CPack_RPM.SUGGESTS expected output
Drop an optional part of the output that is never printed anymore.
2025-03-03 09:09:14 -05:00
Brad King
759ba45bdb Merge topic 'cpack-rpm-weak-deps'
283a48403f CPack/RPM: Fix detection of RPM support for weak dependencies
ab4e74ad0b CPack/RPM: Remove redundant conditions for presence of rpmbuild

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10403
2025-03-03 08:56:55 -05:00
Brad King
42755a6d30 Merge topic 'string-TIMESTAMP-2038'
be2f7097ca Tests: Skip string(TIMESTAMP) 2038 case on parisc 32-bit time_t

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10409
2025-03-02 16:57:17 -05:00
Brad King
be2f7097ca Tests: Skip string(TIMESTAMP) 2038 case on parisc 32-bit time_t
This was missed by commit 74519e1c83 (string(TIMESTAMP): Fix %s
placeholder for year 2038 on Windows, 2025-02-23).
2025-03-01 14:24:13 -05:00
Brad King
283a48403f CPack/RPM: Fix detection of RPM support for weak dependencies
Add a missing `find_program` call to populate `RPM_EXECUTABLE`.
This was left out of two previous changes that intended to query
the `rpm` executable:

* In commit 9b53eca317 (CPack/RPM: Fix weak dep support, 2021-06-29,
  v3.21.0-rc2~4^2), without `RPM_EXECUTABLE` the query always failed,
  so we were concluding that weak dependencies are not supported even
  when they are.

* In commit 488de6294a (CPack: correctly perform querytags on old
  versions of RPM, 2025-01-09, v4.0.0-rc1~182^2~3), without
  `RPM_EXECUTABLE` the query always failed.  This change has not
  yet been in a release anyway.

Also fix the test case for the "suggests" field to verify this.

Issue: #22350
Reported-by: Balazs Kosaras <balazskosaras@gmail.com>
2025-02-28 17:24:44 -05:00
Marc Chevrier
aed9dffdc9 FindPython: migrate tests to RunCMake framework 2025-02-28 17:55:24 +01:00
Brad King
75da788360 Merge topic 'find-package-required'
857a039d66 find_*: Add variable to default calls to REQUIRED

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10364
2025-02-28 11:15:23 -05:00
Brad King
7f850fba3c Merge topic 'rel-sunos'
5dd973f900 ci: Convert sunos packaging jobs to build sunos-{x86_64,sparc64} binaries
fd1907e50e Utilities/Release: Convert base images to build sunos-{x86_64,sparc64}

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10401
2025-02-28 11:09:49 -05:00
Brad King
39d0fd2203 Merge topic 'rel-sunos' into release-4.0
5dd973f900 ci: Convert sunos packaging jobs to build sunos-{x86_64,sparc64} binaries
fd1907e50e Utilities/Release: Convert base images to build sunos-{x86_64,sparc64}

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10401
2025-02-28 11:09:47 -05:00
Brad King
b419c2936f Merge topic 'test-RunCMake-ld--warn-rwx-segments'
5c7224bdff Tests: Teach RunCMake to ignore GNU ld --warn-rwx-segments warnings

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10398
2025-02-28 11:04:59 -05:00
Brad King
9b86715ca9 Merge topic 'test-RunCMake-ld--warn-rwx-segments' into release-4.0
5c7224bdff Tests: Teach RunCMake to ignore GNU ld --warn-rwx-segments warnings

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10398
2025-02-28 11:04:57 -05:00
Brad King
5dd973f900 ci: Convert sunos packaging jobs to build sunos-{x86_64,sparc64} binaries 2025-02-27 16:35:09 -05:00
Martin Duffy
857a039d66 find_*: Add variable to default calls to REQUIRED
This adds a `CMAKE_FIND_REQUIRED` variable which causes `find_package`,
`find_path`, `find_file`, `find_library` and `find_program` to be
considered `REQUIRED` by default.

It also introduces an `OPTIONAL` keyword to those commands, allowing
them to ignore the value of this variable.

Issue: #26576
2025-02-27 10:51:07 -05:00
Brad King
11821a386d Merge topic 'nvpl'
9ead7c2129 FindBLAS: Add support for NVPL
dbbfec8712 Tests/Find{BLAS,LAPACK}: Comment purpose of integer size fallback
6ce494ed6d ci: Add NVPL to Debian aarch64 base image

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10374
2025-02-27 09:36:03 -05:00
Brad King
fafe7f280f Merge topic 'export-cps-build'
c8ccd5a9e3 export: Add build-tree CPS support
4577e06d91 cmExportCommand: Tag arguments that shouldn't be empty
9d83a1ed1f Tests: Rename certain CPS tests

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !10395
2025-02-27 09:29:32 -05:00
Brad King
c493e8b6de Merge topic 'string-TIMESTAMP-2038'
74519e1c83 string(TIMESTAMP): Fix %s placeholder for year 2038 on Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10389
2025-02-27 09:26:22 -05:00
Brad King
5c7224bdff Tests: Teach RunCMake to ignore GNU ld --warn-rwx-segments warnings
GNU ld 2.39 added warnings of the form

    ld: warning: %pB has a LOAD segment with RWX permissions

They appear when linking test binaries on `hppa` and `sparc`.

Debian-Issue: https://bugs.debian.org/1098956
Debian-Issue: https://bugs.debian.org/1098970
2025-02-27 09:02:52 -05:00
Vito Gamberini
9ead7c2129
FindBLAS: Add support for NVPL 2025-02-26 13:29:03 -05:00
Brad King
dbbfec8712 Tests/Find{BLAS,LAPACK}: Comment purpose of integer size fallback 2025-02-26 12:11:59 -05:00
Brad King
3bdf63e84d Merge topic 'cmake-gui-reload-presets'
74be7f5d79 cmake-gui: Add 'Reload Presets' button, replacing reload timer

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10361
2025-02-26 08:44:31 -05:00
Brad King
67f7b5935b Merge topic 'add-custom-command-xcode16-depends'
2dc8c1d45f Xcode: Fix POST_BUILD order in bundle targets on Xcode 16+

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10345
2025-02-26 08:40:32 -05:00
Brad King
74519e1c83 string(TIMESTAMP): Fix %s placeholder for year 2038 on Windows
`difftime` returns a `double`, so commit 6727270b75 (CMake: Extend
TIMESTAMP sub-commands with new unix time format specifier, 2016-02-16,
v3.6.0-rc1~338^2) cast it to `long` to get an integer result.  However,
in the MSVC ABI, `long` is a 32-bit integer.  Use an explicit 64-bit
integer type instead.

Fixes: #26716
2025-02-26 08:14:56 -05:00
Matthew Woehlke
c8ccd5a9e3 export: Add build-tree CPS support
Add Common Package Specification support to export(EXPORT).
2025-02-25 15:42:23 -05:00
Matthew Woehlke
9d83a1ed1f Tests: Rename certain CPS tests
Rename the RunCMake/PackageInfo and RunCMake/CpsExportImport tests to
indicate that they cover CPS generated by the install command. This
opens space for similar tests that will cover CPS generation via the
export command.
2025-02-25 12:18:13 -05:00
Will Bowers
74be7f5d79 cmake-gui: Add 'Reload Presets' button, replacing reload timer
Previously the presets handler in the GUI was on a timer.  Because of
this, error messages got suppressed after the first one (even if the
error message is different from the one originally suppressed).

Add a "reload presets" button which forces the preset to reload, and
always provides an error message if the reload failed.

Fixes: #26707
2025-02-25 08:20:59 -07:00
Brad King
40ed8752ef Merge topic 'genex-transitive-link-libraries'
b3da9c6d60 GenEx: Evaluate LINK_LIBRARIES target properties transitively

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10391
2025-02-25 10:08:14 -05:00
Brad King
18e041b28e Merge topic 'fix-export-export-info'
26691689a3 export: Allow compatible build-tree exports

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !10392
2025-02-25 10:06:46 -05:00
Brad King
b1c592acc8 Merge topic 'add-dependency-one-arg'
609c949061 add_dependencies: Allow calling with no dependencies

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10372
2025-02-25 10:05:19 -05:00
Brad King
40bc9bfdac Merge topic 'find_package-sort-direction'
0e2b87244c find_package: Fix CMAKE_FIND_PACKAGE_SORT_DIRECTION documented default

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10390
2025-02-25 09:53:37 -05:00
Brad King
4af0f637c4 Merge topic 'instrumentation-quote-command'
4e7b37cad3 instrumentation: Quote command arguments to preserve separation
99cd4d979b CTest: Fix startTime in test snippets when using instrumentation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10386
2025-02-25 09:38:52 -05:00
Alexandra Cherdantseva
2dc8c1d45f Xcode: Fix POST_BUILD order in bundle targets on Xcode 16+
XCode 16+ no longer delays our POST_BUILD phase until after bundle files
like `Info.plist` are generated.  Teach the Xcode generator to add
explicit dependencies to the POST_BUILD phase in bundle targets to
ensure the files are created before it runs.

Fixes: #26656
2025-02-25 08:15:12 -05:00
Hongxu Xu
0e2b87244c find_package: Fix CMAKE_FIND_PACKAGE_SORT_DIRECTION documented default
Previously the documentation said the default was `DEC`,
but the implementation has always defaulted to `ASC`.

Fixes: #22728
2025-02-24 15:03:34 -05:00
Matthew Woehlke
26691689a3 export: Allow compatible build-tree exports
Modify how cmExportBuildFileGenerator::FindExportInfo collects target
export information to properly record the export sets which export a
target. (The old behavior treated every invocation as a separate set,
which is reasonable for export(TARGETS) but does not allow referencing a
target exported multiple times via export(EXPORT). This reflects recent
changes to allow this for installed exports.)
2025-02-24 14:54:50 -05:00
Martin Duffy
609c949061 add_dependencies: Allow calling with no dependencies
Fixes: #26713
2025-02-24 13:56:31 -05:00
Martin Duffy
4e7b37cad3 instrumentation: Quote command arguments to preserve separation
Fixes: #26702
2025-02-24 13:11:19 -05:00
Brad King
b3da9c6d60 GenEx: Evaluate LINK_LIBRARIES target properties transitively
The `LINK_LIBRARIES` and `INTERFACE_LINK_LIBRARIES` target properties
establish the graph of link dependencies used to propagate usage
requirements transitively.  Therefore the `$<TARGET_PROPERTY:...>`
generator expression should evaluate them transitively as it does for
other transitive properties.  Add policy CMP0189 for compatibility.

Fixes: #26709
Issue: #12435
2025-02-24 11:43:47 -05:00
Brad King
f48beab388 Merge topic 'custom-transitive-properties'
77c7397ab4 Merge branch 'backport-3.31-custom-transitive-properties'
478d6cfd9a Merge branch 'backport-3.30-custom-transitive-properties'
8b5af40b34 GenEx: Fix evaluation of LINK_LIBRARIES as custom transitive property
161f703e76 GenEx: Restore evaluation context for conditional transitive properties
419c19d531 Tests: Extend CustomTransitiveProperties with custom transitive LINK_LIBRARIES
ff2004d430 Tests: Extend CustomTransitiveProperties with non-transitive LINK_LIBRARIES
d7f1a100d9 Tests: Split CustomTransitiveProperties argument checks into helper
5ac3cca63d Merge branch 'backport-3.31-custom-transitive-properties' (early part)
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10384
2025-02-24 09:15:47 -05:00
Brad King
77c7397ab4 Merge branch 'backport-3.31-custom-transitive-properties' 2025-02-23 08:36:56 -05:00
Brad King
478d6cfd9a Merge branch 'backport-3.30-custom-transitive-properties' 2025-02-23 08:33:12 -05:00
Brad King
8b5af40b34 GenEx: Fix evaluation of LINK_LIBRARIES as custom transitive property
Fix logic from commit b9ee79b8a1 (GenEx: Add support for custom
transitive compile properties, 2024-05-09, v3.30.0-rc1~82^2~1) to more
precisely know when we are computing the link dependency graph.

Issue: #20416
Issue: #26709
2025-02-23 08:30:42 -05:00
Brad King
419c19d531 Tests: Extend CustomTransitiveProperties with custom transitive LINK_LIBRARIES
Demonstrate presence of extra entries due to not always avoiding repeat
visits.
2025-02-23 08:28:32 -05:00
Brad King
ff2004d430 Tests: Extend CustomTransitiveProperties with non-transitive LINK_LIBRARIES 2025-02-23 08:26:45 -05:00
Brad King
d7f1a100d9 Tests: Split CustomTransitiveProperties argument checks into helper 2025-02-23 08:25:32 -05:00
Brad King
833cdca28b Merge topic 'cmake-gui-test-qt6'
245f5ca8b3 Tests: Make CMakeGUI test build with both Qt5 and Qt6
5afbc739dc ci: Specify Qt version separately for each Fedora build
e35d1ee4cd cmake-gui: Clarify variable name for selected Qt major version
19a1c115e0 cmake-gui: Fix integer conversion warnings with Qt 6
cbf0d3da52 cmake-gui: Port away from deprecated API in Qt >= 6.7

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10369
2025-02-22 09:49:25 -05:00
Alexandru Croitor
245f5ca8b3 Tests: Make CMakeGUI test build with both Qt5 and Qt6
Fixes: #26710
2025-02-21 14:41:12 -05:00
Brad King
f0140a6e72 Merge topic 'policy-version-env'
33856b1d62 Add CMAKE_POLICY_VERSION_MINIMUM environment variable
04721acc6c Tests: Cover CMAKE_POLICY_VERSION_MINIMUM in initial cache script
729470ff6d Tests: Cover CMAKE_POLICY_VERSION_MINIMUM in script mode
6cd10ffed7 Tests: Cover CMAKE_POLICY_VERSION_MINIMUM as cache entry

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Acked-by: John Parent <john.parent@kitware.com>
Merge-request: !10376
2025-02-21 09:13:01 -05:00
Brad King
1d606df7cc Merge topic 'policy-version-env' into release-4.0
33856b1d62 Add CMAKE_POLICY_VERSION_MINIMUM environment variable
04721acc6c Tests: Cover CMAKE_POLICY_VERSION_MINIMUM in initial cache script
729470ff6d Tests: Cover CMAKE_POLICY_VERSION_MINIMUM in script mode
6cd10ffed7 Tests: Cover CMAKE_POLICY_VERSION_MINIMUM as cache entry

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Acked-by: John Parent <john.parent@kitware.com>
Merge-request: !10376
2025-02-21 09:12:59 -05:00
Brad King
790954b29d Merge topic 'fix-cps-in-prefix-root'
da0d2a996d CPS: Fix importing from the prefix root

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10375
2025-02-21 09:09:59 -05:00
Brad King
0dd8cdc831 Merge topic 'fix-cps-in-prefix-root' into release-4.0
da0d2a996d CPS: Fix importing from the prefix root

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10375
2025-02-21 09:09:56 -05:00
Brad King
81522be1bb Merge topic 'test-implicit-link-info'
626d466b12 Tests: Make RunCMake.ParseImplicitLinkInfo robust to on-disk libstdc++.a
bf2067d67b Tests: Fix typos in RunCMake.ParseImplicitLinkInfo sample data

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10378
2025-02-21 09:08:22 -05:00
Brad King
626d466b12 Tests: Make RunCMake.ParseImplicitLinkInfo robust to on-disk libstdc++.a
Extend commit 1d7fddca8e (CMakeParseImplicitLinkInfo: Honor GNU static
runtime library flags, 2021-06-02, v3.21.0-rc1~85^2) to cover Cray 8.7
sample data.
2025-02-20 18:50:34 -05:00
Brad King
bf2067d67b Tests: Fix typos in RunCMake.ParseImplicitLinkInfo sample data 2025-02-20 18:50:16 -05:00
Brad King
33856b1d62 Add CMAKE_POLICY_VERSION_MINIMUM environment variable
Extend commit 1a35351125 (Add CMAKE_POLICY_VERSION_MINIMUM to help
configure outdated projects, 2025-02-13, v4.0.0-rc1~12^2) with an
environment variable to initialize the cache entry.  That will make it
easier to use when `cmake` is invoked under layers of scripting.

Closes: #26715
2025-02-20 16:55:53 -05:00
Brad King
04721acc6c Tests: Cover CMAKE_POLICY_VERSION_MINIMUM in initial cache script 2025-02-20 16:27:05 -05:00
Brad King
729470ff6d Tests: Cover CMAKE_POLICY_VERSION_MINIMUM in script mode 2025-02-20 15:59:03 -05:00
Brad King
6cd10ffed7 Tests: Cover CMAKE_POLICY_VERSION_MINIMUM as cache entry 2025-02-20 15:48:00 -05:00
Matthew Woehlke
da0d2a996d CPS: Fix importing from the prefix root
Tweak resolution of CPS prefix path to support the case of the .cps file
being in the prefix root.
2025-02-20 14:49:53 -05:00
Brad King
5585b2521e Merge topic 'compile-commands-posix-paths'
971a8ded06 EXPORT_COMPILE_COMMANDS: Write absolute posix paths to compile_commands.json
ff119423b9 EXPORT_COMPILE_COMMANDS: Append missing newline to compile_commands.json
92fb080ed6 Tests/RunCMake/Swift: Fix CompileCommands expected regex
7d8b39226c cmGlobalNinjaGenerator: Remove obsolete TODO comment

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !10357
2025-02-20 10:27:24 -05:00
ClausKlein
971a8ded06 EXPORT_COMPILE_COMMANDS: Write absolute posix paths to compile_commands.json
Avoid platform-specific path formats in structured fields.
2025-02-18 16:03:15 -05:00
ClausKlein
ff119423b9 EXPORT_COMPILE_COMMANDS: Append missing newline to compile_commands.json 2025-02-18 16:01:24 -05:00
Brad King
92fb080ed6 Tests/RunCMake/Swift: Fix CompileCommands expected regex
Previously missing `()` were allowing `|` to match only partial results.
2025-02-18 15:59:36 -05:00
Brad King
d2cda92936 Merge topic 'remove-FindGCCXML'
2123244746 FindGCCXML: Add policy to remove this module

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10359
2025-02-18 09:51:32 -05:00
Brad King
121b1f717a Merge topic 'instrumentation-presets-hooks'
45d3ffaa95 instrumentation: Use auto for variables holding closures
d75ccd9f8d instrumentation: Fix docs for ctest --collect-instrumentation option
a2232db802 instrumentation: Make hooks compatible with presets

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10352
2025-02-18 09:49:47 -05:00
Brad King
2123244746 FindGCCXML: Add policy to remove this module
GCC-XML has been superseded by CastXML for a long time.

Closes: #26687
2025-02-17 11:35:25 -05:00
Martin Duffy
a2232db802 instrumentation: Make hooks compatible with presets 2025-02-17 11:03:28 -05:00
Brad King
ceacabc654 Merge topic 'regex2'
8d455809b0 string: Allow zero-length matches in all REGEX subcommands
ca65fa9a7f string: Allow references to unmatched groups in REGEX REPLACE

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10251
2025-02-16 11:12:28 -05:00
Brad King
ad13d2f99a Merge topic 'source-with-and-without-extension'
321c647640 Include source file without an extension after the same name with an extension

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !10271
2025-02-16 11:11:09 -05:00
Brad King
3132d62460 Merge topic 'cps-export-components'
647633e961 Tests: Add CPS end-to-end test
85721c4c56 install(PACKAGE_INFO): Export required components

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10339
2025-02-16 11:02:40 -05:00
Brad King
bbbf373fe8 Merge topic 'cps-export-components' into release-4.0
647633e961 Tests: Add CPS end-to-end test
85721c4c56 install(PACKAGE_INFO): Export required components

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10339
2025-02-16 11:02:38 -05:00
Brad King
2526b01ffc Merge topic 'instrumentation_cdash'
a6d4a9a2ae ctest: Include cmake instrumentation data in XML files
85a63143ed instrument: don't report target=TARGET_NAME

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10332
2025-02-16 10:58:12 -05:00
Brad King
4300d08b20 Merge topic 'instrumentation_cdash' into release-4.0
a6d4a9a2ae ctest: Include cmake instrumentation data in XML files
85a63143ed instrument: don't report target=TARGET_NAME

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10332
2025-02-16 10:58:11 -05:00
Brad King
a36b38502c Merge topic 'rel-sunos'
28f1da4b25 ci: Add jobs to build sunos-{i386,sparc} binaries
59ed18e54d Utilities/Release: Add base images to build sunos-{i386,sparc} binaries
a4e5719d31 Solaris: Rename local variable to avoid conflict with system headers

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10350
2025-02-16 10:55:40 -05:00
Matthew Woehlke
647633e961 Tests: Add CPS end-to-end test
Add a test that validates that we can export a package in CPS format and
import it again. This is fairly simplistic at the moment, but still
serves to validate some recent fixes that are not covered by more
targeted unit tests.
2025-02-15 07:49:13 -05:00
Matthew Woehlke
85721c4c56 install(PACKAGE_INFO): Export required components
Modify cmExportPackageInfoGenerator to record not just what packages are
required, but what targets (components) are used by those requirements,
and to populate the requirements' component lists accordingly.
2025-02-15 07:49:13 -05:00
Brad King
95f0039f43 Merge topic 'cray_cce_omp_offload_linker'
3b18fa9e8b Cray: Fix OpenMP linking issue
e8e48ebabd Cray: Enable Cray linker wrapper detection

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10346
2025-02-15 07:45:06 -05:00
Brad King
f9e51b61cd Merge topic 'enum_set-enhancements'
4d48958965 enum_set enhancements, step 3

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10335
2025-02-15 07:31:40 -05:00
Brad King
28f1da4b25 ci: Add jobs to build sunos-{i386,sparc} binaries 2025-02-15 07:28:07 -05:00
Zack Galbreath
a6d4a9a2ae ctest: Include cmake instrumentation data in XML files 2025-02-15 06:25:12 -05:00
Zack Galbreath
85a63143ed instrument: don't report target=TARGET_NAME
Remove the erroneous default target name when instrumenting
custom commands.
2025-02-15 06:21:58 -05:00
Nikita Nemkin
8d455809b0 string: Allow zero-length matches in all REGEX subcommands
The semantics mimic other languages like Python, Java, JS, etc.
To advance past a zero-length match, the search algorithm first
tries to find a non-zero alternative branch. If that fails, it
force-advances by 1 character.

Fixes: #13790, #13792, #18690, #26629
2025-02-15 01:01:49 +05:00
Nikita Nemkin
ca65fa9a7f string: Allow references to unmatched groups in REGEX REPLACE
References to unmatched groups will be replaced with empty strings.

Issue: #26629
Fixes: #19012
2025-02-15 01:00:58 +05:00
John Rodgers
3b18fa9e8b Cray: Fix OpenMP linking issue
Add the `CrayClang` compiler ID to the list of OpenMP flag candidates and
ensure the flags are propagated to the link step to trigger the Cray OpenMP
offload linker (`cce_omp_offload_linker`) wrapper.

Fixes: #24402, #24962
2025-02-14 12:54:49 -06:00
John Rodgers
e8e48ebabd Cray: Enable Cray linker wrapper detection
Enable detection of the Cray OpenMP offload linker (`cce_omp_offload_linker`)
at the parse implicit link info CMake stage.

Issues: #24402, #24962
2025-02-14 12:54:25 -06:00
Evan Wilde
321c647640 Include source file without an extension after the same name with an extension
CMP0115 requires that source files listed in CMake must include their
file extension, but there are cases when projects have different source
files with the same name, but one with an extension and one without.
In the current state, CMake will ignore the file without the extension
an always map it to the file with an extension.

```cmake
add_library(foo bar.c bar)
```

In the above example, the target `foo` will only recognize and depend on
`bar.c` and miss the file `bar` unless `bar` comes before `bar.c` in the
source list.
This issue also affects how custom commands emit files.

This change adds a new policy to recognize files with and without a file
extension as different files, both when building targets, and when they
are being created.

Fixes: #26058
2025-02-14 10:01:10 -05:00
Brad King
8845d33292 Merge topic 'regex'
5d039f3be3 regex: Match ^ at most once in repeated searches

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10221
2025-02-14 09:38:04 -05:00
Brad King
dce6a7aa61 Merge topic 'policy-version-var'
1a35351125 Add CMAKE_POLICY_VERSION_MINIMUM to help configure outdated projects
d723198539 Help: De-duplicate policy version documentation
e5d29e9e00 Help: Drop cmake_minimum_required pre-2.4 behavior

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10343
2025-02-14 09:32:36 -05:00
Brad King
47689e9253 Merge topic 'policy-version-var' into release-4.0
1a35351125 Add CMAKE_POLICY_VERSION_MINIMUM to help configure outdated projects
d723198539 Help: De-duplicate policy version documentation
e5d29e9e00 Help: Drop cmake_minimum_required pre-2.4 behavior

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10343
2025-02-14 09:32:33 -05:00
Brad King
b9ae6f7154 Merge topic 'fix_autogen_dependencies'
2b314e9009 Autogen: Fix missing autogen dependencies if a target is linked twice

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10344
2025-02-14 09:27:59 -05:00
Brad King
4b41264469 Merge topic 'vs-version'
e5fd973b14 VS: Set the linker image version using the target's VERSION property
2e798a4137 VS: Fix UnityBuild test selection in VS10Project tests

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10307
2025-02-14 09:18:23 -05:00
Marc Chevrier
4d48958965 enum_set enhancements, step 3 2025-02-14 10:38:34 +01:00
Alexandru Croitor
2b314e9009 Autogen: Fix missing autogen dependencies if a target is linked twice
Autogen contains code to forward dependencies from an origin target
to its associated <origin>_autogen target. This code also contains a
check to skip forwarding a dependency if it does not appear in the
dependency graph for all configured build types.
This is done by counting the number of times a dependency appears in
the graph for each configured build type.

Unfortunately the code did not account for the case when a dependency
appears more than once in the link graph for a single build type. This
means that for a single-config build, if the same dependency is linked
twice, the dependency will be skipped altogether.

This can lead to build errors in a project where a hypothetical App
target depends on a Lib target, and thus expects App_autogen to depend
on Lib_autogen and any of its dependencies, but the latter is skipped.

Fix this by incrementing the count of a target in the dependency graph
only once per build type.

Fixes: #26700
2025-02-13 14:33:41 -05:00
Brad King
1a35351125 Add CMAKE_POLICY_VERSION_MINIMUM to help configure outdated projects
Provide packagers and end users with a way to try configuring projects that
have not been updated to set their policy version to a supported level.

Closes: #26698
2025-02-13 14:00:26 -05:00
Nikita Nemkin
5d039f3be3 regex: Match ^ at most once in repeated searches
When doing successive matches, track the input start and current search
start positions separately to prevent the `^` anchor from matching in
the middle of the string.  Add policy CMP0186 to provide compatibility.

Issue: #26629
Fixes: #16899
2025-02-13 20:00:02 +05:00