Skip to content
Snippets Groups Projects
Commit 6ed05bf3 authored by Claus-Justus Heine's avatar Claus-Justus Heine
Browse files

Make QGL optional.

parent 35b6bc64
No related branches found
No related tags found
No related merge requests found
dnl
dnl $1 == required: bail out on error
dnl $1 == optional: just issue a warning.
dnl
AC_DEFUN([ALBERT_CHECK_QT],
[AC_ARG_WITH([qtdir],
[ --with-qtdir=QTDIR Attempt to use the QT toolkit located in QTDIR.
......@@ -6,7 +10,7 @@ AC_DEFUN([ALBERT_CHECK_QT],
yes)
;;
no)
AC_MSG_ERROR([Nope, we _need_ QT])
test "$1" = required && AC_MSG_ERROR([Nope, we _need_ QT])
;;
*)
QTDIR=${withval}
......@@ -21,7 +25,7 @@ done
])
AC_LANG_PUSH([C++])
ALBERT_CHECK_PACKAGE(Qt, qt-mt, ${QTDIR}/lib, ${X_LIBS} -lX11,
qgl.h, ${QTDIR}/include, required)
qgl.h, ${QTDIR}/include, $1)
AC_LANG_POP
dnl
dnl check for QGLWidget
......@@ -37,7 +41,11 @@ AC_CACHE_CHECK([whether class QGLWidget compiles and links],
#endif]],
[[QGLWidget qgl;]])],
[ac_cv_qglwidget_links=yes],
[AC_MSG_FAILURE([Unable to compile and link a "QGLWidget"])
[if test "$1" = required; then
AC_MSG_FAILURE([Unable to compile and link a "QGLWidget"])
else
AC_MSG_RESULT([Unable to compile and link a "QGLWidget"])
fi
])
AC_LANG_POP
LDFLAGS="${ac_save_LDFLAGS}"
......@@ -51,13 +59,19 @@ AC_ARG_WITH([moc],
yes)
;;
no)
AC_MSG_ERROR([Nope, we need moc])
test "$1" = required && AC_MSG_ERROR([Nope, we need moc])
;;
*)
MOCPATH=${withval}
;;
esac],
[MOCPATH=${QTDIR}/bin])
AC_PATH_PROG([MOC], moc, , [$MOCPATH:$QTDIR/bin:$PATH])
AC_PATH_PROG([MOC], moc,
[test "$1" == required && AC_MSG_ERROR(["moc" not found])],
[$MOCPATH:$QTDIR/bin:$PATH])
if test -n "$Qt_LIB" -a -n "$MOC" -a "$ac_cv_qglwidget_links" = yes; then
AC_DEFINE([HAVE_QGL_WIDGET], 1,
[Define to "1" if Qt's QGLWidget is present and compiles])
fi
])
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment