2005-01-26 23:55:12 +03:00
|
|
|
PROJECT(CMZLIB)
|
2015-01-14 17:20:27 +03:00
|
|
|
|
|
|
|
# Disable warnings to avoid changing 3rd party code.
|
|
|
|
if(CMAKE_C_COMPILER_ID MATCHES
|
|
|
|
"^(GNU|Clang|AppleClang|XL|VisualAge|SunPro|MIPSpro|HP|Intel)$")
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w")
|
|
|
|
elseif(CMAKE_C_COMPILER_ID STREQUAL "PathScale")
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -woffall")
|
|
|
|
endif()
|
2005-01-26 23:55:12 +03:00
|
|
|
|
2005-03-16 21:26:36 +03:00
|
|
|
INCLUDE_DIRECTORIES(
|
|
|
|
"${CMZLIB_SOURCE_DIR}"
|
|
|
|
"${CMZLIB_SOURCE_DIR}/.."
|
|
|
|
"${CMZLIB_BINARY_DIR}/.."
|
|
|
|
)
|
2005-01-26 23:55:12 +03:00
|
|
|
|
|
|
|
# source files for zlib
|
|
|
|
SET(ZLIB_SRCS
|
2007-09-11 19:22:29 +04:00
|
|
|
adler32.c compress.c crc32.c deflate.c gzio.c inffast.c
|
|
|
|
inflate.c inftrees.c trees.c uncompr.c zutil.c
|
2005-01-26 23:55:12 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
# for windows add the .def and .rc files to the source list
|
2007-09-11 19:22:29 +04:00
|
|
|
# if building shared libs
|
2005-01-26 23:55:12 +03:00
|
|
|
IF(WIN32)
|
|
|
|
IF(BUILD_SHARED_LIBS)
|
|
|
|
SET(ZLIB_DLL 1)
|
2005-02-16 17:17:46 +03:00
|
|
|
IF(NOT UNIX)
|
2014-08-06 17:20:24 +04:00
|
|
|
IF(NOT MINGW)
|
|
|
|
SET(ZLIB_SRCS ${ZLIB_SRCS} zlib.def zlib.rc )
|
|
|
|
ENDIF(NOT MINGW)
|
|
|
|
ENDIF(NOT UNIX)
|
2005-01-26 23:55:12 +03:00
|
|
|
ENDIF(BUILD_SHARED_LIBS)
|
|
|
|
ENDIF(WIN32)
|
|
|
|
|
|
|
|
CONFIGURE_FILE(${CMZLIB_SOURCE_DIR}/.NoDartCoverage
|
|
|
|
${CMZLIB_BINARY_DIR}/.NoDartCoverage)
|
|
|
|
CONFIGURE_FILE(${CMZLIB_SOURCE_DIR}/zlibDllConfig.h.in
|
|
|
|
${CMZLIB_BINARY_DIR}/zlibDllConfig.h)
|
|
|
|
|
|
|
|
FOREACH(name zlib zconf cm_zlib_mangle)
|
|
|
|
CONFIGURE_FILE(${CMZLIB_SOURCE_DIR}/${name}.h
|
|
|
|
${CMZLIB_BINARY_DIR}/${name}.h COPYONLY)
|
|
|
|
ENDFOREACH(name)
|
|
|
|
|
|
|
|
|
|
|
|
ADD_LIBRARY(cmzlib ${ZLIB_SRCS})
|
2009-09-28 19:36:17 +04:00
|
|
|
|
2013-08-26 19:50:08 +04:00
|
|
|
INSTALL(FILES Copyright.txt DESTINATION ${CMAKE_DOC_DIR}/cmzlib)
|