2 # This module is provided as GDCM_USE_FILE by GDCMConfig.cmake.
3 # It can be INCLUDEd in a project to load the needed compiler and linker
4 # settings to use GDCM:
5 # FIND_PACKAGE(GDCM REQUIRED)
6 # INCLUDE(${GDCM_USE_FILE})
9 IF(NOT GDCM_USE_FILE_INCLUDED)
10 SET(GDCM_USE_FILE_INCLUDED 1)
12 # Load the compiler settings used for GDCM.
13 IF(GDCM_BUILD_SETTINGS_FILE)
14 INCLUDE(${CMAKE_ROOT}/Modules/CMakeImportBuildSettings.cmake)
15 CMAKE_IMPORT_BUILD_SETTINGS(${GDCM_BUILD_SETTINGS_FILE})
16 ENDIF(GDCM_BUILD_SETTINGS_FILE)
18 # Add compiler flags needed to use GDCM.
20 "${CMAKE_C_FLAGS} ${GDCM_REQUIRED_C_FLAGS}")
22 "${CMAKE_CXX_FLAGS} ${GDCM_REQUIRED_CXX_FLAGS}")
23 SET(CMAKE_EXE_LINKER_FLAGS
24 "${CMAKE_EXE_LINKER_FLAGS} ${GDCM_REQUIRED_EXE_LINKER_FLAGS}")
25 SET(CMAKE_SHARED_LINKER_FLAGS
26 "${CMAKE_SHARED_LINKER_FLAGS} ${GDCM_REQUIRED_SHARED_LINKER_FLAGS}")
27 SET(CMAKE_MODULE_LINKER_FLAGS
28 "${CMAKE_MODULE_LINKER_FLAGS} ${GDCM_REQUIRED_MODULE_LINKER_FLAGS}")
30 # Add include directories needed to use GDCM.
31 INCLUDE_DIRECTORIES( BEFORE ${GDCM_INCLUDE_DIRS})
33 # Add link directories needed to use GDCM.
34 LINK_DIRECTORIES(${GDCM_LIBRARY_DIRS})
36 # Add cmake module path.
37 SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${GDCM_CMAKE_DIR}")
41 SET(VTK_DIR ${GDCM_VTK_DIR})
44 INCLUDE(${VTK_USE_FILE})
45 set(GDCM_LIBRARIES ${GDCM_LIBRARIES} " vtkgdcm" )
47 MESSAGE("VTK not found in GDCM_VTK_DIR=\"${GDCM_VTK_DIR}\".")
51 ENDIF(NOT GDCM_USE_FILE_INCLUDED)