[Interest] Obtaining TARGET value from .pro file before compiling

Bob Hood bhood2 at comcast.net
Sun Mar 16 12:50:02 CET 2014


On 3/16/2014 4:38 AM, gsmember gs wrote:
> Hello,
> I wanted to ask if it is possible to obtain the TARGET value for using in my
> application from the .pro file.
> All I have found are methods to get values from DEFINES, but I need the
> TARGET value.
> Please help me, thank you!

Well, I'm not sure if this addresses specifically what you're after, but you
can place the TARGET value into a DEFINE, and that will get passed to your
build on the command line.  So, in your *.pro file, you would add this
somewhere after you have defined TARGET:

    DEFINES += TARGET=$$TARGET

If your TARGET is, say, "MyProject", then you'll have "-DTARGET=MyProject" (or
"TARGET=MyProject" listed in the PreprocessorDefinitions of your Visual Studio
project) when your code is built.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20140316/70f7dfad/attachment.html>


More information about the Interest mailing list