From 5d351c69c19d212ddd2cf1f3bdb24900820c6776 Mon Sep 17 00:00:00 2001 From: Jia Tan Date: Sat, 4 Feb 2023 21:06:35 +0800 Subject: [PATCH] Build: Adjust CMake version search regex. Now, the LZMA_VERSION_MAJOR, LZMA_VERSION_MINOR, and LZMA_VERSION_PATCH macros do not need to be on consecutive lines in version.h. They can be separated by more whitespace, comments, or even other content, as long as they appear in the proper order (major, minor, patch). --- CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4009cf93..478fb413 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -64,7 +64,9 @@ file(READ src/liblzma/api/lzma/version.h XZ_VERSION) string(REGEX REPLACE "^.*\n\ #define LZMA_VERSION_MAJOR ([0-9]+)\n\ +.*\ #define LZMA_VERSION_MINOR ([0-9]+)\n\ +.*\ #define LZMA_VERSION_PATCH ([0-9]+)\n\ .*$" "\\1.\\2.\\3" XZ_VERSION "${XZ_VERSION}")