283a48403f CPack/RPM: Fix detection of RPM support for weak dependencies
ab4e74ad0b CPack/RPM: Remove redundant conditions for presence of rpmbuild
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10403
Add a missing `find_program` call to populate `RPM_EXECUTABLE`.
This was left out of two previous changes that intended to query
the `rpm` executable:
* In commit 9b53eca317 (CPack/RPM: Fix weak dep support, 2021-06-29,
v3.21.0-rc2~4^2), without `RPM_EXECUTABLE` the query always failed,
so we were concluding that weak dependencies are not supported even
when they are.
* In commit 488de6294a (CPack: correctly perform querytags on old
versions of RPM, 2025-01-09, v4.0.0-rc1~182^2~3), without
`RPM_EXECUTABLE` the query always failed. This change has not
yet been in a release anyway.
Also fix the test case for the "suggests" field to verify this.
Issue: #22350
Reported-by: Balazs Kosaras <balazskosaras@gmail.com>
This adds a `CMAKE_FIND_REQUIRED` variable which causes `find_package`,
`find_path`, `find_file`, `find_library` and `find_program` to be
considered `REQUIRED` by default.
It also introduces an `OPTIONAL` keyword to those commands, allowing
them to ignore the value of this variable.
Issue: #26576
GNU ld 2.39 added warnings of the form
ld: warning: %pB has a LOAD segment with RWX permissions
They appear when linking test binaries on `hppa` and `sparc`.
Debian-Issue: https://bugs.debian.org/1098956
Debian-Issue: https://bugs.debian.org/1098970
`difftime` returns a `double`, so commit 6727270b75 (CMake: Extend
TIMESTAMP sub-commands with new unix time format specifier, 2016-02-16,
v3.6.0-rc1~338^2) cast it to `long` to get an integer result. However,
in the MSVC ABI, `long` is a 32-bit integer. Use an explicit 64-bit
integer type instead.
Fixes: #26716
Rename the RunCMake/PackageInfo and RunCMake/CpsExportImport tests to
indicate that they cover CPS generated by the install command. This
opens space for similar tests that will cover CPS generation via the
export command.
Previously the presets handler in the GUI was on a timer. Because of
this, error messages got suppressed after the first one (even if the
error message is different from the one originally suppressed).
Add a "reload presets" button which forces the preset to reload, and
always provides an error message if the reload failed.
Fixes: #26707
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