]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
Fix a bug of SALOME_PYQT package - to work properly with Sip and PyQt libraries addit...
authorvsr <vsr@opencascade.com>
Mon, 22 Aug 2005 06:52:32 +0000 (06:52 +0000)
committervsr <vsr@opencascade.com>
Mon, 22 Aug 2005 06:52:32 +0000 (06:52 +0000)
salome_adm/unix/config_files/check_pyqt.m4
salome_adm/unix/make_commence.in

index 573ebc44f41e0090a368eeb6084e39c7a74773a4..ee024efaf8fc2c8caa136b4e12028a1dfe9d430c 100644 (file)
@@ -5,6 +5,9 @@ AC_REQUIRE([CHECK_PYTHON])dnl
 AC_REQUIRE([CHECK_QT])dnl
 AC_REQUIRE([CHECK_SIP])dnl
 
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+
 AC_ARG_WITH(pyqt,
     [  --with-pyqt=DIR      root directory path to PyQt installation ],
     [PYQTDIR="$withval"
@@ -250,12 +253,51 @@ if test "x$pyqt_sips_ok" == "xno"; then
   pyqt_ok=no
 else
   PYQT_INCLUDES="-I$PYQT_SIPS"
+  
+  dnl Additional sip flags required for correct wrappers compilation
+  AC_MSG_CHECKING(which qt classes should be excluded)
+
+  PYQT_SIPFLAGS=""
+
+  CXXFLAGS_old=$CXXFLAGS
+  CXXFLAGS="$CXXFLAGS $QT_INCLUDES"
+  LIBS_old=$LIBS
+  LIBS="$LIBS $QT_LIBS"
+
+  AC_TRY_COMPILE([#include <qcdestyle.h>],
+                 [new QCDEStyle();],,PYQT_SIPFLAGS="$PYQT_SIPFLAGS -x Qt_STYLE_CDE")
+  AC_TRY_COMPILE([#include <qinterlacestyle.h>],
+                 [new QInterlaceStyle();],,PYQT_SIPFLAGS="$PYQT_SIPFLAGS -x Qt_STYLE_INTERLACE")
+  AC_TRY_COMPILE([#include <qmotifstyle.h>],
+                 [new QMotifStyle();],,PYQT_SIPFLAGS="$PYQT_SIPFLAGS -x Qt_STYLE_MOTIF")
+  AC_TRY_COMPILE([#include <qmotifplusstyle.h>],
+                 [new QMotifPlusStyle();],,PYQT_SIPFLAGS="$PYQT_SIPFLAGS -x Qt_STYLE_MOTIFPLUS")
+  AC_TRY_COMPILE([#include <qplatinumstyle.h>],
+                 [new QPlatinumStyle();],,PYQT_SIPFLAGS="$PYQT_SIPFLAGS -x Qt_STYLE_PLATINUM")
+  AC_TRY_COMPILE([#include <qsgistyle.h>],
+                 [new QSGIStyle();],,PYQT_SIPFLAGS="$PYQT_SIPFLAGS -x Qt_STYLE_SGI")
+  AC_TRY_COMPILE([#include <qwindowsstyle.h>],
+                 [new QWindowsStyle();],,PYQT_SIPFLAGS="$PYQT_SIPFLAGS -x Qt_STYLE_WINDOWS")
+  AC_TRY_COMPILE([#include <qwindowsxpstyle.h>],
+                 [new QWindowsXPStyle();],,PYQT_SIPFLAGS="$PYQT_SIPFLAGS -x Qt_STYLE_WINDOWSXP")
+
+  LIBS="$LIBS -lqassistantclient"
+  AC_TRY_LINK([#include <qassistantclient.h>],
+              [new QAssistantClient("foo");],,PYQT_SIPFLAGS="$PYQT_SIPFLAGS -x Qt_ASSISTANTCLIENT")
+
+  AC_MSG_RESULT(done)
+
+  CXXFLAGS=$CXXFLAGS_old
+  LIBS=$LIBS_old
 fi
 
 AC_SUBST(PYQT_INCLUDES)
 AC_SUBST(PYQT_LIBS)
 AC_SUBST(PYQT_SIPS)
 AC_SUBST(PYUIC)
+AC_SUBST(PYQT_SIPFLAGS)
+
+AC_LANG_RESTORE
 
 AC_MSG_RESULT(for pyqt: $pyqt_ok)
 
index 54932dae17c75dc7751ca2790407446917c73f70..6d62bc7438d45ada77c4f6f960f4158364135eb3 100644 (file)
@@ -101,6 +101,7 @@ PYQT_SIPS = @PYQT_SIPS@
 PYQT_LIBS = @PYQT_LIBS@
 PYQT_INCLUDES = @PYQT_INCLUDES@
 PYUIC = @PYUIC@
+PYQT_SIPFLAGS = @PYQT_SIPFLAGS@
 
 # openGL
 OGL_INCLUDES=@OGL_INCLUDES@