[PyQt] SIP building of QtCoremod.sip

Phil Thompson phil at riverbankcomputing.com
Fri Aug 1 09:56:50 BST 2014


On 01/08/2014 6:11 am, Emmanuel Mayssat wrote:
> From: emayssat at epicsqt.org
> To: pyqt at riverbankcomputing.com
> CC: emayssat at epicsqt.org
> Subject: SIP building of QtCoremod.sip
> Date: Thu, 24 Jul 2014 23:25:37 -0700
> 
> 
> 
> 
> To be better acquainted with SIP on large software project, I am
> trying to build the PyQt bindings that are already on my system.
> 
> $ pwd
> /usr/share/sip/PyQt4/QtCore
> $ ls
> configure.py                  qfileinfo.sip              qpair.sip
>                  qstringmatcher.sip
> qabstractanimation.sip        qfile.sip
> qparallelanimationgroup.sip    qstring.sip
> qabstracteventdispatcher.sip  qfilesystemwatcher.sip
> qpauseanimation.sip            qsystemsemaphore.sip
> qabstractfileengine.sip       qfinalstate.sip
> qpluginloader.sip              QtCoremod.sbf
> qabstractitemmodel.sip        qfsfileengine.sip          qpoint.sip
>                  QtCoremod.sip
> [...]
> 
> 
> Now I am trying to build a configure.py file, with the following code
> 
> $ more configure.py
> import os
> import sipconfig
> 
> # The name of the SIP build file generated by SIP and used by the build
> # system.
> build_file = "./sip.d/QtCoremod.sbf"
> 
> build_dir = "./sip.d"
> specification_sip = "QtCoremod.sip"
> platform = "WS_X11"
> 
> # Get the SIP configuration information.
> config = sipconfig.Configuration()
> 
> # Run SIP to generate the code.
> os.system("rm -rf ./sip.d")
> os.mkdir("./sip.d")
> os.system(" ".join([config.sip_bin, "-c", build_dir, "-b", build_file,
> "-t", platform, specification_sip ]))
> 
> # Create the Makefile.
> makefile = sipconfig.SIPModuleMakefile(config, build_file)
> 
> # Add the library we are wrapping.  The name doesn't include any 
> platform
> # specific prefixes or extensions (e.g. the "lib" prefix on UNIX, or 
> the
> # ".dll" extension on Windows).
> makefile.extra_libs = ["QtCore"]
> 
> #look in the currents directory too for libraries
> makefile.extra_lib_dirs = ["."]
> 
> # Generate the Makefile itself.
> os.chdir(build_dir)
> makefile.generate()
> 
> 
> When I 'sudo python configure'.py'. there is no output (meaning
> probably it is successful since sip files are generated.
> Nevertheless, when I run make -C ./sip.d, I get
> 
> $ sudo make
> g++ -c -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
> -fstack-protector --param=ssp-buffer-size=4  -m64 -mtune=generic -fPIC
> -O2 -Wall -W -DNDEBUG -I. -I/usr/include/python2.7 -o
> sipQtCorecmodule.o sipQtCorecmodule.cpp
> In file included from sipQtCorecmodule.cpp:29:0:
> sipAPIQtCore.h:35:21: fatal error: QMetaType: No such file or directory
> compilation terminated.
> make: *** [sipQtCorecmodule.o] Error 1
> 
> 
> !?!?!?
> Is my configuration file ok?

You haven't told it where to find the Qt header files or libraries.

Phil


More information about the PyQt mailing list