forked from oddkiva/sara
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·62 lines (51 loc) · 1.34 KB
/
build.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
#!/bin/bash
set -ex
function install_python_packages_via_pip()
{
pip install numpy nose
}
function build_library()
{
local cmake_options="-DCMAKE_BUILD_TYPE=Release "
cmake_options+="-DCMAKE_PREFIX_PATH=$HOME/Qt/5.10.1/gcc_64 "
cmake_options+="-DSARA_BUILD_VIDEOIO=ON "
cmake_options+="-DSARA_BUILD_PYTHON_BINDINGS=ON "
cmake_options+="-DSARA_BUILD_SHARED_LIBS=ON "
cmake_options+="-DSARA_BUILD_TESTS=ON "
cmake_options+="-DSARA_BUILD_SAMPLES=ON "
# Generate makefile project.
cmake ../sara ${cmake_options}
# Build the library.
make -j`nproc` && make test && make pytest && make package
}
function install_package()
{
if [ -f "/etc/debian_version" ]; then
# Register the package to the local debian repository.
dpkg-sig --sign builder libDO-Sara-shared-*.deb
sudo cp libDO-Sara-shared-*.deb /usr/local/debs
sudo update-local-debs
sudo apt-get update
sudo apt-get install --reinstall libdo-sara-shared
else
rpm_package_name=$(echo `ls *.rpm`)
sudo rpm -ivh --force ${rpm_package_name}
fi
}
if [[ $# == 0 ]]; then
sara_build_dir="sara-build"
else
sara_build_dir=$1
fi
# Create the build directory.
if [ -d "../${sara_build_dir}" ]; then
rm -rf ../${sara_build_dir}
fi
mkdir ../${sara_build_dir}
cd ../${sara_build_dir}
{
install_python_packages_via_pip
build_library
#install_package
}
cd ..