Skip to content
Snippets Groups Projects
Commit 0ef12a43 authored by Oliver Sander's avatar Oliver Sander
Browse files

The build system can now find and integrate my very own psurface

library.  psurface handles parametrized triangulated surface in 3d.
In particular it can be used to have 3d UGGrids with parametrized
boundaries.

[[Imported from SVN: r2222]]
parent c26c440c
Branches
Tags
No related merge requests found
......@@ -67,7 +67,10 @@ echo
DUNE_PATH_ALBERTA
# UG-check
DUNE_PATH_UG
# Check for the AmiraMesh library
DUNE_PATH_AMIRAMESH
# Check for the psurface library
DUNE_PATH_PSURFACE
# Yaspgrid-check
DUNE_MPI
......
# searches for psurface-headers and lib
AC_DEFUN([DUNE_PATH_PSURFACE],[
AC_REQUIRE([AC_PROG_CXX])
AC_ARG_WITH(psurface,
AC_HELP_STRING([--with-psurface=PATH],[directory with the psurface library inside]))
# store values
ac_save_LDFLAGS="$LDFLAGS"
ac_save_CPPFLAGS="$CPPFLAGS"
ac_save_LIBS="$LIBS"
## do nothing if --without-psurface is used
if test x$with_psurface != xno ; then
if test x$with_psurface != x ; then
if test -d $with_psurface; then
# expand tilde / other stuff
PSURFACEROOT=`cd $with_psurface && pwd`
else
AC_MSG_ERROR([directory $with_psurface does not exist])
fi
else
# use some default value...
PSURFACEROOT="/usr/local/psurface"
fi
PSURFACE_LIB_PATH="$PSURFACEROOT/lib"
PSURFACE_INCLUDE_PATH="$PSURFACEROOT/include"
LDFLAGS="$LDFLAGS -L$PSURFACE_LIB_PATH"
CPPFLAGS="$CPPFLAGS -I$PSURFACE_INCLUDE_PATH"
AC_LANG_PUSH([C++])
# check for header
AC_CHECK_HEADER([parametrization/AmiraParamAccess.h],
[PSURFACE_CPPFLAGS="-I$PSURFACE_INCLUDE_PATH"
HAVE_PSURFACE="1"],
AC_MSG_WARN([AmiraParamAccess.h not found in $PSURFACE_INCLUDE_PATH/parametrization]))
CPPFLAGS="$PSURFACE_CPPFLAGS"
# Psurface uses the AmiraMesh data format to read a write parametrized surfaces to disk.
# Therefore, its installation only makes sense if AmiraMesh support is installed as well.
if test x$HAVE_AMIRAMESH != x1 ; then
AC_MSG_WARN(Check for psurface library aborted because AmiraMesh is unavailable!)
HAVE_PSURFACE="0"
fi
# if header is found...
if test x$HAVE_PSURFACE = x1 ; then
LIBS="$LIBS -lparam $AMIRAMESH_LDFLAGS $AMIRAMESH_LIBS"
AC_LINK_IFELSE(AC_LANG_PROGRAM([#include "parametrization/AmiraParamAccess.h"], [AmiraLoadMesh("label", "filename");]),
[PSURFACE_LIBS="-lparam"
PSURFACE_LDFLAGS="-L$PSURFACE_LIB_PATH"
LIBS="$LIBS $PSURFACE_LIBS"],
[HAVE_PSURFACE="0"
AC_MSG_WARN(libpsurface not found!)])
fi
AC_LANG_POP([C++])
## end of psurface check (--without wasn't set)
fi
with_psurface="no"
# survived all tests?
if test x$HAVE_PSURFACE = x1 ; then
AC_SUBST(PSURFACE_LIBS, $PSURFACE_LIBS)
AC_SUBST(PSURFACE_LDFLAGS, $PSURFACE_LDFLAGS)
AC_SUBST(PSURFACE_CPPFLAGS, $PSURFACE_CPPFLAGS)
AC_DEFINE(HAVE_PSURFACE, 1, [Define to 1 if psurface-library is found])
# add to global list
DUNE_PKG_LDFLAGS="$DUNE_PKG_LDFLAGS $PSURFACE_LDFLAGS"
DUNE_PKG_LIBS="$DUNE_PKG_LIBS $PSURFACE_LIBS"
DUNE_PKG_CPPFLAGS="$DUNE_PKG_CPPFLAGS $PSURFACE_CPPFLAGS"
# set variable for summary
with_psurface="yes"
else
AC_SUBST(PSURFACE_LIBS, "")
AC_SUBST(PSURFACE_LDFLAGS, "")
AC_SUBST(PSURFACE_CPPFLAGS, "")
fi
# also tell automake
AM_CONDITIONAL(PSURFACE, test x$HAVE_PSURFACE = x1)
# reset old values
LIBS="$ac_save_LIBS"
CPPFLAGS="$ac_save_CPPFLAGS"
LDFLAGS="$ac_save_LDFLAGS"
])
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment