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

Marcel Krems Marcel.Krems at web.de
Wed Jan 22 01:11:22 CET 2014


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




More information about the Interest mailing list