#!/bin/sh
# Template to set environment variables for the
# non-regression testing framework.

export VORPALINE_BUILD_CONFIG="@CMAKE_BUILD_TYPE.PATH@"
export VORPALINE_SOURCE_DIR="@CMAKE_SOURCE_DIR.PATH@"
export VORPALINE_BUILD_DIR="@CMAKE_BINARY_DIR.PATH@"
export VORPALINE_BIN_DIR="@CMAKE_RUNTIME_OUTPUT_DIRECTORY.PATH@"
export VORPALINE_LIB_DIR="@CMAKE_LIBRARY_OUTPUT_DIRECTORY.PATH@"
export VORPATEST_ROOT_DIR="@CMAKE_SOURCE_DIR.PATH@/tests"
export DATADIR="@CMAKE_SOURCE_DIR.PATH@/tests/data"

args=
while [ -n "$1" ]; do
    case "$1" in
        --with-*=*)
            var=`echo "$1" | sed 's/--with-\([^=]*\)=\(.*\)$/VORPALINE_WITH_\U\1\E=\2/'`
            export "$var"
            shift
            ;;
        --with-*)
            var=`echo "$1" | sed 's/--with-\(.*\)$/VORPALINE_WITH_\U\1=1/'`
            export "$var"
            shift
            ;;
        *)
            args="$args $1"
            shift;
            ;;
    esac
done

