I would like to detect whether qmake is currently building using MingW (win32-gcc) or Visual Studio (win32-msvc200X).
At the moment I am using the following construct:
windows{
contains(QMAKE_CC, gcc){
# MingW
}
contains(QMAKE_CC, cl){
# Visual Studio
}
}
This does not seem particularly robust. Is there a better way?
qmake is a utility that automates the generation of makefiles. Makefiles are used by the program make to build executable programs from source code; therefore qmake is a make-makefile tool, or makemake for short.
For simple projects, you only need to run qmake in the top level directory of your project. By default, qmake generates a Makefile that you then use to build the project, and you can then run your platform's make tool to build the project. qmake can also be used to generate project files.
The project file format used by qmake can be used to support both simple and fairly complex build systems. Simple project files use a straightforward declarative style, defining standard variables to indicate the source and header files that are used in the project.
prf files: In a directory listed in the QMAKEFEATURES environment variable that contains a list of directories delimited by the platform's path list separator (colon for Unix, semicolon for Windows).
Probably not anymore robust, but different:
windows {
*-g++* {
# MinGW
}
*-msvc* {
# MSVC
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With