Repository navigation
Conversation
vszakats
force-pushed
the
cm-find-verdetect
branch
from
August 15, 2024 07:41
4f4c04f to
13200ca
Compare
1 task
- more generic (can be re-used in most Find modules) - uses a single regex - breaks syntax highlighers less (mcedit) - logic can be retrofitted more easily into the `file(STRING REGEX)` `CMAKE_MATCH_1` feature offered by CMake 3.29.0 and later. https://cmake.org/cmake/help/latest/command/file.html#strings
vszakats
force-pushed
the
cm-find-verdetect
branch
from
August 16, 2024 14:22
05d1b59 to
89de206
Compare
vszakats
added a commit
that referenced
this pull request
Aug 17, 2024
- use the same pattern across all Find modules:
- verify if the version header exists before reading it.
- use a single regex per lookup.
- sync regexes between Find modules.
- use generic temporary variable names.
- improve readability.
- make it simpler to transition to new CMake syntax in the future:
```cmake
file(STRINGS "${CARES_INCLUDE_DIR}/ares_version.h" _version_str REGEX "<...>")
unset(_version_str)
set(CARES_VERSION "${CMAKE_MATCH_1}")
```
Ref: https://cmake.org/cmake/help/latest/policy/CMP0159.html#policy:CMP0159
- fix zstd version detection to be CMake 3.7 compatible.
Required 3.9 before this patch, for the `CMAKE_MATCH_<n>` feature.
Follow-up to c5d506e #12200
Follow-up to 4e2f364 #14548
Closes #14572
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
use
pkg-configversion when available and where it wasn't yet used.add manual version detection for dependencies where this is possible
(via a public header) and where it wasn't done yet.
pkg-confighints to Find modules #14545