#!/bin/sh

print_usage(){
    echo "usage: $0 [--cppflags] [--ldflags] [--version]" 1>&2
}

if  [ $# -eq 0 ]; then
    print_usage
    exit 1
fi

#The variables are all prepared in CMAKE and also provided by 
#Find@PROJECT_NAME@.cmake, so dependent applications can create consistent
#Makefiles.
while [ $# -gt 0 ]; do
    case "$1" in
      --cppflags)
        OUTPUT="${OUTPUT}@@PROJECT_NAME@_CPPFLAGS_MAKEFILE@"
        shift;;
      --ldflags)
        OUTPUT="${OUTPUT}@@PROJECT_NAME@_LDFLAGS_MAKEFILE@"
        shift;;
      --version)
        OUTPUT="${OUTPUT}@@PROJECT_NAME@_SOVERSION@"
        shift;;
      *)
        echo "invalid option: $1" 1>&2
        print_usage
        exit 2;;
    esac
done

echo ${OUTPUT}
