#!/bin/sh

ADD_DEFINITION() {
    KEY=$1
    VALUE=$(eval "echo \${${KEY}}")
    if [ -n "${VALUE}" ]
    then
	DEFINITIONS="${DEFINITIONS} -D${KEY}=${VALUE}"
    fi
}

LOCATION=$(dirname $0)

if [ -f ~/.auto_cmake ]
then
  . ~/.auto_cmake
fi

DEFINITIONS=""

ADD_DEFINITION BOOST_ROOT
ADD_DEFINITION QT_QMAKE_EXECUTABLE

eval "cmake ${DEFINITIONS} ${LOCATION}"
