2013-04-01 18:04:40 +01:00
|
|
|
project(quazip)
|
|
|
|
|
2013-08-26 01:53:29 +01:00
|
|
|
# Find ZLIB for quazip
|
|
|
|
# Use system zlib on unix and Qt ZLIB on Windows
|
2014-04-06 18:43:09 +01:00
|
|
|
if(UNIX)
|
2013-08-26 01:53:29 +01:00
|
|
|
find_package(ZLIB REQUIRED)
|
2014-04-06 18:43:09 +01:00
|
|
|
else(UNIX)
|
|
|
|
get_filename_component(ZLIB_FOUND_DIR "${Qt5Core_DIR}/../../../include/QtZlib" ABSOLUTE)
|
|
|
|
set(ZLIB_INCLUDE_DIRS ${ZLIB_FOUND_DIR} CACHE PATH "Path to ZLIB headers of Qt")
|
|
|
|
set(ZLIB_LIBRARIES "")
|
|
|
|
if(NOT EXISTS "${ZLIB_INCLUDE_DIRS}/zlib.h")
|
|
|
|
message("Please specify a valid zlib include dir")
|
|
|
|
endif(NOT EXISTS "${ZLIB_INCLUDE_DIRS}/zlib.h")
|
|
|
|
endif(UNIX)
|
2013-08-26 01:53:29 +01:00
|
|
|
|
2013-01-11 01:25:40 +00:00
|
|
|
# set all include directories for in and out of source builds
|
|
|
|
include_directories(
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}
|
|
|
|
${ZLIB_INCLUDE_DIRS}
|
|
|
|
)
|
|
|
|
|
|
|
|
file(GLOB SRCS "*.c" "*.cpp")
|
|
|
|
file(GLOB PUBLIC_HEADERS "*.h")
|
|
|
|
|
2013-04-01 18:04:40 +01:00
|
|
|
# Static link!
|
2014-04-06 18:43:09 +01:00
|
|
|
add_definitions(-DQUAZIP_STATIC)
|
2013-01-11 01:25:40 +00:00
|
|
|
|
|
|
|
add_library(quazip STATIC ${SRCS})
|
2014-04-06 18:43:09 +01:00
|
|
|
qt5_use_modules(quazip Core)
|
2013-01-11 01:25:40 +00:00
|
|
|
target_link_libraries(quazip ${ZLIB_LIBRARIES})
|