Commit Graph

12253 Commits

Author SHA1 Message Date
Brad King
6987e87032 Merge topic 'json-parse-errors'
bed7e90bae cmJSONState: Use StructuredErrors when available

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10472
2025-03-18 09:54:15 -04:00
Brad King
953e5ec831 Merge branch 'backport-export-multiple-set-not-installed' 2025-03-17 18:04:53 -04:00
Martin Duffy
d723409e8e export: Allow multiple exports when only one export is installed
Since commit c8997fc046 (export: Allow depending on targets exported
multiple times, 2024-12-26, v4.0.0-rc1~241^2), it is possible to depend
on a target exported multiple times so long as the target is exported in
only one set and with a consistent namespace.  However, as a
side-effect, a target could not be in multiple export sets even if only
one of those sets was installed.

Update the check so that uninstalled export sets do not count towards a
target being exported multiple times.
2025-03-17 18:01:30 -04:00
Martin Duffy
bed7e90bae cmJSONState: Use StructuredErrors when available
When the version of JsonCpp permits it, use StructuredErrors to generate
error messages for parse errors in the same style as other CMake-generated
JSON error messages.

Fixes: #26717
2025-03-17 14:17:34 -04:00
Brad King
c005babf89 Merge topic 'pkgc-name-prefix'
f59bab006d PkgC: Add NAME and PREFIX

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !10473
2025-03-17 11:52:18 -04:00
Vito Gamberini
f59bab006d
PkgC: Add NAME and PREFIX
Fixes: #26067
2025-03-14 15:17:27 -04:00
Brad King
2604f5d8b3 Merge topic 'json-errors-filename'
f134468a98 JSON: Improve JSON error message formatting

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10463
2025-03-14 12:17:02 -04:00
Brad King
718886fa60 Merge topic 'FortranCInterface-Cray'
ce45045d50 FortranCInterface: Add support for Cray module mangling

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10466
2025-03-14 12:14:16 -04:00
Brad King
40e685d76c Merge topic 'cps-fix-default-configs'
63c96e76f9 cmPackageInfoReader: Fix default configurations

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !10469
2025-03-14 12:06:42 -04:00
Brad King
df2ec408c9 Merge topic 'cps-fix-default-configs' into release-4.0
63c96e76f9 cmPackageInfoReader: Fix default configurations

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !10469
2025-03-14 12:06:40 -04:00
Brad King
1f59bfaef4 Merge topic 'file-MAKE_DIRECTORY-result-var'
41d91387f6 Merge branch 'backport-3.31-file-MAKE_DIRECTORY-result-var'
3dd701c068 Merge branch 'backport-3.31-file-MAKE_DIRECTORY-result-var' (early part)
397ec37528 file(MAKE_DIRECTORY): Do not make directories for command keywords
a039a1655d file(MAKE_DIRECTORY): Clarify formatting of unexpected arguments error
90d9c79348 file(MAKE_DIRECTORY): Do not make directories for command keywords

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10467
2025-03-14 11:45:44 -04:00
Matthew Woehlke
63c96e76f9 cmPackageInfoReader: Fix default configurations
Fix two minor issues with how default configurations are set from CPS
packages. First, imported configurations were (appropriately) being
converted to upper case, but default configurations weren't. Second,
default configurations were being set only after importing components
from the root package configuration file, resulting in configurations
specified in the root file preceding the default configurations.
2025-03-13 14:27:58 -04:00
Brad King
41d91387f6 Merge branch 'backport-3.31-file-MAKE_DIRECTORY-result-var' 2025-03-13 11:58:47 -04:00
Brad King
a039a1655d file(MAKE_DIRECTORY): Clarify formatting of unexpected arguments error 2025-03-13 11:57:27 -04:00
Victor Brunini
ce45045d50 FortranCInterface: Add support for Cray module mangling
Cray Fortran uses mangling of the form `my_sub$my_module_` with the
subroutine name first.  Teach FortranCInterface to detect this case.
Add `FortranCInterface_MODULE_{,_}ORDER` result variables to report it.

