]> git.siccegge.de Git - frida/frida.git/commitdiff
Add our own FindQuaZip.cmake untill debian ships a useable one
authorChristoph Egger <christoph@christoph-egger.org>
Mon, 23 Feb 2015 13:03:04 +0000 (14:03 +0100)
committerChristoph Egger <christoph@christoph-egger.org>
Mon, 23 Feb 2015 13:03:04 +0000 (14:03 +0100)
CMakeLists.txt
cmake/Modules/FindQuaZip.cmake [new file with mode: 0644]

index 629d7e125653de0f4f3746b94e65799277c0b150..d948879d1cb61acb021154ff2bca54f2ae9fa614 100644 (file)
@@ -5,6 +5,8 @@ set(CMAKE_VERBOSE_MAKEFILE on)
 
 set(CMAKE_AUTOMOC ON)
 set(CMAKE_INCLUDE_CURRENT_DIR ON)
+set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules")
+
 
 find_package(Qt5Widgets)
 find_package(Qt5 CONFIG REQUIRED Widgets Gui)
diff --git a/cmake/Modules/FindQuaZip.cmake b/cmake/Modules/FindQuaZip.cmake
new file mode 100644 (file)
index 0000000..17ef6a0
--- /dev/null
@@ -0,0 +1,40 @@
+# 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_LIBRARIES           - List of QuaZip libraries
+# QUAZIP_ZLIB_INCLUDE_DIR    - The include dir of zlib headers
+
+
+IF (QUAZIP_INCLUDE_DIRS AND QUAZIP_LIBRARIES)
+       # in cache already
+       SET(QUAZIP_FOUND TRUE)
+ELSE (QUAZIP_INCLUDE_DIRS AND QUAZIP_LIBRARIES)
+       IF (WIN32)
+               FIND_PATH(QUAZIP_LIBRARY_DIR
+                       WIN32_DEBUG_POSTFIX d
+                       NAMES libquazip.dll
+                       HINTS "C:/Programme/" "C:/Program Files"
+                       PATH_SUFFIXES QuaZip/lib
+               )
+               FIND_LIBRARY(QUAZIP_LIBRARIES NAMES libquazip.dll HINTS ${QUAZIP_LIBRARY_DIR})
+               FIND_PATH(QUAZIP_INCLUDE_DIR NAMES quazip.h HINTS ${QUAZIP_LIBRARY_DIR}/../ PATH_SUFFIXES include/quazip)
+               FIND_PATH(QUAZIP_ZLIB_INCLUDE_DIR NAMES zlib.h)
+       ELSE(WIN32)
+               FIND_PACKAGE(PkgConfig)
+#     pkg_check_modules(PC_QCA2 QUIET qca2)
+               pkg_check_modules(PC_QUAZIP quazip)
+               FIND_LIBRARY(QUAZIP_LIBRARIES
+                       WIN32_DEBUG_POSTFIX d
+                       NAMES quazip-qt5
+                       HINTS /usr/lib /usr/lib64
+               )
+               FIND_PATH(QUAZIP_INCLUDE_DIR quazip.h
+                       HINTS /usr/include /usr/local/include
+                       PATH_SUFFIXES quazip
+               )
+               FIND_PATH(QUAZIP_ZLIB_INCLUDE_DIR zlib.h HINTS /usr/include /usr/local/include)
+       ENDIF (WIN32)
+       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)
+ENDIF (QUAZIP_INCLUDE_DIRS AND QUAZIP_LIBRARIES)