-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")
- FIND_PATH(GDCMDEFSPATH
- "gdcmDefs.h"
- PATHS ${ITK_INCLUDE_DIRS})
- IF(${GDCMDEFSPATH} MATCHES "GDCMDEFSPATH-NOTFOUND")
- SET(CLITK_USE_SYSTEM_GDCM TRUE)
- ENDIF()
-ENDIF(ITK_VERSION_MAJOR LESS "4")
+set(CLITK_USE_SYSTEM_GDCM FALSE)
+# ITK4 creates a target for each gdcm library when it compiles GDCM
+get_target_property(GDCMDICTTARG gdcmDICT TYPE )
+if(NOT GDCMDICTTARG)
+ set(CLITK_USE_SYSTEM_GDCM TRUE)
+endif()