With optimizations on, Cray Fortran inlines the module subroutine into
the calling object, so our symbol with the `INFO` string is not used.
Add a directive to suppress inlining to avoid this.
2025-03-13 10:18:02 -05:00
Martin Duffy
f134468a98 JSON: Improve JSON error message formatting
This improves the output of JSON-related error messages. It adds the filename to
the output and excludes the column number.

This is particularly useful when there are multiple JSON files being read that
could be responsible for an error, ie CMakePresets.json and
CMakeUserPresets.json, or multiple instrumentation queries.

Issue: #26717
2025-03-13 10:44:31 -04:00
Brad King
5d1ec25c60 Merge topic 'test-cray-clang'
a5f5a87482 Tests/RunCMake/if: Optionally skip checking write-only directory permissions
2a37015319 Tests/FortranModules: Skip submodules with Cray Fortran compiler
fa4ac78f4a Tests/FortranModules: Simplify check for submodules support
2c28321adb Tests: Combine conditions for BundleUtilities test
6dfd8e19b5 GetPrerequisites: Recognize CrayPE system libraries

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10464
2025-03-13 09:46:51 -04:00
Brad King
b040b91b2b Merge topic 'cpack-project-path'
2d9ae9de96 CPack: Allow source-relative CPACK_PROJECT_CONFIG_FILE

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10461
2025-03-13 09:44:20 -04:00
Brad King
a5f5a87482 Tests/RunCMake/if: Optionally skip checking write-only directory permissions
Some file systems do not support this.
2025-03-12 16:58:46 -04:00
Brad King
2a37015319 Tests/FortranModules: Skip submodules with Cray Fortran compiler
Issue: #18925
2025-03-12 16:39:23 -04:00
Brad King
fa4ac78f4a Tests/FortranModules: Simplify check for submodules support 2025-03-12 16:37:54 -04:00
Brad King
2c28321adb Tests: Combine conditions for BundleUtilities test 2025-03-12 16:37:54 -04:00
Nikita Nemkin
2d9ae9de96 CPack: Allow source-relative CPACK_PROJECT_CONFIG_FILE
Resolve relative CPACK_PROJECT_CONFIG_FILE explicitly at config
generation time. Otherwise, it will be resolved at runtime
relative to the CPack execution directory (which could be anything).

Additionally, issue a warning if reading PACK_PROJECT_CONFIG_FILE
fails at runtime.

Fixes: #15522
2025-03-12 20:37:01 +05:00
Brad King
85d1b74386 Merge topic 'pdb-name-genex-support'
15a1769bd8 GenEx: Add support for PDB_NAME and COMPILE_PDB_NAME

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Acked-by: nicolas loxol <nicolas.loxol@gmail.com>
Acked-by: Giacomo Rombaut <giacomo.rombaut@gmail.com>
Merge-request: !10418
2025-03-12 09:12:12 -04:00
Brad King
b7abc78e6c Merge topic 'pkg-config-import-populate'
28a92bde80 PkgC: Implement cmake_pkg_config IMPORT / POPULATE
7f172faca5 Help: Add install() section heading for common options

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10393
2025-03-12 09:06:04 -04:00
Vito Gamberini
28a92bde80
PkgC: Implement cmake_pkg_config IMPORT / POPULATE
Issue: #26067
2025-03-11 11:24:07 -04:00
Giacomo Rombaut
15a1769bd8 GenEx: Add support for PDB_NAME and COMPILE_PDB_NAME
Closes: #26729
2025-03-11 10:28:12 -04:00
Brad King
6d260533e7 Merge topic 'link-information-with-decorated-diagnostics'
ee066d2271 LinkerId: Suppress decorated diagnostics during linker inspection

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Acked-by: Nils Gladitz <nilsgladitz@gmail.com>
Merge-request: !10442
2025-03-11 09:40:28 -04:00
Brad King
dfbcaa9ee1 Merge topic 'link-information-with-decorated-diagnostics' into release-4.0
ee066d2271 LinkerId: Suppress decorated diagnostics during linker inspection

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Acked-by: Nils Gladitz <nilsgladitz@gmail.com>
Merge-request: !10442
2025-03-11 09:40:24 -04:00
Marc Chevrier
ee066d2271 LinkerId: Suppress decorated diagnostics during linker inspection
Fixes: #26747
2025-03-10 10:36:27 -04:00
Brad King
cd38131f31 Merge topic 'path-resolver'
8dfc725cdb PathResolver: Add mode to collapse paths naively and look up on-disk case
75913fe430 PathResolver: Document in comments the on-disk case lookup on macOS

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10438
2025-03-09 10:48:46 -04:00
Brad King
8dfc725cdb PathResolver: Add mode to collapse paths naively and look up on-disk case
In CMake 3.31 and below, `CollapseFullPath` did this on Windows.  KWSys
has since stopped looking up the on-disk case in `CollapseFullPath` to
avoid disk access when most callers only need an in-memory operation.
We currently call `GetActualCaseForPath` explicitly when needed.

