QGIS/tools/qgisdetect.m4
jobi ac455c294e ** Changed to simple macros for detecting QT and GDAL
** Added code for detecting QGIS as m4 file to tools
** this will be installed together with QT and GDAL detection to
   $prefix/share/aclocal/qgis.m4
   so the plugins can just use those simple unique macros
** updated German translation
!! Developers have to link the installed qgis.m4 to /usr/share/aclocal/
!! or where ever aclocal keeps the m4 files
!! otherwise it's not detected by the plugins autogen.sh (more exactly
!! aclocal)
!! It can be cheated by adding -I path/to/qgis.m4 to the aclocal of
!! autogen.sh. But be carefull not to commit that to CVS


git-svn-id: http://svn.osgeo.org/qgis/trunk@1213 c8812cc2-4d05-0410-92ff-de0c093fc19c
2004-04-18 23:44:41 +00:00

70 lines
1.8 KiB
Plaintext

# Check for working QGIS
# Jens Oberender <j.obi@troja.net> 2004
AC_DEFUN([AQ_CHECK_QGIS],
[
dnl
dnl Get the cflags and libraries from qgis-config
dnl
AC_ARG_WITH([qgis],
AC_HELP_STRING([--with-qgis=path],
[Full path to 'qgis-config', e.g. '--with-qgis=/usr/local/bin/qgis-config]),
[ac_qgis_config_path=$withval])
if test x"$ac_qgis_config_path" = x ; then
ac_qgis_config_path=`which qgis-config`
if test x"$ac_qgis_config_path" = x ; then
ac_qgis_config_path=`dirname $ac_qgis_config_path`
fi
fi
AC_PATH_PROG(QGIS_CONFIG, qgis-config, no, $ac_qgis_config_path)
if test x"$QGIS_CONFIG" = xno ; then
if test x"$ac_qgis_config_path" = x ; then
AC_MSG_ERROR([qgis-config not found in $ac_qgis_config_path! Supply a path with --with-qgis=PATH])
else
AC_MSG_ERROR([qgis-config not found! Supply a path with --with-qgis=PATH])
fi
else
AC_MSG_CHECKING([QGIS_CFLAGS])
QGIS_CFLAGS=`$QGIS_CONFIG --cflags`
AC_MSG_RESULT($QGIS_CFLAGS)
AC_MSG_CHECKING([QGIS_LDADD])
QGIS_LDADD=`$QGIS_CONFIG --libs`
AC_MSG_RESULT($QGIS_LDADD)
ac_save_CXXFLAGS="$CXXFLAGS"
ac_save_LDFLAGS="$LDFLAGS"
CXXFLAGS="$CXXFLAGS $QGIS_CFLAGS"
LDFLAGS="$QGIS_LDADD $QT_LDADD $GDAL_LDADD /Users/didge/lib/libqgis.dylib $LDFLAGS"
case "${host}" in
*darwin*)
LDFLAGS="$LDFALGS -flat_namespace -undefined suppress"
;;
esac
AC_LINK_IFELSE([
#include <qgsfeature.h>
int main(int argc, char *argv[]) {
QgsFeature * myQgsFeature = new QgsFeature(1);
return 0;
}
], [ac_qgis_linked='yes'], [ac_qgis_linked='no'])
CXXFLAGS="$ac_save_CXXFLAGS"
LDFLAGS="$ac_save_LDFLAGS"
AC_MSG_CHECKING([if linking with QGIS works])
if test x$ac_qgis_linked = xyes ; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
fi
AC_SUBST(QGIS_CFLAGS)
AC_SUBST(QGIS_LDADD)
])