forked from PointCloudLibrary/pcl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.sh
executable file
·313 lines (289 loc) · 8.39 KB
/
.travis.sh
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
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
#!/bin/sh
PCL_DIR=`pwd`
BUILD_DIR=$PCL_DIR/build
DOC_DIR=$BUILD_DIR/doc/doxygen/html
TUTORIALS_DIR=$BUILD_DIR/doc/tutorials/html
ADVANCED_DIR=$BUILD_DIR/doc/advanced/html
CMAKE_C_FLAGS="-Wall -Wextra -Wabi -O2"
CMAKE_CXX_FLAGS="-Wall -Wextra -Wabi -O2"
if [ "$TRAVIS_OS_NAME" == "linux" ]; then
if [ "$CC" == "clang" ]; then
CMAKE_C_FLAGS="$CMAKE_C_FLAGS -Qunused-arguments"
CMAKE_CXX_FLAGS="$CMAKE_CXX_FLAGS -Qunused-arguments"
fi
fi
function before_install ()
{
if [ "$TRAVIS_OS_NAME" == "linux" ]; then
if [ "$CC" == "clang" ]; then
sudo ln -s ../../bin/ccache /usr/lib/ccache/clang
sudo ln -s ../../bin/ccache /usr/lib/ccache/clang++
fi
fi
}
function build ()
{
case $CC in
clang ) build_lib;;
gcc ) build_lib_core;;
esac
}
function build_lib ()
{
# A complete build
# Configure
mkdir $BUILD_DIR && cd $BUILD_DIR
cmake -DCMAKE_C_FLAGS="$CMAKE_C_FLAGS" -DCMAKE_CXX_FLAGS="$CMAKE_CXX_FLAGS" \
-DPCL_ONLY_CORE_POINT_TYPES=ON \
-DPCL_QT_VERSION=4 \
-DBUILD_simulation=ON \
-DBUILD_global_tests=OFF \
-DBUILD_examples=OFF \
-DBUILD_tools=OFF \
-DBUILD_apps=OFF \
$PCL_DIR
# Build
make -j2
}
function build_examples ()
{
# A complete build
# Configure
mkdir $BUILD_DIR && cd $BUILD_DIR
cmake -DCMAKE_C_FLAGS="$CMAKE_C_FLAGS" -DCMAKE_CXX_FLAGS="$CMAKE_CXX_FLAGS" \
-DPCL_ONLY_CORE_POINT_TYPES=ON \
-DPCL_QT_VERSION=4 \
-DBUILD_simulation=ON \
-DBUILD_global_tests=OFF \
-DBUILD_examples=ON \
-DBUILD_tools=OFF \
-DBUILD_apps=OFF \
$PCL_DIR
# Build
make -j2
}
function build_tools ()
{
# A complete build
# Configure
mkdir $BUILD_DIR && cd $BUILD_DIR
cmake -DCMAKE_C_FLAGS="$CMAKE_C_FLAGS" -DCMAKE_CXX_FLAGS="$CMAKE_CXX_FLAGS" \
-DPCL_ONLY_CORE_POINT_TYPES=ON \
-DPCL_QT_VERSION=4 \
-DBUILD_simulation=ON \
-DBUILD_global_tests=OFF \
-DBUILD_examples=OFF \
-DBUILD_tools=ON \
-DBUILD_apps=OFF \
$PCL_DIR
# Build
make -j2
}
function build_apps ()
{
# A complete build
# Configure
mkdir $BUILD_DIR && cd $BUILD_DIR
cmake -DCMAKE_C_FLAGS="$CMAKE_C_FLAGS" -DCMAKE_CXX_FLAGS="$CMAKE_CXX_FLAGS" \
-DPCL_ONLY_CORE_POINT_TYPES=ON \
-DPCL_QT_VERSION=4 \
-DBUILD_simulation=OFF \
-DBUILD_outofcore=OFF \
-DBUILD_people=OFF \
-DBUILD_global_tests=OFF \
-DBUILD_examples=OFF \
-DBUILD_tools=OFF \
-DBUILD_apps=ON \
$PCL_DIR
# Build
make -j2
}
function build_lib_core ()
{
# A reduced build, only pcl_common
# Configure
mkdir $BUILD_DIR && cd $BUILD_DIR
cmake -DCMAKE_C_FLAGS="$CMAKE_C_FLAGS" -DCMAKE_CXX_FLAGS="$CMAKE_CXX_FLAGS" \
-DPCL_ONLY_CORE_POINT_TYPES=ON \
-DBUILD_2d=OFF \
-DBUILD_features=OFF \
-DBUILD_filters=OFF \
-DBUILD_geometry=OFF \
-DBUILD_global_tests=OFF \
-DBUILD_io=OFF \
-DBUILD_kdtree=OFF \
-DBUILD_keypoints=OFF \
-DBUILD_ml=OFF \
-DBUILD_octree=OFF \
-DBUILD_outofcore=OFF \
-DBUILD_people=OFF \
-DBUILD_recognition=OFF \
-DBUILD_registration=OFF \
-DBUILD_sample_consensus=OFF \
-DBUILD_search=OFF \
-DBUILD_segmentation=OFF \
-DBUILD_stereo=OFF \
-DBUILD_surface=OFF \
-DBUILD_tools=OFF \
-DBUILD_tracking=OFF \
-DBUILD_visualization=OFF \
$PCL_DIR
# Build
make -j2
}
function test_core ()
{
# Configure
mkdir $BUILD_DIR && cd $BUILD_DIR
cmake -DCMAKE_C_FLAGS="$CMAKE_C_FLAGS" -DCMAKE_CXX_FLAGS="$CMAKE_CXX_FLAGS" \
-DPCL_ONLY_CORE_POINT_TYPES=ON \
-DBUILD_tools=OFF \
-DBUILD_examples=OFF \
-DBUILD_apps=OFF \
-DBUILD_simulation=OFF \
-DBUILD_stereo=OFF \
-DBUILD_tracking=OFF \
-DBUILD_global_tests=ON \
-DBUILD_2d=ON \
-DBUILD_features=ON \
-DBUILD_filters=ON \
-DBUILD_geometry=ON \
-DBUILD_io=ON \
-DBUILD_kdtree=ON \
-DBUILD_keypoints=ON \
-DBUILD_ml=OFF \
-DBUILD_octree=ON \
-DBUILD_outofcore=ON \
-DBUILD_people=OFF \
-DBUILD_recognition=OFF \
-DBUILD_registration=OFF \
-DBUILD_sample_consensus=ON \
-DBUILD_search=ON \
-DBUILD_segmentation=OFF \
-DBUILD_simulation=OFF \
-DBUILD_surface=OFF \
-DBUILD_visualization=ON \
-DBUILD_tests_2d=ON \
-DBUILD_tests_common=ON \
-DBUILD_tests_features=ON \
-DBUILD_tests_filters=OFF \
-DBUILD_tests_geometry=ON \
-DBUILD_tests_io=ON \
-DBUILD_tests_kdtree=ON \
-DBUILD_tests_keypoints=ON \
-DBUILD_tests_octree=ON \
-DBUILD_tests_outofcore=ON \
-DBUILD_tests_people=OFF \
-DBUILD_tests_recognition=OFF \
-DBUILD_tests_registration=OFF \
-DBUILD_tests_sample_consensus=ON \
-DBUILD_tests_search=ON \
-DBUILD_tests_segmentation=OFF \
-DBUILD_tests_surface=OFF \
-DBUILD_tests_visualization=ON \
$PCL_DIR
# Build and run tests
make -j2 tests
}
function test_ext ()
{
# Configure
mkdir $BUILD_DIR && cd $BUILD_DIR
cmake -DCMAKE_C_FLAGS="$CMAKE_C_FLAGS" -DCMAKE_CXX_FLAGS="$CMAKE_CXX_FLAGS" \
-DPCL_ONLY_CORE_POINT_TYPES=ON \
-DBUILD_tools=OFF \
-DBUILD_examples=OFF \
-DBUILD_apps=OFF \
-DBUILD_simulation=OFF \
-DBUILD_stereo=OFF \
-DBUILD_tracking=OFF \
-DBUILD_global_tests=ON \
-DBUILD_2d=ON \
-DBUILD_features=ON \
-DBUILD_filters=ON \
-DBUILD_geometry=ON \
-DBUILD_io=ON \
-DBUILD_kdtree=ON \
-DBUILD_keypoints=OFF \
-DBUILD_ml=ON \
-DBUILD_octree=ON \
-DBUILD_outofcore=OFF \
-DBUILD_people=ON \
-DBUILD_recognition=ON \
-DBUILD_registration=ON \
-DBUILD_sample_consensus=ON \
-DBUILD_search=ON \
-DBUILD_segmentation=ON \
-DBUILD_surface=ON \
-DBUILD_visualization=ON \
-DBUILD_tests_2d=OFF \
-DBUILD_tests_common=OFF \
-DBUILD_tests_features=OFF \
-DBUILD_tests_filters=ON \
-DBUILD_tests_geometry=OFF \
-DBUILD_tests_io=OFF \
-DBUILD_tests_kdtree=OFF \
-DBUILD_tests_keypoints=OFF \
-DBUILD_tests_octree=OFF \
-DBUILD_tests_outofcore=OFF \
-DBUILD_tests_people=ON \
-DBUILD_tests_recognition=ON \
-DBUILD_tests_registration=ON \
-DBUILD_tests_sample_consensus=OFF \
-DBUILD_tests_search=OFF \
-DBUILD_tests_segmentation=ON \
-DBUILD_tests_surface=ON \
-DBUILD_tests_visualization=OFF \
$PCL_DIR
# Build and run tests
make -j2 tests
}
function doc ()
{
# Do not generate documentation for pull requests
if [[ $TRAVIS_PULL_REQUEST != 'false' ]]; then exit; fi
# Install sphinx
pip3 install --user sphinx pyparsing==2.1.9 sphinxcontrib-doxylink
# Configure
mkdir $BUILD_DIR && cd $BUILD_DIR
cmake -DDOXYGEN_USE_SHORT_NAMES=OFF \
-DSPHINX_HTML_FILE_SUFFIX=php \
-DWITH_DOCS=ON \
-DWITH_TUTORIALS=ON \
$PCL_DIR
git config --global user.email "[email protected]"
git config --global user.name "PointCloudLibrary (via TravisCI)"
if [ -z "$id_rsa_{1..23}" ]; then echo 'No $id_rsa_{1..23} found !' ; exit 1; fi
echo -n $id_rsa_{1..23} >> ~/.ssh/travis_rsa_64
base64 --decode --ignore-garbage ~/.ssh/travis_rsa_64 > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
echo -e "Host github.com\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
cd $DOC_DIR
git clone [email protected]:PointCloudLibrary/documentation.git .
# Generate documentation and tutorials
cd $BUILD_DIR
make doc tutorials advanced
# Upload to GitHub if generation succeeded
if [[ $? == 0 ]]; then
# Copy generated tutorials to the doc directory
cp -r $TUTORIALS_DIR/* $DOC_DIR/tutorials
cp -r $ADVANCED_DIR/* $DOC_DIR/advanced
# Commit and push
cd $DOC_DIR
git add --all
git commit --amend --reset-author -m "Documentation for commit $TRAVIS_COMMIT" -q
git push --force
else
exit 2
fi
}
case $1 in
before-install ) before_install;;
build ) build;;
build-examples ) build_examples;;
build-tools ) build_tools;;
build-apps ) build_apps;;
test-core ) test_core;;
test-ext ) test_ext;;
doc ) doc;;
esac