Add a mode to `cm::PathResolver` to combine these operations and cache
disk access behind the `System::ReadName` callback.  We will use this to
restore the way CMake 3.31 and below normalized input paths on Windows.

Issue: #26750
Issue: #20214
2025-03-07 18:22:46 -05:00
Brad King
5d510ae8a0 Merge topic 'genex-fix-target-pdb-base-name'
fe11677945 GenEx: Fix TARGET_PDB_FILE_BASE_NAME with PDB_NAME and DEBUG_POSTFIX
434c289f3b Help: Clarify references to <CONFIG>_POSTFIX target properties

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10431
2025-03-07 12:18:28 -05:00
Brad King
cdbeb7773e Merge topic 'ctest-regression'
712cb8cb14 ctest: Restore support for -T Test without dashboard configuration
e47dc29967 cmCTestStartCommand: Remove unnecessary code
f54699d31d cmCTest: De-duplicate working directory code

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10432
2025-03-07 12:08:33 -05:00
Giacomo Rombaut
fe11677945 GenEx: Fix TARGET_PDB_FILE_BASE_NAME with PDB_NAME and DEBUG_POSTFIX
When `PDB_NAME` is explicitly set, the `<CONFIG>_POSTFIX` is not added
to the `.pdb` names.

Fixes: #26733
2025-03-06 11:40:59 -05:00
Daniel Pfeifer
712cb8cb14 ctest: Restore support for -T Test without dashboard configuration
Since commit 774fcbe49c (CTest: Base command line mode on top of
scripting commands, 2024-10-05, v4.0.0-rc1~653^2) we drive dashboard
client steps through `cmCTestHandlerCommand::ExecuteHandlerCommand`
instead of calling `ProcessHandler` directly.  This requires the
`BuildDirectory` to be known to establish a work directory.

Fixes: #26743
Co-authored-by: Brad King <brad.king@kitware.com>
2025-03-06 09:43:22 -05:00
Brad King
de7168c097 Merge topic 'remove-kfreebsd'
99c8abed55 kFreeBSD: Remove support for obsolete platform

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10410
2025-03-06 07:57:22 -05:00
Brad King
c7dbb2fe63 Merge topic 'FindPython-crosscompiling-consistency'
5c1521c54d FindPython: enforce artifacts consistency when cross-compiling

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10413
2025-03-06 07:55:31 -05:00
Brad King
d84881dce6 Merge topic 'fix-cps-cmake-deps'
c3d279841b find_package: CPS component requirements != CMake components

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10427
2025-03-06 07:53:27 -05:00
Matthew Woehlke
c3d279841b find_package: CPS component requirements != CMake components
Modify how CMake handles required components of a CPS transitive
dependency to not pass them as COMPONENTS if a CMake-script package is
found as the resolved dependency. This is necessary as many CMake-script
package description files do not treat component requests as target
requests (which, in CPS-land, they effectively are), but do implement
logic to mark themselves 'not found' if requested components are
missing. As a result, passing in the required targets as required
components is likely to cause the dependency to be spuriously not found
if it is only available via a CMake-script package configuration file.

