[CMake] Suggesting to FindQT4.cmake where to find QT4

Andreas Pakulat apaku at gmx.de
Mon May 25 17:35:59 EDT 2009


On 25.05.09 23:17:55, Jed Brown wrote:
> David Thompson wrote:
> >>> Have you ever tried setting the PATH?  It is actually quite easy and does
> >>> not involve "great contortions".
> >>>
> >>> All I do is execute
> >>>
> >>> PATH='/home/software/qtsdk-2009.02/qt/bin:'$PATH
> >>>
> >>> and from then on, cmake uses the version of Qt4 that I downloaded and
> >>> installed in the specified location.  If I want the system version of Qt4
> >>> again (which I don't for my needs), I remove the above from my PATH.
> >> The issue is obviously what happens as soon as there are two independent
> >> libraries that are both so selfish.  Reylying on PATH being set up
> >> specially for you is terrible design unless you can guarantee that there
> >> will never be another.
> > 
> > Perhaps there is a miscommunication here; I think Alan is assuming that
> > you install at least one (if not all) versions of Qt into their own
> > directories (with no other software
> > in /home/software/qtsdk-2009.02/qt/bin except Qt) while you are assuming
> > that multiple packages are being installed into the same directory tree.
> > Doing things the former way, you can have as many of these entries in
> > your path as you like and there will never be a conflict among packages
> > because each PATH entry only points to a single package.
> 
> That's fine as long as all your users, with their wide variety of
> (dis-)organization schemes, agree that this is how software is
> installed.  The moment that is not true, this scheme breaks down.

As soon as people start installing differing versions of the same
software into the same prefix they've already screwed up anyway. Thats
not supported by any software I use on a daily basis (even KDE3 and KDE4
are only co-installable in some parts into the same directory).

> With autoconf, for example, you would normally be able to specify
> --with-foo-dir=/path/a --with-bar-dir=/path/b.  I don't see why there
> is so much resistance to making this sort of thing work in a reliable
> and consistent manner.

Because in the case of Qt4, qmake already knows _exactly_ where
include's and libs are for the version it has been built with. That
information is hardcoded into qmake (adjustable by qt.conf based on
qmake's absolute path). So there's simply no need to go through the
hassle of specifying both separately.

In general of course the situation is a bit different and in fact quite
some of the find-modules in CMake support specifying the libs and
include dirs via special cmake variables.

Andreas

-- 
Executive ability is prominent in your make-up.


More information about the CMake mailing list