[Qt-interest] qmake: select variables depending in compiler
Gordon Schumacher
gordon at rebit.com
Sun Nov 22 17:49:42 CET 2009
Christian Döring wrote:
> Matthias Pospiech schrieb:
>
>> I have a pro file which sets up my project with many libaries.
>> These libaries exist for visual studio 2005, 2008, mingw and soon also
>> for linux (gcc)
>>
>> These libaries (dll) files are stored in different path, such as
>>
>> project/lib/libaryname//$${COMPILER}/debug
>>
>> where COMPILER has currently the values {mingw, msvc2005, msvc2008, gcc}
>>
>> Now I want to have an automatic selection of these paths depending on
>> the compiler currently used.
>>
>> How would one achieve this within qmake?
>>
>> Matthias
>>
>> _______________________________________________
>> Qt-interest mailing list
>> Qt-interest at trolltech.com
>> http://lists.trolltech.com/mailman/listinfo/qt-interest
>>
>>
> Hello,
>
> You can use QMAKE_CC or QMAKE_CXX in your .pro-File to determnine the
> compiler.
> If you additionally want to distinguish between different versions of
> visual studio you can use $$find(QMAKE_COMPILER_DEFINES, "_MSC_VER")
> which should give you something like win32-msvc2008 or win32-msvc2005
> I hope that helps.
>
Or you may just use scoping, and use things like:
*-msvc* {
...only if we're using a Microsoft compiler...
}
win32 {
...only on Windows...
}
Read the Scoping section in the qmake docs, and look in the mkspecs
directory to see what your match glob should be.
More information about the Qt-interest-old
mailing list