-dnl Copyright (C) 2009-2010 CEA/DEN, EDF R&D
+dnl Copyright (C) 2006-2010 CEA/DEN, EDF R&D
dnl
dnl This library is free software; you can redistribute it and/or
dnl modify it under the terms of the GNU Lesser General Public
dnl
dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
dnl
+
dnl the following variables are exported:
dnl QT_MOC
dnl QT_UIC
dnl path given with --with-qt4 options
dnl presence of QTDIR variable
dnl /usr
+dnl when HAS_GUI is false (no salome gui) and nothing is said for qt4, qt4 is not checked
dnl usages
dnl ./configure --prefix=/home/prascle/partage/maquettes/install
dnl ./configure --prefix=/home/prascle/partage/maquettes/install --with-qt4
AC_REQUIRE([AC_PROG_CPP])
qt_ok=no
+ qt4_wanted=yes
+ WITH_QT4=0
# --- check if qt4 standard install directory is defined (with subdirectories bin lib include)
qt4_install_path=""
fi
fi
- # --- if qt4 standard install directory is not defined: QTDIR value if defined, or /usr
+ # --- if qt4 standard install directory is not defined
+ # if HAS_GUI= 0: Qt4 not wanted
+ # else: QTDIR value if defined, or /usr
if test x${withval} = xnotset
then
- if test -z $QTDIR
+ if test x${HAS_GUI} = x0
then
- qt4_install_path="/usr"
+ qt4_wanted=no
+ AC_MSG_NOTICE([SALOME GUI not present, Qt4 not specified, skip detection])
else
- if test $QTDIR = /usr/lib/qt3 ; then
- 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
+ if test -z $QTDIR
+ then
+ qt4_install_path="/usr"
+ else
+ if test $QTDIR = /usr/lib/qt3 ; then
+ 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
+ fi
fi
+ qt4_install_path=$QTDIR
fi
- qt4_install_path=$QTDIR
fi
fi
# --- if qt4 standard install directory is not wanted: --without-qt4 or --with-qt4=no
if test x${withval} = xno
then
- qt4_install_path=""
+ qt4_wanted=no
+ AC_MSG_NOTICE([Qt4 is not wanted, skip detection])
fi
QT_DIR=${qt4_install_path}
AC_SUBST(QT_DIR)
+ # ----------------------------------------------------------------------
+ # --- only when qt4 wanted (no explicit --without-qt4 nor --with-qt4=no)
+
+ if test x${qt4_wanted} = xyes
+ then
+
# --- check if qt4 includes directory is defined
qt4_include_path=""
AC_ARG_WITH([qt4-includes],
fi
fi
- WITH_QT4=0
-
- AC_MSG_NOTICE(${qt4_include_path})
- AC_MSG_NOTICE(${qt4_library_path})
- AC_MSG_NOTICE(${qt4_tools_path})
# test if qt4 is completely defined
qt4_defined=yes
then
qt4_defined=no
AC_MSG_NOTICE([No Qt4 include path defined])
+ else
+ AC_MSG_NOTICE([Qt4 include path is ${qt4_include_path}])
fi
if test x${qt4_library_path} = x
then
qt4_defined=no
AC_MSG_NOTICE([No Qt4 library path defined])
+ else
+ AC_MSG_NOTICE([Qt4 library path is ${qt4_library_path}])
fi
if test x${qt4_tools_path} = x
then
qt4_defined=no
AC_MSG_NOTICE([No Qt4 tools path defined])
+ else
+ AC_MSG_NOTICE([Qt4 tools path is ${qt4_tools_path}])
fi
# saving values for compilation variables
AC_SUBST(qt4_cppflags)
# --- we test the library file presence and usability
- if test x${qt4_library_path} = /usr/lib
+ if test x${qt4_library_path} = x/usr/lib
then
qt4_ldflags=""
else
fi
AC_MSG_NOTICE([checking whether link with qt4 is working])
- qt4_lib_name=QtGui
- qt4_libs="-l$qt4_lib_name"
+ qt4_libs="-lQtCore -lQtGui"
LDFLAGS="${LDFLAGS} ${qt4_ldflags}"
LIBS="${LIBS} ${qt4_libs}"
AC_LANG_PUSH(C++)
AC_MSG_NOTICE([No Qt4 support])
fi
+ # restoring saved values
+ CPPFLAGS=$saved_CPPFLAGS
+ LDFLAGS=$saved_LDFLAGS
+ LIBS=$saved_LIBS
+
+ fi
+ # --- end: only when qt4 wanted (no explicit --without-qt4 nor --with-qt4=no)
+ # ----------------------------------------------------------------------
+
# Propagate test into atlocal
AC_SUBST(WITH_QT4)
# ... and into source files
AC_DEFINE_UNQUOTED(HAS_QT4, $WITH_QT4, [Qt4 library])
- # restoring saved values
- CPPFLAGS=$saved_CPPFLAGS
- LDFLAGS=$saved_LDFLAGS
- LIBS=$saved_LIBS
-
])
AC_DEFUN([I2_CHECK_QSCINTILLA],
[
AC_REQUIRE([I2_CHECK_QT4])
-
qscintilla_ok=no
WITH_QSCI4=0
+ # ----------------------------------------------------------------------
+ # --- check qscintilla only when qt4 OK
+
+ if test x${WITH_QT4} = x1
+ then
+
# --- check if qsci4 includes directory is defined
qsci4_include_path=""
qsci4_cppflags=""
AC_SUBST(qsci4_libs)
WITH_QSCI4=1
qscintilla_ok=yes
- # Propagate test into atlocal
- AC_SUBST(WITH_QSCI4)
fi
else
AC_MSG_NOTICE([no support for qscintilla for qt4])
fi
+ # restoring saved values
+ CPPFLAGS=$saved_CPPFLAGS
+ LDFLAGS=$saved_LDFLAGS
+ LIBS=$saved_LIBS
+
+ else
+ # --- end: check qscintilla only when qt4 OK
+ # ----------------------------------------------------------------------
+ AC_MSG_NOTICE([qscintilla for qt4 not checked because Qt4 not wanted or not detected])
+ fi
+
+ # Propagate test into atlocal
+ AC_SUBST(WITH_QSCI4)
+
# Propagate test into Makefiles...
AM_CONDITIONAL(WITH_QSCI4, test $WITH_QSCI4 = 1)
# ... and into source files
AC_DEFINE_UNQUOTED(HAS_QSCI4, $WITH_QSCI4, [QsciScintilla library])
- # restoring saved values
- CPPFLAGS=$saved_CPPFLAGS
- LDFLAGS=$saved_LDFLAGS
- LIBS=$saved_LIBS
-
])