Commit Graph

37006 Commits

Author SHA1 Message Date
Brad King 4b5b172a65 CMake 4.0.0-rc1 2025-02-19 09:18:19 -05:00
Martin Duffy 45d3ffaa95 instrumentation: Use auto for variables holding closures 2025-02-17 11:08:30 -05:00
Martin Duffy a2232db802 instrumentation: Make hooks compatible with presets 2025-02-17 11:03:28 -05:00
Brad King 47faea8e15 Merge topic 'version-standalone' into release-4.0
de7648117a CMakeVersion: Make script independently loadable

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10356
2025-02-17 10:31:38 -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
Brad King de7648117a CMakeVersion: Make script independently loadable 2025-02-16 09:29:17 -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 a4e5719d31 Solaris: Rename local variable to avoid conflict with system headers 2025-02-15 07:28:06 -05:00
Brad King 6597a470c7 Merge topic 'update-curl' into release-4.0
80ec307900 curl: Set build options the way we need for CMake
ba77812035 Merge branch 'upstream-curl' into update-curl
1865f86e28 curl 2025-02-13 (57495c64)
302d842f6e curl: Update script to get curl 8.12.1

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10342
2025-02-15 07:27:27 -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
Brad King 80ec307900 curl: Set build options the way we need for CMake
Set options added by the update to curl 8.12.1.

In particular, now that upstream curl's CMake code depends on
OpenSSL via imported targets from FindOpenSSL, we can let it
handle the transitive dependency on posix threads.
2025-02-14 08:57:11 -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 8e38ea12ec Merge topic 'cps-fix-config-import' into release-4.0
0ba5343b66 cmPackageInfoReader: Fix configuration-specific importing

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10330
2025-02-12 09:33:54 -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 6571bf0be5 Merge topic 'update-kwsys' into release-4.0
9afe813781 Merge branch 'upstream-KWSys' into update-kwsys
7cd4048b3a KWSys 2025-02-12 (49c09912)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10327
2025-02-12 09:27:37 -05:00
Brad King e14b86b7ff Merge topic 'findbase_dont_erase_outofbounds_entry' into release-4.0
f5837f0ac9 cmFindBase: Don't pass vector::erase an out of bounds iterator

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10331
2025-02-12 09:23: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
Brad King 9afe813781 Merge branch 'upstream-KWSys' into update-kwsys
# By KWSys Upstream
* upstream-KWSys:
  KWSys 2025-02-12 (49c09912)
2025-02-12 07:24:00 -05:00
Robert Maynard f5837f0ac9 cmFindBase: Don't pass vector::erase an out of bounds iterator
Fixes: #26606
2025-02-11 14:59:21 -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 0ba5343b66 cmPackageInfoReader: Fix configuration-specific importing
Modify cmPackageInfoReader to also append the configuration to the
IMPORTED_CONFIGURATIONS property of every target which has configuration
specific properties. We retain pre-populating this with the package's
default_configurations (if specified) in order to ensure that those are
given preference, but we also need to add every configuration that
actually exists in order to ensure that the target is usable, especially
if default_configurations was not provided.
2025-02-11 13:23:29 -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
Matthew Woehlke caff0d62c6 cmFindPackageCommand: Simplify cmStrCat
Replace an unnecessary single-character string_view in cmStrCat with a
literal character.
2025-02-11 12:29:06 -05:00
Brad King b2674f3b38 Merge topic 'instrumentation-doc-fixes' into release-4.0
32e9d27c88 instrumentation: Remove undocumented binaryDir field from snippets
d88458b5ea instrumentation: Improve documentation for CMake Instrumentation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10320
2025-02-11 07:46:46 -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
Martin Duffy 32e9d27c88 instrumentation: Remove undocumented binaryDir field from snippets
Removes field from snippet files redundant with the index file's "buildDir"
2025-02-10 17:19:10 -05:00
Brad King 0938643895 Merge branch 'upstream-KWSys' into update-kwsys
# By KWSys Upstream
* upstream-KWSys:
  KWSys 2025-02-10 (2e2f80f1)
2025-02-10 08:27:08 -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
Brad King 599ad2b12d Merge topic 'sunos-i386-mkdtemp' into release-4.0
4db9e1009d Solaris: Backport our mkdtemp code paths to SunOS 5.10 i386
f189e64126 Tests: Add cases covering our mkdtemp code paths

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10313
2025-02-10 08:21:01 -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 ef848cdfc7 cmake: Add default CA path /etc/opt/csw/ssl/certs on Solaris
Extend commit 0abd3e538e (cmake: Use a default CA path when not using
system curl, 2015-01-22, v3.2.0-rc1~66^2) to cover Solaris with OpenCSW.
2025-02-09 13:31:07 -05:00
Brad King 4db9e1009d Solaris: Backport our mkdtemp code paths to SunOS 5.10 i386
`mkdtemp` is not available on this architecture until SunOS 5.11.
Look up the symbol at runtime, and if missing, fall back to an
approximate implementation.
2025-02-09 13:29:39 -05:00
Martin Duffy 9689155a05 instrumentation: Add Config value to snippet data 2025-02-09 12:29:09 -05:00
Martin Duffy ee3a55fc48 cmMakefileGenerator: Update GetConfigName to return const reference 2025-02-09 12:29:08 -05:00
Matthew Woehlke 35a7ed125b find_package: Fix reporting of rejected CPS files' version
The logic to extract the version of a CPS file into the location used to
record files that were considered but rejected was happening too late,
resulting in rejected files unnecessarily reporting their version as
"unknown". Fix this by filling the variable sooner.
2025-02-07 11:57:54 -05:00
Aditya Vidyadhar Kamath ff03db6657 AIX: Add platform id variables 'AIX' and 'CMAKE_HOST_AIX'
This allows projects to use `if(AIX)` blocks instead of spelling
out `if(CMAKE_SYSTEM_NAME STREQUAL "AIX")`.  We already have similar
variables for many other platforms.
2025-02-07 11:10:43 -05:00
Brad King e74ff65385 Merge topic 'instrumentation-make-hooks' into release-4.0
314440c320 instrumentation: Run preBuild and postBuild hooks before and after make
6598248da7 instrumentation: Avoid busy-wait on postBuild hook
f8339cb944 instrumentation: Enable tests on more Makefile generators
0fbb927bdd instrumentation: Disable preBuild and postBuild hooks on Windows
a13be1301f Tests/RunCMake/Instrumentation: Improve quoting and escaping in CMake code

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10295
2025-02-07 08:32:04 -05:00
Brad King fc18e51970 Merge topic 'update-kwsys' into release-4.0
a78db45626 Merge branch 'upstream-KWSys' into update-kwsys
1a8650a908 KWSys 2025-02-07 (60bb82bc)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10299
2025-02-07 08:19:53 -05:00
Brad King a78db45626 Merge branch 'upstream-KWSys' into update-kwsys
# By KWSys Upstream
* upstream-KWSys:
  KWSys 2025-02-07 (60bb82bc)
2025-02-07 07:16:44 -05:00
Brad King ae68964f5d Merge topic 'multiline-cache-help' into release-4.0
637a0f7ed4 cmCacheManager: Prevent corruption from multiline help strings

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10290
2025-02-06 10:39:11 -05:00
Martin Duffy 314440c320 instrumentation: Run preBuild and postBuild hooks before and after make
Updates the preBuild and postBuild instrumentation hooks to run before and
after make is invoked.
2025-02-06 09:49:09 -05:00