Solved qmake CONFIG variables with values
-
Is it possible to add to CONFIG variables with values?
Eg something like
CONFIG += FOO=1 FOO==1 { message("foo is 1") } FOO==2 { message("foo is 2") }
When doing so, I get the error
Excess closing brace.
Obviously, I could use
CONFIG += FOO1
andFOO1 {...}
but I want to make sure that the values of FOO are exclusive and thatCONFIG += FOO=1 CONFIG += FOO=2
results in FOO==2.
Is this possible with qmake?
-
Hi,
AFAIK, no.
Can you explain what you are trying to achieve using CONFIG like that ?
Your code does not look like it needs to have that stored in CONFIG.
-
I want to build different assets from a single .pro file (so I want to set different SOURCES, INCLUDES, ...). CONFIG seemed to be the most 'logical' way to me.
However, I noticed that I can achieve what I want using the following snippet
FOO = 1 FOO = 2 contains (FOO, 1) { message("FOO is 1") } contains (FOO, 2) { message("FOO is 2") }
-
CONFIG is rather to enable features.
If you want control like that, your current solution is better.