-
Notifications
You must be signed in to change notification settings - Fork 4
/
configure
executable file
·61 lines (50 loc) · 1.56 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
#!/bin/sh
echo "Orocos configure script."
function usage
{
echo "This script allows you to set the compiler."
echo "Usage : ../configure [--prefix=/install/path][CC=compiler][CXX=compiler]"
}
function getcompiler
{
arg=$1
if [ $(expr match "$arg" "CC=") != 0 ]; then
CMAKE_CC="$arg"
fi
if [ $(expr match "$arg" "CXX=") != 0 ]; then
CMAKE_CXX="$arg"
fi
if [ $(expr match "$arg" "--prefix=") != 0 ]; then
CMAKE_PREFIX="${arg:9}"
CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=$CMAKE_PREFIX -DCMAKE_PREFIX_PATH=$CMAKE_PREFIX"
fi
}
while [ "$1" != "" ]; do
case $1 in
-h | --help ) usage
exit
;;
* ) getcompiler $1
esac
shift
done
if [ -f ./configure ]; then
echo "Error: run configure from a 'build' directory:"
echo " $ mkdir build"
echo " $ cd build"
echo " $ ../configure [options]"
exit 1
fi
if [ -f ./CMakeCache.txt ]; then
echo "Error: One can not change the compiler once configured !"
echo "Error: In order to change the compiler, use a fresh build directory."
exit 1
fi
if [ x$(which cmake) == x ]; then
echo "Error: 'cmake' executable not found. Download it from http://www.cmake.org"
echo "Error: or install the cmake package of your distribution version 2.6.2 or higher."
exit 1
fi
echo "Invoking: 'CC=$CMAKE_CC CXX=$CMAKE_CXX cmake .. $CMAKE_ARGS'"
bash -c "$CMAKE_CC $CMAKE_CXX cmake .. $CMAKE_ARGS" || (echo "Error: cmake produced an error."; exit 1)
echo "OK: configure done."