Here is a real simple example of how to build a basic project with CMake and Qt. Hopefully this should be enough to get you started. In Qt just click open project and select the CMakeLists.txt file. Select the build folder and you are done. The code structure below works with any source files in the same folder as your CMakeLists.txt file. I set it up to build to a Debug folder in the parent directory/folder of the CMakeLists.txt file.
This CMake file will build my ModernTriangle example of how to use Qt 5.5 with modern OpenGL. Skip to the bottom of this post for some more info on why you might want to use CMake with Qt Creator. Continue reading