]> Creatis software - crea.git/commitdiff
Use GDCM2 as available DICOM Reader instead of GDCM1.3
authorFrederic Cervenansky <Frederic.Cervenansky@creatis.insa-lyon.fr>
Fri, 12 Mar 2010 11:06:48 +0000 (11:06 +0000)
committerFrederic Cervenansky <Frederic.Cervenansky@creatis.insa-lyon.fr>
Fri, 12 Mar 2010 11:06:48 +0000 (11:06 +0000)
cmake/CREAMacro_FindAndUseLibraries.cmake

index 5643dc28b4dd0694ad687e958de800da90820cf9..0a9f2fabbb5a361de7c8ab3caed9328dd9461575 100644 (file)
@@ -1,7 +1,7 @@
 
 
 MACRO(CREA_FIND_AND_USE_LIBRARIES)
-MESSAGE(ERROR "EED CREAMacrp_FindAndUseLibraries")
+#MESSAGE(ERROR "EED CREAMacrp_FindAndUseLibraries")
 set(USE_DEBUG_LIB "" CACHE BOOL "Use Debug Libraries" )
 
 #-----------------------------------------------------------------------------
@@ -157,22 +157,18 @@ IF(USE_GDCM)
   ENDIF(NOT GDCM_FOUND)
 ENDIF(USE_GDCM)
 
-#-----------------------------------------------------------------------------
-
 #-----------------------------------------------------------------------------
 IF(USE_GDCM2)
-  IF(NOT GDCM_FOUND)
     # Search GDCM2
-    FIND_PACKAGE(GDCM)
-    # If gdcm found
-    IF(GDCM_FOUND)
-      INCLUDE(${GDCM_USE_FILE})
+    FIND_PACKAGE(GDCM REQUIRED)
+    INCLUDE(${GDCM_USE_FILE})
 
       IF(NOT ${GDCM_MAJOR_VERSION} EQUAL 2)
        MESSAGE(FATAL_ERROR "gdcm version 2 needed. found ${GDCM_MAJOR_VERSION}.${GDCM_MINOR_VERSION}.${GDCM_BUILD_VERSION}. Set GDCM_DIR to the gdcm version 2 directory")
       ENDIF(NOT ${GDCM_MAJOR_VERSION} EQUAL 2)
       
       CREA_DEFINE( USE_GDCM2 )
+         MARK_AS_ADVANCED(GDCM_DIR)
       CREA_DEFINE_WITH_VAL( GDCM_NAME_SPACE gdcm )
       
       MESSAGE ( STATUS "=======================================")
@@ -183,32 +179,29 @@ 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 !
-      IF(USE_ITK)
-       IF (GDCM_NAME_SPACE STREQUAL "gdcm")
-         MESSAGE(FATAL_ERROR "GDCM_NAME_SPACE value is 'gdcm' which conflicts with ITK embededd gdcm namespace : rebuild gdcm with another GDCM_NAME_SPACE value")
-       ENDIF (GDCM_NAME_SPACE STREQUAL "gdcm")
-      ENDIF(USE_ITK)
 
-      MARK_AS_ADVANCED(GDCM_DIR)
 
-      SET(GDCM_LIBRARIES
+      SET(GDCM2_LIBRARIES
         ${GDCM_LIBRARIES} 
        )
 
-      # TODO : Test that GDCM was built with option "vtkgdcm"
       IF(USE_GDCM_VTK)
        IF(USE_VTK)
          SET(GDCM_LIBRARIES
            ${GDCM_LIBRARIES}
-            vtkgdcm  
+            vtkgdcm
+                       gdcm2vtk
             )
        ENDIF(USE_VTK)
       ENDIF(USE_GDCM_VTK)
       
-    ENDIF(GDCM_FOUND)
-  ENDIF(NOT GDCM_FOUND)
+
 ENDIF(USE_GDCM2)
 
+
+
+#-----------------------------------------------------------------------------
+
 #-----------------------------------------------------------------------------
 
 #-----------------------------------------------------------------------------
@@ -281,8 +274,7 @@ IF(USE_BOOST)
       CREA_DEFINE( USE_BOOST )
          IF(WIN32)
                
-               LINK_DIRECTORIES( ${Boost_INCLUDE_DIRS}/stage/lib) #JCP 01/10/2009
-
+               LINK_DIRECTORIES( ${Boost_INCLUDE_DIRS}/Bin/lib) 
                #message("creamacro find and use lib = ${Boost_SIGNALS_LIBRARY}")
                IF(USE_DEBUG_LIB)
                        SET(BOOST_LIBRARIES