Commit Graph

6276 Commits

Author SHA1 Message Date
Brad King
e94ace226b Merge topic 'configure-log-find-v1'
a3f273b657 cmFindBase: Create `find-v1` configure log events
58b5d41a4f cmFindBase: Track initial state with an `enum`

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !10621
2025-04-29 10:54:10 -04:00
Brad King
456cff9ebd Merge topic 'project-compat-version'
0138df29dc project: add COMPAT_VERSION keyword

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !10696
2025-04-28 11:20:01 -04:00
Ben Boeckel
a3f273b657 cmFindBase: Create find-v1 configure log events
Record `find_` command events in the configure log, except
`find_package` as it is far more complicated (and will have its own
event kind).

Note that testing only generates the events of interest, there is no
verification. Also note that testing that the "found" to "notfound"
transition causes an event is not testable because a truthy value in the
variable skips any kind of verification or other logic beyond
normalization.

Co-Authored-by: Ryan Krattiger <ryan.krattiger@kitware.com>
See: #24833
2025-04-28 13:55:36 +02:00
Vito Gamberini
0138df29dc project: add COMPAT_VERSION keyword
Fixes: #26893
2025-04-25 13:42:11 -04:00
Zack Galbreath
2df19bec2b instrumentation: include output sizes in CTest XML 2025-04-24 11:39:45 -04:00
Brad King
bf5661bb25 Merge topic 'test-ctest-regression'
6bc5b467a9 Tests: Fix RunCMake.CTestCommandLine under ctest -T Coverage

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10699
2025-04-23 08:43:05 -04:00
Brad King
6bc5b467a9 Tests: Fix RunCMake.CTestCommandLine under ctest -T Coverage
Update commit 712cb8cb14 (ctest: Restore support for -T Test without
dashboard configuration, 2025-03-06, v4.0.0-rc4~11^2) to avoid
conflating coverage of CMake itself with the coverage mode of ctest
being tested.
2025-04-22 11:25:24 -04:00
Brad King
dc8ead96c2 Merge topic 'file-download-url-error'
cc2cbfc61e file: Add more context to errors from file(DOWNLOAD)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !10672
2025-04-22 09:35:29 -04:00
Brad King
cd44c127ef Merge topic 'FindPython-SABI_LIBRARY-definition'
25cbaf162f Merge branch 'backport-FindPython-SABI_LIBRARY-definition'
bd7a27bcc7 FindPython: fix the definition of SABI artifacts
554ef95470 FindPython: fix the definition of SABI artifacts

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10687
2025-04-22 09:15:36 -04:00
Marc Chevrier
bd7a27bcc7 FindPython: fix the definition of SABI artifacts
Fixes: #26881
2025-04-21 11:47:49 -04:00
Brad King
15daf279f2 Merge topic 'swift-warning-as-error'
dfa78c4868 Swift: Honor COMPILE_WARNING_AS_ERROR for command-line build systems

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10660
2025-04-21 09:38:45 -04:00
Martin Duffy
cc2cbfc61e file: Add more context to errors from file(DOWNLOAD) 2025-04-18 13:30:05 -04:00
Evan Wilde
dfa78c4868 Swift: Honor COMPILE_WARNING_AS_ERROR for command-line build systems
Define missing CMAKE_Swift_COMPILE_OPTIONS_WARNING_AS_ERROR for Swift to
`-warnings-as-errors`.

Fixes: #26872
2025-04-18 09:26:45 -04:00
Brad King
e78cf73b52 Merge topic 'makefile-progress'
5781cf406f Makefile: Fix progress with non-excluded targets in excluded dirs
89ab14b05b cmGlobalGenerator: Constify IsExcluded use of cmLocalGenerator
0aabf32590 cmGeneratorExpression: Constify use of cmLocalGenerator
88f54fba43 cmLocalGenerator: Avoid unnecessary const-ness propagation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10658
2025-04-17 10:00:51 -04:00
Brad King
3cc9b88eba Merge topic 'fileapi-reply-on-failure'
0cc962665b fileapi: Generate partial reply when buildsystem generation fails
09aa968ed0 cmFileAPI: Add BuildReplyEntry wrapper around AddReplyIndexObject
5e0a644ee8 Tests/RunCMake/FileAPI: Explicitly specify expected reply index prefix
0a0bd69f4b Help: Polish cmake-file-api(7) manual

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !10652
2025-04-17 09:59:20 -04:00
Brad King
74c62a180d Merge topic 'empty_elseif_warning'
2a8bc1c4aa if: Add warning when elseif has no argument

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Alex Turbov <i.zaufi@gmail.com>
Merge-request: !10643
2025-04-16 09:40:23 -04:00
Brad King
9d1a0fa256 Merge topic 'normalize-input-paths'
cd4e72ca08 Normalize PWD environment variable before using it

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10659
2025-04-16 09:37:09 -04:00
xndcn
5781cf406f Makefile: Fix progress with non-excluded targets in excluded dirs
Fixes: #26871
2025-04-16 09:04:17 -04:00
Aliochat
2a8bc1c4aa if: Add warning when elseif has no argument
Resolves: #26442
2025-04-15 10:58:25 -04:00
Brad King
23bc326b81 Merge topic 'diab-asm-test'
e6e5ab6d00 Tests/RunCMake/Diab: Explicitly specify ASM compiler for asm test

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10647
2025-04-15 09:40:45 -04:00
Brad King
cd4e72ca08 Normalize PWD environment variable before using it
In commit 5aed3ee49d (cmSystemTools: Add GetLogicalWorkingDirectory,
2024-10-28, v4.0.0-rc1~528^2~6) we incorrectly trusted `PWD` to be a
normalized path so long as its realpath matches the current working
directory.

