本文根据已有的CMakeList.txt工程利用Qt Creator创建CMake工程。
参考文献:http://www./tikiwiki/tiki-index.php?page=Setting+Up+An+Application+-+QtCreator+-+Linux
参考文献:http://blog.csdn.net/frestone2010/article/details/6690854 (用cmake构建Qt工程(对比qmake进行学习))
其中CMakeLists.txt范例:http://pan.baidu.com/s/1i3qz9cT http://download.csdn.net/detail/deng_sai/8786231
简单版:http://download.csdn.net/detail/deng_sai/9041861 如果需要设置cmakelists所写工程能调试,则需设置:
1、
cmake或者cmake-gui 时将变量CMAKE_BUILD_TYPE设置为Debug。
IntroductionThis set of instructions will walk you through setting up a QtCreator C++ project from scratch. When you have finished this tutorial you will be able to compile a working Ogre Application and you will be ready to start the Basic Tutorials.
PrerequisitesFollow the instruction at Building Your Projects With CMake to setup a CMake project. Setting up an Ogre project in QtCreatorOpen projectQtCreator - File - Open File or Project: Choose build locationRun CMake此处可能点击Run CMake后Qt Creator 没反应。可能是Qt Creator的CMake的执行命令的路径没指定。 Projects->Manage Kits...->Build & Run -> CMake(可以指定为cmake,也可直接指定cmake-gui。不过假如首先指定的是cmake-gui,run cmake后可能无法显示导入的工程文件,需要再次指定为cmake后再一次run cmake)
click FinishMake in consoleYou need to find the qtcreator-build(/home/deng_sai/myQtCreator/fast_qt/openPOWERLINK-V1.08.4/Build) directory and run this in a console: make && make install
The reason is that it's a bit involved to set up an INSTALL build configuration in QtCreator, and it only needs to be done once. Setup executable for project runNow, click the green arrow in the sidebar to build and run the project. RejoiceConclusionAs you can see, it's rather easy to setup a project in QtCreator if you use a CMake script. |
|