#!/bin/bash

# QMAKESPEC is possibly also required on some systems
# See Qt/qmake docs for your system and Evolvotron README if you have any problems.
if [ -z "$QTDIR" ] ; then
  echo "QTDIR not defined"
  echo "You almost certainly need QTDIR defined and pointing at your QT installation"
  echo "If you know different, edit ./configure and remove this test."
  exit 1
fi

# TODO?: Should perhaps test "which qmake" here.
# If not found, add $(QTDIR)/bin to path.  But the ./BUILD script does that.
echo "Your qmake version is:"
qmake-qt4 --version 

echo
echo "Your gcc version is (unless qmake is set up to use a different one):"
gcc --version

echo

CONFIG_OPTS="$@"
VERSION_NUMBER=`./VERSION`

echo
echo "Running qmake-qt4 with CONFIG_OPTS=$CONFIG_OPTS VERSION_NUMBER=$VERSION_NUMBER..."

qmake-qt4 "CONFIG_OPTS=$CONFIG_OPTS" "VERSION_NUMBER=$VERSION_NUMBER" main.pro 

echo "...configuration completed - ready to do 'make' now"
