generate fwd-pris in qt_module_config, not in syncqt
the forwarding pri is loaded even if it was still created by syncqt, so a top-level qmake -r will still catch it even in the future. Change-Id: I2e4b556cd06eb88be9ee378662a2e6e1bff67ad7 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
This commit is contained in:
parent
d31f4a560d
commit
a8ad1e77ba
@ -1232,7 +1232,7 @@ foreach my $lib (@modules_to_sync) {
|
||||
# create forwarding module pri in qtbase/mkspecs/modules
|
||||
if ($module_fwd) {
|
||||
my $modulepri = $modulepris{$lib};
|
||||
if (-e $modulepri) {
|
||||
if (defined $modulepri and -e $modulepri) {
|
||||
my $modulepriname = basename($modulepri);
|
||||
make_path($module_fwd, $lib, $verbose_level);
|
||||
my $moduleprifwd = "$module_fwd/$modulepriname";
|
||||
|
@ -12,6 +12,22 @@ isEmpty(MODULE):MODULE = $$section($$list($$basename(_PRO_FILE_)), ., 0, 0)
|
||||
isEmpty(TARGET):error("You must set TARGET before include()'ing $${_FILE_}")
|
||||
isEmpty(VERSION):VERSION = $$QT_VERSION
|
||||
|
||||
# Find the module's source root dir.
|
||||
MODULE_PROFILE_DIR = $$_PRO_FILE_PWD_
|
||||
for(ever) {
|
||||
exists($$MODULE_PROFILE_DIR/sync.profile):break()
|
||||
nmpri = $$dirname(MODULE_PROFILE_DIR)
|
||||
equals(nmpri, $$MODULE_PROFILE_DIR):error("No sync.profile found. This does not look like a Qt module source tree.")
|
||||
MODULE_PROFILE_DIR = $$nmpri
|
||||
unset(nmpri)
|
||||
}
|
||||
|
||||
isEmpty(MODULE_BASE_DIR): MODULE_BASE_DIR = $$MODULE_PROFILE_DIR
|
||||
MODULE_BASE_OUTDIR = $$shadowed($$MODULE_BASE_DIR)
|
||||
isEmpty(MODULE_QMAKE_OUTDIR): MODULE_QMAKE_OUTDIR = $$MODULE_BASE_OUTDIR
|
||||
|
||||
load(qt_module_fwdpri)
|
||||
|
||||
MODULE_INCLUDES = $$eval(QT.$${MODULE}.includes)
|
||||
MODULE_PRIVATE_INCLUDES = $$eval(QT.$${MODULE}.private_includes)
|
||||
INCLUDEPATH *= $$MODULE_PRIVATE_INCLUDES
|
||||
@ -103,7 +119,6 @@ aix-g++* {
|
||||
!static:PRL_EXPORT_DEFINES += QT_SHARED
|
||||
|
||||
#install directives
|
||||
CONFIG += qt_install_module
|
||||
CONFIG += qt_install_headers
|
||||
load(qt_installs)
|
||||
|
||||
|
52
mkspecs/features/qt_module_fwdpri.prf
Normal file
52
mkspecs/features/qt_module_fwdpri.prf
Normal file
@ -0,0 +1,52 @@
|
||||
!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
|
||||
|
||||
# This check will be removed soon. Weird indentation to avoid reindenting the code later.
|
||||
syncprofile = $$cat($$MODULE_PROFILE_DIR/sync.profile, lines)
|
||||
contains(syncprofile, "^%modulepris.*") {
|
||||
MODULE_FWD_PRI = $$mod_qmake_base/mkspecs/modules/$$replace(MODULE_PRI, ^.*/,)
|
||||
} else {
|
||||
|
||||
MODULE_FWD_PRI = $$mod_qmake_base/mkspecs/modules/qt_$${MODULE}.pri
|
||||
|
||||
# Create a forwarding module .pri file
|
||||
MODULE_FWD_PRI_CONT = \
|
||||
"QT_MODULE_BASE = $$MODULE_BASE_DIR" \
|
||||
"QT_MODULE_BIN_BASE = $$mod_component_base/bin" \
|
||||
"QT_MODULE_INCLUDE_BASE = $$MODULE_BASE_OUTDIR/include" \
|
||||
"QT_MODULE_IMPORT_BASE = $$mod_component_base/imports" \
|
||||
"QT_MODULE_LIB_BASE = $$mod_component_base/lib" \
|
||||
"QT_MODULE_PLUGIN_BASE = $$mod_component_base/plugins" \
|
||||
"include($$MODULE_PRI)"
|
||||
write_file($$MODULE_FWD_PRI, MODULE_FWD_PRI_CONT)|error("Aborting.")
|
||||
touch($$MODULE_FWD_PRI, $$MODULE_PRI)
|
||||
|
||||
} # create forwarding module pris
|
||||
|
||||
# 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 \
|
||||
name depends module_config CONFIG DEFINES sources \
|
||||
includes private_includes bins libs plugins imports \
|
||||
)):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
|
Loading…
Reference in New Issue
Block a user