OK... I know again why I
hate QT... this is a never-ending story.
I think I've gotten it (not yet completely) working like this:
- Download the official compiler from here:
http://www.qt.io/download-open-source (
http://download.qt.io/official_releases/qt/5.4/5.4.1/qt-opensource-windows-x86-mingw491_opengl-5.4.1.exe)
- Install the tools including the compiler (it is unselected by default)
- Make a copy of the GCC compiler (name it e.g. "GNU GCC compiler for QT")
- Setup the toolchain master path to point to the root of the installed MinGW compiler (not the QT binaries)
- Follow the steps you've described (global var, extensions, project setup etc...)
- Select the virtual target "All"
- Hit "Compile"
The result:
- The "debug" build target compiles just fine (I think the first build target will always compiler fine)
- The "release" (2nd, 3rd...) target fails
To get the application running I needed to copy it into the QT "bin" directory, otherwise it was unable to find the windows platform plugin.. :-/
So - its not yet perfect. I've attached the project to this post so you can play with it.
I would clearly prefer if it works with qt5 instead of qt4 first, btw...
BTW: I preferred the commands for "ui" file types to be:
$(#qt.bin)\uic.exe $file -o $(project_dir)qt_ui\ui_$file_name.h...and:
$(project_dir)qt_ui\ui_$file_name.h...and respectively for "moc":
$(#qt.bin)\moc.exe $file -o $(project_dir)qt_moc\moc_$file_name.cpp...and:
$(project_dir)qt_moc\moc_$file_name.cpp...in case you wonder.
It should be more generic because usually you have one main QT development SDK which should be 5.
Also: For the global compiler vars it is enough to set the master path. That is because anything like
$(#qt.include) will automatically be expanded to
[PATH]\include (the GCV's field name) if it is not set.