qt5base-lts/mkspecs/features/qt.prf
Kent Hansen 613183ff8c Automatically add QtQuick module if only QtDeclarative is specified
QtQuick and related APIs (QQuickItem, SceneGraph, et al), which
used to live in the QtDeclarative module, have moved to a new
module, QtQuick.

Existing projects that use QtQuick-specific APIs should add "quick"
to their project's QT variable, and update their include statements.

E.g.,

QT += declarative

should be changed to

QT += declarative quick

and

 #include <QtDeclarative/qquickitem.h>

should be changed to

 #include <QtQuick/qquickitem.h>

and similarly for the other QtQuick classes.

In order to give existing projects a chance to migrate smoothly, we
should issue a warning and automatically add the QtQuick module if
only the QtDeclarative module was specified. (If a project doesn't
use any QtQuick APIs, the warning can be ignored -- but there is no
way to disable it.)

This change, along with the compatibility headers in QtDeclarative,
make it possible to build existing projects without any modifications
on the project's side.

This change will be removed at a later time; when that happens,
existing projects that did not port to the QtQuick module will no
longer build.

Change-Id: I56abcadc1e5c74490527fc03646310d801bfc084
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2011-12-02 15:59:58 +01:00

196 lines
7.9 KiB
Plaintext

CONFIG *= moc thread
contains(QT, declarative)|contains(QT, declarative-private):!contains(DEFINES, QT_BUILD_QUICK_LIB):!contains(QT, quick):!contains(QT, quick-private) {
warning("This project is using the declarative module, but not the quick module.")
warning("If you're using QtQuick-specific APIs (QQuickItem, SceneGraph et al), you should add")
warning(" QT += quick")
warning("to your project's .pro file.")
contains(QT, declarative-private):QT += quick-private
else:QT += quick
}
#handle defines
win32 {
qt_static:DEFINES += QT_NODLL
!contains(DEFINES, QT_NODLL) {
QT_ENV_DLL = $$(QT_DLL)
QT_ENV_NO_DLL = $$(QT_NODLL)
isEmpty(QT_ENV_NO_DLL) {
shared|!isEmpty(QT_ENV_DLL):DEFINES += QT_DLL
}
contains(DEFINES, QT_MAKEDLL)|contains(DEFINES, QT_DLL):QMAKE_QT_DLL = 1
}
# Some files include qplatformdefs.h, which lives in the individual mkspec directory
# However, if QMAKESPEC_ORIGINAL is set, the module/app is outside of the QtBase
# directory, and using the default profile. So we add the original mkspecs directory
# to the include path
!isEmpty(QMAKESPEC_ORIGINAL):INCLUDEPATH += $$QMAKESPEC_ORIGINAL
}
CONFIG(release, debug|release):DEFINES += QT_NO_DEBUG
contains(QT_CONFIG, force_asserts):DEFINES += QT_FORCE_ASSERTS
no_keywords:DEFINES += QT_NO_KEYWORDS
plugin { #Qt plugins
static:DEFINES += QT_STATICPLUGIN
DEFINES += QT_PLUGIN
# Triggers both on Qt being configured with -arch boundschecker,
# and if you qmake CONFIG+=boundchecker on your plugin project
boundschecker|contains(QT_CONFIG,boundschecker) {
# This option is added for plugins when Qt is configured for Boundschecker,
# since we want Boundschecker to not instrument the qt_plugin_query_verification_data
# function, as we call that function without the plugin's dependent DLLs, thus
# Boundscheckers instrumentation will fail. The function only returns a const char *,
# so no instrumentation is really needed on that function anyways.
QMAKE_CFLAGS += /nmignore:*:qt_plugin_query_verification_data
QMAKE_CXXFLAGS += /nmignore:*:qt_plugin_query_verification_data
}
}
#handle includes
INCLUDEPATH = $$QMAKE_INCDIR_QT $$INCLUDEPATH #prepending prevents us from picking up "stale" includes
QT_PLUGIN_VERIFY = QTPLUGIN DEPLOYMENT_PLUGIN
for(QT_CURRENT_VERIFY, $$list($$QT_PLUGIN_VERIFY)) {
for(QTPLUG, $$list($$lower($$unique($$QT_CURRENT_VERIFY)))) {
qplugin_style =
!qt_debug:!qt_release {
CONFIG(debug, debug|release):qplugin_style = debug
else:qplugin_style = release
} else:CONFIG(qt_debug, qt_debug|qt_release) {
qplugin_style = debug
} else {
qplugin_style = release
}
# Check if the plugin is known to Qt. We can use this to determine
# the plugin path. Unknown plugins must rely on the default link path.
ACCESSIBLEPLUGINS = qtaccessiblewidgets qtaccessiblecompatwidgets
CODECPLUGINS = qcncodecs qjpcodecs qkrcodecs qtwcodecs
DECORATIONPLUGINS = qdecorationdefault qdecorationwindows
GFXDRIVERPLUGINS = qgfxvnc qscreenvfb qgfxsnap qgfxvga16 qgfxmatrox qgfxvoodoo qgfxtransformed qgfxshadowfb
IMAGEPLUGINS = qgif qmng qjpeg qsvg
INPUTPLUGINS = qimsw-multi
MOUSEDRIVERPLUGINS = qtslibmousehandler
SQLPLUGINS = qsqldb2 qsqloci qsqltds qsqlodbc qsqlpsql qsqlibase qsqlmysql qsqlite2 qsqlite
PHONONPLUGINS = phonon_waveout phonon_ds9
ALLQTPLUGINS = $$ACCESSIBLEPLUGINS $$CODECPLUGINS $$DECORATIONPLUGINS $$GFXDRIVERPLUGINS $$IMAGEPLUGINS $$INPUTPLUGINS $$MOUSEDRIVERPLUGINS $$SQLPLUGINS $$PHONONPLUGINS
QT_PLUGINPATH =
contains(ALLQTPLUGINS, $$QTPLUG) {
# Determine the plugin path
contains(ACCESSIBLEPLUGINS, $$QTPLUG): QT_PLUGINPATH = accessible
contains(CODECPLUGINS, $$QTPLUG): QT_PLUGINPATH = codecs
contains(DECORATIONPLUGINS, $$QTPLUG): QT_PLUGINPATH = decorations
contains(GFXDRIVERPLUGINS, $$QTPLUG): QT_PLUGINPATH = gfxdrivers
contains(IMAGEPLUGINS, $$QTPLUG): QT_PLUGINPATH = imageformats
contains(INPUTPLUGINS, $$QTPLUG): QT_PLUGINPATH = inputmethods
contains(MOUSEDRIVERPLUGINS, $$QTPLUG): QT_PLUGINPATH = mousedrivers
contains(SQLPLUGINS, $$QTPLUG): QT_PLUGINPATH = sqldrivers
contains(PHONONPLUGINS, $$QTPLUG): QT_PLUGINPATH = phonon_backend
}
# Generate the plugin linker line
target_qt:isEqual(TARGET, QTPLUG) {
warning($$TARGET cannot have a QTPLUGIN of $$QTPLUG)
} else {
QT_LINKAGE = -l$${QTPLUG}
win32 {
CONFIG(debug, debug|release):QT_LINKAGE = -l$${QTPLUG}d
} else:mac {
isEqual(qplugin_style, debug):QT_LINKAGE = -l$${QTPLUG}_debug
}
}
# Only link against plugin in static builds
isEqual(QT_CURRENT_VERIFY, QTPLUGIN): {
!isEmpty(QT_PLUGINPATH): LIBS *= -L$$[QT_INSTALL_PLUGINS]/$$QT_PLUGINPATH
LIBS += $$QT_LINKAGE
# if the plugin is linked statically there is no need to deploy it
DEPLOYMENT_PLUGIN -= $$QT_CURRENT_VERIFY
}
isEqual(QT_CURRENT_VERIFY, DEPLOYMENT_PLUGIN):shared:wince*: {
QT_ITEM =
CONFIG(debug, debug|release): QT_ITEM = $${QTPLUG}d4.dll
else: QT_ITEM = $${QTPLUG}4.dll
eval(qt_additional_plugin_$${QTPLUG}.files = $$[QT_INSTALL_PLUGINS]/$${QT_PLUGINPATH}/$${QT_ITEM})
eval(qt_additional_plugin_$${QTPLUG}.path = $${QT_PLUGINPATH})
DEPLOYMENT *= qt_additional_plugin_$${QTPLUG}
}
}
}
#specific module settings
!isEmpty(QT_BUILD_TREE):QMAKE_LIBDIR = $$QT_BUILD_TREE/lib $$QMAKE_LIBDIR #as above, prepending prevents us from picking up "stale" libs
QMAKE_LIBDIR += $$QMAKE_LIBDIR_QT
# Topological ordering of modules based on their QT.<module>.depends variable
QT = $$sort_depends(QT, "QT.")
QT_DEPENDS=
unset(using_privates)
for(QTLIB, $$list($$lower($$unique(QT)))) {
# Figure out if we're wanting to use the private headers of a module
contains(QTLIB, .*-private) {
QTLIB ~= s/-private//
use_private = UsePrivate
} else {
use_private = NoPrivate
}
isEmpty(QT.$${QTLIB}.name) {
message("Warning: unknown QT module: $$QTLIB")
next()
}
target_qt:isEqual(TARGET, QTLIB) {
warning($$TARGET cannot have a QT of $$QTLIB)
next()
}
qtAddModule($$QTLIB, $$use_private)
QT_DEPENDS += $$eval(QT.$${QTLIB}.depends)
isEqual(use_private, UsePrivate):using_privates = true
}
# add include paths for all .depends, since module/application might need f.ex. template specializations etc.
QT_DEPENDS -= $$QT
for(QTLIB, $$list($$lower($$unique(QT_DEPENDS)))):INCLUDEPATH *= $$INCLUDEPATH $$eval(QT.$${QTLIB}.includes)
!isEmpty(using_privates):!no_private_qt_headers_warning:if(!debug_and_release|!build_pass) {
message("This project is using private headers and will therefore be tied to this specific Qt module build version.")
message("Running this project against other versions of the Qt modules may crash at any arbitrary point.")
message("This is not a bug, but a result of using Qt internals. You have been warned!")
}
qt_compat {
!qt_compat_no_warning:QTDIR_build:warning(***USE of COMPAT inside of QTDIR!**) #just for us
INCLUDEPATH *= $$QMAKE_INCDIR_QT/Qt
DEFINES *= QT_COMPAT
}
wince*:static:gui {
QTLIB += qmenu_wce.res
}
!isEmpty(QT_NAMESPACE):DEFINES *= QT_NAMESPACE=$$QT_NAMESPACE
mac {
!isEmpty(QT_NAMESPACE_MAC_CRC):DEFINES *= QT_NAMESPACE_MAC_CRC=$$QT_NAMESPACE_MAC_CRC
}
#SIMD defines:
mmx:DEFINES += QT_HAVE_MMX
3dnow:DEFINES += QT_HAVE_3DNOW
sse:DEFINES += QT_HAVE_SSE QT_HAVE_MMXEXT
sse2:DEFINES += QT_HAVE_SSE2
sse3:DEFINES += QT_HAVE_SSE3
ssse3:DEFINES += QT_HAVE_SSSE3
sse4_1:DEFINES += QT_HAVE_SSE4_1
sse4_2:DEFINES += QT_HAVE_SSE4_2
avx:DEFINES += QT_HAVE_AVX
iwmmxt:DEFINES += QT_HAVE_IWMMXT