CMakeLists.txt 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. # Disable warnings on Borland to avoid changing 3rd party code.
  14. IF(BORLAND)
  15. SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w-")
  16. ENDIF(BORLAND)
  17. # source files for zlib
  18. SET(ZLIB_SRCS
  19. adler32.c gzio.c inftrees.c uncompr.c
  20. compress.c infblock.c infutil.c zutil.c
  21. crc32.c infcodes.c
  22. deflate.c inffast.c
  23. inflate.c trees.c
  24. )
  25. # for windows add the .def and .rc files to the source list
  26. IF(WIN32)
  27. IF(BUILD_SHARED_LIBS)
  28. SET(ZLIB_DLL 1)
  29. IF(NOT UNIX)
  30. IF(NOT BORLAND)
  31. IF(NOT MINGW)
  32. SET(ZLIB_SRCS ${ZLIB_SRCS} zlib.def zlib.rc )
  33. ENDIF(NOT MINGW)
  34. ENDIF(NOT BORLAND)
  35. ENDIF(NOT UNIX)
  36. ENDIF(BUILD_SHARED_LIBS)
  37. ENDIF(WIN32)
  38. CONFIGURE_FILE(${CMZLIB_SOURCE_DIR}/.NoDartCoverage
  39. ${CMZLIB_BINARY_DIR}/.NoDartCoverage)
  40. CONFIGURE_FILE(${CMZLIB_SOURCE_DIR}/zlibDllConfig.h.in
  41. ${CMZLIB_BINARY_DIR}/zlibDllConfig.h)
  42. FOREACH(name zlib zconf cm_zlib_mangle)
  43. CONFIGURE_FILE(${CMZLIB_SOURCE_DIR}/${name}.h
  44. ${CMZLIB_BINARY_DIR}/${name}.h COPYONLY)
  45. ENDFOREACH(name)
  46. ADD_LIBRARY(cmzlib ${ZLIB_SRCS})