Fix this by introducing a new 'required targets' concept, and by passing
CPS component requirements as both required targets and optional
components. The latter serves as a hint for packages that might provide
only a subset of themselves. The former is used to post-validate a
CMake-script package, or is folded on-the-fly into required components
when considering CPS packages.

Note that this functionality is not exposed to the user at this time,
and is only used when resolving transitive dependencies for a CPS
package.
2025-03-05 14:47:49 -05:00
Roger Leigh
99c8abed55 kFreeBSD: Remove support for obsolete platform
kFreeBSD is no longer maintained or supported and was never an
officially-supported release architecture for Debian.

Closes: #26742
2025-03-05 11:57:49 -05:00
Marc Chevrier
5c1521c54d FindPython: enforce artifacts consistency when cross-compiling
Fixes: #26696
2025-03-05 17:11:56 +01:00
Brad King
3524abf345 Merge topic 'build-database-fixes'
12d73c9f78 cmExperimental: recycle build database uuid
d02ca76184 cmDyndepCollation: record required modules to the build database
8a773168fd Tests/CXXModules: help diagnose build database errors
7ca4ac8e13 cmBuildDatabase: fix language comparison for visibility

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10414
2025-03-05 08:32:50 -05:00
Brad King
ba3ad7c9e3 Merge topic 'ninja-acc-target-comments'
0122e02293 Ninja: Add COMMENT to custom command and target descriptions
30fb5b1b22 Ninja: add COMMENT to build statement descriptions

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9484
2025-03-05 08:31:31 -05:00
Brad King
2586a2ce82 Merge topic 'ninja-many-subdirs'
5a36d0c9e7 Ninja: Fix regression with a large number of subdirectories
a30cf4a66a Tests/RunCMake/Configure: Split ninja-specific RerunCMake case

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10420
2025-03-05 08:22:27 -05:00
Ben Boeckel
5a36d0c9e7 Ninja: Fix regression with a large number of subdirectories
Since commit f50fb77a4f (Ninja: Regenerate when test or install scripts
are missing, 2024-10-29, v4.0.0-rc1~516^2) the list of paths we pass to
`ninja -t restat` scales with the number of project subdirectories.
Run it in blocks to avoid "command line too long" errors, particularly
on Windows.

Fixes: #26738
2025-03-04 13:37:01 -05:00
Brad King
a30cf4a66a Tests/RunCMake/Configure: Split ninja-specific RerunCMake case
Split the test case from commit f50fb77a4f (Ninja: Regenerate when test
or install scripts are missing, 2024-10-29, v4.0.0-rc1~516^2) into a
dedicated case.
2025-03-04 17:46:31 +01:00
Brad King
0af6821799 Merge topic 'cpack-rpm-weak-deps-tags'
14baa13ab8 CPack/RPM: Add support for all weak dependency tags
847f515934 Tests: Simplify RunCMake.CPack_RPM.SUGGESTS expected output

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10415
2025-03-04 08:47:25 -05:00
Ben Boeckel
12d73c9f78 cmExperimental: recycle build database uuid 2025-03-03 22:03:27 +01:00
Ben Boeckel
8a773168fd Tests/CXXModules: help diagnose build database errors
In tests that compare multiple files, knowing which file(s) errors come
from is difficult. Log the actual filepaths when this occurs to help
debugging.
2025-03-03 22:02:40 +01:00