[Interest] Fwd: Defining a string in qmake command line

Till Oliver Knoll till.oliver.knoll at gmail.com
Fri Jan 24 22:57:14 CET 2014


Am 24.01.2014 um 03:39 schrieb Thiago Macieira <thiago.macieira at intel.com>:

> On quinta-feira, 23 de janeiro de 2014 23:05:26, Soroush Rabiei wrote:
>> The problem is that bash (or qmake) eats the double quotation. Definition
>> needs to be wrapped in quotations. So it should pass to compiler something
>> like:
>> 
>> -DSERIAL\"6b6ab0\"
> 
> You have to work back from what you want. You want a compiler argument 
> containing the string:
> 
>    -DSERIAL="6b6ab0"
> 
> Since Make runs commands using the shell, you need to add one level of 
> escaping so the shell will do what you want:

Instead of passing a string argument down the entire toolchain and hence escaping it a 1000 times maybe it would be easier to somehow create a header *.h file dynamically in some preprocess step? You'd probably still want to pass it along to some shell script, maybe even via qmake still. But you could save a few levels of escape characters.

Cheers,
  Oliver





More information about the Interest mailing list