diff options
author | Norbert Lange <nolange79@gmail.com> | 2021-12-23 15:16:48 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2022-01-10 22:56:48 (GMT) |
commit | 4ce5765a8605cf4aa0fbb01f77ae2bf764452ccd (patch) | |
tree | aaea9d908e1fd302370ddf40ead8b3b9a8ea34fa /Modules/FindLTTngUST.cmake | |
parent | 26ab79082084ef09ba55315e4b846b1d362d6c41 (diff) | |
download | CMake-4ce5765a8605cf4aa0fbb01f77ae2bf764452ccd.zip CMake-4ce5765a8605cf4aa0fbb01f77ae2bf764452ccd.tar.gz CMake-4ce5765a8605cf4aa0fbb01f77ae2bf764452ccd.tar.bz2 |
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.
Diffstat (limited to 'Modules/FindLTTngUST.cmake')
-rw-r--r-- | Modules/FindLTTngUST.cmake | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Modules/FindLTTngUST.cmake b/Modules/FindLTTngUST.cmake index f478e4d..a70a418 100644 --- a/Modules/FindLTTngUST.cmake +++ b/Modules/FindLTTngUST.cmake @@ -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}") |