-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathconfigure
executable file
·58 lines (50 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
#!/bin/sh
die() {
echo $@
exit 1
}
install_prefix_default="/usr"
usage() {
cat <<EOF
'configure' configures Locksmith to adapt to many kinds of system.
Configuration:
-h, --help display this help and exit
-V, --version display version information and exit
--srcdir DIR find the sources in DIR
--debug-build create a debug (rather than release) build.
Installation directories:
--prefix PREFIX Set CMAKE_INSTALL_PREFIX. Default $install_prefix_default
Some influential environment variables:
CC C compiler command
CFLAGS C compiler flags
LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
nonstandard directory <lib dir>
EOF
}
curdir="$(dirname $0)"
srcdir="$curdir"
build_type="Release"
install_prefix="$install_prefix_default"
while [ $# -gt 0 ]; do
case "$1" in
--debug-build)
build_type="Debug";;
-h|--help) usage; exit 0;;
--prefix) shift
[ $# -eq 0 ] && die "--prefix requires an argument. -h for help."
install_prefix=$1
shift;;
--srcdir) shift
[ $# -eq 0 ] && die "--srcdir requires an argument. -h for help."
srcdir=$1
shift;;
-V|--version)
grep CPACK_PACKAGE_VERSION_ "$curdir/CMakeLists.txt";
exit 0;;
*) die "can't understand parameter: $1. -h for help."
esac
shift
done
cmake -DCMAKE_BUILD_TYPE="$build_type" \
-DCMAKE_INSTALL_PREFIX="$install_prefix" \
$srcdir