-
Notifications
You must be signed in to change notification settings - Fork 432
/
CMakeLists.txt
199 lines (168 loc) · 5.73 KB
/
CMakeLists.txt
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
###############################################################################
#
# test/unit/CMakeLists.txt controls building of PDAL unit tests suite
#
# Copyright (c) 2009 Mateusz Loskot <mateusz@loskot.net>
#
###############################################################################
SET(PDAL_UNIT_TEST pdal_test)
if (LIBXML2_FOUND)
SET (PDAL_UNITTEST_XMLSCHEMA_TEST XMLSchemaTest.cpp)
endif()
SET(PDAL_UNITTEST_TEST_SRC
BoundsTest.cpp
drivers/bpf/BPFTest.cpp
drivers/buffer/BufferReaderTest.cpp
filters/ByteSwapFilterTest.cpp
filters/CacheFilterTest.cpp
drivers/caris/CarisReaderTest.cpp
filters/ChipperTest.cpp
filters/ColorFilterTest.cpp
filters/ColorizationFilterTest.cpp
ConfigTest.cpp
filters/CropFilterTest.cpp
filters/DecimationFilterTest.cpp
DimensionTest.cpp
EnvironmentTest.cpp
drivers/faux/FauxReaderTest.cpp
drivers/faux/FauxWriterTest.cpp
FileUtilsTest.cpp
filters/HexbinFilterTest.cpp
filters/InPlaceReprojectionFilterTest.cpp
drivers/las/LasReaderTest.cpp
drivers/las/LasWriterTest.cpp
LogTest.cpp
MetadataTest.cpp
filters/MosaicFilterTest.cpp
OptionsTest.cpp
PipelineManagerTest.cpp
drivers/pipeline/PipelineReaderTest.cpp
drivers/pipeline/PipelineWriterTest.cpp
PointBufferCacheTest.cpp
PointBufferTest.cpp
drivers/qfit/QFITReaderTest.cpp
RangeTest.cpp
filters/ScalingFilterTest.cpp
filters/SelectorFilterTest.cpp
SchemaLayoutTest.cpp
SchemaTest.cpp
SpatialReferenceTest.cpp
StageFactoryTest.cpp
filters/StatsFilterTest.cpp
StreamFactoryTest.cpp
SupportTest.cpp
drivers/terrasolid/TerraSolidReaderTest.cpp
drivers/text/TextWriterTest.cpp
ThreadTest.cpp
UserCallbackTest.cpp
UtilsTest.cpp
VectorTest.cpp
${PDAL_UNITTEST_XMLSCHEMA_TEST}
)
if(WITH_APPS)
if(LIBXML2_FOUND)
list(APPEND PDAL_UNITTEST_TEST_SRC
apps/pcinfoTest.cpp
)
endif(LIBXML2_FOUND)
list(APPEND PDAL_UNITTEST_TEST_SRC
apps/pc2pcTest.cpp
apps/pcpipelineTest.cpp
)
endif(WITH_APPS)
set(PDAL_PLANG_TEST_SRC
plang/PLangTest.cpp
plang/PredicateFilterTest.cpp
plang/ProgrammableFilterTest.cpp
)
SET(PDAL_UNITTEST_TEST_INC
)
SET(PDAL_UNITTEST_CONFIG_SRC
Support.cpp
TestConfig.cpp
main.cpp
)
SET(PDAL_UNITTEST_CONFIG_INC
Support.hpp
TestConfig.hpp
)
if (WITH_ORACLE)
if (NOT USE_PDAL_PLUGIN_OCI)
set(PDAL_OCI_TEST_CPP drivers/oci/OCITest.cpp)
FOREACH(file ${PDAL_OCI_TEST_CPP})
SET(PDAL_UNITTEST_TEST_SRC "${PDAL_UNITTEST_TEST_SRC};${file}" CACHE INTERNAL "source files for test")
ENDFOREACH(file)
endif()
endif (WITH_ORACLE)
if (WITH_SQLITE)
if (NOT USE_PDAL_PLUGIN_SQLITE)
set(PDAL_SQLITE_TEST_CPP drivers/sqlite/Writer.cpp)
FOREACH(file ${PDAL_SQLITE_TEST_CPP})
SET(PDAL_UNITTEST_TEST_SRC "${PDAL_UNITTEST_TEST_SRC};${file}" CACHE INTERNAL "source files for test")
ENDFOREACH(file)
endif()
endif (WITH_SQLITE)
if (WITH_GDAL)
set(PDAL_GDAL_TEST_CPP
GDALUtilsTest.cpp
drivers/nitf/NitfReaderTest.cpp
)
FOREACH(file ${PDAL_GDAL_TEST_CPP})
SET(PDAL_UNITTEST_TEST_SRC "${PDAL_UNITTEST_TEST_SRC};${file}" CACHE INTERNAL "source files for test")
ENDFOREACH(file)
endif (WITH_GDAL)
if (WITH_NITRO)
set(PDAL_NITRO_TEST_CPP
drivers/nitf/NitfWriterTest.cpp
)
FOREACH(file ${PDAL_NITRO_TEST_CPP})
SET(PDAL_UNITTEST_TEST_SRC "${PDAL_UNITTEST_TEST_SRC};${file}" CACHE INTERNAL "source files for test")
ENDFOREACH(file)
endif (WITH_NITRO)
set(PDAL_UNITTEST_SOURCES "")
FOREACH(file ${PDAL_UNITTEST_TEST_SRC})
SET(PDAL_UNITTEST_SOURCES "${PDAL_UNITTEST_SOURCES};${file}" CACHE INTERNAL "source files for test")
ENDFOREACH(file)
FOREACH(file ${PDAL_PLANG_TEST_SRC})
SET(PDAL_UNITTEST_SOURCES "${PDAL_UNITTEST_SOURCES};${file}" CACHE INTERNAL "source files for test")
ENDFOREACH(file)
FOREACH(file ${PDAL_UNITTEST_CONFIG_SRC})
SET(PDAL_UNITTEST_SOURCES "${PDAL_UNITTEST_SOURCES};${file}" CACHE INTERNAL "source files for test")
ENDFOREACH(file)
FOREACH(file ${PDAL_UNITTEST_CONFIG_INC})
SET(PDAL_UNITTEST_SOURCES "${PDAL_UNITTEST_SOURCES};${file}" CACHE INTERNAL "source files for test")
ENDFOREACH(file)
source_group("Header Files" FILES ${PDAL_UNITTEST_TEST_INC})
source_group("Header Files\\config" FILES ${PDAL_UNITTEST_CONFIG_INC})
source_group("Source Files" FILES ${PDAL_UNITTEST_TEST_SRC})
source_group("Source Files\\config" FILES ${PDAL_UNITTEST_CONFIG_SRC})
INCLUDE_DIRECTORIES(
.
../../include
${GDAL_INCLUDE_DIR}
${GEOTIFF_INCLUDE_DIR}
${ORACLE_INCLUDE_DIR})
PDAL_ADD_EXECUTABLE(${PDAL_UNIT_TEST} ${PDAL_UNITTEST_SOURCES})
set_target_properties(${PDAL_UNIT_TEST} PROPERTIES COMPILE_DEFINITIONS PDAL_DLL_IMPORT)
if(WIN32)
add_definitions("-DPDAL_DLL_EXPORT=1")
if (MSVC)
#add_definitions("-DBOOST_TEST_DYN_LINK")
endif()
else()
# Our own static build of embedded boost should do BOOST_TEST_DYN_LINK
# when it is compiled, but regular static builds of Boost will
# not do this.
if(Boost_PROGRAM_OPTIONS_LIBRARY MATCHES "\\.a$" )
# pass, we can compile static
message(STATUS "Static boost for boost::unit_test, not setting BOOST_TEST_DYN_LINK")
else()
message(STATUS "No non-embed static boost library found, setting BOOST_TEST_DYN_LINK")
add_definitions("-DBOOST_TEST_DYN_LINK")
endif()
endif()
TARGET_LINK_LIBRARIES( ${PDAL_UNIT_TEST} ${PDAL_LINKAGE}
${PDAL_LIB_NAME} )
TARGET_LINK_LIBRARIES( ${PDAL_UNIT_TEST} ${BOOST_LINKAGE}
${Boost_LIBRARIES} )
ADD_TEST(pdal_test "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/pdal_test" "${PROJECT_SOURCE_DIR}/test/data" --catch_system_errors=no)