[CMake] Finding Qt4 binaries under Windows

John Drescher drescherjm at gmail.com
Fri Aug 21 16:31:03 EDT 2009


> So, if you compiled to C:\Qt\4.5.1 then you have a couple of options:
>
> set QTDIR to C:\Qt\4.5.1 in the environment variables.
>
> OR
>
> find_package(Qt4 PATHS "C:/Qt/4/.5.1") like Pau suggested.
>
> If you don't like the version number on there then recompile Qt 4.5.1 so
> that it has a path of C:\Qt and NOT C:\Qt\4.5.1
>

I just let cmake-gui try to find it and when it fails I manually set
the location of the qmake executable. This way I can have more than 1
Qt version installed and I do not have to play with environment
variables to switch between versions. After telling cmake-gui where
qmake.exe is for a project it will never ask me again unless I clear
the cache. I guess I could create a batch file that launches cmake-gui
with a different environment to do this but its not like I do this
ever day..

John


More information about the CMake mailing list