]> Creatis software - clitk.git/commitdiff
Detect ITK_USE_SYSTEM_GDCM with target
authorSimon Rit <simon.rit@creatis.insa-lyon.fr>
Sat, 4 Jan 2014 15:23:43 +0000 (16:23 +0100)
committerSimon Rit <simon.rit@creatis.insa-lyon.fr>
Sat, 4 Jan 2014 15:23:43 +0000 (16:23 +0100)
cmake/dependencies.cmake

index 2bd9f8219852174e552e474621d400b9ab210776..7091fffe04d8ade7c75ef4d846bcc3388a8fdae1 100644 (file)
@@ -63,14 +63,11 @@ 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")
+ELSE()
+  # 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()
-ENDIF(ITK_VERSION_MAJOR LESS "4")
-
-#DD(CLITK_USE_SYSTEM_GDCM)
+ENDIF()