# Windows: qMake: descrepancy between "Build Configuration" and "CONFIG()" TYPE?

• In my project's build settings, i have this:

and this:

(I also have a "release" config, where "qmake build configuration" is set to "Release")

It is my understanding that %{CurrentBuild:Name} is in fact the "build configuration" name. Right?

So far so good. In my qMake file i have this:

CONFIG(release, debug|release) {
build_type = release
} else {
build_type = debug
}

message(build_type: \$\${build_type})
message(\$\${TARGET} \$\${build_depth}bit)

I'm under the impression that that will basically get me the value of the "qmake build configuration" popup, (lower cased) is this a correct assumption?

As expected then, when editing the qMake file, it gets re-parsed and i see something consistent like this:

Project MESSAGE: build_type: debug
Project MESSAGE: CFTest Debug 64bit

or this:

Project MESSAGE: build_type: release
Project MESSAGE: CFTest 64bit

However, when i go to BUILD, for some reason the qMake file gets parsed THREE times, and on the THIRD time, the two messages CONFLICT! See below:

Project MESSAGE: ------------------------------
Project MESSAGE: build_type: debug
Project MESSAGE: CFTest Debug 64bit
Project MESSAGE: ------------------------------
Project MESSAGE: build_type: debug
Project MESSAGE: CFTest Debug 64bit
Project MESSAGE: ------------------------------
Project MESSAGE: build_type: release
Project MESSAGE: CFTest Debug 64bit

why would they conflict? how is that possible? i'm concerned that this is causing an invisible problem.

• it seems the THIRD one must be for the "main" Makefile, which is not "debug" so my logic marks it as "release" even though the \$\${TARGET}} is "debug". That would explain why the discrepancy.

• This is normal for qmake on Windows: it runs 3 times and generates 3 Makefiles. Some more information: https://stackoverflow.com/questions/17360553/qmake-processes-my-pro-file-three-times-instead-of-one

• thanks for that but why the discrepancy on the third pass? is that expected? if so, why?

• One is for the main Makefile, the second is for debug build and the last one for release build.

• it seems the THIRD one must be for the "main" Makefile, which is not "debug" so my logic marks it as "release" even though the \$\${TARGET}} is "debug". That would explain why the discrepancy.