Advertisement
hamzaalloush

dcmtk-example-3rdparty

May 26th, 2015
281
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CMake 1.62 KB | None | 0 0
  1. IF(WIN32)
  2.  
  3.   # For Windows, we don't used FIND_PACKAGE because DCMTK usually is used with its
  4.   # own set of 3rd-party support libraries that can be downloaded from DCMTK's
  5.   # website (pre-built).
  6.  
  7.   # zlib support: find out whether user has library
  8.   GET_FILENAME_COMPONENT(ZLIB_DIR "${DCMTK_SOURCE_DIR}/../zlib-1.2.5" ABSOLUTE)
  9.   FIND_PATH(WITH_ZLIBINC "include/zlib.h" "${ZLIB_DIR}" NO_DEFAULT_PATH)
  10.  
  11.   # zlib support: configure compiler
  12.   IF(DCMTK_WITH_ZLIB)
  13.     IF(WITH_ZLIBINC)
  14.       SET(ZLIB_INCDIR ${WITH_ZLIBINC}/include)
  15.       SET(ZLIB_LIBDIR ${WITH_ZLIBINC}/lib)
  16.       SET(ZLIB_LIBS debug ${ZLIB_LIBDIR}/zlib_d.lib optimized ${ZLIB_LIBDIR}/zlib_o.lib)
  17.       MESSAGE(STATUS "Info: DCMTK ZLIB support will be enabled")
  18.       SET(WITH_ZLIB 1)
  19.     ELSE(WITH_ZLIBINC) # turn off library if library path not set
  20.       MESSAGE(STATUS "Warning: ZLIB support will be disabled because zlib directory was not specified. Correct path and re-enable DCMTK_WITH_ZLIB.")
  21.       SET(DCMTK_WITH_ZLIB OFF CACHE BOOL "" FORCE)
  22.       SET(WITH_ZLIB "")
  23.     ENDIF(WITH_ZLIBINC)
  24.   ENDIF(DCMTK_WITH_ZLIB)
  25.  
  26. ELSE(WIN32)
  27.  
  28.   # Find zlib
  29.   IF(DCMTK_WITH_ZLIB)
  30.     PKG_SEARCH_MODULE(ZLIB REQUIRED zlib)
  31.     IF(NOT ZLIB_FOUND)
  32.       MESSAGE(STATUS "Warning: ZLIB support will be disabled because zlib was not found.")
  33.       SET(WITH_ZLIB "")
  34.       SET(DCMTK_WITH_ZLIB OFF CACHE BOOL "" FORCE)
  35.     ELSE(NOT ZLIB_FOUND)
  36.       MESSAGE(STATUS "Info: DCMTK ZLIB support will be enabled")
  37.       SET(WITH_ZLIB 1)
  38.       INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIRS})
  39.       SET(ZLIB_LIBS ${ZLIB_LIBRARIES})
  40.     ENDIF(NOT ZLIB_FOUND)
  41.   ENDIF(DCMTK_WITH_ZLIB)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement