mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-10 07:40:03 -06:00
FindLTTngUST: Fix version component extraction
The regex was greedy and slurped away all but the last digit, so 2.13.1 was for ex. detected as 2.3.1. Fix this by expecting preceding whitespace.
This commit is contained in:
@@ -63,11 +63,11 @@ if(LTTNGUST_INCLUDE_DIRS AND LTTNGUST_LIBRARIES)
|
||||
REGEX "^[\t ]*#define[\t ]+LTTNG_UST_MINOR_VERSION[\t ]+[0-9]+[\t ]*$")
|
||||
file(STRINGS "${lttngust_version_file}" lttngust_version_patch_string
|
||||
REGEX "^[\t ]*#define[\t ]+LTTNG_UST_PATCHLEVEL_VERSION[\t ]+[0-9]+[\t ]*$")
|
||||
string(REGEX REPLACE ".*([0-9]+).*" "\\1"
|
||||
string(REGEX REPLACE ".*[\t ]+([0-9]+).*" "\\1"
|
||||
lttngust_v_major "${lttngust_version_major_string}")
|
||||
string(REGEX REPLACE ".*([0-9]+).*" "\\1"
|
||||
string(REGEX REPLACE ".*[\t ]+([0-9]+).*" "\\1"
|
||||
lttngust_v_minor "${lttngust_version_minor_string}")
|
||||
string(REGEX REPLACE ".*([0-9]+).*" "\\1"
|
||||
string(REGEX REPLACE ".*[\t ]+([0-9]+).*" "\\1"
|
||||
lttngust_v_patch "${lttngust_version_patch_string}")
|
||||
set(LTTNGUST_VERSION_STRING
|
||||
"${lttngust_v_major}.${lttngust_v_minor}.${lttngust_v_patch}")
|
||||
|
||||
Reference in New Issue
Block a user