forked from niw/iphone_opencv_test
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmake_all.sh
executable file
·53 lines (46 loc) · 2.89 KB
/
make_all.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
#!/bin/sh
# first, get OpenCV from http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/$OPENCV_VERSION
if [ -z "$1" ]; then
OPENCV_VERSION="2.3.1"
echo "No OpenCV version given, using default: " $OPENCV_VERSION
else
OPENCV_VERSION="$1"
fi
# open archive and patch it
tar xjvf OpenCV-"$OPENCV_VERSION".tar.bz2 &&
cd OpenCV-"$OPENCV_VERSION" &&
patch -p1 < ../OpenCV-"$OPENCV_VERSION".patch
# build Simulator version
cd .. &&
mkdir build_simulator &&
cd build_simulator &&
../opencv_cmake.sh Simulator ../OpenCV-"$OPENCV_VERSION" &&
make -j 4 &&
make install
# build Device version
cd .. &&
mkdir build_device &&
cd build_device &&
../opencv_cmake.sh Device ../OpenCV-"$OPENCV_VERSION" &&
make -j 4 &&
make install
# build Universal version
cd .. &&
mkdir -p opencv_universal/lib &&
lipo opencv_simulator/lib/libopencv_calib3d.a opencv_device/lib/libopencv_calib3d.a -output opencv_universal/lib/libopencv_calib3d.a -create
lipo opencv_simulator/lib/libopencv_contrib.a opencv_device/lib/libopencv_contrib.a -output opencv_universal/lib/libopencv_contrib.a -create
lipo opencv_simulator/lib/libopencv_core.a opencv_device/lib/libopencv_core.a -output opencv_universal/lib/libopencv_core.a -create
lipo opencv_simulator/lib/libopencv_features2d.a opencv_device/lib/libopencv_features2d.a -output opencv_universal/lib/libopencv_features2d.a -create
lipo opencv_simulator/lib/libopencv_flann.a opencv_device/lib/libopencv_flann.a -output opencv_universal/lib/libopencv_flann.a -create
lipo opencv_simulator/lib/libopencv_gpu.a opencv_device/lib/libopencv_gpu.a -output opencv_universal/lib/libopencv_gpu.a -create
lipo opencv_simulator/lib/libopencv_highgui.a opencv_device/lib/libopencv_highgui.a -output opencv_universal/lib/libopencv_highgui.a -create
lipo opencv_simulator/lib/libopencv_imgproc.a opencv_device/lib/libopencv_imgproc.a -output opencv_universal/lib/libopencv_imgproc.a -create
lipo opencv_simulator/lib/libopencv_legacy.a opencv_device/lib/libopencv_legacy.a -output opencv_universal/lib/libopencv_legacy.a -create
lipo opencv_simulator/lib/libopencv_ml.a opencv_device/lib/libopencv_ml.a -output opencv_universal/lib/libopencv_ml.a -create
lipo opencv_simulator/lib/libopencv_objdetect.a opencv_device/lib/libopencv_objdetect.a -output opencv_universal/lib/libopencv_objdetect.a -create
lipo opencv_simulator/lib/libopencv_video.a opencv_device/lib/libopencv_video.a -output opencv_universal/lib/libopencv_video.a -create
# copy common files
cp -r opencv_device/lib/pkgconfig opencv_universal/lib/ &&
cp -r opencv_device/include opencv_device/share opencv_universal/ &&
# clean
rm -rf opencv_universal/share/OpenCV/doc