PROJECT(DICOMParser)

INCLUDE_DIRECTORIES(${DICOMParser_SOURCE_DIR})
INCLUDE_DIRECTORIES(${DICOMParser_BINARY_DIR})

IF(WIN32)
  IF(BUILD_SHARED_LIBS)
    SET(DICOM_DLL 1)
  ELSE(BUILD_SHARED_LIBS)
    SET(DICOM_STATIC 1)
  ENDIF(BUILD_SHARED_LIBS)
ENDIF(WIN32)

IF(VTK_SOURCE_DIR)
   # Inside VTK, use its setting.
   SET(DICOM_ANSI_STDLIB ${VTK_USE_ANSI_STDLIB})
ELSE(VTK_SOURCE_DIR)
   # Not inside VTK, use ANSI streams.
   SET(DICOM_ANSI_STDLIB 1)
ENDIF(VTK_SOURCE_DIR)

INCLUDE(${CMAKE_ROOT}/Modules/TestForSTDNamespace.cmake)
SET(DICOM_NO_STD_NAMESPACE ${CMAKE_NO_STD_NAMESPACE})


CONFIGURE_FILE(${DICOMParser_SOURCE_DIR}/DICOMCMakeConfig.h.in
               ${DICOMParser_BINARY_DIR}/DICOMCMakeConfig.h)

ADD_LIBRARY(vtkDICOMParser DICOMFile.cxx DICOMParser.cxx DICOMAppHelper.cxx)

IF(NOT VTK_INSTALL_NO_LIBRARIES)
  INSTALL_TARGETS(${VTK_INSTALL_LIB_DIR} vtkDICOMParser)
ENDIF(NOT VTK_INSTALL_NO_LIBRARIES)
IF(NOT VTK_INSTALL_NO_DEVELOPMENT)
  INSTALL_FILES(${VTK_INSTALL_INCLUDE_DIR} "(\\.h|\\.txx)$")
  INSTALL_FILES(${VTK_INSTALL_INCLUDE_DIR} FILES ${DICOMParser_BINARY_DIR}/DICOMCMakeConfig.h) 
ENDIF(NOT VTK_INSTALL_NO_DEVELOPMENT)
