On 01.02.11 23:14:26, Michael Jansen wrote: > > > > Do you need that for running ? > > > > For building it's not necessary. Use CMAKE_PREFIX_PATH. > > > > > > I always thought that PATH controls which qt version is selected if you > > > have more than one (First qmake found). It was that way some time ago. > > > And QTDIR IS USED in FindQt4.cmake. I don't reevaluate my finding every > > > day so perhaps something changed. > > > > Ok. > > So when an executable is searched, it is searched in a set of default > > directories (as e.g. /usr/bin/) and in PATH. So setting PATH so that it > > points to the qmake you want works. > > CMAKE_PREFIX_PATH is more generic (and didn't exist in cmake 2.4.something). > > So you can set this too to make cmake find the Qt you want (not pointing to > > QTDIR/bin, but just to QTDIR). > > QTDIR is a variable specific to FindQt4.cmake, so it works too. > > > > So all three work, the most generic/powerful one is CMAKE_PREFIX_PATH. > > Then the 100 points question is: > > If all of them point to a directory with a qt installed (three different > versions). Which one wins? > > a) CMAKE_PREFIX_PATH > b) PATH > c) QTDIR > > I remember more than one newbie losing his grip over not beeing able to > convince cmake to pickup the right one. > > Can you answer it without looking at the cmake file? I can't.
No of course not because you don't know how QTDIR is being used. But thats rather a problem of the FindQt4.cmake module not documented where it uses the QTDIR variable. Once you know it puts that into the PATHS option the rest is a mere look at the cmake manual which lists the order in which it searches for stuff. In particular in your case it'll find the qmake in CMAKE_PREFIX_PATH. > > > Yes it is. Even acknowledged by a cmake dev. Which doesn't make it > > > magically work though. > > > > That is the lib64 issue you have, right ? > > I remember this one was tricky. > > Yes. But there are some executables build and the run during a build that > need > to pickup the right libs too. I am not sure all of them are doing it right or > if there is a right way to do it. The one gnome helper i can point you too is > not using cmake. Well, in kde modules the executables being built will have rpath set too, so that should work - in theory. But as I don't know what exactly Alex and you are talking about here and what your setup is I'll shut up :) Andreas -- You will be given a post of trust and responsibility.