简体   繁体   中英

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM