CMakeLists.txt 1.31 KB
Newer Older
Andy Cedilnik's avatar
Andy Cedilnik committed
1
2
PROJECT(CMZLIB)

Andy Cedilnik's avatar
Andy Cedilnik committed
3
4
5
6
7
INCLUDE_DIRECTORIES(
  "${CMZLIB_SOURCE_DIR}"
  "${CMZLIB_SOURCE_DIR}/.."
  "${CMZLIB_BINARY_DIR}/.."
  )
Andy Cedilnik's avatar
Andy Cedilnik committed
8

9
10
11
12
13
14
# Tell the header files included from the .c files that they are being
# built.  Used to disable warnings since we do not want to change the
# code much.
ADD_DEFINITIONS(-DCMZLIB_IN_C)

# Match all headers for dependencies but complain about none.
15
INCLUDE_REGULAR_EXPRESSION("^.*$")
16

Andy Cedilnik's avatar
Andy Cedilnik committed
17
18
19
20
21
22
23
24
25
26
27
28
29
# source files for zlib
SET(ZLIB_SRCS
  adler32.c   gzio.c      inftrees.c  uncompr.c
  compress.c  infblock.c  infutil.c   zutil.c
  crc32.c     infcodes.c 
  deflate.c   inffast.c  
  inflate.c   trees.c
  )

# for windows add the .def and .rc files to the source list
IF(WIN32)
  IF(BUILD_SHARED_LIBS)
    SET(ZLIB_DLL 1)
30
31
32
33
34
35
36
    IF(NOT UNIX)
      IF(NOT BORLAND)
        IF(NOT MINGW)
          SET(ZLIB_SRCS ${ZLIB_SRCS} zlib.def zlib.rc  )
        ENDIF(NOT MINGW)
      ENDIF(NOT BORLAND) 
    ENDIF(NOT UNIX)   
Andy Cedilnik's avatar
Andy Cedilnik committed
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
  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})