XCode 16+ no longer delays our POST_BUILD phase until after bundle files
like `Info.plist` are generated. Teach the Xcode generator to add
explicit dependencies to the POST_BUILD phase in bundle targets to
ensure the files are created before it runs.
Fixes: #26656
Modify how cmExportBuildFileGenerator::FindExportInfo collects target
export information to properly record the export sets which export a
target. (The old behavior treated every invocation as a separate set,
which is reasonable for export(TARGETS) but does not allow referencing a
target exported multiple times via export(EXPORT). This reflects recent
changes to allow this for installed exports.)
The `LINK_LIBRARIES` and `INTERFACE_LINK_LIBRARIES` target properties
establish the graph of link dependencies used to propagate usage
requirements transitively. Therefore the `$<TARGET_PROPERTY:...>`
generator expression should evaluate them transitively as it does for
other transitive properties. Add policy CMP0189 for compatibility.
Fixes: #26709
Issue: #12435
Fix logic from commit b9ee79b8a1 (GenEx: Add support for custom
transitive compile properties, 2024-05-09, v3.30.0-rc1~82^2~1) to more
precisely know when we are computing the link dependency graph.
Issue: #20416
Issue: #26709
245f5ca8b3 Tests: Make CMakeGUI test build with both Qt5 and Qt6
5afbc739dc ci: Specify Qt version separately for each Fedora build
e35d1ee4cd cmake-gui: Clarify variable name for selected Qt major version
19a1c115e0 cmake-gui: Fix integer conversion warnings with Qt 6
cbf0d3da52 cmake-gui: Port away from deprecated API in Qt >= 6.7
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10369
Extend commit 1a35351125 (Add CMAKE_POLICY_VERSION_MINIMUM to help
configure outdated projects, 2025-02-13, v4.0.0-rc1~12^2) with an
environment variable to initialize the cache entry. That will make it
easier to use when `cmake` is invoked under layers of scripting.
Closes: #26715
8d455809b0 string: Allow zero-length matches in all REGEX subcommands
ca65fa9a7f string: Allow references to unmatched groups in REGEX REPLACE
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10251
321c647640 Include source file without an extension after the same name with an extension
Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !10271
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
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
28f1da4b25 ci: Add jobs to build sunos-{i386,sparc} binaries
59ed18e54d Utilities/Release: Add base images to build sunos-{i386,sparc} binaries
a4e5719d31 Solaris: Rename local variable to avoid conflict with system headers
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10350
Add a test that validates that we can export a package in CPS format and
import it again. This is fairly simplistic at the moment, but still
serves to validate some recent fixes that are not covered by more
targeted unit tests.
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.
The semantics mimic other languages like Python, Java, JS, etc.
To advance past a zero-length match, the search algorithm first
tries to find a non-zero alternative branch. If that fails, it
force-advances by 1 character.
Fixes: #13790, #13792, #18690, #26629
Add the `CrayClang` compiler ID to the list of OpenMP flag candidates and
ensure the flags are propagated to the link step to trigger the Cray OpenMP
offload linker (`cce_omp_offload_linker`) wrapper.
Fixes: #24402, #24962
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
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
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
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
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
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: #26629Fixes: #16899
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.
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
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
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.
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
f8db82ba81 Configure CMake itself with policies through CMake 3.31
34652be5d2 export: Increase maximum policy version in exported files to 3.31
5cd2669146 Add deprecation warnings for policies CMP0142 and below
Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !10296
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.
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
Refactor common logic out of individual RunCMake/find_package-CPS tests.
Move enabling the experimental gate to the RunCMakeTest.cmake, add a
separate test to verify the experimental warning, and suppress it
everywhere else. This will greatly simplify writing non-failure tests.
The set of RunCMake/find_package tests is quite large, which makes
development and management less efficient. While this could probably
stand additional refactoring, split out just the CPS tests for now, as
those are currently under active development.
The OLD behaviors of all policies are deprecated, but only by
documentation. Add an explicit deprecation diagnostic for policies
introduced in CMake 3.25 and below to encourage projects to port
away from setting policies to OLD.
Corruption happens when a multiline help string starts with
a newline. This causes an overflow in substr() and the whole,
unescaped help string is written to the cache file.
Multiline strings are escaped line by line. The fix is to start
searching for line break points from position 1. A break point
at zero, which triggers the overflow, could only produce
a redundant empty line.
Fixes: #9098
The `CreateProcessW` documentation states "to run a batch file, you must
start the command interpreter". Use `cmd /c the.bat` to run batch files.
Also, use a "short path" to the `.bat` file if needed to avoid spaces.
Previously this worked in some cases only due to undocumented behavior
of `CreateProcessW` when given a `.bat` file.
Fixes: #26655
Implement finding components of CPS packages. Specifically, reject any
candidate packages that don't provide all required components, and
ignore appendices that don't provide requested (required or optional)
components. This applies to both top-level searches and also searching
for package dependencies.
Fix find_package to set an error message when trying to find
dependencies of a CPS package fails. This fixes the command previously
reporting "find_package unknown error" for such failures.
* remove support of size computation based on "magic" enum element because
Oracle SunPro compilers crash on it.
* enhance handling of enum_set with explicit size.
Replace our hard-coded default for `/RTC1` with a first-class
abstraction to select runtime checks from an enumeration of logical
names. Add a `MSVC_RUNTIME_CHECKS` target property and corresponding
`CMAKE_MSVC_RUNTIME_CHECKS` variable.
Removing the old default flag requires a policy because existing
projects may rely on string processing to edit them and choose
runtime checks under the old behavior. Add policy CMP0184 to
provide compatibility.
Fixes: #26614
4e6a13f211 Use lower case style for commands
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Acked-by: Alex Turbov <i.zaufi@gmail.com>
Merge-request: !10245
Previously we didn't properly exclude $<COMPILE_ONLY:OBJECT lib>
from the right hand side of `target_link_libraries`.
Fix the update that commit 73337cb383 (LINK_LIBRARIES: Evaluate
separately for linking and usage requirements, 2022-03-22,
v3.24.0-rc1~404^2~2) made to `AddObjectEntries`.
Fixes: #26642
`find_package(CURL CONFIG)` provides `CURL_VERSION` from the upstream
cmake package version file.
Upstream curl commit `699ac9430c` (cmake: publish/check supported
protocols/features via `CURLConfig.cmake`, 2024-12-29) extends the
upstream cmake package to provide our old `CURL_VERSION_STRING`.
Provide both names from CMake's own module to aid transition.
Fixes: #26634
bc4c71627a Help: Fix typos found by the `rst-backticks` hook
c833629508 Help: Fix typos found by the `rst-directive-colons` hook
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10237
b83c5b2c83 pre-commit: Add `pygrep-hooks` repo and 3 hooks to check RST files
abe46bf9e1 pre-commit: Add the `clang-format` hook
8f4dd0558e pre-commit: Add the `typos` hook for extra spellchecking
54eba3a42a pre-commit: Add the `codespell` hook
244e3d314c pre-commit: Add the `sphinx-lint` hook
efa7c6aedf pre-commit: Add a hook to check whitespaces and conflict markers
2c06b9f429 pre-commit: Add a hook to fix missed EOL at the end of files
1861948755 pre-commit: Add a hook to check JSON files
...
Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !10143
Revise commit fc7aa3cd69 (tests: Preserve empty arguments in test
command lines, 2024-09-30, v3.31.0-rc1~33^2) to delay variable expansion
until code evaluation. Otherwise we may parse the working directory
path as CMake language code.
CMake now provides the CMAKE_<LANG>_LINK_MODE variable which specify how
the link step is done. So, the CMAKE_<LANG>_USING_LINKER_MODE variable
is no longer needed.