2019-02-19 21:18:08 +08:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
number_of_build_workers=8
|
|
|
|
|
2019-03-04 22:15:19 +08:00
|
|
|
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
|
|
|
|
|
|
|
|
|
2019-02-20 18:42:53 +08:00
|
|
|
# RELEASE
|
2019-02-19 21:18:08 +08:00
|
|
|
mkdir -p build_release
|
|
|
|
cd build_release
|
2019-03-04 22:15:19 +08:00
|
|
|
cmake .. -DCMAKE_BUILD_TYPE=Release ${additional_defines}
|
2019-02-19 21:18:08 +08:00
|
|
|
cmake --build . --target install -- -j${number_of_build_workers}
|
|
|
|
#cmake --build . --target install --parallel ${number_of_build_workers} #valid only for CMake 3.12+
|
2019-03-14 05:56:44 +08:00
|
|
|
rm -f DarknetConfig.cmake
|
|
|
|
rm -f DarknetConfigVersion.cmake
|
2019-02-19 21:18:08 +08:00
|
|
|
cd ..
|
2019-03-14 05:56:44 +08:00
|
|
|
cp cmake/Modules/*.cmake share/darknet
|
2019-03-04 06:35:38 +08:00
|
|
|
|
|
|
|
# DEBUG
|
|
|
|
mkdir -p build_debug
|
|
|
|
cd build_debug
|
2019-03-04 22:15:19 +08:00
|
|
|
cmake .. -DCMAKE_BUILD_TYPE=Debug ${additional_defines}
|
2019-03-04 06:35:38 +08:00
|
|
|
cmake --build . --target install -- -j${number_of_build_workers}
|
|
|
|
#cmake --build . --target install --parallel ${number_of_build_workers} #valid only for CMake 3.12+
|
2019-03-14 05:56:44 +08:00
|
|
|
rm -f DarknetConfig.cmake
|
|
|
|
rm -f DarknetConfigVersion.cmake
|
2019-03-04 06:35:38 +08:00
|
|
|
cd ..
|
2019-03-14 05:56:44 +08:00
|
|
|
cp cmake/Modules/*.cmake share/darknet
|