doudou / orocos-ocl forked from psoetens/orocos-ocl

Orocos Component Library

This URL has Read+Write access

Sylvain Joyeux (author)
Thu Mar 12 07:27:13 -0700 2009
commit  02ef5c832d72fd5b85ead1680f9725ed815a4137
tree    ad0bc8ab9ce7413e9fe746dcaa02f6e92d08c4bf
parent  a3dad9567b6a790f7b08c3d2707f515e28c55383
orocos-ocl / configure
100755 62 lines (50 sloc) 1.589 kb
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
#!/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 -DOROCOS_INSTALL=$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.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."