diff options
author | Brad King <brad.king@kitware.com> | 2010-08-17 19:16:47 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2010-08-17 19:16:47 (GMT) |
commit | 8f4cc1eb2be86f399e7ba0b91016a685ebe379a0 (patch) | |
tree | 21532ecf632309e76cf7365ad57fcb5618824f7c /Modules | |
parent | a890f6a00bab8b0544b868b02f09fa33775bf16b (diff) | |
parent | 75e727855ae860d4289c9dafa8247a4cb3b5852f (diff) | |
download | CMake-8f4cc1eb2be86f399e7ba0b91016a685ebe379a0.zip CMake-8f4cc1eb2be86f399e7ba0b91016a685ebe379a0.tar.gz CMake-8f4cc1eb2be86f399e7ba0b91016a685ebe379a0.tar.bz2 |
Merge topic 'FixZLIBVersion'
75e7278 Fix ZLIB version parsing if no TWEAK version exists
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/FindZLIB.cmake | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Modules/FindZLIB.cmake b/Modules/FindZLIB.cmake index ce29ca0..1ac6c2c 100644 --- a/Modules/FindZLIB.cmake +++ b/Modules/FindZLIB.cmake @@ -50,9 +50,14 @@ IF(ZLIB_INCLUDE_DIR AND EXISTS "${ZLIB_INCLUDE_DIR}/zlib.h") STRING(REGEX REPLACE "^.*ZLIB_VERSION \"([0-9]+).*$" "\\1" ZLIB_VERSION_MAJOR "${ZLIB_H}") STRING(REGEX REPLACE "^.*ZLIB_VERSION \"[0-9]+\\.([0-9]+).*$" "\\1" ZLIB_VERSION_MINOR "${ZLIB_H}") STRING(REGEX REPLACE "^.*ZLIB_VERSION \"[0-9]+\\.[0-9]+\\.([0-9]+).*$" "\\1" ZLIB_VERSION_PATCH "${ZLIB_H}") - STRING(REGEX REPLACE "^.*ZLIB_VERSION \"[0-9]+\\.[0-9]+\\.[0-9]+\\.([0-9]+).*$" "\\1" ZLIB_VERSION_TWEAK "${ZLIB_H}") + SET(ZLIB_VERSION_STRING "${ZLIB_VERSION_MAJOR}.${ZLIB_VERSION_MINOR}.${ZLIB_VERSION_PATCH}") - SET(ZLIB_VERSION_STRING "${ZLIB_VERSION_MAJOR}.${ZLIB_VERSION_MINOR}.${ZLIB_VERSION_PATCH}.${ZLIB_VERSION_TWEAK}") + # only append a TWEAK version if it exists: + SET(ZLIB_VERSION_TWEAK "") + IF( "${ZLIB_H}" MATCHES "^.*ZLIB_VERSION \"[0-9]+\\.[0-9]+\\.[0-9]+\\.([0-9]+).*$") + SET(ZLIB_VERSION_TWEAK "${CMAKE_MATCH_1}") + SET(ZLIB_VERSION_STRING "${ZLIB_VERSION_STRING}.${ZLIB_VERSION_TWEAK}") + ENDIF( "${ZLIB_H}" MATCHES "^.*ZLIB_VERSION \"[0-9]+\\.[0-9]+\\.[0-9]+\\.([0-9]+).*$") SET(ZLIB_MAJOR_VERSION "${ZLIB_VERSION_MAJOR}") SET(ZLIB_MINOR_VERSION "${ZLIB_VERSION_MINOR}") |