-
Notifications
You must be signed in to change notification settings - Fork 157
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
245 lines (185 loc) · 8.23 KB
/
CMakeLists.txt
File metadata and controls
245 lines (185 loc) · 8.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
project (${WIKI}IO)
if(NOT WikiExamples_BINARY_DIR)
find_package(VTK REQUIRED)
include(${VTK_USE_FILE})
endif()
set(KIT_LIBS ${VTK_LIBRARIES})
#
# Build all .cxx files in the directory
file(GLOB ALL_FILES *.cxx)
include(${WikiExamples_SOURCE_DIR}/CMake/RequiresGitLfs.cmake)
# VTK follows the C++03 standard but some examples require C++11
include(${WikiExamples_SOURCE_DIR}/CMake/RequiresCxxVersion.cmake)
Requires_CxxVersion(ImageWriter 11 ALL_FILES)
include(${WikiExamples_SOURCE_DIR}/CMake/RequiresVersion.cmake)
Requires_Version(VRMLImporterDemo "7.1.0" ALL_FILES)
Requires_Version(ExportPolyDataScene "8.0.0" ALL_FILES)
Requires_Version(ImportPolyDataScene "8.0.0" ALL_FILES)
Requires_Version(OBJImporter "8.0.0" ALL_FILES)
Requires_Version(ImageWriter "8.1.0" ALL_FILES)
Requires_GitLfs(DEMReader ALL_FILES)
foreach(SOURCE_FILE ${ALL_FILES})
string(REPLACE ".cxx" "" TMP ${SOURCE_FILE})
string(REPLACE ${CMAKE_CURRENT_SOURCE_DIR}/ "" EXAMPLE ${TMP})
add_executable(${WIKI}${EXAMPLE} ${EXECUTABLE_FLAG} ${EXAMPLE}.cxx)
target_link_libraries(${WIKI}${EXAMPLE} ${KIT_LIBS})
endforeach()
if (BUILD_TESTING)
# Testing
set(KIT IO)
set(NEEDS_ARGS
3DSImporter
ConvertFile
DEMReader
DumpXMLFile
ExportPolyDataScene
GenericDataObjectReader
ImageReader2Factory
ImportPolyDataScene
IndividualVRML
JPEGReader
JPEGWriter
MetaImageReader
OBJImporter
ParticleReader
PNGReader
PNGWriter
ReadAllPolyDataTypes
ReadAllPolyDataTypesDemo
ReadBMP
ReadDICOM
ReadDICOMSeries
ReadImageData
ReadLegacyUnstructuredGrid
ReadOBJ
ReadPDB
ReadPlainTextTriangles
ReadPLY
ReadPLOT3D
ReadPNM
ReadPolyData
ReadRectilinearGrid
ReadSTL
ReadStructuredGrid
ReadTIFF
ReadTextFile
ReadUnknownTypeXMLFile
ReadUnstructuredGrid
SimplePointsReader
StructuredPointsReader
StructuredGridReader
VRMLImporter
VRMLImporterDemo
WriteBMP
WritePLY
WritePNM
WriteSTL
WriteTIFF
WriteVTI
WriteVTU
)
set(DATA ${WikiExamples_SOURCE_DIR}/src/Testing/Data)
set(TEMP ${WikiExamples_BINARY_DIR}/Testing/Temporary)
add_test(${KIT}-3DSImporter ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${KIT}CxxTests
Test3DSImporter ${DATA}/iflamingo.3ds)
add_test(${KIT}-ConvertFile ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${KIT}CxxTests
TestConvertFile ${DATA}/Bunny.vtp ${TEMP}/ConvertFile.ply)
add_test(${KIT}-DumpXMLFile ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${KIT}CxxTests
TestDumpXMLFile ${DATA}/Bunny.vtp)
add_test(${KIT}-ExportPolyDataScene ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${KIT}CxxTests
TestExportPolyDataScene ${DATA}/Bunny.vtp)
add_test(${KIT}-ImportPolyDataScene ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${KIT}CxxTests
TestImportPolyDataScene ${DATA}/ExportBunny.vtp)
add_test(${KIT}-GenericDataObjectReader ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${KIT}CxxTests
TestGenericDataObjectReader ${DATA}/Bunny.vtp)
add_test(${KIT}-IndividualVRML ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${KIT}CxxTests
TestIndividualVRML ${DATA}/teapot.wrl teapot)
add_test(${KIT}-ImageReader2Factory ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${KIT}CxxTests
TestImageReader2Factory ${DATA}/Gourds.png)
add_test(${KIT}-JPEGReader ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${KIT}CxxTests
TestJPEGReader ${DATA}/Pileated.jpg)
add_test(${KIT}-JPEGWriter ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${KIT}CxxTests
TestJPEGWriter ${TEMP}/JPEGWriter.jpg)
add_test(${KIT}-MetaImageReader ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${KIT}CxxTests
TestMetaImageReader ${DATA}/Gourds.mha)
add_test(${KIT}-OBJImporter ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${KIT}CxxTests
TestOBJImporter ${DATA}/doorman/doorman.obj ${DATA}/doorman/doorman.mtl ${DATA}/doorman)
add_test(${KIT}-ParticleReader ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${KIT}CxxTests
TestParticleReader ${DATA}/Particles.raw)
add_test(${KIT}-PNGReader ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${KIT}CxxTests
TestPNGReader ${DATA}/Gourds.png)
add_test(${KIT}-PNGWriter ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${KIT}CxxTests
TestPNGWriter ${TEMP}/PNGWriter.png)
add_test(${KIT}-ReadAllPolyDataTypes ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${KIT}CxxTests
TestReadAllPolyDataTypes ${DATA}/horse.ply)
add_test(${KIT}-ReadAllPolyDataTypesDemo ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${KIT}CxxTests
TestReadAllPolyDataTypesDemo ${DATA}/teapot.g ${DATA}/cowHead.vtp ${DATA}/horse.ply ${DATA}/trumpet.obj ${DATA}/42400-IDGH.stl ${DATA}/v.vtk)
add_test(${KIT}-ReadBMP ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${KIT}CxxTests
TestReadBMP ${DATA}/masonry.bmp)
add_test(${KIT}-ReadDICOM ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${KIT}CxxTests
TestReadDICOM ${DATA}/prostate.img)
add_test(${KIT}-ReadDICOMSeries ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${KIT}CxxTests
TestReadDICOMSeries ${DATA}/DICOMDirectory)
add_test(${KIT}-ReadImageData ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${KIT}CxxTests
TestReadImageData ${DATA}/vase.vti)
add_test(${KIT}-ReadLegacyUnstructuredGrid ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${KIT}CxxTests
TestReadLegacyUnstructuredGrid ${DATA}/VTKCellTypes.vtk)
add_test(${KIT}-ReadOBJ ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${KIT}CxxTests
TestReadOBJ ${DATA}/trumpet.obj)
add_test(${KIT}-ReadPDB ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${KIT}CxxTests
TestReadPDB ${DATA}/lys.pdb)
add_test(${KIT}-ReadPLOT3D ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${KIT}CxxTests
TestReadPLOT3D ${DATA}/combxyz.bin ${DATA}/combq.bin)
add_test(${KIT}-ReadPLY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${KIT}CxxTests
TestReadPLY ${DATA}/shark.ply)
add_test(${KIT}-ReadPolyData ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${KIT}CxxTests
TestReadPolyData ${DATA}/Torso.vtp)
add_test(${KIT}-ReadPNM ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${KIT}CxxTests
TestReadPNM ${DATA}/Gourds.pnm)
add_test(${KIT}-ReadRectilinearGrid ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${KIT}CxxTests
TestReadRectilinearGrid ${DATA}/RectilinearGrid.vtr)
add_test(${KIT}-ReadSTL ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${KIT}CxxTests
TestReadSTL ${DATA}/42400-IDGH.stl)
add_test(${KIT}-ReadStructuredGrid ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${KIT}CxxTests
TestReadStructuredGrid ${DATA}/StructuredGrid.vts)
add_test(${KIT}-ReadPlainTextTriangles ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${KIT}CxxTests
TestReadPlainTextTriangles ${DATA}/Triangles.txt)
add_test(${KIT}-ReadUnknownTypeXMLFile ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${KIT}CxxTests
TestReadUnknownTypeXMLFile ${DATA}/Bunny.vtp)
add_test(${KIT}-ReadTIFF ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${KIT}CxxTests
TestReadTIFF ${DATA}/ColorCells.tif)
add_test(${KIT}-ReadTextFile ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${KIT}CxxTests
TestReadTextFile ${DATA}/TeapotPoints.txt)
add_test(${KIT}-ReadUnstructuredGrid ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${KIT}CxxTests
TestReadUnstructuredGrid ${DATA}/tetra.vtu)
add_test(${KIT}-SimplePointsReader ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${KIT}CxxTests
TestSimplePointsReader ${DATA}/coords.txt)
add_test(${KIT}-StructuredPointsReader ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${KIT}CxxTests
TestStructuredPointsReader ${DATA}/StructuredPoints.vtk)
add_test(${KIT}-StructuredGridReader ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${KIT}CxxTests
TestStructuredGridReader ${DATA}/SampleStructGrid.vtk)
add_test(${KIT}-VRMLImporter ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${KIT}CxxTests
TestVRMLImporter ${DATA}/sextant.wrl -E 30)
add_test(${KIT}-VRMLImporterDemo ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${KIT}CxxTests
TestVRMLImporterDemo ${DATA}/grasshop.wrl)
add_test(${KIT}-WriteBMP ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${KIT}CxxTests
TestWriteBMP ${TEMP}/WriteBMP.bmp)
add_test(${KIT}-WritePNM ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${KIT}CxxTests
TestWritePNM ${TEMP}/WritePNM.pnm)
add_test(${KIT}-WritePLY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${KIT}CxxTests
TestWritePLY ${TEMP}/WritePLY.ply)
add_test(${KIT}-WriteSTL ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${KIT}CxxTests
TestWriteSTL ${TEMP}/WriteSTL.stl)
add_test(${KIT}-WriteTIFF ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${KIT}CxxTests
TestWriteTIFF ${TEMP}/WriteTIFF.tif)
add_test(${KIT}-WriteVTI ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${KIT}CxxTests
TestWriteVTI ${TEMP}/WriteVTI.vti)
add_test(${KIT}-WriteVTU ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${KIT}CxxTests
TestWriteVTU ${TEMP}/WriteVTU.vtu)
# These tests use git large file system data
if(GIT_LFS)
add_test(${KIT}-DEMReader ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${KIT}CxxTests
TestDEMReader ${DATA}/SainteHelens.dem)
endif()
include(${WikiExamples_SOURCE_DIR}/CMake/ExamplesTesting.cmake)
endif()