-
Notifications
You must be signed in to change notification settings - Fork 1
/
configure
executable file
·80 lines (68 loc) · 1.55 KB
/
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#!/bin/sh
# A very rudimentally configure script
set -e # exit at the first error
dirname_0=$(dirname "$0")
sourcedir=$(cd "$dirname_0" && pwd)
usage="\
Usage: $0 [OPTION]...
Build Options:
--release set release flags (default:false)
--cxx-path=PATH CXX compiler path
--prefix-path=PATH additional path for libraries
--install-path=PATH set the installation path
"
# default values
RELEASE=no
SIZED_QUEUE=OFF
for i in "$@"
do
case $i in
--help)
echo "$usage"
exit
;;
--release)
RELEASE=yes
shift # past argument=value
;;
--sized-queue)
SIZED_QUEUE=ON
shift # past argument=value
;;
--cxx-path=*)
CXX_PATH="${i#*=}"
shift # past argument=value
;;
--prefix-path=*)
PREFIX_PATH="${i#*=}"
shift # past argument=value
;;
--install-path=*)
INSTALL_PATH="${i#*=}"
shift # past argument=value
;;
*)
echo "error: unknown option";echo
echo "$usage"
exit
;;
esac
done
CMAKE_ARGS="-DSIZED_QUEUE=$SIZED_QUEUE"
if [ $RELEASE = "yes" ] ; then
CMAKE_ARGS="$CMAKE_ARGS -D CMAKE_BUILD_TYPE=Release"
else
CMAKE_ARGS="$CMAKE_ARGS -D CMAKE_BUILD_TYPE=Debug"
fi
if [ "$CXX_PATH" != "" ] ; then
CMAKE_ARGS="$CMAKE_ARGS -D CMAKE_CXX_COMPILER=$CXX_PATH"
fi
if [ "$PREFIX_PATH" != "" ] ; then
CMAKE_ARGS="$CMAKE_ARGS -D CMAKE_PREFIX_PATH=$PREFIX_PATH"
fi
if [ "$INSTALL_PATH" != "" ] ; then
CMAKE_ARGS="$CMAKE_ARGS -D CMAKE_INSTALL_PREFIX=$INSTALL_PATH"
fi
# call cmake
set -x
cmake $CMAKE_ARGS "$sourcedir"