Fixes: #26870
2025-04-15 09:37:08 -04:00
Brad King
6c35c9ea22 Merge topic 'LINKER_FLAGS-CMP0181-OLD'
2e9648e0de Ninja generator: restore correct encoding for policy CMP0181=OLD

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !10645
2025-04-15 09:36:40 -04:00
Brad King
0cc962665b fileapi: Generate partial reply when buildsystem generation fails
In particular, the `configureLog` reply is useful for IDEs to read
`CMakeFiles/CMakeConfigureLog.yaml` when configuration fails.

Fixes: #26621
2025-04-14 10:42:03 -04:00
Brad King
5e0a644ee8 Tests/RunCMake/FileAPI: Explicitly specify expected reply index prefix 2025-04-14 09:34:22 -04:00
Sanjiv Gupta
e6e5ab6d00 Tests/RunCMake/Diab: Explicitly specify ASM compiler for asm test
Do not depend on detection of ASM compiler to run the asm test.
Specify `CMAKE_ASM_COMPILER` explicitly.

Fixes: #26864
2025-04-14 08:52:34 -04:00
Brad King
ee24bb6a6f Merge topic 'cmake-parent-list-file'
a9ea55f0d7 Fix CMAKE_PARENT_LIST_FILE after return from include() or find_package()
41708398eb cmMakefile: Factor out base class for list file scope RAII
ce8be3da80 cmMakefile: De-duplicate CMAKE_CURRENT_LIST_FILE variable names
0b85f8f137 Tests: Add cases for CMAKE_PARENT_LIST_FILE with include() and find_package()
002979e145 Tests/RunCMake/include: Match incidental line numbers more robustly

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10505
2025-04-14 08:29:52 -04:00
Brad King
bc1c3e94e0 Merge topic 'cps-link-only'
ebe487ea81 export: Allow export with LINK_ONLY library dependencies
13c7bb5b0c cmGeneratorExpression: Update strip function to collect parsed expressions

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10522
2025-04-14 08:25:55 -04:00
Marc Chevrier
2e9648e0de Ninja generator: restore correct encoding for policy CMP0181=OLD
Fixes: #26857
2025-04-12 16:37:57 +02:00
Benjamin Buch
a9ea55f0d7 Fix CMAKE_PARENT_LIST_FILE after return from include() or find_package()
Fix the implementation, clarify the documentation, and add tests.

Fixes: #25026
Co-authored-by: Brad King <brad.king@kitware.com>
2025-04-12 09:40:37 -04:00
Benjamin Buch
0b85f8f137 Tests: Add cases for CMAKE_PARENT_LIST_FILE with include() and find_package()
Issue: #25026
Co-authored-by: Brad King <brad.king@kitware.com>
2025-04-12 09:38:12 -04:00
Brad King
002979e145 Tests/RunCMake/include: Match incidental line numbers more robustly 2025-04-12 09:20:00 -04:00
Martin Duffy
ebe487ea81 export: Allow export with LINK_ONLY library dependencies 2025-04-11 13:20:14 -04:00
Brad King
cc2d986fdf Merge topic 'GNUInstallDirs-special-cases'
4ed399ccfb GNUInstallDirs: Change special path defaults to absolute
7566a477f7 GNUInstallDirs: Factor out helper for special absolute path logic
42dfcbf1a5 GNUInstallDirs: Refactor LIBDIR default calculation
9789f7d05e GNUInstallDirs: Add internal helper to compute specific defaults
83f44bbf53 GNUInstallDirs: Factor out helper to compute system type
0c9b6aa9e4 GNUInstallDirs: De-duplicate description of defaults
18e1341950 GNUInstallDirs: Move defaults from arguments to variables
9f41a67fce GNUInstallDirs: Reduce duplication of CMAKE_INSTALL_ prefix
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10542
2025-04-10 08:57:49 -04:00
Brad King
b309159930 Merge topic 'iar-add-icstat-support'
c7d2a17253 IAR: Add support for C-STAT static analysis

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10624
2025-04-10 08:40:28 -04:00
Brad King
180fc85666 Merge topic 'FindXCTest-xcode-16'
2e59cee922 FindXCTest: Fix test module generation for Xcode 16
c653c1aa47 FindXCTest: Pass -bundle_loader linker flag for test module more reliably

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10573
2025-04-10 08:27:40 -04:00
Brad King
3c08fa2b0d Merge topic 'FindXCTest-xcode-16' into release-4.0
2e59cee922 FindXCTest: Fix test module generation for Xcode 16
c653c1aa47 FindXCTest: Pass -bundle_loader linker flag for test module more reliably

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10573
2025-04-10 08:27:38 -04:00
Brad King
2e59cee922 FindXCTest: Fix test module generation for Xcode 16
In Xcode 7.3 and above, the `TEST_HOST` setting causes Xcode to
implicitly place the test module inside the executable bundle regardless
of the module's own location settings.  Since commit a364d2513a (Xcode:
Fixup XCTest bundle location for Xcode 7.3, 2016-03-25, v3.5.2~6^2) we
explicitly tell CMake to put the test module in the same location so
that generator expressions used by `xctest_add_test` agree with where
Xcode actually puts it.  In Xcode 16 and above, our explicit location
settings for the test module conflict with Xcode's `TEST_HOST` rules,
causing errors about multiple commands producing the same path.

