Commit Graph

69260 Commits

Author SHA1 Message Date
Evan Wilde 321c647640 Include source file without an extension after the same name with an extension
CMP0115 requires that source files listed in CMake must include their
file extension, but there are cases when projects have different source
files with the same name, but one with an extension and one without.
In the current state, CMake will ignore the file without the extension
an always map it to the file with an extension.

```cmake
add_library(foo bar.c bar)
```

In the above example, the target `foo` will only recognize and depend on
`bar.c` and miss the file `bar` unless `bar` comes before `bar.c` in the
source list.
This issue also affects how custom commands emit files.

This change adds a new policy to recognize files with and without a file
extension as different files, both when building targets, and when they
are being created.

Fixes: #26058
2025-02-14 10:01:10 -05:00
Brad King 8845d33292 Merge topic 'regex'
5d039f3be3 regex: Match ^ at most once in repeated searches

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10221
2025-02-14 09:38:04 -05:00
Brad King 808ada63cb Merge topic 'diab-compiler-support'
8ce6689d8b Diab: Add WindRiver Systems's Diab C/C++ toolchain

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10276
2025-02-14 09:35:26 -05:00
Brad King 4db710b664 Merge branch 'release-4.0' 2025-02-14 09:32:37 -05:00
Brad King dce6a7aa61 Merge topic 'policy-version-var'
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:36 -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 5261222999 Merge branch 'release-4.0' 2025-02-14 09:27:59 -05:00
Brad King b9ae6f7154 Merge topic 'fix_autogen_dependencies'
2b314e9009 Autogen: Fix missing autogen dependencies if a target is linked twice

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10344
2025-02-14 09:27:59 -05:00
Brad King cb2552fc21 Merge topic 'fix_autogen_dependencies' into release-4.0
2b314e9009 Autogen: Fix missing autogen dependencies if a target is linked twice

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10344
2025-02-14 09:27:58 -05:00
Brad King 8bc033f8c9 Merge topic 'FindGettext-whitespace'
f34c28fd57 FindGettext: CMake linting: fix mismatching spaces
c9b7906968 FindGettext: Remove the unneeded space before a full stop

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10341
2025-02-14 09:25:03 -05:00
Brad King 0c8a78cdbe Merge branch 'release-4.0' 2025-02-14 09:23:42 -05:00
Brad King 372a2c3630 Merge topic 'FindPython-ARTIFACTS_PREFIX'
e9770a315d FindPython: Support for multiple searches in same directory

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10340
2025-02-14 09:23:42 -05:00
Brad King 18d11a6cdc Merge topic 'FindPython-ARTIFACTS_PREFIX' into release-4.0
e9770a315d FindPython: Support for multiple searches in same directory

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10340
2025-02-14 09:23:40 -05:00
Brad King 4a7e6063df Merge branch 'release-4.0' 2025-02-14 09:20:00 -05:00
Brad King 7d83672b2d Merge topic 'doc-src-var-xref'
8905157694 Help: Link CMAKE_CURRENT_LIST_(DIR|FILE|LINE) to/from FUNCTION-equivalents

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10338
2025-02-14 09:20:00 -05:00
Brad King 95a0a16229 Merge topic 'doc-src-var-xref' into release-4.0
8905157694 Help: Link CMAKE_CURRENT_LIST_(DIR|FILE|LINE) to/from FUNCTION-equivalents

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10338
2025-02-14 09:19:58 -05:00
Brad King 4b41264469 Merge topic 'vs-version'
e5fd973b14 VS: Set the linker image version using the target's VERSION property
2e798a4137 VS: Fix UnityBuild test selection in VS10Project tests

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10307
2025-02-14 09:18:23 -05:00
Kitware Robot b18513105c CMake Nightly Date Stamp 2025-02-14 00:07:19 -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 d723198539 Help: De-duplicate policy version documentation 2025-02-13 12:36:54 -05:00
Brad King e5d29e9e00 Help: Drop cmake_minimum_required pre-2.4 behavior
The long outdated pre-2.4 compatibility behavior is no longer relevant
since CMake 4.0 dropped support for pre-3.5 compatibility.
2025-02-13 12:22:21 -05:00
Sanjiv Gupta 8ce6689d8b Diab: Add WindRiver Systems's Diab C/C++ toolchain
Teach CMake to recognize Diab versions 5.9.x.x and above.

