[PyQt] sip/pyqt4/cmake question

Hans-Peter Jansen hpj at urpla.net
Tue Dec 7 09:06:15 GMT 2010


On Tuesday 07 December 2010, 03:56:17 luxInteg wrote:
> On Monday 06 December 2010 21:05:51 luxInteg wrote:
> > greetings
> >
> > I am attempting to compile a test   Qt4/PyQt4 project with cmake
> > The machine used for compiling has these:-
> > --cpu amd64 2 cores
> > --o/s linux 64bit cblfs  kernel-2.6.32
> > --gcc-4.4.2,cmake-2.8.0,sip-4.10.2 PyQt4-4.7.1
> >
> > my cmake/sip instruction is :-
> > ######################
> > set(SIP_PATH   /usr/share/sip/PyQt4 )
> > find_program(SIP_EXECUTABLE sip)
> >
> > add_custom_command(OUTPUT
> >     ${CMAKE_CURRENT_BINARY_DIR}/fileC.cpp
> >     ${CMAKE_CURRENT_BINARY_DIR}/fileD.cpp
> >   COMMAND ${SIP_EXECUTABLE} -c ${CMAKE_CURRENT_BINARY_DIR}
> >     ${CMAKE_CURRENT_SOURCE_DIR}/sipfile.sip
> >   DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/sipfile.sip
> >   COMMENT "Processing ${CMAKE_CURRENT_SOURCE_DIR}/sipfile.sip"
> >   VERBATIM)
>
> sip --help on my machine yields:-
>
> lI [ ~ ]$ sip --help
> sip: Usage: sip [-h] [-V] [-a file] [-b file] [-c dir] [-d file] [-e]
> [-g] [-I dir] [-j #] [-k] [-m file] [-o] [-p module] [-r] [-s suffix]
> [-t tag] [-w] [-x feature] [-z file] [file]
> lI [ ~ ]$
>
>
> The only  option I have used in the   cmake add_custom_comand()
>  above are -c and -I.  I would be grateful if someone could enlighten
> what the recommended calling options   to use are when using sip with
> cmake. (for example should python modules be called and if so which
> ones etc)
>
> (In any case my machine does not have a  'man sip' and   even  a
> search on the internet  for  'sip --help'  did not prove very
> informative  so explanation of the options above would be helpful
> generally.

The first tier of information is:
http://www.riverbankcomputing.com/static/Docs/sip4/index.html
of course. Any sane distribution should have installed this under 
documentation somewhere, e.g. in my openSUSE packages:

/usr/share/doc/packages/python-sip-devel/doc/html/index.html

Another pretty enlightening source is sipdistutils.py. If that's still 
lacking, get all what you want to know (and probably much what you 
don't) by studying siputils.py and the function generate_code in 
configure.py of PyQt. Running the latter in verbose mode is a good 
starter in that quest.. 

Pete


More information about the PyQt mailing list