2011-08-19 23:38:05 +00:00
|
|
|
project(minizip)
|
|
|
|
|
|
|
|
cmake_minimum_required(VERSION 2.6)
|
|
|
|
|
2011-08-22 15:37:53 +00:00
|
|
|
if (UNIX)
|
|
|
|
find_package(ZLIB REQUIRED)
|
|
|
|
endif()
|
2011-08-19 23:38:05 +00:00
|
|
|
|
|
|
|
set (SOURCES
|
|
|
|
ioapi.c
|
|
|
|
unzip.c
|
|
|
|
zip.c
|
|
|
|
)
|
|
|
|
|
|
|
|
set (HEADERS
|
|
|
|
ioapi.h
|
|
|
|
unzip.h
|
|
|
|
zip.h
|
|
|
|
)
|
|
|
|
|
2011-08-22 13:19:07 +00:00
|
|
|
if (APPLE)
|
|
|
|
# Mac OS X does not have fopen64()
|
|
|
|
# and several related functions as the standard fopen()
|
|
|
|
# calls are 64bit
|
|
|
|
add_definitions("-DUSE_FILE32API")
|
|
|
|
endif()
|
|
|
|
|
2011-08-19 23:38:05 +00:00
|
|
|
add_library(minizip
|
|
|
|
${SOURCES}
|
|
|
|
${HEADERS}
|
|
|
|
)
|
|
|
|
|
2011-08-22 15:37:53 +00:00
|
|
|
if (UNIX)
|
|
|
|
target_link_libraries(minizip z)
|
|
|
|
else()
|
|
|
|
target_link_libraries(minizip "${CMAKE_CURRENT_SOURCE_DIR}/../zlib/zlib.lib")
|
|
|
|
endif()
|
|
|
|
|
2011-08-19 23:38:05 +00:00
|
|
|
|