On Mon, Oct 19, 2009 at 5:17 PM, Daniel Grubbs <[email protected]> wrote:
> I have problems with this as well. I have seen the documentation, it just
> doesn't make any sense to me. I think you are using some terminology in a
> way that I am unfamiliar with. To me, debug and release are mutually
> exclusive, much like true and false. In fact, the documentation you point to
> specifically states that they are mutually exclusive more than once. Yet it
> also states that the pro file is processed 3 times: debug, release and
> debug_and_release. This seems quite confusing. Let me guess what is really
> happening:
>
> Qmake processes .pro files into Makefiles. The Makefiles may then be used to
> build the program.
>
> If just "CONFIG += release" is specified in the .pro file, a Makefile that
> only builds a release version is made by qmake.
>
> If just "CONFIG += debug" is specified in the .pro file, a Makefile that
> only builds a debug version is made by qmake.
>
> If "CONFIG += debug_and_release" is specified in the .pro file, a
> "Makefile.Release" file is produced to make the release version, a
> "Makefile.Debug" is produced to make the debug version, and a plain Makefile
> is produced which may call either or both of the other Makefiles.
>
> The confusion comes from using the same variable/flags to specify both the
> configuration of the Makefiles and how the code is handled by the compiler.
> (In the "CONFIG += debug" makefile and the "Makefile.Debug" version, the
> "-g" compiler flag is set, otherwise it is not.) For the compiler, "debug"
> and "release" actually are mutually exclusive. For the Makefiles they are
> not. It would probably be easier to understand if different flags and/or
> variables were used for the different uses.
>
> Please let me know if I'm wrong about all this. I think I've finally got it
> figured out.
First, read the FAQ entry I mentioned a couple mails ago.
Second, the step you're missing is that you might have, somehow or
another, specified "CONFIG += debug release" or "CONFIG += release
debug" or worse "CONFIG += release debug release". These flags are of
course mutually exclusive (you would use "debug_and_release" if you
wanted both) and qmake will use the last one specified. That's what
the CONFIG() function does -- you specify which values you want to
look for ("debug|release") and which one you want to check for
("debug") and if the LAST specified value matches what you wanted, the
test function returns true.
/s/ Adam
_______________________________________________
Qt-creator mailing list
[email protected]
http://lists.trolltech.com/mailman/listinfo/qt-creator