Detecting the target architecture in .pro file
-
I am looking for a way to distinguish between different target platforms (32 and 64 bit) respectively between the different tools chains used.
I have found "this":http://qt-project.org/faq/answer/how_can_i_detect_in_the_.pro_file_if_i_am_compiling_on_a_32_bit_or_a_64_bi
but it does not really help or the discussion is wrong. Using in the .pro file:
@
message (HOST:$$QMAKE_HOST)
message (HOST:$$QMAKE_HOST.arch)
message (TARGET:$$QMAKE_TARGET)
message (TARGET:$$QMAKE_TARGET.arch)
@
Following output is generated:
@
Project MESSAGE: HOST:
Project MESSAGE: HOST:x86
Project MESSAGE: TARGET:
Project MESSAGE: TARGET:
@
This is on win7 64 bit with a MinGW 32 bit tool chain.
On another installation it shows:
@
Project MESSAGE: HOST:
Project MESSAGE: HOST:x86_64
Project MESSAGE: TARGET:
Project MESSAGE: TARGET:
@
This is on win7 64 bit with MinGW dual target 32/64 bit tool chain.Anyone knows more details?
Or how can I detect the tool chain and the target OS properly?
-
The wording "platform" in "this post":http://qt-project.org/faq/answer/how_can_i_detect_in_the_.pro_file_if_i_am_compiling_on_a_32_bit_or_a_64_bi#502 threw me off track.
The wording platform relates "here":http://qt-project.org/doc/qt-4.8/supported-platforms.html to the OS and its version e.g. "Microsoft Windows 7 (64-bit)" which is in both of my cases identical.
QMAKE_HOST.arch is changing with the tool chain used. MinGW 32bit shows therefore x86 and the dual target MinGW shows x86_64.
How and where QMAKE_TARGET can be activated is still not clear to me.