#!/bin/sh
# autopkgtest check: Build and run a program against libcnoid, to
# verify that the headers and pkg-config file are installed correctly
# (C) 2013 Thomas Moulard
# Author: Thomas Moulard <thomas.moulard@gmail.com>

set -e

WORKDIR=$(mktemp -d)
trap "rm -rf $WORKDIR" 0 INT QUIT ABRT PIPE TERM
cd $WORKDIR
cat <<EOF > cnoidtest.cpp
#include <cnoid/Body>

int main()
{
    Body body;
    return 0;
}
EOF

g++ -o cnoidtest cnoidtest.cpp `pkg-config --cflags --libs choreonoid`
echo "build: OK"
[ -x cnoidtest ]
./cnoidtest
echo "run: OK"
