CMake: Fix regex on empty libzip version

This commit is contained in:
Vicki Pfau 2020-06-23 23:22:10 -07:00
parent a1daf63cdb
commit a921c89187
1 changed files with 2 additions and 2 deletions

View File

@ -617,13 +617,13 @@ if(USE_LIBZIP)
list(APPEND DEPENDENCY_LIB ${LIBZIP_LIBRARIES})
list(APPEND FEATURES LIBZIP)
list(APPEND VFS_SRC ${CMAKE_CURRENT_SOURCE_DIR}/src/util/vfs/vfs-zip.c)
string(REGEX MATCH "^[0-9]+" LIBZIP_VERSION_MAJOR ${libzip_VERSION})
string(REGEX MATCH "^[0-9]+" LIBZIP_VERSION_MAJOR "${libzip_VERSION}")
if (LIBZIP_VERSION_MAJOR LESS 1)
set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS},libzip2")
elseif(LIBZIP_VERSION_MAJOR EQUAL 1)
set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS},libzip4|libzip5")
else()
message(AUTHOR_WARNING Unknown version of libzip detected: ${libzip_VERSION})
message(AUTHOR_WARNING "Unknown version of libzip detected: ${libzip_VERSION}")
endif()
elseif(USE_MINIZIP)
include_directories(AFTER ${MINIZIP_INCLUDE_DIRS})