[Interest] QMake generation config file from variables in .pro file

Constantin Makshin cmakshin at gmail.com
Thu Jan 30 04:58:29 CET 2014


I wonder why such useful feature is left undocumented...

On 01/30/2014 01:27 AM, Guido Seifert wrote:
> Wow, have to try this immediately. If this works it would be much better
> than what I concocted. :-)
> 
> Guido
> 
>> Hi,
>>
>> actually this is possible with qmake.
>> If you have a file named config.h.in you can use normal qmake variables 
>> in it e.g. "#define Version $$VERSION".
>>
>> Then put the following in your .pro file:
>> versionconfig.input = config.h.in
>> versionconfig.output = config.h
>> QMAKE_SUBSTITUTES += versionconfig
>>
>>
>> Marcel
>>
>>
>> Am 16.01.2014 14:42, schrieb Guido Seifert:
>>> Hi,
>>> when I use cmake I can create a file config.h.in, which contains
>>> things like:
>>> #define Version "@VERSION@"
>>>
>>> in the CMakeLists.txt I can define a variable:
>>> SET(VERSION "something")
>>> and add:
>>>
>>> configure_file (
>>>    "config.h.in"
>>> )
>>>
>>> This creates a config.h with #define Version "something".
>>>
>>> Question is, can I do the same with qmake? How?
>>>
>>> Guido
>>> _______________________________________________
>>> Interest mailing list
>>> Interest at qt-project.org
>>> http://lists.qt-project.org/mailman/listinfo/interest
>>
>> _______________________________________________
>> Interest mailing list
>> Interest at qt-project.org
>> http://lists.qt-project.org/mailman/listinfo/interest
>>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20140130/78b6344d/attachment.sig>


More information about the Interest mailing list