#=========================================================
# CLITK = Command Line ITK
+PROJECT(clitk)
cmake_minimum_required(VERSION 2.8)
cmake_policy(VERSION 2.8)
if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW)
endif(COMMAND cmake_policy)
-PROJECT(clitk)
IF(NOT DEFINED CLITK_SOURCE_DIR)
SET(CLITK_SOURCE_DIR ${PROJECT_SOURCE_DIR})
ENDIF(NOT DEFINED CLITK_SOURCE_DIR)
TARGET_LINK_LIBRARIES(clitkCommon statgrab)
ENDIF(NOT ${LIBSTATGRAB} MATCHES "LIBSTATGRAB-NOTFOUND")
-TARGET_LINK_LIBRARIES(clitkCommon vtkCommon vtkImaging ${ITK_LIBRARIES})
+### Check if ITK was compiled with SYSTEM_GDCM = ON and set the gdcm libraries accordingly
+SET(CLITK_USE_SYSTEM_GDCM FALSE)
+IF(ITK_VERSION_MAJOR LESS "4")
+ IF(ITK_USE_SYSTEM_GDCM)
+ SET(CLITK_USE_SYSTEM_GDCM TRUE)
+ ENDIF(ITK_USE_SYSTEM_GDCM)
+ELSE(ITK_VERSION_MAJOR LESS "4")
+ SET(GDCM_INCLUDE ".*include/gdcm-.*")
+ IF(ITKGDCM_INCLUDE_DIRS MATCHES ${GDCM_INCLUDE})
+ SET(CLITK_USE_SYSTEM_GDCM TRUE)
+ ENDIF(ITKGDCM_INCLUDE_DIRS MATCHES ${GDCM_INCLUDE})
+ENDIF(ITK_VERSION_MAJOR LESS "4")
+
+IF(CLITK_USE_SYSTEM_GDCM)
+ SET(CLITK_GDCM_LIBRARIES gdcmDSED)
+ENDIF(CLITK_USE_SYSTEM_GDCM)
+
+TARGET_LINK_LIBRARIES(clitkCommon vtkCommon vtkImaging ${ITK_LIBRARIES} ${CLITK_GDCM_LIBRARIES})
ADD_LIBRARY(clitkDicomRTStruct STATIC
clitkDicomRT_Contour.cxx
clitkDicomRTStruct2ImageFilter.cxx
)
-TARGET_LINK_LIBRARIES(clitkDicomRTStruct vtkHybrid)
+TARGET_LINK_LIBRARIES(clitkDicomRTStruct vtkHybrid ${CLITK_GDCM_LIBRARIES})
#ADD_LIBRARY(clitkCommonShared SHARED ${clitkCommon_SRC})
#SET_TARGET_PROPERTIES(clitkCommonShared PROPERTIES COMPILE_FLAGS -fPIC)
TARGET_LINK_LIBRARIES(clitkConvertBSplineDeformableTransformToVF clitkCommon ${ITK_LIBRARIES})
SET(REGISTRATION_INSTALL ${REGISTRATION_INSTALL} clitkConvertBSplineDeformableTransformToVF)
- SET_TARGET_PROPERTIES(${REGISTRATION_INSTALL} PROPERTIES INSTALL_RPATH "${VTK_DIR}:${ITK_DIR}" )
+# SET_TARGET_PROPERTIES(${REGISTRATION_INSTALL} PROPERTIES INSTALL_RPATH "${VTK_DIR}:${ITK_DIR}" )
INSTALL (TARGETS ${REGISTRATION_INSTALL} DESTINATION bin PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE)
ENDIF(CLITK_BUILD_REGISTRATION)
ADD_EXECUTABLE(clitkRegionGrowing clitkRegionGrowing.cxx ${clitkRegionGrowing_GGO_C} ${clitkRelativePosition_GGO_C})
TARGET_LINK_LIBRARIES(clitkRegionGrowing clitkCommon ${ITK_LIBRARIES})
- SET_TARGET_PROPERTIES(${SEGMENTATION_INSTALL} PROPERTIES INSTALL_RPATH "${VTK_DIR}:${ITK_DIR}" )
+# SET_TARGET_PROPERTIES(${SEGMENTATION_INSTALL} PROPERTIES INSTALL_RPATH "${VTK_DIR}:${ITK_DIR}" )
INSTALL (TARGETS ${SEGMENTATION_INSTALL} DESTINATION bin PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE)
ENDIF(CLITK_BUILD_SEGMENTATION)
SET(TOOLS_INSTALL ${TOOLS_INSTALL} clitkDicomRTPlan2Gate)
ENDIF(ITK_VERSION_MAJOR VERSION_LESS 4)
- SET_TARGET_PROPERTIES(${TOOLS_INSTALL} PROPERTIES INSTALL_RPATH "${VTK_DIR}:${ITK_DIR}" )
+# SET_TARGET_PROPERTIES(${TOOLS_INSTALL} PROPERTIES INSTALL_RPATH "${VTK_DIR}:${ITK_DIR}" )
INSTALL (TARGETS ${TOOLS_INSTALL} DESTINATION bin PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
ENDIF(CLITK_BUILD_TOOLS)
#=========================================================
# Install options (also used by CPack)
IF(UNIX OR APPLE)
- SET_TARGET_PROPERTIES(vv
- PROPERTIES INSTALL_RPATH "${VTK_DIR}:${ITK_DIR}")
+# SET_TARGET_PROPERTIES(vv
+# PROPERTIES INSTALL_RPATH "${VTK_DIR}:${ITK_DIR}")
INSTALL (TARGETS vv DESTINATION bin PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE)
# INSTALL (FILES ${CMAKE_CURRENT_SOURCE_DIR}/icons/ducky.png DESTINATION .)