]> Creatis software - gdcm.git/blob - vtk/CMakeLists.txt
Fix bug in windows part
[gdcm.git] / vtk / CMakeLists.txt
1 #-----------------------------------------------------------------------------
2 # VTK GDCM Reader subdir
3 # Rebuild gdcm whenever a file starting with vtk* is modified
4 INCLUDE_REGULAR_EXPRESSION("^vtk.*$")
5
6 #-----------------------------------------------------------------------------
7 # Include the VTK library
8 INCLUDE(${VTK_USE_FILE})
9
10 # Need gdcm header files
11 INCLUDE_DIRECTORIES(
12   ${GDCM_SOURCE_DIR}/src/
13   ${GDCM_BINARY_DIR}/
14 )
15
16 # Depending on VTK version build more stuff:
17 IF("${VTK_MAJOR_VERSION}" GREATER 4)
18   SET(VTKGDCM_LIB_SRCS
19     vtkGdcmReader.cxx
20     vtkGdcmWriter.cxx
21     vtkImageColorViewer.cxx
22     vtkImageMapToWindowLevelColors2.cxx
23   )
24 ELSE("${VTK_MAJOR_VERSION}" GREATER 4)
25   SET(VTKGDCM_LIB_SRCS
26     vtkGdcmReader.cxx
27     vtkGdcmWriter.cxx
28   )
29 ENDIF("${VTK_MAJOR_VERSION}" GREATER 4)
30
31 #-----------------------------------------------------------------------------
32 # Create vtkgdcm library
33 ADD_LIBRARY(vtkgdcm ${VTKGDCM_LIB_SRCS})
34 TARGET_LINK_LIBRARIES(vtkgdcm
35   gdcm
36   vtkCommon
37   vtkIO
38   vtkFiltering
39 )
40 IF("${VTK_MAJOR_VERSION}" GREATER 4)
41   TARGET_LINK_LIBRARIES(vtkgdcm
42     vtkRendering
43   )
44 ENDIF("${VTK_MAJOR_VERSION}" GREATER 4)
45
46 #-----------------------------------------------------------------------------
47 SET(vtkgdcmdemo_SOURCES
48   vtkGdcmDemo.cxx
49 )
50 ADD_EXECUTABLE(vtkgdcmdemo ${vtkgdcmdemo_SOURCES})
51 TARGET_LINK_LIBRARIES(vtkgdcmdemo
52   vtkgdcm
53   vtkGraphics
54   vtkRendering
55 )
56
57 #-----------------------------------------------------------------------------
58 SET(Bmp2Dcm_SOURCES
59   Bmp2Dcm.cxx
60 )
61 ADD_EXECUTABLE(Bmp2Dcm ${Bmp2Dcm_SOURCES})
62 TARGET_LINK_LIBRARIES(Bmp2Dcm
63   vtkgdcm
64   vtkImaging
65
66 )
67
68 #-----------------------------------------------------------------------------
69 SET(vtkgdcmViewer_SOURCES
70   vtkgdcmViewer.cxx
71 )
72
73 # let's do some APPLE/WIN32 magic here
74 #IF(WIN32)
75 #  SET(GUI_EXECUTABLE WIN32)
76 #ENDIF(WIN32)
77 IF(APPLE)
78   IF(VTK_USE_CARBON)
79     SET(GUI_EXECUTABLE MACOSX_BUNDLE)
80   ENDIF(VTK_USE_CARBON)
81   IF(VTK_USE_COCOA)
82     SET(GUI_EXECUTABLE MACOSX_BUNDLE)
83   ENDIF(VTK_USE_COCOA)
84   # when using X11 on Apple you don't need this...
85 ENDIF(APPLE)
86
87 ADD_EXECUTABLE(vtkgdcmViewer ${GUI_EXECUTABLE} ${vtkgdcmViewer_SOURCES})
88 TARGET_LINK_LIBRARIES(vtkgdcmViewer
89   vtkgdcm
90   vtkRendering
91 )
92 ADD_EXECUTABLE(vtkgdcmViewer2 ${GUI_EXECUTABLE} vtkgdcmViewer2.cxx)
93 TARGET_LINK_LIBRARIES(vtkgdcmViewer2
94   vtkgdcm
95   vtkRendering
96 )
97 ADD_EXECUTABLE(vtkgdcmSerieViewer ${GUI_EXECUTABLE} vtkgdcmSerieViewer.cxx)
98 TARGET_LINK_LIBRARIES(vtkgdcmSerieViewer
99   vtkgdcm
100   vtkRendering
101 )
102 ADD_EXECUTABLE(vtkgdcmSerieViewer2 ${GUI_EXECUTABLE} vtkgdcmSerieViewer2.cxx)
103 TARGET_LINK_LIBRARIES(vtkgdcmSerieViewer2
104   vtkgdcm
105   vtkRendering
106 )
107
108
109 #-----------------------------------------------------------------------------
110 SET(vtkWriteDicom_SOURCES
111   vtkWriteDicom.cxx
112 )
113 SET(vtkWriteDicomExtended_SOURCES
114   vtkWriteDicomExtended.cxx  
115 )
116 ADD_EXECUTABLE(vtkWriteDicom ${vtkWriteDicom_SOURCES})
117 TARGET_LINK_LIBRARIES(vtkWriteDicom
118   vtkgdcm
119   vtkIO
120   vtkRendering
121 )
122 ADD_EXECUTABLE(vtkWriteDicomExtended ${vtkWriteDicomExtended_SOURCES})
123 TARGET_LINK_LIBRARIES(vtkWriteDicomExtended
124   vtkgdcm
125   vtkIO
126   vtkRendering
127 )
128 #-----------------------------------------------------------------------------
129 # Install vtk header
130 IF(NOT GDCM_INSTALL_NO_DEVELOPMENT)
131   INSTALL_FILES(${GDCM_INSTALL_INCLUDE_DIR} FILES vtkGdcmReader.h)
132   INSTALL_FILES(${GDCM_INSTALL_INCLUDE_DIR} FILES vtkGdcmWriter.h)
133 ENDIF(NOT GDCM_INSTALL_NO_DEVELOPMENT)
134
135 IF(NOT GDCM_INSTALL_NO_LIBRARIES)
136   INSTALL_TARGETS(${GDCM_INSTALL_LIB_DIR} vtkgdcm)
137   INSTALL_TARGETS(${GDCM_INSTALL_BIN_DIR} vtkgdcmViewer)
138   INSTALL_TARGETS(${GDCM_INSTALL_BIN_DIR} vtkgdcmViewer2)
139   INSTALL_TARGETS(${GDCM_INSTALL_BIN_DIR} vtkgdcmSerieViewer)
140 ENDIF(NOT GDCM_INSTALL_NO_LIBRARIES)
141