2012-04-16 12:13:12 +00:00
|
|
|
!build_pass {
|
|
|
|
|
|
|
|
QTDIR = $$[QT_HOST_PREFIX]
|
|
|
|
exists($$QTDIR/.qmake.cache) {
|
|
|
|
mod_component_base = $$QTDIR
|
|
|
|
mod_qmake_base = $$QTDIR
|
|
|
|
} else {
|
|
|
|
mod_component_base = $$MODULE_BASE_OUTDIR
|
|
|
|
mod_qmake_base = $$MODULE_QMAKE_OUTDIR
|
|
|
|
}
|
|
|
|
# Permit modules to enforce being built outside QTDIR.
|
|
|
|
force_independent: mod_component_base = $$MODULE_BASE_OUTDIR
|
|
|
|
|
2012-09-15 00:55:24 +00:00
|
|
|
isEmpty(MODULE_INSTALL_LIBS): MODULE_INSTALL_LIBS = $$[QT_INSTALL_LIBS/raw]
|
2012-08-09 13:02:44 +00:00
|
|
|
|
2012-04-16 12:13:12 +00:00
|
|
|
MODULE_FWD_PRI = $$mod_qmake_base/mkspecs/modules/qt_$${MODULE}.pri
|
|
|
|
|
2012-08-08 19:38:35 +00:00
|
|
|
# -rpath-link is used by the linker to find depedencies of dynamic
|
|
|
|
# libraries which were NOT specified on the command line.
|
|
|
|
# This means that .libs of each module's regular .depends (QT) don't
|
|
|
|
# need to be put there, as they appear on the linker line anyway.
|
|
|
|
# A module's QT_PRIVATE's .libs OTOH need to be put there.
|
|
|
|
# .depends_private (QT_FOR_PRIVATE) is somewhat special: if the privates
|
|
|
|
# are used, the libraries are explicitly linked. If not, their locations
|
|
|
|
# need to be put into -rpath-link. As QT_FOR_PRIVATE cannot in turn
|
|
|
|
# contain privates, they always end up in -rpath-link of dependant
|
|
|
|
# modules.
|
|
|
|
# For simplicity of use, each module's rpath list has all dependencies
|
|
|
|
# transitively resolved already.
|
|
|
|
pubqt = $$MODULE_DEPENDS $$QT_FOR_PRIVATE
|
|
|
|
pubdep = $$resolve_depends(pubqt, "QT.")
|
|
|
|
privqt = $$replace(QT_PRIVATE, -private$, )
|
|
|
|
privdep = $$resolve_depends(privqt, "QT.")
|
|
|
|
rpaths =
|
2012-08-13 15:01:38 +00:00
|
|
|
pluginpath =
|
2012-08-08 19:38:35 +00:00
|
|
|
alldep = $$pubdep $$privdep
|
2012-08-13 15:01:38 +00:00
|
|
|
for(dep, alldep) { # Inherit link-rpaths from all our dependencies
|
2012-08-08 19:38:35 +00:00
|
|
|
rpaths += $$eval(QT.$${dep}.rpath_link) $$eval(QT.$${dep}.rpath_link_private)
|
2012-08-13 15:01:38 +00:00
|
|
|
pluginpath += $$eval(QT.$${dep}.plugin_path) $$eval(QT.$${dep}.plugins)
|
|
|
|
}
|
2012-08-08 19:38:35 +00:00
|
|
|
privdep -= $$pubdep
|
|
|
|
for(dep, privdep): \ # Add our private dependencies' lib paths as new link-rpaths
|
|
|
|
rpaths += $$eval(QT.$${dep}.libs)
|
|
|
|
!isEmpty(rpaths) {
|
|
|
|
rpaths = $$unique(rpaths)
|
|
|
|
module_rpathlink = "QT.$${MODULE}.rpath_link = $$val_escape(rpaths)"
|
|
|
|
} else {
|
|
|
|
module_rpathlink =
|
|
|
|
}
|
|
|
|
rpaths_priv =
|
|
|
|
xtradep = $$resolve_depends(QT_FOR_PRIVATE, "QT.")
|
|
|
|
for(dep, xtradep): \ # Add our private API's dependencies' lib paths as new link-rpaths
|
|
|
|
rpaths_priv += $$eval(QT.$${dep}.libs)
|
|
|
|
rpaths_priv = $$unique(rpaths_priv)
|
|
|
|
rpaths_priv -= $$rpaths
|
|
|
|
!isEmpty(rpaths_priv) {
|
|
|
|
module_rpathlink_priv = "QT.$${MODULE}.rpath_link_private = $$val_escape(rpaths_priv)"
|
|
|
|
} else {
|
|
|
|
module_rpathlink_priv =
|
|
|
|
}
|
2012-08-13 15:01:38 +00:00
|
|
|
pluginpath = $$unique(pluginpath)
|
2012-08-08 19:38:35 +00:00
|
|
|
|
2012-04-16 12:13:12 +00:00
|
|
|
# Create a forwarding module .pri file
|
|
|
|
MODULE_FWD_PRI_CONT = \
|
|
|
|
"QT_MODULE_BASE = $$MODULE_BASE_DIR" \
|
|
|
|
"QT_MODULE_BIN_BASE = $$mod_component_base/bin" \
|
2012-07-10 19:35:39 +00:00
|
|
|
"QT_MODULE_INCLUDE_BASE = $$mod_component_base/include" \
|
2012-04-16 12:13:12 +00:00
|
|
|
"QT_MODULE_IMPORT_BASE = $$mod_component_base/imports" \
|
|
|
|
"QT_MODULE_LIB_BASE = $$mod_component_base/lib" \
|
|
|
|
"QT_MODULE_PLUGIN_BASE = $$mod_component_base/plugins" \
|
2012-08-08 19:38:35 +00:00
|
|
|
$$module_rpathlink \
|
|
|
|
$$module_rpathlink_priv \
|
2012-08-09 13:02:44 +00:00
|
|
|
"QT.$${MODULE}.rpath = $$MODULE_INSTALL_LIBS" \
|
2012-08-13 15:01:38 +00:00
|
|
|
"QT.$${MODULE}.plugin_path = $$val_escape(pluginpath)" \
|
2012-04-16 12:13:12 +00:00
|
|
|
"include($$MODULE_PRI)"
|
|
|
|
write_file($$MODULE_FWD_PRI, MODULE_FWD_PRI_CONT)|error("Aborting.")
|
|
|
|
touch($$MODULE_FWD_PRI, $$MODULE_PRI)
|
|
|
|
|
|
|
|
# Then, inject the new module into the current cache state
|
|
|
|
!contains(QMAKE_INTERNAL_INCLUDED_FILES, $$MODULE_PRI) { # before the actual include()!
|
|
|
|
added = $$MODULE_PRI $$MODULE_FWD_PRI
|
|
|
|
cache(QMAKE_INTERNAL_INCLUDED_FILES, add transient, added)
|
|
|
|
unset(added)
|
|
|
|
}
|
|
|
|
include($$MODULE_FWD_PRI)
|
|
|
|
for(var, $$list(VERSION MAJOR_VERSION MINOR_VERSION PATCH_VERSION \
|
2012-04-19 17:21:32 +00:00
|
|
|
name depends private_depends module_config CONFIG DEFINES sources \
|
2012-10-15 15:51:51 +00:00
|
|
|
includes private_includes bins libs plugins imports \
|
2012-04-16 12:13:12 +00:00
|
|
|
)):defined(QT.$${MODULE}.$$var, var):cache(QT.$${MODULE}.$$var, transient)
|
|
|
|
cache(QT_CONFIG, transient)
|
|
|
|
|
|
|
|
} # !build_pass
|
|
|
|
|
|
|
|
# Schedule the regular .pri file for installation
|
|
|
|
CONFIG += qt_install_module
|