Switching Between Debug and Release Mode in Qt Creator without Modifying Project File
-
Is there any way to switch between debug and release mode in Qt Creator without modifying the project file? It's tedious to have to change the project file every time I switch from compiling in debug mode to test the program and building static for a exe that can be released.
Thanks! -
Pease show your .pro file content. Without seeing it, it's only a guessing game about what you are currently doing.
-
Here 'tis, the relevant part being CONFIG += static and CONFIG += release. I'd like to be able to switch between compiling debug in Qt Creator and compiling static release for final exe version to be released without having to keep commenting out the CONFIG += lines.
Thanks again.#------------------------------------------------- # # Project created by QtCreator 2016-05-03T14:13:40 # #------------------------------------------------- QT += core gui greaterThan(QT_MAJOR_VERSION, 4): QT += widgets TARGET = ReplicatorNew TEMPLATE = app SOURCES += *all cpps here HEADERS += *all h's here FORMS += \ *all ui's here CONFIG += static CONFIG += release RC_ICONS = "*icon file here" RESOURCES += \ * resource file here
-
You can do build type specific stuff using this construct:
CONFIG(release, debug|release) { CONFIG += static }
Note that you are likely not going to get the result you expect. If you want a fully static application, you have to use fully static dependencies in the first place. This also requires abide to all the constraints related to the license of said dependencies.
-
Sorry and thanks Sgaist I was being lazy and forgot to research first I think I found what I'm looking here and here.
So I only use static when compiling for deployment. So I put it in my build script and at the QMake step I do:qmake "CONFIG += static release" project.pro