forked from AlexeyAB/darknet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·37 lines (32 loc) · 1.04 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
#!/usr/bin/env bash
number_of_build_workers=8
if [[ "$OSTYPE" == "darwin"* ]]; then
OpenCV_DIR="/usr/local/Cellar/opencv@3/3.4.5"
additional_defines="-DOpenCV_DIR=${OpenCV_DIR}"
if [[ "$1" == "gcc" ]]; then
export CC="/usr/local/bin/gcc-8"
export CXX="/usr/local/bin/g++-8"
fi
fi
# RELEASE
mkdir -p build_release
cd build_release
cmake .. -DCMAKE_BUILD_TYPE=Release ${additional_defines}
cmake --build . --target install -- -j${number_of_build_workers}
#cmake --build . --target install --parallel ${number_of_build_workers} #valid only for CMake 3.12+
rm DarknetConfig.cmake
rm DarknetConfigVersion.cmake
cd ..
rm DarknetConfig.cmake
rm DarknetConfigVersion.cmake
# DEBUG
mkdir -p build_debug
cd build_debug
cmake .. -DCMAKE_BUILD_TYPE=Debug ${additional_defines}
cmake --build . --target install -- -j${number_of_build_workers}
#cmake --build . --target install --parallel ${number_of_build_workers} #valid only for CMake 3.12+
rm DarknetConfig.cmake
rm DarknetConfigVersion.cmake
cd ..
rm DarknetConfig.cmake
rm DarknetConfigVersion.cmake