cmake-templates icon indicating copy to clipboard operation
cmake-templates copied to clipboard

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

Open district10 opened this issue 9 years ago • 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.

district10 avatar Jul 06 '16 08:07 district10

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 avatar Jul 12 '16 04:07 district10

You should configure your cmake properly in advance.

district10 avatar Jan 10 '17 03:01 district10

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

district10 avatar Jan 12 '17 08:01 district10

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.

Jeetsinghji avatar Feb 21 '18 14:02 Jeetsinghji