2012-02-24 18:21:51 +00:00
|
|
|
CONFIG *= thread
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
#handle defines
|
|
|
|
win32 {
|
2012-05-30 10:09:00 +00:00
|
|
|
contains(QT_CONFIG, shared) {
|
|
|
|
# this variable is read by qmake in qmake/generators/win32/msvc_vcproj.cpp
|
|
|
|
# function VcprojGenerator::initDeploymentTool(), which contains some hardcoded
|
|
|
|
# library names (the ones that were static in Qt 4)
|
|
|
|
# it probably doesn't work anymore and should not be in this file
|
|
|
|
QMAKE_QT_DLL = 1
|
2011-04-27 10:05:43 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
CONFIG(release, debug|release):DEFINES += QT_NO_DEBUG
|
2011-11-11 10:21:52 +00:00
|
|
|
contains(QT_CONFIG, force_asserts):DEFINES += QT_FORCE_ASSERTS
|
2011-04-27 10:05:43 +00:00
|
|
|
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
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-12-20 08:05:29 +00:00
|
|
|
qtestlib {
|
|
|
|
warning("CONFIG+=qtestlib is deprecated. Use QT+=testlib instead.")
|
|
|
|
QT += testlib
|
|
|
|
}
|
|
|
|
qdbus {
|
|
|
|
warning("CONFIG+=qdbus is deprecated. Use QT+=dbus instead.")
|
|
|
|
QT += dbus
|
|
|
|
}
|
|
|
|
help {
|
|
|
|
warning("CONFIG+=help is deprecated. Use QT+=help instead.")
|
|
|
|
QT += help-private # sic!
|
|
|
|
}
|
|
|
|
designer {
|
|
|
|
warning("CONFIG+=designer is deprecated. Use QT+=designer instead.")
|
|
|
|
QT += designer
|
|
|
|
}
|
|
|
|
uitools {
|
|
|
|
warning("CONFIG+=uitools is deprecated. Use QT+=uitools instead.")
|
|
|
|
QT += uitools
|
|
|
|
}
|
|
|
|
qaxcontainer {
|
|
|
|
warning("CONFIG+=qaxcontainer is deprecated. Use QT+=axcontainer instead.")
|
|
|
|
QT += axcontainer
|
|
|
|
}
|
|
|
|
qaxserver {
|
|
|
|
warning("CONFIG+=qaxserver is deprecated. Use QT+=axserver instead.")
|
|
|
|
QT += axserver
|
|
|
|
}
|
2012-12-10 13:56:29 +00:00
|
|
|
|
2012-12-20 08:05:29 +00:00
|
|
|
unset(using_privates)
|
|
|
|
qtAddModules(QT, LIBS)
|
|
|
|
qtAddModules(QT_PRIVATE, LIBS_PRIVATE)
|
2013-10-21 14:16:57 +00:00
|
|
|
!isEmpty(using_privates):!no_private_qt_headers_warning:if(!debug_and_release|!build_pass) {
|
2012-12-20 08:05:29 +00:00
|
|
|
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!")
|
|
|
|
}
|
2013-02-01 16:30:31 +00:00
|
|
|
qtAddRpathLink($$QT $$QT_PRIVATE)
|
2012-12-20 08:05:29 +00:00
|
|
|
|
|
|
|
wince*:static:gui {
|
|
|
|
QTLIB += qmenu_wce.res
|
|
|
|
}
|
|
|
|
|
2013-11-04 11:08:43 +00:00
|
|
|
qt_module_deps = $$QT $$QT_PRIVATE
|
|
|
|
qt_module_deps = $$replace(qt_module_deps, -private$, _private)
|
|
|
|
qt_module_deps = $$resolve_depends(qt_module_deps, "QT.")
|
2014-04-02 20:17:40 +00:00
|
|
|
|
|
|
|
# static builds: link qml import plugins into the app.
|
2013-11-04 11:08:43 +00:00
|
|
|
contains(qt_module_deps, qml): \
|
2013-10-18 11:26:16 +00:00
|
|
|
contains(QT_CONFIG, static):contains(TEMPLATE, .*app):!host_build:!no_import_scan {
|
2014-06-02 09:40:36 +00:00
|
|
|
!isEmpty(QTREPOS) {
|
|
|
|
for (qrep, QTREPOS): \
|
|
|
|
exists($$qrep/qml): \
|
|
|
|
QMLPATHS += $$qrep/qml
|
|
|
|
} else {
|
|
|
|
QMLPATHS += $$[QT_INSTALL_QML/get]
|
|
|
|
}
|
|
|
|
|
2013-09-10 14:25:32 +00:00
|
|
|
# run qmlimportscanner
|
2014-03-10 23:31:16 +00:00
|
|
|
qtPrepareTool(QMLIMPORTSCANNER, qmlimportscanner, _SYS)
|
2013-10-18 11:20:41 +00:00
|
|
|
for (QMLPATH, QMLPATHS): \
|
|
|
|
IMPORTPATHS += -importPath $$QMLPATH
|
|
|
|
|
2014-03-10 23:31:16 +00:00
|
|
|
#message(run $$QMLIMPORTSCANNER_SYS $$_PRO_FILE_PWD_ $$IMPORTPATHS)
|
|
|
|
JSON = $$system($$QMLIMPORTSCANNER_SYS $$_PRO_FILE_PWD_ $$IMPORTPATHS)
|
2013-09-10 14:25:32 +00:00
|
|
|
|
|
|
|
parseJson(JSON, IMPORTS)| error("Failed to parse qmlimportscanner output.")
|
|
|
|
|
|
|
|
!isEmpty(IMPORTS._KEYS_) {
|
|
|
|
# add import plugins to LIBS line
|
|
|
|
for (key, IMPORTS._KEYS_): {
|
|
|
|
PATH = $$eval(IMPORTS.$${key}.path)
|
|
|
|
PLUGIN = $$eval(IMPORTS.$${key}.plugin)
|
2013-11-01 14:21:45 +00:00
|
|
|
!isEmpty(PATH):!isEmpty(PLUGIN): LIBS *= -L$$PATH -l$${PLUGIN}$$qtPlatformTargetSuffix()
|
2013-09-10 14:25:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
# create qml_plugin_import.cpp
|
|
|
|
IMPORT_FILE_CONT = \
|
|
|
|
"// This file is autogenerated by qmake. It imports static plugin classes for" \
|
|
|
|
"// static plugins used by QML imports." \
|
|
|
|
"$${LITERAL_HASH}include <QtPlugin>"
|
|
|
|
for (key, IMPORTS._KEYS_) {
|
|
|
|
PLUGIN = $$eval(IMPORTS.$${key}.plugin)
|
|
|
|
CLASSNAME = $$eval(IMPORTS.$${key}.classname)
|
|
|
|
!isEmpty(PLUGIN) {
|
|
|
|
!isEmpty(CLASSNAME) {
|
|
|
|
!contains(ADDED_IMPORTS, $$PLUGIN) {
|
|
|
|
ADDED_IMPORTS += $$PLUGIN
|
|
|
|
IMPORT_FILE_CONT += "Q_IMPORT_PLUGIN($$CLASSNAME)"
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
error("Plugin $$PLUGIN is missing a classname entry, please add one to the qmldir file.")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
QML_IMPORT_CPP = $$OUT_PWD/$$lower($$basename(TARGET))_qml_plugin_import.cpp
|
|
|
|
write_file($$QML_IMPORT_CPP, IMPORT_FILE_CONT)|error("Aborting.")
|
|
|
|
SOURCES += $$QML_IMPORT_CPP
|
2014-06-25 08:44:54 +00:00
|
|
|
QMAKE_DISTCLEAN += $$QML_IMPORT_CPP
|
2013-09-10 14:25:32 +00:00
|
|
|
|
|
|
|
# copy qml files. this part is platform spesific.
|
2013-10-22 10:56:14 +00:00
|
|
|
mac {
|
|
|
|
osx {
|
|
|
|
# Note: user can override QMAKE_BUNDLE_QML from pro file to change target bundle path
|
|
|
|
isEmpty(QMAKE_QML_BUNDLE_PATH):QMAKE_QML_BUNDLE_PATH = "Resources/qt_qml"
|
|
|
|
qmlTargetPath = $$OUT_PWD/$${TARGET}.app/Contents/$$QMAKE_QML_BUNDLE_PATH
|
|
|
|
qtconfTargetPath = $$OUT_PWD/$${TARGET}.app/Contents/Resources/qt.conf
|
|
|
|
} else {
|
|
|
|
# iOS: flat bundle layout (no Contents/Resources)
|
|
|
|
isEmpty(QMAKE_QML_BUNDLE_PATH):QMAKE_QML_BUNDLE_PATH = "qt_qml"
|
|
|
|
qmlTargetPath = $CODESIGNING_FOLDER_PATH/$$QMAKE_QML_BUNDLE_PATH
|
|
|
|
qtconfTargetPath = $CODESIGNING_FOLDER_PATH/qt.conf
|
|
|
|
}
|
2013-09-10 14:25:32 +00:00
|
|
|
|
2013-10-22 10:56:14 +00:00
|
|
|
# set import path in qt.conf to point to the bundeled qml:
|
2013-09-10 14:25:32 +00:00
|
|
|
QT_CONF_CONTENTS = \
|
|
|
|
"[Paths]" \
|
2013-10-22 10:56:14 +00:00
|
|
|
"Imports = $$QMAKE_QML_BUNDLE_PATH" \
|
|
|
|
"Qml2Imports = $$QMAKE_QML_BUNDLE_PATH"
|
|
|
|
write_file("$$OUT_PWD/qt.conf", QT_CONF_CONTENTS)|error("Aborting.")
|
2013-09-10 14:25:32 +00:00
|
|
|
|
2013-10-22 10:56:14 +00:00
|
|
|
# write qt.conf and copy each qml import dir into the bundle.
|
|
|
|
# But strip away archives and other files that are not needed:
|
|
|
|
!isEmpty(QMAKE_POST_LINK): QMAKE_POST_LINK += ";"
|
|
|
|
QMAKE_POST_LINK += \
|
|
|
|
"cp $$OUT_PWD/qt.conf $$qtconfTargetPath; " \
|
|
|
|
"test -d $$qmlTargetPath && rm -r $$qmlTargetPath; " \
|
|
|
|
"mkdir -p $$qmlTargetPath && " \
|
|
|
|
"for p in $$QMLPATHS; do" \
|
|
|
|
"rsync -r --exclude='*.a' --exclude='*.prl' --exclude='*.qmltypes' "
|
|
|
|
macx-xcode: QMAKE_POST_LINK += "$p/ $$qmlTargetPath; done"
|
|
|
|
else: QMAKE_POST_LINK += "\$\$p/ $$qmlTargetPath; done"
|
2013-09-10 14:25:32 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-04-16 19:18:27 +00:00
|
|
|
!import_qpa_plugin {
|
|
|
|
warning("CONFIG-=import_qpa_plugin is deprecated. Use QTPLUGIN.platforms=- instead.")
|
|
|
|
QTPLUGIN.platforms = -
|
|
|
|
} else: qpa_minimal_plugin {
|
|
|
|
warning("CONFIG+=qpa_minimal_plugin is deprecated. Use QTPLUGIN.platforms=qminimal instead.")
|
|
|
|
QTPLUGIN.platforms = qminimal
|
|
|
|
}
|
|
|
|
|
2014-04-02 20:17:40 +00:00
|
|
|
contains(TEMPLATE, .*app) {
|
|
|
|
autoplugs =
|
|
|
|
for (qtmod, qt_module_deps) {
|
|
|
|
for (ptype, QT.$${qtmod}.plugin_types) {
|
|
|
|
isEmpty(QTPLUGIN.$$ptype) {
|
|
|
|
for (plug, QT_PLUGINS) {
|
|
|
|
equals(QT_PLUGIN.$${plug}.TYPE, $$ptype) {
|
|
|
|
for (dep, QT_PLUGIN.$${plug}.EXTENDS) {
|
|
|
|
!contains(qt_module_deps, $$dep) {
|
|
|
|
plug =
|
|
|
|
break()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
autoplugs += $$plug
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
plug = $$eval(QTPLUGIN.$$ptype)
|
|
|
|
!equals(plug, -): \
|
|
|
|
autoplugs += $$plug
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
manualplugs = $$QTPLUGIN
|
|
|
|
manualplugs -= $$autoplugs
|
|
|
|
QTPLUGIN -= $$manualplugs
|
|
|
|
!isEmpty(QTPLUGIN): \
|
|
|
|
warning("Redundant entries in QTPLUGIN: $$QTPLUGIN")
|
|
|
|
QTPLUGIN = $$manualplugs $$autoplugs
|
|
|
|
}
|
|
|
|
|
2012-12-20 08:05:29 +00:00
|
|
|
QT_PLUGIN_VERIFY = DEPLOYMENT_PLUGIN
|
2012-12-10 13:56:29 +00:00
|
|
|
contains(QT_CONFIG, static) {
|
|
|
|
QT_PLUGIN_VERIFY += QTPLUGIN
|
2012-12-20 08:05:29 +00:00
|
|
|
force_import_plugins|contains(TEMPLATE, .*app) {
|
2012-12-10 13:56:29 +00:00
|
|
|
import_plugins:!isEmpty(QTPLUGIN) {
|
|
|
|
IMPORT_FILE_CONT = \
|
|
|
|
"// This file is autogenerated by qmake. It imports static plugin classes for" \
|
|
|
|
"// static plugins specified using QTPLUGIN and QT_PLUGIN_CLASS.<plugin> variables." \
|
|
|
|
"$${LITERAL_HASH}include <QtPlugin>"
|
|
|
|
for(IMPORT_PLUG, $$list($$unique(QTPLUGIN))) {
|
|
|
|
PLUG_CLASS = $$eval(QT_PLUGIN.$${IMPORT_PLUG}.CLASS_NAME)
|
|
|
|
!isEmpty(PLUG_CLASS): \
|
|
|
|
IMPORT_FILE_CONT += "Q_IMPORT_PLUGIN($$PLUG_CLASS)"
|
|
|
|
else: \
|
|
|
|
warning("Plugin class name could not be determined for $$IMPORT_PLUG plugin.")
|
|
|
|
}
|
|
|
|
IMPORT_CPP = $$OUT_PWD/$$lower($$basename(TARGET))_plugin_import.cpp
|
|
|
|
write_file($$IMPORT_CPP, IMPORT_FILE_CONT)|error("Aborting.")
|
|
|
|
SOURCES += $$IMPORT_CPP
|
|
|
|
QMAKE_DISTCLEAN += $$IMPORT_CPP
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-04-27 10:05:43 +00:00
|
|
|
for(QT_CURRENT_VERIFY, $$list($$QT_PLUGIN_VERIFY)) {
|
|
|
|
for(QTPLUG, $$list($$lower($$unique($$QT_CURRENT_VERIFY)))) {
|
|
|
|
# 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.
|
2012-10-24 13:02:08 +00:00
|
|
|
QT_PLUGINPATH = $$eval(QT_PLUGIN.$${QTPLUG}.TYPE)
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
# Generate the plugin linker line
|
|
|
|
target_qt:isEqual(TARGET, QTPLUG) {
|
|
|
|
warning($$TARGET cannot have a QTPLUGIN of $$QTPLUG)
|
|
|
|
} else {
|
2012-09-20 10:17:30 +00:00
|
|
|
QT_LINKAGE = -l$${QTPLUG}$$qtPlatformTargetSuffix()
|
2011-04-27 10:05:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
# Only link against plugin in static builds
|
|
|
|
isEqual(QT_CURRENT_VERIFY, QTPLUGIN): {
|
2014-04-04 14:49:26 +00:00
|
|
|
!isEmpty(QT_PLUGINPATH) {
|
|
|
|
plugpath = $$eval(QT_PLUGIN.$${QTPLUG}.PATH)
|
|
|
|
isEmpty(plugpath): \
|
|
|
|
plugpath = $$[QT_INSTALL_PLUGINS/get]
|
|
|
|
LIBS *= -L$$plugpath/$$QT_PLUGINPATH
|
|
|
|
}
|
2011-04-27 10:05:43 +00:00
|
|
|
LIBS += $$QT_LINKAGE
|
|
|
|
# if the plugin is linked statically there is no need to deploy it
|
|
|
|
DEPLOYMENT_PLUGIN -= $$QT_CURRENT_VERIFY
|
|
|
|
}
|
2013-09-13 09:22:45 +00:00
|
|
|
isEqual(QT_CURRENT_VERIFY, DEPLOYMENT_PLUGIN):shared:if(wince*|winrt): {
|
2011-04-27 10:05:43 +00:00
|
|
|
QT_ITEM =
|
2013-02-15 17:15:22 +00:00
|
|
|
debug: QT_ITEM = $${QTPLUG}d4.dll
|
2011-04-27 10:05:43 +00:00
|
|
|
else: QT_ITEM = $${QTPLUG}4.dll
|
|
|
|
|
2012-03-22 11:40:00 +00:00
|
|
|
eval(qt_additional_plugin_$${QTPLUG}.files = $$[QT_INSTALL_PLUGINS/get]/$${QT_PLUGINPATH}/$${QT_ITEM})
|
2011-04-27 10:05:43 +00:00
|
|
|
eval(qt_additional_plugin_$${QTPLUG}.path = $${QT_PLUGINPATH})
|
|
|
|
|
|
|
|
DEPLOYMENT *= qt_additional_plugin_$${QTPLUG}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|