2018-02-08 16:47 GMT+01:00 william.croc...@analog.com <

> My goal is to keep all files in the same directory and all .pro logic in
> the same file.
> QMake should be ashamed of itself.

Why? It is a design decision made by the people who made qmake to have 1
.pro file per major target.
The most obvious evidence is the `TEMPLATE` variable in pro files.
Whether or not it is a good design can be debated, but I do not see any
reason to be ashamed of.
It is like saying that Java should be ashamed of itself because you can
only have 1 public class per file.
Anyway we could also debate whether having multiple target of multiple
TEMPLATE type in a single pro file is a good idea or not.

A bad solution to your problem would be to use CONFIG.
In your .pro you would have:

build_lib {
    TEMPLATE = lib
} else {
    TEMPLATE = app
    SOURCES += main.cpp

And then you could build it like so:

    qmake CONFIG+=build_lib


Interest mailing list

Reply via email to