CMakeLists.txt 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. PROJECT(CMZLIB)
  2. INCLUDE_DIRECTORIES(
  3. "${CMZLIB_SOURCE_DIR}"
  4. "${CMZLIB_SOURCE_DIR}/.."
  5. "${CMZLIB_BINARY_DIR}/.."
  6. )
  7. # Tell the header files included from the .c files that they are being
  8. # built. Used to disable warnings since we do not want to change the
  9. # code much.
  10. ADD_DEFINITIONS(-DCMZLIB_IN_C)
  11. # Match all headers for dependencies but complain about none.
  12. INCLUDE_REGULAR_EXPRESSION("^.*$")
  13. # source files for zlib
  14. SET(ZLIB_SRCS
  15. adler32.c gzio.c inftrees.c uncompr.c
  16. compress.c infblock.c infutil.c zutil.c
  17. crc32.c infcodes.c
  18. deflate.c inffast.c
  19. inflate.c trees.c
  20. )
  21. # for windows add the .def and .rc files to the source list
  22. IF(WIN32)
  23. IF(BUILD_SHARED_LIBS)
  24. SET(ZLIB_DLL 1)
  25. IF(NOT UNIX)
  26. IF(NOT BORLAND)
  27. IF(NOT MINGW)
  28. SET(ZLIB_SRCS ${ZLIB_SRCS} zlib.def zlib.rc )
  29. ENDIF(NOT MINGW)
  30. ENDIF(NOT BORLAND)
  31. ENDIF(NOT UNIX)
  32. ENDIF(BUILD_SHARED_LIBS)
  33. ENDIF(WIN32)
  34. CONFIGURE_FILE(${CMZLIB_SOURCE_DIR}/.NoDartCoverage
  35. ${CMZLIB_BINARY_DIR}/.NoDartCoverage)
  36. CONFIGURE_FILE(${CMZLIB_SOURCE_DIR}/zlibDllConfig.h.in
  37. ${CMZLIB_BINARY_DIR}/zlibDllConfig.h)
  38. FOREACH(name zlib zconf cm_zlib_mangle)
  39. CONFIGURE_FILE(${CMZLIB_SOURCE_DIR}/${name}.h
  40. ${CMZLIB_BINARY_DIR}/${name}.h COPYONLY)
  41. ENDFOREACH(name)
  42. ADD_LIBRARY(cmzlib ${ZLIB_SRCS})