在Qt qmake中对Kit使用条件表达式 [英] Using conditional expression for Kits in Qt qmake

查看:258
本文介绍了在Qt qmake中对Kit使用条件表达式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个qmake(Qt 4.8.6).pro文件,我需要根据已编译的工具包添加条件表达式:

I have a qmake (Qt 4.8.6) .pro file and I need to add conditional expressions based on the compiled kits:

我目前有2个套件(使用不同的编译器),一个用于 Desktop ,一个用于 Embedded Platform ,我的应用程序链接到一些已编译的库既适用于台式机,也适用于嵌入在两个不同文件夹中的嵌入式服务器.

I currently have 2 Kits (with different compilers), one for the Desktop and one for the Embedded Platform, my application is linked to some libraries, that are compiled both for Desktop and for Embedded in two different folders.

所以我想要实现的是:

unix { embedded-platform { LIBS+= -lonearm -ltwoarm etc... }}
unix { desktop { LIBS += -lonex86 -ltwox86 etc... }}

我仔细阅读了文档,但我不知道如何从.pro内部了解构建的工具包.

I read the docs carefully but I can't figure out how to be aware of what kit is being built from inside the .pro.

我已经尝试过此处提出的解决方案

I already tried the solution proposed here https://forum.qt.io/topic/52954/solved-qmake-how-to-achieve-kit-detection-and-automatic-conditional-linking/3 but it does not solve my problem as there is no way to discriminate between custom Kits on the same platform (the two compilers are g++ and arm-linux-gnueabihf-g++).

有什么建议吗?

推荐答案

您也应该能够基于编译器进行切换.在mkspecs文件夹中列出了要使用的关键字.

You should be able to switch based on the compiler, too. The keywords to use are listed in the mkspecs folder.

在我的计算机上,找到Qt 5.4套件之一的mkspecs,它具有以下文件夹:

Looking at the mkspecs on my computer for one of the Qt 5.4 kits, it had the following folders:

aix-g++
aix-g++-64
aix-xlc
aix-xlc-64
android-g++
blackberry-armle-v7-qcc
blackberry-armv7le-qcc
blackberry-x86-qcc
common
common/aix
common/android
common/c89
common/ios
common/ios/GLES2
common/mac
common/nacl
common/posix
common/qnx
common/wince
common/winrt_winphone
common/winrt_winphone/assets
common/winrt_winphone/manifests
common/winrt_winphone/manifests/8.0
common/winrt_winphone/manifests/8.1
common/winrt_winphone/manifests/8.1_wp
cygwin-g++
darwin-g++
devices
devices/blackberry-playbook-armle-v7-qcc
devices/blackberry-playbook-armv7le-qcc
devices/blackberry-playbook-x86-qcc
devices/common
devices/linux-archos-gen8-g++
devices/linux-arm-amlogic-8726M-g++
devices/linux-arm-hisilicon-hix5hd2-g++
devices/linux-arm-trident-pnx8473-g++
devices/linux-beagleboard-g++
devices/linux-imx53qsb-g++
devices/linux-imx6-g++
devices/linux-mipsel-broadcom-97425-g++
devices/linux-rasp-pi-g++
devices/linux-sh4-stmicro-ST7108-g++
devices/linux-sh4-stmicro-ST7540-g++
devices/linux-snowball-g++
devices/linux-tegra2-g++
features
features/android
features/data
features/data/android
features/data/cmake
features/data/headersclean
features/mac
features/qpa
features/unix
features/win32
features/winrt
freebsd-g++
freebsd-g++46
freebsd-icc
hpux-acc
hpux-acc-64
hpux-acc-o64
hpux-g++
hpux-g++-64
hpuxi-acc-32
hpuxi-acc-64
hpuxi-g++-64
hurd-g++
irix-cc
irix-cc-64
irix-g++
irix-g++-64
linux-arm-gnueabi-g++
linux-clang
linux-clang-libc++
linux-cxx
linux-g++
linux-g++-32
linux-g++-64
linux-icc
linux-icc-32
linux-icc-64
linux-kcc
linux-llvm
linux-lsb-g++
linux-pgcc
lynxos-g++
macx-clang
macx-clang-32
macx-g++
macx-g++-32
macx-g++40
macx-g++42
macx-icc
macx-ios-clang
macx-ios-clang/features
macx-llvm
macx-xcode
modules
netbsd-g++
openbsd-g++
qnx-armle-v7-qcc
qnx-armv7le-qcc
qnx-x86-qcc
sco-cc
sco-g++
solaris-cc
solaris-cc-64
solaris-cc-64-stlport
solaris-cc-stlport
solaris-g++
solaris-g++-64
tru64-cxx
tru64-g++
unixware-cc
unixware-g++
unsupported
unsupported/android-g++
unsupported/freebsd-clang
unsupported/integrity-ghs
unsupported/linux-armcc
unsupported/linux-host-g++
unsupported/linux-scratchbox2-g++
unsupported/nacl-g++
unsupported/nacl64-g++
unsupported/qnx-X11-g++
unsupported/vxworks-ppc-dcc
unsupported/vxworks-ppc-g++
unsupported/vxworks-simpentium-dcc
unsupported/vxworks-simpentium-g++
unsupported/win32-msvc2003
win32-g++
win32-icc
win32-msvc2005
win32-msvc2008
win32-msvc2010
win32-msvc2012
win32-msvc2013
wince60standard-armv4i-msvc2005
wince60standard-x86-msvc2005
wince70embedded-armv4i-msvc2008
wince70embedded-x86-msvc2008
winphone-arm-msvc2012
winphone-arm-msvc2013
winphone-x86-msvc2012
winphone-x86-msvc2013
winrt-arm-msvc2012
winrt-arm-msvc2013
winrt-x64-msvc2012
winrt-x64-msvc2013
winrt-x86-msvc2012
winrt-x86-msvc2013

希望有帮助.

这篇关于在Qt qmake中对Kit使用条件表达式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