aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorJia Tan <jiat0218@gmail.com>2023-02-04 21:06:35 +0800
committerJia Tan <jiat0218@gmail.com>2023-03-07 23:57:39 +0800
commit5d351c69c19d212ddd2cf1f3bdb24900820c6776 (patch)
tree4322cfe7abf0125a0c6afdf3fe5b1617dea6bd6e /CMakeLists.txt
parentliblzma: Improve documentation for version.h. (diff)
downloadxz-5d351c69c19d212ddd2cf1f3bdb24900820c6776.tar.xz
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).
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt2
1 files changed, 2 insertions, 0 deletions
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}")