Commit Graph

37428 Commits

Author SHA1 Message Date
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
Brad King
41708398eb cmMakefile: Factor out base class for list file scope RAII 2025-04-12 09:39:17 -04:00
Brad King
ce8be3da80 cmMakefile: De-duplicate CMAKE_CURRENT_LIST_FILE variable names 2025-04-12 09:39:17 -04:00
Kitware Robot
95437332ec CMake Nightly Date Stamp 2025-04-12 00:07:23 -04:00
Martin Duffy
ebe487ea81 export: Allow export with LINK_ONLY library dependencies 2025-04-11 13:20:14 -04:00
Martin Duffy
13c7bb5b0c cmGeneratorExpression: Update strip function to collect parsed expressions 2025-04-11 10:54:20 -04:00
Kitware Robot
3ecefb7154 CMake Nightly Date Stamp 2025-04-11 00:04:21 -04:00
Brad King
ee515b2aa8 CMake 4.0.1 2025-04-10 10:58:22 -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
Kitware Robot
b9b2005e35 CMake Nightly Date Stamp 2025-04-10 00:06:45 -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
Brad King
11f67538c1 Merge topic 'update-kwsys'
abe4e4466b Merge branch 'upstream-KWSys' into update-kwsys
21c464252f KWSys 2025-04-09 (0fa969cb)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10625
2025-04-09 11:36:27 -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
Brad King
abe4e4466b Merge branch 'upstream-KWSys' into update-kwsys
# By KWSys Upstream
* upstream-KWSys:
  KWSys 2025-04-09 (0fa969cb)
2025-04-09 09:37:34 -04:00
Brad King
cacd17230f Merge topic 'apple-CoreFoundation-headers'
d736dafa22 Merge branch 'backport-3.31-apple-CoreFoundation-headers'
42390e7aa2 Source: Include specific CoreFoundation headers instead of umbrella header
14ffd1cc4e cmXCodeObject: Drop unused CoreFoundation header

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10616
2025-04-09 09:08:38 -04:00
Kitware Robot
e15833c7c7 CMake Nightly Date Stamp 2025-04-09 00:04:24 -04:00
Brad King
d736dafa22 Merge branch 'backport-3.31-apple-CoreFoundation-headers' 2025-04-08 11:39:10 -04:00
Sergey Fedorov
42390e7aa2 Source: Include specific CoreFoundation headers instead of umbrella header
Some CoreFoundation headers included by the umbrella header, which we do
not need, use syntax that GCC does not support.  Avoid including them.

GCC-Issue: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115880
2025-04-08 11:38:24 -04:00
Brad King
14ffd1cc4e cmXCodeObject: Drop unused CoreFoundation header
It has not been needed since commit d250b67722 (cmGlobalXCodeGenerator:
Adopt pbxproj object id generation, 2021-01-06, v3.19.3~4^2~2).
2025-04-08 11:38:23 -04:00
Brad King
8a3860379d Merge topic 'normalize-input-paths'
5805461074 cmSystemTools: Simplify call to FindProgram for our own executable
db0e2574cb cmSystemTools: Restore FindProgram look-up of on-disk case on Windows
5d700abda4 Source: Simplify FindProgram calls

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10620
2025-04-08 10:45:46 -04:00
Brad King
f21682cf1a Merge topic 'normalize-input-paths' into release-4.0
5805461074 cmSystemTools: Simplify call to FindProgram for our own executable
db0e2574cb cmSystemTools: Restore FindProgram look-up of on-disk case on Windows
5d700abda4 Source: Simplify FindProgram calls

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10620
2025-04-08 10:45:45 -04:00
Brad King
dc55705681 Merge topic 'apple-posix'
f183631ae3 Merge branch 'backport-3.31-apple-posix' into apple-posix
aa64d4482f macOS: Define _DARWIN_C_SOURCE in more sources

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10619
2025-04-08 10:42:17 -04:00
Brad King
9d3954e26d Merge topic 'patch-FindLibLZMA'
86ed465ee6 FindLibLZMA: Update documentation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10614
2025-04-08 10:37:20 -04:00
Brad King
0033f46d97 Merge topic 'patch-FindCurses'
fb53372487 FindCurses: Update documentation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10597
2025-04-08 10:00:37 -04:00
Kitware Robot
a970c5cfdb CMake Nightly Date Stamp 2025-04-08 00:04:31 -04:00
Brad King
5805461074 cmSystemTools: Simplify call to FindProgram for our own executable
Remove the unnecessary `FindProgramPath` wrapper.  Call the KWSys
`FindProgram` directly, without our CMake-specific wrapper, since
we follow-up with a `ToNormalizedPathOnDisk` anyway.
2025-04-07 19:57:07 -04:00
Brad King
db0e2574cb cmSystemTools: Restore FindProgram look-up of on-disk case on Windows
KWSys's `FindProgram` no longer looks up the actual case on disk.  This
behavior change was inherited from the change to `CollapseFullPath`.
Extend commit 773b75e4ed (cmake: Explicitly look up on-disk case of
input paths on Windows, 2024-10-23, v4.0.0-rc1~589^2) to cover this by
wrapping `FindProgram` in a CMake-specific layer.

