[CMake] Finding Qt3 moc and uic when Qt4 is installed in path

Craig Bradney cbradney at zip.com.au
Mon Apr 3 18:43:03 EDT 2006


On Tuesday 04 April 2006 00:30, Filipe Sousa wrote:
> On Monday 03 April 2006 23:07, Craig Bradney wrote:
> > Hi,
> >
> > I'm wondering if anyone has a solution to the problem I'm facing right
> > now... ie, on Gentoo Qt3's bin files are in /usr/qt/3/bin and Qt4 ones
> > are in /usr/bin. FindQt3.cmake in cmake 2.3.4-20060317 is giving me
> > these...
> >
> > /usr/qt/3 for $ENV{QTDIR}
> > /usr/bin/moc for ${QT_MOC_EXECUTABLE}
> > /usr/bin/uic for ${QT_UIC_EXECUTABLE}
> > /usr/qt/3/lib/libqt-mt.so for ${QT_QT_LIBRARY}
> > /usr/qt/3/include for ${QT_INCLUDE_DIR}
> >
> > The bins are called moc and uic as looked for by FintQt3.cmake.
>
> Add NO_DEFAULT_PATH to FIND_PROGRAM() in FindQt3.cmake
>
> $ cmake --help-command FIND_PROGRAM
>        ...
>        The reason the paths listed in the call to the command are searched
>        last is that most users of CMake would expect things to be found
> first in the locations specified by their environment.  Projects may
> override this behavior by simply calling the command twice:
>
>           FIND_PROGRAM(<VAR> NAMES name PATHS paths NO_DEFAULT_PATH)
>           FIND_PROGRAM(<VAR> NAMES name)
>
>        Once one of these calls succeeds the result variable will be set and
>        stored in the cache so that neither call will search again.

Yep. Thanks. It'll bite a few people though given its allowing an environment 
based override for includes etc and not the binaries. Perhaps, given Qt4 has 
done away with the QTDIR option, FindQt3.cmake could accept this as a first 
option over the default paths from the cmake build.

Craig


More information about the CMake mailing list