Closes: #26666
2025-02-13 10:15:00 -05:00
Yegor Yefremov f34c28fd57 FindGettext: CMake linting: fix mismatching spaces 2025-02-13 16:10:05 +01:00
Yegor Yefremov c9b7906968 FindGettext: Remove the unneeded space before a full stop 2025-02-13 16:09:55 +01:00
Nikita Nemkin 5d039f3be3 regex: Match ^ at most once in repeated searches
When doing successive matches, track the input start and current search
start positions separately to prevent the `^` anchor from matching in
the middle of the string.  Add policy CMP0186 to provide compatibility.

Issue: #26629
Fixes: #16899
2025-02-13 20:00:02 +05:00
Alex Neundorf 8905157694 Help: Link CMAKE_CURRENT_LIST_(DIR|FILE|LINE) to/from FUNCTION-equivalents 2025-02-13 09:46:20 -05:00
Marc Chevrier e9770a315d FindPython: Support for multiple searches in same directory
This is a complement to commit 9b0510fa57 (FindPython: add support for
multiple searches in same directory, 2025-01-05).
2025-02-13 09:36:43 -05:00
Brad King b5c76292fb Merge branch 'release-4.0' 2025-02-13 09:33:06 -05:00
Brad King a0aa37180c Merge topic 'find-cps-version'
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:06 -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
Brad King b4db1c2a81 Merge topic 'FindGettext-doc'
d1b888a55e FindGettext: Fix gettext_create_translations signature and description

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10334
2025-02-13 09:31:44 -05:00
Brad King 7654d615ad Merge branch 'release-4.0' 2025-02-13 09:30:57 -05:00
Brad King 60bcd9cc50 Merge topic 'doc-header-only'
2d5f2c9311 Help: Make cmake-buildsystem(7) header-only examples consistent

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10333
2025-02-13 09:30:56 -05:00
Brad King f45c1384cb Merge topic 'doc-header-only' into release-4.0
2d5f2c9311 Help: Make cmake-buildsystem(7) header-only examples consistent

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10333
2025-02-13 09:30:55 -05:00
Brad King 7c2dde2728 Merge branch 'release-4.0' 2025-02-13 09:29:26 -05:00
Brad King 0ab7ac117f Merge branch 'release-3.31' 2025-02-13 09:29:21 -05:00
Brad King 3ba4ca5963 Merge branch 'release-3.31' into release-4.0 2025-02-13 09:29:00 -05:00
Brad King c5a0ae1ae2 Merge branch 'release-4.0' 2025-02-13 09:28:32 -05:00
Brad King 6062453319 Merge topic 'ci-msvc-14.43'
8353a88661 ci: Update Windows builds to MSVC 14.43 toolset

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10336
2025-02-13 09:28:32 -05:00
Brad King 10da186af0 Merge topic 'ci-msvc-14.43' into release-4.0
8353a88661 ci: Update Windows builds to MSVC 14.43 toolset

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10336
2025-02-13 09:28:30 -05:00
Brad King c3735f37da Merge topic 'ci-msvc-14.43' into release-3.31
8353a88661 ci: Update Windows builds to MSVC 14.43 toolset

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10336
2025-02-13 09:27:24 -05:00
Kitware Robot 2bccf69381 CMake Nightly Date Stamp 2025-02-13 00:06:09 -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 8353a88661 ci: Update Windows builds to MSVC 14.43 toolset 2025-02-12 11:05:51 -05:00
Yegor Yefremov d1b888a55e FindGettext: Fix gettext_create_translations signature and description
The first input parameter is a potfile and not mofile.
Also mention the fact that the generated binary files
will be automatically installed.
2025-02-12 10:12:40 -05:00
Brad King e845e1b5d0 Merge branch 'release-4.0' 2025-02-12 09:43:19 -05:00
Brad King 0492b52fd1 Merge topic 'instrumentation-build-snippet'
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:19 -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