forked from datalogics-robb/zlib-dl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists_minizip.txt
50 lines (40 loc) · 1.49 KB
/
CMakeLists_minizip.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
cmake_minimum_required(VERSION 2.8)
#project(minizip)
include(../../../conanbuildinfo.cmake)
conan_basic_setup()
set(SOURCES ioapi.c mztools.c unzip.c zip.c)
set(HEADERS crypt.h ioapi.h mztools.h unzip.h zip.h minizip_extern.h)
if(WIN32)
set(SOURCES ${SOURCES} iowin32.c)
set(HEADERS ${HEADERS} iowin32.h)
if(BUILD_SHARED_LIBS)
set(SOURCES ${SOURCES} minizip1.rc)
endif()
endif()
add_library(minizip ${SOURCES} ${HEADERS})
target_include_directories(minizip PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/../..
${CMAKE_CURRENT_SOURCE_DIR}/../../_build
${CMAKE_CURRENT_SOURCE_DIR}/../../_build/source_subfolder)
find_library(ZLIB_LIBRARY NAMES z zlib zlibstatic zlibstaticd PATHS
${CMAKE_CURRENT_SOURCE_DIR}/../../_build
${CMAKE_CURRENT_SOURCE_DIR}/../../_build/lib)
target_link_libraries(minizip PRIVATE ${ZLIB_LIBRARY})
target_compile_definitions(minizip PRIVATE MINIZIP_BUILDING)
if(BUILD_SHARED_LIBS)
set_target_properties(minizip PROPERTIES INSTALL_RPATH "$ORIGIN" BUILD_WITH_INSTALL_RPATH True)
target_compile_definitions(minizip PRIVATE MINIZIP_DLL ZLIB_DLL)
if(WIN32)
set_target_properties(minizip PROPERTIES SUFFIX "1.dll")
endif()
endif()
set_target_properties(minizip PROPERTIES PUBLIC_HEADER "${HEADERS}")
set_target_properties(minizip PROPERTIES SOVERSION 1)
set_target_properties(minizip PROPERTIES VERSION "1.1.0")
install(TARGETS minizip
ARCHIVE DESTINATION "lib"
LIBRARY DESTINATION "lib"
RUNTIME DESTINATION "bin"
PUBLIC_HEADER DESTINATION "include"
COMPONENT library
)