1 dnl Copyright (C) 2006-2022 CEA/DEN, EDF R&D
3 dnl This library is free software; you can redistribute it and/or
4 dnl modify it under the terms of the GNU Lesser General Public
5 dnl License as published by the Free Software Foundation; either
6 dnl version 2.1 of the License, or (at your option) any later version.
8 dnl This library is distributed in the hope that it will be useful,
9 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
10 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 dnl Lesser General Public License for more details.
13 dnl You should have received a copy of the GNU Lesser General Public
14 dnl License along with this library; if not, write to the Free Software
15 dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 AC_REQUIRE([AC_PROG_CC])dnl
22 AC_REQUIRE([AC_PROG_CXX])dnl
23 AC_REQUIRE([AC_PROG_CPP])dnl
24 AC_REQUIRE([AC_PROG_CXXCPP])dnl
25 AC_REQUIRE([CHECK_OPENGL])dnl
26 AC_REQUIRE([AC_LINKER_OPTIONS])dnl
30 if test "x$OpenGL_ok" != "xyes" ; then
31 AC_MSG_WARN(Qt needs OpenGL correct configuration, check configure output)
39 if test "x$QTDIR" = "x"
41 AC_MSG_RESULT(please define QTDIR variable)
44 AC_MSG_RESULT(QTDIR is $QTDIR)
47 AC_CHECK_FILE(${QTDIR}/include/qt3/qglobal.h,QTINC="/qt3",QTINC="")
48 QT_VERS=`grep "QT_VERSION_STR" ${QTDIR}/include${QTINC}/qglobal.h | sed -e 's%^#define QT_VERSION_STR\([[:space:]]*\)%%g' -e 's%\"%%g'`
49 AC_MSG_RESULT(Qt version is $QT_VERS)
50 QT_VERS="Qt_"`echo $QT_VERS | sed -e 's%\"%%g' -e 's%\.%_%g'`
53 if test "x$qt_ok" = "xyes"
55 if test -f ${QTDIR}/bin/moc
59 AC_PATH_PROG(MOC, moc)
64 AC_MSG_RESULT(moc qt-compiler not in PATH variable)
67 AC_MSG_RESULT(moc found)
71 if test "x$qt_ok" = "xyes"
73 if test -f ${QTDIR}/bin/uic
77 AC_PATH_PROG(UIC, uic)
82 AC_MSG_RESULT(uic qt-interface compiler not in PATH variable)
85 AC_MSG_RESULT(uic found)
92 if test "x$qt_ok" = "xyes"
94 CPPFLAGS_old=$CPPFLAGS
95 CPPFLAGS="$CPPFLAGS -I$QTDIR/include${QTINC}"
98 AC_CHECK_HEADER(qaction.h,qt_ok=yes ,qt_ok=no)
100 CPPFLAGS=$CPPFLAGS_old
102 AC_MSG_CHECKING(include of qt headers)
104 if test "x$qt_ok" = "xno"
106 AC_MSG_RESULT(qt headers not found, or too old qt version, in $QTDIR/include)
107 AC_MSG_RESULT(QTDIR environment variable may be wrong)
110 QT_INCLUDES="-I${QT_ROOT}/include${QTINC} -DQT_THREAD_SUPPORT -DQT_CLEAN_NAMESPACE"
111 QT_MT_INCLUDES="-I${QT_ROOT}/include${QTINC} -DQT_THREAD_SUPPORT -DQT_CLEAN_NAMESPACE"
115 if test "x$qt_ok" = "xyes"
117 AC_MSG_CHECKING(linking qt library)
119 if test "x$QTDIR" = "x/usr"
121 LIBS="$LIBS -lqt-mt $OGL_LIBS"
123 LIBS="$LIBS -L$QTDIR/lib${LIB_LOCATION_SUFFIX} -lqt-mt $OGL_LIBS"
126 CXXFLAGS_old=$CXXFLAGS
127 CXXFLAGS="$CXXFLAGS $QT_INCLUDES"
129 AC_CACHE_VAL(salome_cv_lib_qt,[
131 #include <qapplication.h>
134 QApplication a(n, s);
136 eval "salome_cv_lib_qt=yes",eval "salome_cv_lib_qt=no")
138 qt_ok="$salome_cv_lib_qt"
140 if test "x$qt_ok" = "xno"
142 AC_MSG_RESULT(unable to link with qt library)
143 AC_MSG_RESULT(QTDIR environment variable may be wrong)
146 if test "x$QTDIR" = "x/usr"
149 QT_MT_LIBS=" -lqt-mt"
151 QT_LIBS="-L$QTDIR/lib${LIB_LOCATION_SUFFIX} -lqt-mt"
152 QT_MT_LIBS="-L$QTDIR/lib${LIB_LOCATION_SUFFIX} -lqt-mt"
157 CXXFLAGS=$CXXFLAGS_old
165 AC_SUBST(QT_INCLUDES)
166 AC_SUBST(QT_MT_INCLUDES)
173 AC_MSG_RESULT(for Qt: $qt_ok)