安装Qt
QT中open project,选择cmakelist.txt
Run cmake
-
build位置选择在OpenGL文件夹下已经编译好的build文件夹里,已经选错的话在project里更改
点左下角的小锤子编译
-
点左下角的电脑图标,选择要运行的程序运行,注意:要将tutorial xxx文件夹里面的其他文件放到build下才能正常运行,或者将编译好的文件放到tutorial xxx下。
参考
http://www.opengl-tutorial.org/beginners-tutorials/tutorial-1-opening-a-window/
In QtCreator, go to File->Tools->Options->Compile&Execute->CMake
Set the path to CMake. This is most probably /usr/bin/cmake
File->Open Project; Select tutorials/CMakeLists.txt
Select a build directory, preferably outside the tutorials folder
Optionally set -DCMAKE_BUILD_TYPE=Debug in the parameters box. Validate.
Click on the hammer on the bottom. The tutorials can now be launched from the tutorials/ folder.
To run the tutorials from QtCreator, click on Projects->Execution parameters->Working Directory, and select the directory where the shaders, textures & models live. Example for tutorial 2 : ~/opengl-tutorial/tutorial02_red_triangle/