district10/cmake-templates

HOWTO: Use Qt Creator to Open CMakeLists.txt directly (will generate proper project files)

district10 opened this issue · 4 comments

Linux

1. Use qt-creator to Open CMakeLists.txt

Use qt-creator to open CMakeLists.txt

2. Set Project Output Directory

Output dir

3. Run CMake

Unix Generator (qt4)? It generates a .cbp project (CodeBlocks Project) actually.

Run CMake

4. Build & Run

Build & Run

You can also/actually use code blocks to open this project.

Windows

1

Downloaded Qt5.6 for windows VS2015 from http://mirrors.ustc.edu.cn/qtproject/official_releases/qt/5.6/5.6.0/qt-opensource-windows-x86-msvc2015_64-5.6.0.exe.

2

Install it and then goto C:\Qt\VS2015x64\Qt5.6.0\Tools\QtCreator\bin to open qtcreator.exe:

open qtcreator.exe

In qt creator, hit Ctrl+o, to open a CMakeLists.txt:

open CMakeLists.txt

3

Configure it.

configure it

4

cmake it:

cmake it

Run it:

run it

You should configure your cmake properly in advance.

Sadly, seems not work on Ubuntu (or maybe, not work with newer Qt Creator?).

cmake-import-error

Have anyone encountered this situation? It seems that it can't find one of CMake variable while generating Qt project. Any help will be appreciated.