forked from tensorlayer/HyperPose
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure
executable file
·47 lines (41 loc) · 908 Bytes
/
configure
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
#!/bin/bash
set -e
CMAKE_FLAGS=
add_cmake_flag() {
echo "usinig $1=$2"
CMAKE_FLAGS="$CMAKE_FLAGS -D$1=$2"
}
parse_args() {
for i in "$@"; do
case $i in
--prefix=*)
PREFIX="${i#*=}"
;;
--with-trace)
WITH_TRACE=1
;;
--build-fake)
BUILD_FAKE=1
;;
*)
echo "unknown argument $1"
exit
;;
esac
done
}
add_cmake_flags() {
if [ "${BUILD_FAKE}" == 1 ]; then
add_cmake_flag BUILD_FAKE ON
fi
if [ "${WITH_TRACE}" == 1 ]; then
add_cmake_flag WITH_TRACE ON
fi
add_cmake_flag CMAKE_EXPORT_COMPILE_COMMANDS ON
add_cmake_flag CMAKE_BUILD_TYPE Release
add_cmake_flag EXECUTABLE_OUTPUT_PATH $(pwd)/bin
add_cmake_flag LIBRARY_OUTPUT_PATH $(pwd)/lib
}
parse_args $@
add_cmake_flags
cmake . $CMAKE_FLAGS