[Interest] Qmake: execute two different link steps?

Konstantin Tokarev annulen at yandex.ru
Thu Dec 3 13:02:11 CET 2015



03.12.2015, 15:00, "Elvis Stansvik" <elvstone at gmail.com>:
> Hi André,
>
> 2015-12-03 10:51 GMT+01:00 André Hartmann <andre.hartmann at iseg-hv.de>:
>>  Hello,
>>
>>  I have a Qmake based project that is developed in Qt Creator (currently
>>  compiled with Linux/gcc and Windows/MinGW).
>>
>>  Depending on a configuration variable the PRO file my program links to one
>>  of two librarys:
>>
>>  TARGET = myProg
>>
>>  CONFIG += TESTLIB
>>
>>  CONFIG(TESTLIB): LIBS += libXXXtest
>>  else: LIBS += libXXX
>>
>>  For now, I have to change the config variable each time.
>>
>>  Is there an easy way to have a second target that is automatically linked to
>>  the correct version? The object files are all the same,
>>  just the link step needs to be executed again. After that, I'd like have two
>>  executeables, e.g.:
>>
>>  myProg-test -> linked to libXXXtest
>>  myProg -> linked to libXXX
>>
>>  Is this possible?
>
> I think with QMake this is not possible without converting your
> project to a subdirs project (TEMPLATE = subdirs), with separate
> sub-directories for the executables you wish to build (TEMPLATE =
> app). Or switch to QBS or CMake.
>
> Happy to be proven wrong though :)

You can create custom target and do one of link steps manually

-- 
Regards,
Konstantin



More information about the Interest mailing list