开发者

Is it possible to use Qt Creator without qmake?

I've heard that it is possible to build non-Qt applications (like simple C++ HelloWorld) with Qt Creator. I downloaded and installed Qt Creator, and tried to compile simple code with it. But I didn't succeed: Creator needs qmake to create makefile.

Although the package I downloaded includes MinGW, there is no开发者_运维技巧 qmake inside of it.

I still want to use it just like an IDE to create simple C++ sources and compile them with MinGW. Is it possible to use Qt Creator without installing whole platform?


Qt Creator support CMake projects, you just need to choose Open a file or project and select the root CMakeList.txt of your project.

If you want to define your own build workflow, you can remove the default build step and create your own custom build steps (Qt Creator Build Steps).


I think you can modify the build step to remove qmake and use your custom make file.


You totally can!

You can write a .pro file yourself and use it as a project file to use QtCreator without linking / using any of the Qt libraries.

In Project / Compilation Parameters, you can actually tune the compilation steps (removing the qmake step and adding your own).

I use it for a big project of mine and it's very efficient: QtCreator's C analyzer is diamond.

Here's a sample project file for me:

TEMPLATE = app
TARGET = 
DEPENDPATH += . include
INCLUDEPATH += . include

# Input
HEADERS += include/x.h \
           include/y.h \
           include/z.h 
SOURCES += src/x.cpp

Note that I actually use qmake to generate this file automatically, but you can also put your hands into it and modify it by hand.

Afterwards, it's only a matter of $ qtcreator yourfile.pro.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