I used the MinGW to compile the project. I had to change the mingw paths in the CMakeCache.txt file and add the path to the qmake.exe.
But it worked then.