4 message(FATAL_ERROR "Include Defs.cmake")
7 if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/src/zlib.h")
8 set(DEFAULT_ZLIB_SRC_PATH ${CMAKE_CURRENT_SOURCE_DIR}/src)
10 # Assume build inside Android source tree
11 set(DEFAULT_ZLIB_SRC_PATH "../zlib/src")
14 set(ZLIB_SRC_PATH ${DEFAULT_ZLIB_SRC_PATH} CACHE STRING "Path to zlib source tree")
16 if (IS_ABSOLUTE ${ZLIB_SRC_PATH})
17 set(ZLIB_ABS_PATH ${ZLIB_SRC_PATH})
19 set(ZLIB_ABS_PATH "${CMAKE_SOURCE_DIR}/${ZLIB_SRC_PATH}")
23 ${ZLIB_ABS_PATH}/adler32.c
24 ${ZLIB_ABS_PATH}/compress.c
25 ${ZLIB_ABS_PATH}/crc32.c
26 ${ZLIB_ABS_PATH}/crc32.h
27 ${ZLIB_ABS_PATH}/deflate.c
28 ${ZLIB_ABS_PATH}/deflate.h
29 ${ZLIB_ABS_PATH}/gzclose.c
30 ${ZLIB_ABS_PATH}/gzguts.h
31 ${ZLIB_ABS_PATH}/gzlib.c
32 ${ZLIB_ABS_PATH}/gzread.c
33 ${ZLIB_ABS_PATH}/gzwrite.c
34 ${ZLIB_ABS_PATH}/infback.c
35 ${ZLIB_ABS_PATH}/inffast.c
36 ${ZLIB_ABS_PATH}/inffast.h
37 ${ZLIB_ABS_PATH}/inffixed.h
38 ${ZLIB_ABS_PATH}/inflate.c
39 ${ZLIB_ABS_PATH}/inflate.h
40 ${ZLIB_ABS_PATH}/inftrees.c
41 ${ZLIB_ABS_PATH}/inftrees.h
42 ${ZLIB_ABS_PATH}/trees.c
43 ${ZLIB_ABS_PATH}/trees.h
44 ${ZLIB_ABS_PATH}/uncompr.c
45 ${ZLIB_ABS_PATH}/zconf.h
46 ${ZLIB_ABS_PATH}/zlib.h
47 ${ZLIB_ABS_PATH}/zutil.c
48 ${ZLIB_ABS_PATH}/zutil.h
51 if (DE_COMPILER_IS_MSC)
52 # 4127: conditional expression is constant
53 # 4131: 'x': uses old style declarator
54 # 4242, 4244: conversion from 'x' to 'y', possible loss of data
55 # 4996: deprecated POSIX name
56 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Wall /wd4127 /wd4131 /wd4242 /wd4244 /wd4996")
58 elseif (DE_COMPILER_IS_GCC OR DE_COMPILER_IS_CLANG)
59 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-implicit-function-declaration")
63 if (DE_OS_IS_UNIX OR DE_OS_IS_QNX)
64 add_definitions(-D_XOPEN_SOURCE=600)
67 set(CMAKE_C_FLAGS ${DE_3RD_PARTY_C_FLAGS})
69 add_library(z STATIC ${ZLIB_SRCS})
71 set(ZLIB_INCLUDE_PATH ${ZLIB_ABS_PATH} PARENT_SCOPE)
72 set(ZLIB_LIBRARY z PARENT_SCOPE)