CMakeLists.txt 1.4 KB

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