[Interest] How to read Qmake .pro file built-in variables

rap rap at dlc.fi
Thu Sep 25 17:42:55 CEST 2014


Perfect!  Thank you Karl!

/Risto

Date: Thu, 25 Sep 2014 08:13:10 -0500
From: Karl Ruetz <karl.ruetz at ruetzdogz.com>
Subject: Re: [Interest] How to read Qmake .pro file built-in variables
To: Interest at qt-project.org
Message-ID: <42D70809-3EDE-4CC0-AB25-F1E013F70F95 at ruetzdogz.com>
Content-Type: text/plain; charset=windows-1252

Here?s how I do it:

TARGET = MyProgram
VERSION = 1.0.0.0


DEFINES += \
  APP_VERSION=\"\\\"$$VERSION\\\"\" \
  APP_NAME=\\\"$$TARGET\\\"

I then access the TARGET as the constant APP_NAME and VERSION as the constant APP_VERSION

Karl

On Sep 25, 2014, at 8:04 AM, rap <rap at dlc.fi> wrote:

> Is there a way to read the contents of the qmake project file (.pro) built-in variables, specially the "TARGET" variable?  I'm 
> doing
> a bunch of small examples and getting the TARGET (.exe) name to my QWindow class would help to pass the name to setTitle()
> consistently and automatically.
>
> Thanks,
> /Risto 




More information about the Interest mailing list