district10 / cmake-templates

Some CMake Templates (examples). Qt, Boost, OpenCV, C++11, etc 一些栗子
http://blog.tangzhixiong.com/post-0100-cmake-templates.html
MIT License
530 stars 140 forks source link

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

Open district10 opened 8 years ago

district10 commented 8 years ago

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.

district10 commented 8 years ago

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

district10 commented 7 years ago

You should configure your cmake properly in advance.

district10 commented 7 years ago

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

Jeetsinghji commented 6 years ago

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.