AC_DEFUN([OPTIONS_QT], [
AC_ARG_WITH([qt],
[AC_HELP_STRING([--with-qt], [Possible usage:
- "Qt_Install_Path" - prefix to path where Qt was installd;
- "" or "yes" or "auto" - means seaching installed Qt product in the system (checking $QTDIR and then - standard system paths );
+ "Qt_Install_Path" - prefix to path where Qt was installed;
+ "" or "yes" or "auto" - means seaching installed Qt product in the system (checking $QT4_ROOT_DIR or $QTDIR and then - standard system paths);
"no" - not use Qt product (is not supported)
By default "" option is used)])],
[with_qt=$withval], [with_qt=""])
qt_ok=yes
-QTDIR=$(echo $QTDIR | sed 's%[/]\+$%%')
+QT_DIR=$(echo $QT4_ROOT_DIR | sed 's%[/]\+$%%')
+if test -z $QT_DIR ; then
+ QT_DIR=$(echo $QTDIR | sed 's%[/]\+$%%')
+fi
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
if test "x$with_qt" != "x" ; then
dnl Using "--with-qt" prefix path
- QTDIR="$with_qt"
-elif test "$QTDIR" = "/usr/lib/qt3" ; then
- dnl Using QTDIR environment variable
- AC_MSG_RESULT(current QTDIR is $QTDIR)
+ QT_DIR="$with_qt"
+elif test "$QT_DIR" = "/usr/lib/qt3" ; then
+ dnl Using QTDIR/QT4_ROOT_DIR environment variable
+ AC_MSG_RESULT(current QTDIR is $QT_DIR)
dnl
if test -d /usr/lib/qt4 ; then
AC_MSG_RESULT(it is strange for a qt4 installation !)
AC_MSG_RESULT(/usr/lib/qt4 is present)
AC_MSG_RESULT(replacing QTDIR by /usr/lib/qt4)
- QTDIR=/usr/lib/qt4
+ QT_DIR=/usr/lib/qt4
fi
-elif test -z $QTDIR ; then
- AC_MSG_WARN(undefined QTDIR variable which specify where Qt product was installed)
+elif test -z $QT_DIR ; then
+ AC_MSG_WARN(undefined both QTDIR and Qt4_ROOT_DIR variables; any of them should specify where Qt product was installed)
for d in /usr/local/lib/qt4 /usr/lib/qt4 /usr ; do
if test -f ${d}/lib/libQtCore.so ; then
AC_MSG_RESULT(trying ${d})
- QTDIR="${d}"
+ QT_DIR="${d}"
break
elif test -f ${d}/lib64/libQtCore.so ; then
AC_MSG_RESULT(trying ${d})
- QTDIR="${d}"
+ QT_DIR="${d}"
break
elif test -f ${d}/libQtCore.so ; then
AC_MSG_RESULT(trying ${d})
- QTDIR="${d}"
+ QT_DIR="${d}"
break
fi
done
#
# check QTDIR environment variable
#
-if test "x$QTDIR" = "x"
+if test "x$QT_DIR" = "x"
then
- AC_MSG_RESULT(Please define correct path in "--with-qt" option or use correct $QTDIR variable)
+ AC_MSG_RESULT([Please define correct path in "--with-qt" option or use correct $QTDIR (or, alternatively, $QT4_ROOT_DIR) variable])
qt_ok=no
fi
then
qt_inc_ok=no
QTINC=""
- AC_CHECK_FILE(${QTDIR}/include/qt4/QtCore/qglobal.h,QTINC="/qt4",QTINC="")
+ AC_CHECK_FILE(${QT_DIR}/include/qt4/QtCore/qglobal.h,QTINC="/qt4",QTINC="")
if test "x$QTINC" = "x"
then
- AC_CHECK_FILE(${QTDIR}/include${QTINC}/QtCore/qglobal.h,qt_inc_ok=yes,qt_inc_ok=no)
+ AC_CHECK_FILE(${QT_DIR}/include${QTINC}/QtCore/qglobal.h,qt_inc_ok=yes,qt_inc_ok=no)
else
qt_inc_ok=yes
fi
if test "x$qt_inc_ok" = "xyes"
then
AC_MSG_CHECKING(whether Qt version >= 4.0)
- QT_VERSION=`grep "QT_VERSION_STR" ${QTDIR}/include${QTINC}/QtCore/qglobal.h | sed -e 's%^#define QT_VERSION_STR[[:space:]]*\"\([[:digit:]\.]*\)\"%\1%g'`
+ QT_VERSION=`grep "QT_VERSION_STR" ${QT_DIR}/include${QTINC}/QtCore/qglobal.h | sed -e 's%^#define QT_VERSION_STR[[:space:]]*\"\([[:digit:]\.]*\)\"%\1%g'`
QT_VERSION_ID=`echo $QT_VERSION | awk -F. '{v=$[1]*10000+$[2]*100+$[3];print v}'`
if test $QT_VERSION_ID -ge 40000
then
#
if test "x$qt_ok" = "xyes"
then
- if test -f ${QTDIR}/bin/moc
+ if test -f ${QT_DIR}/bin/moc
then
- MOC=${QTDIR}/bin/moc
+ MOC=${QT_DIR}/bin/moc
else
AC_PATH_PROG(MOC, moc)
fi
#
if test "x$qt_ok" = "xyes"
then
- if test -f ${QTDIR}/bin/uic
+ if test -f ${QT_DIR}/bin/uic
then
- UIC=${QTDIR}/bin/uic
+ UIC=${QT_DIR}/bin/uic
else
AC_PATH_PROG(UIC, uic)
fi
#
if test "x$qt_ok" = "xyes"
then
- if test -f ${QTDIR}/bin/rcc
+ if test -f ${QT_DIR}/bin/rcc
then
- QRCC=${QTDIR}/bin/rcc
+ QRCC=${QT_DIR}/bin/rcc
else
AC_PATH_PROG(QRCC, rcc)
fi
#
if test "x$qt_ok" = "xyes"
then
- if test -f ${QTDIR}/bin/lrelease
+ if test -f ${QT_DIR}/bin/lrelease
then
- LRELEASE=${QTDIR}/bin/lrelease
+ LRELEASE=${QT_DIR}/bin/lrelease
else
AC_PATH_PROG(LRELEASE, lrelease)
fi
fi
fi
-QT_ROOT=$QTDIR
+QT_ROOT=$QT_DIR
#
# check Qt header files
AC_CHECKING(include Qt header files)
CPPFLAGS_old=$CPPFLAGS
- CPPFLAGS="$CPPFLAGS -I${QTDIR}/include${QTINC} -I${QTDIR}/include${QTINC}/QtCore"
+ CPPFLAGS="$CPPFLAGS -I${QT_DIR}/include${QTINC} -I${QT_DIR}/include${QTINC}/QtCore"
AC_CHECK_HEADER(QObject,qt_ok=yes,qt_ok=no)
CPPFLAGS=$CPPFLAGS_old
if test "x$qt_ok" = "xno"
then
- AC_MSG_RESULT(qt header files are not found in $QTDIR/include${QTINC}/QtCore)
+ AC_MSG_RESULT(qt header files are not found in $QT_DIR/include${QTINC}/QtCore)
AC_MSG_RESULT(QTDIR environment variable may be wrong (probably too old Qt version))
else
AC_MSG_RESULT(qt header files seem to be OK)
- QT_INCLUDES="-I${QTDIR}/include${QTINC}"
+ QT_INCLUDES="-I${QT_DIR}/include${QTINC}"
# user header files
- QT_INCLUDES="${QT_INCLUDES} -I${QTDIR}/include${QTINC}/QtCore"
- QT_INCLUDES="${QT_INCLUDES} -I${QTDIR}/include${QTINC}/QtGui"
- QT_INCLUDES="${QT_INCLUDES} -I${QTDIR}/include${QTINC}/QtOpenGL"
- QT_INCLUDES="${QT_INCLUDES} -I${QTDIR}/include${QTINC}/QtXml"
+ QT_INCLUDES="${QT_INCLUDES} -I${QT_DIR}/include${QTINC}/QtCore"
+ QT_INCLUDES="${QT_INCLUDES} -I${QT_DIR}/include${QTINC}/QtGui"
+ QT_INCLUDES="${QT_INCLUDES} -I${QT_DIR}/include${QTINC}/QtOpenGL"
+ QT_INCLUDES="${QT_INCLUDES} -I${QT_DIR}/include${QTINC}/QtXml"
# not used currently header files (uncomment if required)
- #QT_INCLUDES="${QT_INCLUDES} -I$(QTDIR)/include${QTINC}/QtAssistant"
- #QT_INCLUDES="${QT_INCLUDES} -I$(QTDIR)/include${QTINC}/QtDBus"
- #QT_INCLUDES="${QT_INCLUDES} -I$(QTDIR)/include${QTINC}/QtDesigner"
- #QT_INCLUDES="${QT_INCLUDES} -I$(QTDIR)/include${QTINC}/QtNetwork"
- #QT_INCLUDES="${QT_INCLUDES} -I$(QTDIR)/include${QTINC}/QtSql"
- #QT_INCLUDES="${QT_INCLUDES} -I$(QTDIR)/include${QTINC}/QtSvg"
- #QT_INCLUDES="${QT_INCLUDES} -I$(QTDIR)/include${QTINC}/QtTest"
- #QT_INCLUDES="${QT_INCLUDES} -I$(QTDIR)/include${QTINC}/QtUiTools"
-
- QT_ASSISTANT_INCLUDES="${QT_ASSISTANT_INCLUDES} -I${QTDIR}/include${QTINC}/QtAssistant"
- QT_ASSISTANT_INCLUDES="${QT_ASSISTANT_INCLUDES} -I${QTDIR}/include${QTINC}/QtNetwork"
+ #QT_INCLUDES="${QT_INCLUDES} -I$(QT_DIR)/include${QTINC}/QtAssistant"
+ #QT_INCLUDES="${QT_INCLUDES} -I$(QT_DIR)/include${QTINC}/QtDBus"
+ #QT_INCLUDES="${QT_INCLUDES} -I$(QT_DIR)/include${QTINC}/QtDesigner"
+ #QT_INCLUDES="${QT_INCLUDES} -I$(QT_DIR)/include${QTINC}/QtNetwork"
+ #QT_INCLUDES="${QT_INCLUDES} -I$(QT_DIR)/include${QTINC}/QtSql"
+ #QT_INCLUDES="${QT_INCLUDES} -I$(QT_DIR)/include${QTINC}/QtSvg"
+ #QT_INCLUDES="${QT_INCLUDES} -I$(QT_DIR)/include${QTINC}/QtTest"
+ #QT_INCLUDES="${QT_INCLUDES} -I$(QT_DIR)/include${QTINC}/QtUiTools"
+
+ QT_ASSISTANT_INCLUDES="${QT_ASSISTANT_INCLUDES} -I${QT_DIR}/include${QTINC}/QtAssistant"
+ QT_ASSISTANT_INCLUDES="${QT_ASSISTANT_INCLUDES} -I${QT_DIR}/include${QTINC}/QtNetwork"
# this flag is obsolete with Qt 4
QT_MT_INCLUDES="$QT_INCLUDES"
CXXFLAGS="$CXXFLAGS $QT_INCLUDES"
LIBS_old=$LIBS
- if test "x$QTDIR" = "x/usr" ; then
+ if test "x$QT_DIR" = "x/usr" ; then
QT_LIB_DIR=""
- elif test -d ${QTDIR}/lib; then
- QT_LIB_DIR="-L$QTDIR/lib"
- elif test -d ${QTDIR}/lib64; then
- QT_LIB_DIR="-L$QTDIR/lib64"
- elif test "x$QTDIR" = "x/usr/lib/qt4" ; then
+ elif test -d ${QT_DIR}/lib; then
+ QT_LIB_DIR="-L$QT_DIR/lib"
+ elif test -d ${QT_DIR}/lib64; then
+ QT_LIB_DIR="-L$QT_DIR/lib64"
+ elif test "x$QT_DIR" = "x/usr/lib/qt4" ; then
QT_LIB_DIR=""
else
AC_MSG_ERROR(Can't detect of Qt library directory )
# BEGIN: for CCRT (installation of qt have only a "lib" directory)
if test "x$qt_ok" = "xno"
then
- QT_LIB_DIR="-L$QTDIR/lib"
+ QT_LIB_DIR="-L$QT_DIR/lib"
LIBS="$LIBS_old $QT_LIB_DIR -lQtCore"
AC_CACHE_VAL(salome_cv_lib_qt,[
CXXFLAGS=$CXXFLAGS_old
fi
-AC_SUBST(QTDIR)
+AC_SUBST(QT_DIR)
AC_SUBST(MOC)
AC_SUBST(UIC)
AC_SUBST(QRCC)