Commit Graph

12122 Commits

Author SHA1 Message Date
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
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
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
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
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
Martin Duffy
4e7b37cad3 instrumentation: Quote command arguments to preserve separation
Fixes: #26702
2025-02-24 13:11:19 -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
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
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
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
Martin Duffy
a2232db802 instrumentation: Make hooks compatible with presets 2025-02-17 11:03:28 -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
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
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
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
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
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
Brad King
3f2386db2b Merge topic 'find-cps-version' into release-4.0
3e6466eb16 find_package: Honor version requests when finding CPS packages
7a0e698384 find_package: Fix CPS version parsing
35a7ed125b find_package: Fix reporting of rejected CPS files' version

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10297
2025-02-13 09:33:04 -05:00
Matthew Woehlke
3e6466eb16 find_package: Honor version requests when finding CPS packages
Teach find_package to check a CPS package's version (when provided)
against a version request given to the find_package invocation.
2025-02-12 11:36:41 -05:00
Matthew Woehlke
7a0e698384 find_package: Fix CPS version parsing
Update cmPackageInfoReader's version parsing to more fully conform to
the specification and to reject non-conforming version strings. Start
adding framework to support version schemas other than "simple". Fix how
cmFindPackageCommand extracts version parts to not fail if more than
four parts are present.
2025-02-12 11:35:54 -05:00
Brad King
1d274d34b9 Merge topic 'instrumentation-build-snippet' into release-4.0
c8e319d08c instrumentation: Add experimental notes to docs
f777af7734 instrumentation: Update docs for available snippets
2299b2fcab instrumentation: Add build snippet

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10328
2025-02-12 09:43:17 -05:00
Brad King
4977e98594 Merge topic 'cps-fix-extra-schema' into release-4.0
83b22da7ac cmPackageInfoReader: Inherit cps_version
caff0d62c6 cmFindPackageCommand: Simplify cmStrCat

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10329
2025-02-12 09:32:37 -05:00
Brad King
7e5a80c7ff Merge topic 'execute_process-cmd-bat' into release-4.0
b902fbd0c6 execute_process: Clarify when a Windows command interpreter is used
e388ed687a execute_process: Improve invocation of .cmd/.bat with spaces

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Nikita Nemkin <nikita@nemkin.ru>
Acked-by: Alexey Edelev <alexey.edelev@qt.io>
Merge-request: !10321
2025-02-12 09:10:03 -05:00
Martin Duffy
2299b2fcab instrumentation: Add build snippet
Adds a new snippet generation for recording the full time spent waiting for
`ninja` or `make` invocations to finish.
2025-02-11 13:31:28 -05:00
Matthew Woehlke
83b22da7ac cmPackageInfoReader: Inherit cps_version
Modify cmPackageInfoReader to not require schema_version in supplemental
files (i.e. appendices and/or configuration-specific files). This is
important as our own generation is not including cps_version in
supplemental files, and it is forbidden in the same according to a
strict reading of the specification.
2025-02-11 12:32:46 -05:00
Brad King
ab8b94986d Tests: Fix memory leak in CMakeLib.testUVPatches
In commit f189e64126 (Tests: Add cases covering our mkdtemp code paths,
2025-02-07) we forgot to close the libuv default loop.
2025-02-11 07:57:42 -05:00
Brad King
2baab9b99f Merge topic 'print-presets-log-level' into release-4.0
5303ad3823 Presets: Only print presets variables for verbose log level or higher

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10315
2025-02-11 07:45:21 -05:00
Brad King
e388ed687a execute_process: Improve invocation of .cmd/.bat with spaces
Extend the fix from commit 74c9d40876 (execute_process: Fix invocation
of .cmd/.bat with spaces, 2025-01-31) to work without relying on
conversion to a "short path", which may not exist.  Instead, extending
the `cmd /c` wrapper to `cmd /c call` seems to support spaces directly.

Suggested-by: Alexandru Croitor <alexandru.croitor@qt.io>
Fixes: #26655
2025-02-10 19:44:19 -05:00
Brad King
640cf691fe Merge topic 'instrumentation-build-config' into release-4.0
9689155a05 instrumentation: Add Config value to snippet data
ee3a55fc48 cmMakefileGenerator: Update GetConfigName to return const reference

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10300
2025-02-10 08:24:59 -05:00
Craig Scott
5303ad3823
Presets: Only print presets variables for verbose log level or higher
Fixes: #26664
2025-02-10 22:56:55 +11:00
Brad King
f189e64126 Tests: Add cases covering our mkdtemp code paths
* `cmSystemTools::MakeTempDirectory` is our own code.

* `uv_fs_mkdtemp` requires patching to backport to platforms
  not supported by upstream libuv.
2025-02-09 13:29:38 -05:00
Martin Duffy
9689155a05 instrumentation: Add Config value to snippet data 2025-02-09 12:29:09 -05:00
Brad King
b1e37ad8bb Tests: Port CMakeLib.testSystemTools to common infrastructure 2025-02-08 09:51:18 -05:00