[PyKDE] how to determine QT include and library dir ?

Gerard Vermeulen gvermeul at grenoble.cnrs.fr
Mon Jan 20 21:00:01 GMT 2003


On Mon, Jan 20, 2003 at 05:05:40PM -0200, Ricardo Niederberger Cabral wrote:
> 	I have a C++ extension module using QT and I need to set the distutils include_dirs and library_dirs variable.
> 	My question is: How do I determine them inside setup.py ?
> 	I know there is a QTDIR env variable, but on my system, for example, it points to /usr/qt/2 (and I have QT 3.1.0 installed and working perfectly). So it seems that I shouldn't trust this env var, or should I ?
> 	I checked the configure script of some kde projects, and they all seem to check by brute force all possibilities (/usr/local/qt/include /usr/include/qt ...)
> 	
> 
> Thanks, 
> -- 
> Ricardo Niederberger Cabral
> <nieder at mail.ru>
> 
Easiest is to rely on QTDIR (PyQwt is doing this now).
If you don't trust environment variables (neither do I) you can do:

QTDIR=/usr/lib/qt3 python setup.py build

or

QTDIR=/usr/lib/qt3 python setup.py bdist_rpm


The other possibility, is that you let the user edit the setup.py file
to fill in the Qt root directory.


It is certainly possible within distutils to search for the "good" Qt
directory, but that requires good understanding of distutils. I might
do something like that in the next version of PyQwt.

Gerard




More information about the PyQt mailing list