Issue: #20214
2025-04-07 19:57:07 -04:00
Brad King
5d700abda4 Source: Simplify FindProgram calls
Remove defaulted arguments.  Remove unnecessary `.c_str()`.
2025-04-07 19:55:30 -04:00
Brad King
f183631ae3 Merge branch 'backport-3.31-apple-posix' into apple-posix 2025-04-07 15:57:25 -04:00
Sergey Fedorov
aa64d4482f macOS: Define _DARWIN_C_SOURCE in more sources
Restore Darwin APIs removed by `_POSIX_C_SOURCE`.
2025-04-07 15:56:36 -04:00
Peter Kokot
86ed465ee6 FindLibLZMA: Update documentation
- Module documentation synced a bit with other similar find modules.
- Added examples section.
2025-04-07 21:50:30 +02:00
Kitware Robot
9c3cf45c82 CMake Nightly Date Stamp 2025-04-07 00:04:58 -04:00
Kitware Robot
8d034572fd CMake Nightly Date Stamp 2025-04-06 00:04:37 -04:00
Peter Kokot
fb53372487 FindCurses: Update documentation
- Module documentation synced with other similar find modules.
- Added examples section.
- Documented backward-compatibility variables as deprecated.
- Added versions mentioning when variable got obsoleted/deprecated.
- Curses_FOUND variable used instead of the CURSES_FOUND. Both are set
  by the find_package_handle_standard_args().
2025-04-05 21:34:34 +02:00
Kitware Robot
e2e5303fe2 CMake Nightly Date Stamp 2025-04-05 00:04:50 -04:00
Brad King
9856550232 Merge topic 'improve-cps-multiple-inclusion'
de5fa2ae53 find_package: Improve support for CPS multiple inclusion

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10586
2025-04-04 08:38:31 -04:00
Kitware Robot
995c633e91 CMake Nightly Date Stamp 2025-04-04 00:04:30 -04:00
Matthew Woehlke
de5fa2ae53 find_package: Improve support for CPS multiple inclusion
Keep track of CPS files we have imported in CMake's state, and use this
(instead of the prior, temporary work-around that used `<name>_CONFIG`)
as a guard for trying to import more than once from the same file. This
has two advantages; first, it is robust against finding the same package
name in different locations in alternating searches, and second, it
allows us to load additional appendices associated with a root package
that has already been loaded.

Fixes: #26731
2025-04-03 14:40:39 -04:00
Brad King
be1f4dde2e Merge topic 'find_package-cps-multiple-inclusion'
b498611902 find_package: Add minimal support for CPS multiple inclusion

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10581
2025-04-03 14:06:53 -04:00
Brad King
3e4519a4e3 Merge topic 'find_package-cps-multiple-inclusion' into release-4.0
b498611902 find_package: Add minimal support for CPS multiple inclusion

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10581
2025-04-03 14:06:51 -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
42e7c0aa27 Merge topic 'fix-state-reset'
acaae6d265 cmState: Improve how state is reset

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !10583
2025-04-03 14:03:34 -04:00
Kitware Robot
a2530fd955 CMake Nightly Date Stamp 2025-04-03 00:04:41 -04:00
Matthew Woehlke
acaae6d265 cmState: Improve how state is reset
Modify cmState::Reset to create a fresh BuildsystemDirectoryStateType
for the root, rather than trying to reset the old one. This is less
brittle with respect to changes made to BuildsystemDirectoryStateType
(e.g. adding new members).
2025-04-02 15:18:00 -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
Matthew Woehlke
b498611902 find_package: Add minimal support for CPS multiple inclusion
Do not try to load a CPS file if we've already loaded the same file.
This only works if the current `find_package` call selects the same file
as the previous most recent call, and if the user has not meddled with
the `<name>_CONFIG` variable.

Issue: #26731
2025-04-02 13:45:36 -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
Brad King
3178be226d Merge topic 'cmake-cache-line-parser'
a5281fd635 cmCacheManager: clarify whitespace skipping

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !10571
2025-04-02 10:22:12 -04:00