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

Alexander Neundorf a.neundorf-work at gmx.net
Thu May 28 18:15:25 EDT 2009


On Monday 25 May 2009, Jed Brown wrote:
> Bill Hoffman wrote:
> > You can also set QMake on the cmake command line as well:
> >
> > cmake -DQT_QMAKE_EXECUTABLE=/path/to/qmake ../source
>
> Yeah, I'm much less concerned with this particular case as with the
> philosophy that the correct way to select installations is by modifying
> PATH.  Frustratingly, a new user will fire up cmake and get the wrong
> version (they're not even aware of exactly what the dependencies are,
> let alone the naming convention for the cache variable that will get the
> correct version).  So they interactively change a couple paths and
> reconfigure.  Lo and behold, they now have an inconsistent state because
> the cache wasn't flushed when they changed QT_QMAKE_EXECUTABLE (I don't
> know if this is the case with Qt, but is is with most packages).
...
> Using PATH and falling back on peculiarly named variables (hopefully
> only one non-advanced variable per package, so that it's unambiguous)

With the new cmake-gui this is now much easier :-)

Also, instead of setting PATH to /opt/qt-a.b.c/bin/ you can also set 
CMAKE_PREFIX_PATH to /opt/qt-a.b.c/, also to a list of directories, which 
cmake will search in the order you specified.

Alex


More information about the CMake mailing list