Fix this by dropping CMake's explicit location for the test module
unless needed to match a project-specified location for the testee.
Instead, teach `xctest_add_test` to express the xctest module location
selected by `TEST_HOST` by using generator expressions referencing the
testee bundle.

Fixes: #26301
Fixes: #26514
2025-04-09 17:06:13 -04:00
Felipe Torrezan
c7d2a17253 IAR: Add support for C-STAT static analysis
The IAR platform offers an integrated static analysis tool named
IAR C-STAT.

Closes: #26844
2025-04-09 12:01:02 -04:00
Cristian Le
4ed399ccfb GNUInstallDirs: Change special path defaults to absolute
Add policy `CMP0192` for compatibility.

Closes: #25852
Signed-off-by: Cristian Le <git@lecris.dev>
2025-04-09 11:31:43 -04:00
Peter Kokot
44b53f8481 FindOpenSSL: Update documentation
- Added examples section.
- Synced module descriptions a bit with other find modules.
- OpenSSL_FOUND variable used. The OPENSSL_FOUND is also set by the
  find_package_handle_standard_args() to the same value.
- Described the applink interface a bit further.
2025-04-08 00:30:41 +02:00
Cristian Le
42dfcbf1a5 GNUInstallDirs: Refactor LIBDIR default calculation
Implement via the `_GNUInstallDirs_<dir>_get_default` helper.

Signed-off-by: Cristian Le <git@lecris.dev>
2025-04-04 12:17:39 -04:00
Brad King
1a87a23ca3 Merge topic 'test-tolerate-env-Werror'
2f9211b4e4 Tests: Isolate RunCMake.LinkWarningAsError from -Werror flags in environment

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10587
2025-04-04 08:24:32 -04:00
Brad King
2f9211b4e4 Tests: Isolate RunCMake.LinkWarningAsError from -Werror flags in environment
Fixes: #26836
2025-04-03 15:12:26 -04:00
Brad King
07970d3c64 Merge topic 'restore-home-tidle'
01f92efeb0 Restore expansion of leading '~' as home directory in input paths

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10580
2025-04-03 14:04:57 -04:00
Brad King
01f92efeb0 Restore expansion of leading '~' as home directory in input paths
This was accidentally dropped by commit 622596c6b2 (cmSystemTools:
Re-implement ToNormalizedPathOnDisk without translation map, 2024-10-30,
v4.0.0-rc1~528^2~5).  Previously it was done by `CollapseFullPath`.
`cm::PathResolver` intentionally does not expand `~` because it makes
sense only for transforming input paths.  Teach `ToNormalizedPathOnDisk`
to handle it directly.

Fixes: #26827
2025-04-02 14:41:48 -04:00
Brad King
ff5712fbfc Merge topic 'find_package-fix-nested-calls'
37823b366f find_package: Restore component requirements in nested calls

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10576
2025-04-02 10:23:28 -04:00
Brad King
7167236ba3 Merge topic 'find_package-fix-nested-calls' into release-4.0
37823b366f find_package: Restore component requirements in nested calls

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10576
2025-04-02 10:23:27 -04:00
Matthew Woehlke
37823b366f find_package: Restore component requirements in nested calls
Fix logic to populate required and optional components from CMake
variables when `find_package` is called in a nested context.

This was broken in commit e2a6416622 (find_package: Refactor in support
of recursion, 2024-11-29, v4.0.0-rc1~356^2), which promoted the
component sets from locals (in cmFindPackageCommand::InitialPass) to
member variables. Previously, in a nested context, these sets were
simply not filled, and we relied on the variables indicating component
requirement to already be set. When logic was added to properly fill the
sets (which is needed for CPS), it blindly dumped all components into
the required set, without actually checking whether the context had
marked the components as required or optional.

Fixes: #26824
2025-04-02 10:16:40 -04:00
Brad King
4e8495bc11 Merge topic 'revert-get_filename_component-REALPATH-symlink-parent'
94d65a9535 get_filename_component: Restore lexical preprocessing of REALPATH for compat

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10564
2025-04-02 10:12:24 -04:00
Brad King
39cccd1db8 Merge topic 'patch-CMAKE_COMPILER_IS_GNU'
50e57aa4ca CMAKE_COMPILER_IS_*: Replace with CMAKE_<LANG>_COMPILER_ID

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10551
2025-04-01 13:05:54 -04:00