Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/keepassxreboot/keepassxc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorLars Wendler <polynomial-c@gentoo.org>2021-05-25 15:40:06 +0300
committerJonathan White <support@dmapps.us>2021-05-29 19:46:19 +0300
commit0ce4e7001c5953ae3c733892d05e0ee0877e27ee (patch)
treefbcae0f18ba27b32cdc4ca6bea8ae4f6997eedfd /cmake
parent8f0e0b6f94f46dc085f7daa13568569cb12a4206 (diff)
Detect quazip >= 1.0 via pkgconfig
Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/FindQuaZip.cmake41
1 files changed, 25 insertions, 16 deletions
diff --git a/cmake/FindQuaZip.cmake b/cmake/FindQuaZip.cmake
index a387e2f81..d733e5978 100644
--- a/cmake/FindQuaZip.cmake
+++ b/cmake/FindQuaZip.cmake
@@ -1,24 +1,33 @@
# QUAZIP_FOUND - QuaZip library was found
-# QUAZIP_INCLUDE_DIR - Path to QuaZip include dir
-# QUAZIP_INCLUDE_DIRS - Path to QuaZip and zlib include dir (combined from QUAZIP_INCLUDE_DIR + ZLIB_INCLUDE_DIR)
+# QUAZIP_INCLUDE_DIRS - Path to QuaZip include dir
# QUAZIP_LIBRARIES - List of QuaZip libraries
-# QUAZIP_ZLIB_INCLUDE_DIR - The include dir of zlib headers
if(MINGW)
find_library(QUAZIP_LIBRARIES libquazip5)
- find_path(QUAZIP_INCLUDE_DIR quazip.h PATH_SUFFIXES quazip5)
- find_path(QUAZIP_ZLIB_INCLUDE_DIR zlib.h)
+ find_path(QUAZIP_INCLUDE_DIRS quazip.h PATH_SUFFIXES quazip5)
+elseif(APPLE)
+ find_library(QUAZIP_LIBRARIES quazip1-qt5)
+ find_path(QUAZIP_INCLUDE_DIRS quazip.h PATH_SUFFIXES quazip)
else()
- find_library(QUAZIP_LIBRARIES
- NAMES quazip5 quazip
- PATHS /usr/lib /usr/lib64 /usr/local/lib
- )
- find_path(QUAZIP_INCLUDE_DIR quazip.h
- PATHS /usr/include /usr/local/include
- PATH_SUFFIXES quazip5 quazip
- )
- find_path(QUAZIP_ZLIB_INCLUDE_DIR zlib.h PATHS /usr/include /usr/local/include)
+ # Try pkgconfig first
+ find_package(PkgConfig QUIET)
+ if (PKG_CONFIG_FOUND)
+ pkg_check_modules(QUAZIP QUIET quazip1-qt5)
+ endif()
+ if(NOT QUAZIP_FOUND)
+ # Try to find QuaZip version 0.x
+ find_library(QUAZIP_LIBRARIES
+ NAMES quazip5 quazip
+ PATHS /usr/lib /usr/lib64 /usr/local/lib
+ )
+ find_path(QUAZIP_INCLUDE_DIRS quazip.h
+ PATHS /usr/include /usr/local/include
+ PATH_SUFFIXES quazip5 quazip
+ )
+ endif()
endif()
+
+mark_as_advanced(QUAZIP_LIBRARIES QUAZIP_INCLUDE_DIRS)
+
include(FindPackageHandleStandardArgs)
-set(QUAZIP_INCLUDE_DIRS ${QUAZIP_INCLUDE_DIR} ${QUAZIP_ZLIB_INCLUDE_DIR})
-find_package_handle_standard_args(QUAZIP DEFAULT_MSG QUAZIP_LIBRARIES QUAZIP_INCLUDE_DIR QUAZIP_ZLIB_INCLUDE_DIR QUAZIP_INCLUDE_DIRS)
+find_package_handle_standard_args(QuaZip DEFAULT_MSG QUAZIP_LIBRARIES QUAZIP_INCLUDE_DIRS)