]> Creatis software - crea.git/commitdiff
Bug #1509: gdcm2 doesn't work anymore
authorFrederic Cervenansky <Frederic.Cervenansky@creatis.insa-lyon.fr>
Mon, 16 Jul 2012 10:07:49 +0000 (10:07 +0000)
committerFrederic Cervenansky <Frederic.Cervenansky@creatis.insa-lyon.fr>
Mon, 16 Jul 2012 10:07:49 +0000 (10:07 +0000)
cmake/CREAMacro_FindAndUseLibraries.cmake

index ab516d69eb8ee5b234ca45ff4e8e0b5c362c2977..f7c22a8668a0a475fde98129390b1fa0bf9db622 100644 (file)
@@ -105,9 +105,15 @@ IF(USE_ITK)
       INCLUDE(${ITK_USE_FILE})
       CREA_DEFINE( USE_ITK )
       CREA_DEFINE( _USE_ITK_ )
-      SET(ITK_LIBRARIES
-       ITKCommon ITKIO ITKBasicFilters ITKAlgorithms
-       )  
+         If (${ITK_VERSION_MAJOR} MATCHES "4")
+          MESSAGE ( STATUS "* Version = ${ITK_VERSION_MAJOR}.${ITK_VERSION_MINOR}.${ITK_VERSION_PATCH}")
+               SET(ITK_LIBRARIES
+               ${ITK_LIBRARIES}) 
+                MESSAGE ( STATUS "${ITK_LIBRARIES}")
+               ELSEIF()
+               SET(ITK_LIBRARIES
+                       ITKCommon ITKIO ITKBasicFilters ITKAlgorithms)
+               ENDIF()
       MARK_AS_ADVANCED(ITK_DIR)
     ELSE(ITK_FOUND)
       message(FATAL_ERROR "ITK_DIR not found")
@@ -176,8 +182,9 @@ IF(USE_GDCM2)
     MESSAGE(ERROR "CANNOT USE BOTH gdcm AND gdcm2 !")
   ENDIF (USE_GDCM)
 
-  IF(NOT USE_ITK) # JPR : ITK vs GDCM (avoid cmake break)
+#  IF(NOT USE_ITK) # JPR : ITK vs GDCM (avoid cmake break)
     # Search GDCM2
+
     FIND_PACKAGE(GDCM REQUIRED)
     INCLUDE(${GDCM_USE_FILE})
 
@@ -197,9 +204,9 @@ IF(USE_GDCM2)
       
       # Test that GDCM_NAME_SPACE is **NOT** "gdcm" or will conflict with 
       # embedded gdcm in ITK and will result in hard seg faults !
-                  INCLUDE_DIRECTORIES(${GDCM_INCLUDE_DIR})      
-                       LINK_DIRECTORIES( ${GDCM_LIBRARY_DIR}) 
-
+                  INCLUDE_DIRECTORIES(${GDCM_INCLUDE_DIRS})     
+                       LINK_DIRECTORIES( ${GDCM_LIBRARY_DIRS}) 
+                       
       SET(GDCM2_LIBRARIES
         ${GDCM_LIBRARIES} 
        )
@@ -210,18 +217,32 @@ IF(USE_GDCM2)
                  SET(GDCM_LIBRARIES
                        ${GDCM_LIBRARIES}
                        vtkgdcm
-                       #gdcm2vtk
+                       gdcmIOD
+                       gdcmMSFF
+                       gdcmexpat
+                       gdcmCommon
+                       gdcmMEXD
+                       gdcmexpat
+                       gdcmDSED
+                       gdcmDICT
+                       gdcmjpeg8
+                       gdcmjpeg12
+                       gdcmjpeg16
+                       socketxx
+                       gdcmopenjpeg
+                       gdcmcharls
                     )
                ELSE(WIN32)
                    SET(GDCM_LIBRARIES
                        ${GDCM_LIBRARIES}
                        vtkgdcm
+                       gdcmIOD
                        )
                ENDIF(WIN32)
                
        ENDIF(USE_VTK)
       ENDIF(USE_GDCM_VTK)
-  ENDIF(NOT USE_ITK) # JPR : ITK vs GDCM (avoid cmake break)
# ENDIF(NOT USE_ITK) # JPR : ITK vs GDCM (avoid cmake break)
 
 ENDIF(USE_GDCM2)