git.s-ol.nu forks/DiligentTools / 54a073b
Added optional MiniZip library assiduous 2 years ago
1 changed file(s) with 44 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
11
22 project(ZLib C)
33
4 set(SOURCE
4 set(ZLIB_SOURCE
55 adler32.c
66 compress.c
77 crc32.c
1919 zutil.c
2020 )
2121
22 set(INCLUDE
22 set(ZLIB_INCLUDE
2323 crc32.h
2424 deflate.h
2525 gzguts.h
3333 zutil.h
3434 )
3535
36 add_library(ZLib STATIC ${SOURCE} ${INCLUDE})
36 add_library(ZLib STATIC ${ZLIB_SOURCE} ${ZLIB_INCLUDE})
3737 set_common_target_properties(ZLib)
3838
3939 target_link_libraries(ZLib PRIVATE Diligent-BuildSettings)
5757
5858 target_include_directories(ZLib PUBLIC .)
5959
60 source_group("src" FILES ${SOURCE})
61 source_group("include" FILES ${INCLUDE})
60 source_group("src" FILES ${ZLIB_SOURCE})
61 source_group("include" FILES ${ZLIB_INCLUDE})
6262
6363 set_target_properties(ZLib PROPERTIES
6464 FOLDER DiligentTools/ThirdParty
6565 )
66
67
68 option(ZLIB_BUILD_MINIZIP "Build minizip library" OFF)
69 if(${ZLIB_BUILD_MINIZIP})
70 set(MINIZIP_SOURCE
71 contrib/minizip/ioapi.c
72 contrib/minizip/iowin32.c
73 contrib/minizip/mztools.c
74 contrib/minizip/unzip.c
75 contrib/minizip/zip.c
76 )
77 set(MINIZIP_INCLUDE
78 contrib/minizip/crypt.h
79 contrib/minizip/ioapi.h
80 contrib/minizip/iowin32.h
81 contrib/minizip/mztools.h
82 contrib/minizip/unzip.h
83 contrib/minizip/zip.h
84 )
85
86 add_library(MiniZip STATIC ${MINIZIP_SOURCE} ${MINIZIP_INCLUDE})
87 set_common_target_properties(MiniZip)
88
89 target_link_libraries(MiniZip PRIVATE Diligent-BuildSettings PUBLIC ZLib)
90
91 if(MSVC)
92 target_compile_definitions(MiniZip PRIVATE -D_CRT_SECURE_NO_DEPRECATE)
93 target_compile_options(MiniZip PRIVATE /W3 /wd4131 /wd4189 /wd4456 /wd4244 /wd4701 /wd4703)
94 endif()
95
96 target_include_directories(MiniZip PUBLIC contrib/minizip/)
97
98 source_group("src" FILES ${MINIZIP_SOURCE})
99 source_group("include" FILES ${MINIZIP_INCLUDE})
100
101 set_target_properties(MiniZip PROPERTIES
102 FOLDER DiligentTools/ThirdParty
103 )
104 endif()