]> Creatis software - clitk.git/commitdiff
Add libvtkgdcm to clitkDicomRTStructLib
authorDavid Sarrut <david.sarrut@gmail.com>
Fri, 3 Feb 2012 06:57:12 +0000 (07:57 +0100)
committerDavid Sarrut <david.sarrut@creatis.insa-lyon.fr>
Thu, 30 May 2013 07:28:56 +0000 (09:28 +0200)
common/CMakeLists.txt

index cd6af5b41b3066f07fd7109e8a536efe1a431930..672023e08e723cd8b38abe99d2b4cd1639257bc1 100644 (file)
@@ -81,14 +81,39 @@ ENDIF(CLITK_USE_SYSTEM_GDCM)
 
 TARGET_LINK_LIBRARIES(clitkCommon vtkCommon vtkImaging ${ITK_LIBRARIES} ${CLITK_GDCM_LIBRARIES})
 
-ADD_LIBRARY(clitkDicomRTStruct STATIC
-  clitkDicomRT_Contour.cxx
-  clitkDicomRT_ROI.cxx
-  clitkDicomRT_StructureSet.cxx
-  clitkDicomRTStruct2ImageFilter.cxx
-)
+IF (CLITK_USE_SYSTEM_GDCM)
+  DD(CLITK_USE_SYSTEM_GDCM)
+  FIND_PACKAGE(GDCM REQUIRED)
+  INCLUDE(${GDCM_USE_FILE})
+  
+  FIND_LIBRARY(LIBVTKGDCM vtkgdcm ${GDCM_LIBRARY_DIRS})
+  SET(GDCM_LIBRARIES ${LIBVTKGDCM})
+
+  DD(GDCM_USE_FILE)
+  DD(GDCM_LIBRARY_DIRS)
+  DD(GDCM_LIBRARIES)
+
+  ADD_LIBRARY(clitkDicomRTStruct STATIC
+    clitkDicomRT_Contour.cxx
+    clitkDicomRT_ROI.cxx
+    clitkDicomRT_StructureSet.cxx
+    clitkDicomRTStruct2ImageFilter.cxx
+    vtkGDCMPolyDataReader.cxx
+    vtkGDCMPolyDataWriter.cxx
+    )
+  TARGET_LINK_LIBRARIES(clitkDicomRTStruct ${ITK_LIBRARIES} ${GDCM_LIBRARIES})
+
+ELSE()
+  ADD_LIBRARY(clitkDicomRTStruct STATIC
+    clitkDicomRT_Contour.cxx
+    clitkDicomRT_ROI.cxx
+    clitkDicomRT_StructureSet.cxx
+    clitkDicomRTStruct2ImageFilter.cxx
+    )
+ENDIF()
+
 
-TARGET_LINK_LIBRARIES(clitkDicomRTStruct vtkHybrid ${CLITK_GDCM_LIBRARIES}) 
+TARGET_LINK_LIBRARIES(clitkDicomRTStruct vtkHybrid ${CLITK_GDCM_LIBRARIES} ${GDCM_LIBRARIES} 
 
 #ADD_LIBRARY(clitkCommonShared SHARED ${clitkCommon_SRC})
 #SET_TARGET_PROPERTIES(clitkCommonShared PROPERTIES COMPILE_FLAGS -fPIC)