For those who had this error loading a CMakeLists.txt

CMake Error at C:/Program Files/CMake 2.8/share/cmake-2.8/Modules/FindQt4.cmake:1726 (MESSAGE): Qt qmake not found!

using the lastest CMake 2.8 and QT 4.6, the solution is to add some entries windows register (regedit):

  • add a key in HKEY_CURRENT_USER\Software\Trolltech called Versions
  • add a new string in it with the name DefaultQtVersion and the value 4.6
  • add a key in HKEY_CURRENT_USER\Software\Trolltech\Versions called 4.6
  • add a new string in it with the name InstallDir and the value C:\Qt\2009.05\qt

Then you have to edit

C:/Program Files/CMake 2.8/share/cmake-2.8/Modules/FindQt4.cmake

add the following line

HKEY_CURRENT_USER\\Software\\Trollt.../bin

(warning the text is stripped here)

after the line 372 (so at line 373)

save it and it's done!

I hope it will help someone :)

CMake-dev 's guys please update cmake! (ar, I will have to mail them surely )

PS: well perhaps it 's not needed to modify FindQt4.cmake file... I had to reinstall and it work with just the register modified..