redo include path logic for pre-generated headers

make the include dir in the source tree the "main" include path, as
that's where the majority of the headers is. then selectively add the
shadowed dirs.

Change-Id: I03ad13cfcf77175c141b94d41b1221740d851faf
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
This commit is contained in:
Oswald Buddenhagen 2013-06-07 16:23:25 +02:00 committed by The Qt Project
parent f3331e14e6
commit 4fd568fa06
3 changed files with 37 additions and 19 deletions

View File

@ -10,8 +10,17 @@
#
load(qt_build_paths)
# Pre-generated headers in the source tree and
# - shadow build or
# - non-shadow non-prefix build of a module which is not qtbase (because the build-time
# generated headers all end up in qtbase).
!git_build:if(!equals(_PRO_FILE_PWD_, $$OUT_PWD) \
|if(!prefix_build:!equals(MODULE_BASE_INDIR, $$[QT_HOST_PREFIX]))): \
CONFIG += split_incpath
force_independent|split_incpath: \
CONFIG += need_fwd_pri
MODULE_FWD_PRI = $$MODULE_QMAKE_OUTDIR/mkspecs/modules/qt_lib_$${MODULE}.pri
force_independent: \
need_fwd_pri: \
MODULE_PRI = $$MODULE_QMAKE_OUTDIR/mkspecs/modules-inst/qt_lib_$${MODULE}.pri
else: \
MODULE_PRI = $$MODULE_FWD_PRI
@ -56,20 +65,22 @@ else: \
MODULE_PRIVATE_INCLUDES = \$\$QT_MODULE_INCLUDE_BASE/$$MODULE_INCNAME/$$VERSION \
\$\$QT_MODULE_INCLUDE_BASE/$$MODULE_INCNAME/$$VERSION/$$MODULE_INCNAME
}
split_incpath: \
MODULE_SHADOW_INCLUDES = $$replace(MODULE_INCLUDES, ^\\\$\\\$QT_MODULE_INCLUDE_BASE, \
$$MODULE_BASE_OUTDIR/include)
MODULE_INCLUDES += $$MODULE_AUX_INCLUDES
MODULE_PRIVATE_INCLUDES += $$MODULE_PRIVATE_AUX_INCLUDES
!git_build:if(!equals(_PRO_FILE_PWD_, $$OUT_PWD) \
|if(!prefix_build:!equals(MODULE_BASE_DIR, $$[QT_HOST_PREFIX]))) {
pub_inc = $$replace(MODULE_INCLUDES, ^\\\$\\\$QT_MODULE_INCLUDE_BASE, $$MODULE_BASE_DIR/include)
priv_inc = $$replace(MODULE_PRIVATE_INCLUDES, ^\\\$\\\$QT_MODULE_INCLUDE_BASE, $$MODULE_BASE_DIR/include)
force_independent {
MODULE_FWD_PRI_CONT_SUFFIX = \
"QT.$${MODULE}.includes += $$pub_inc" \
"QT.$${MODULE}.private_includes = $$priv_inc"
} else {
MODULE_INCLUDES += $$pub_inc
MODULE_PRIVATE_INCLUDES = $$priv_inc
}
internal_module {
MODULE_PRIVATE_INCLUDES = $$MODULE_INCLUDES $$MODULE_PRIVATE_INCLUDES
MODULE_INCLUDES =
MODULE_PRIVATE_SHADOW_INCLUDES = $$MODULE_SHADOW_INCLUDES
MODULE_SHADOW_INCLUDES =
}
split_incpath {
!isEmpty(MODULE_SHADOW_INCLUDES): \
MODULE_FWD_PRI_CONT_SUFFIX += "QT.$${MODULE}.includes += $$MODULE_SHADOW_INCLUDES"
!isEmpty(MODULE_PRIVATE_SHADOW_INCLUDES): \
MODULE_FWD_PRI_CONT_SUFFIX += "QT.$${MODULE}.private_includes += $$MODULE_PRIVATE_SHADOW_INCLUDES"
}
MODULE_PRI_CONT = \
"QT.$${MODULE}.VERSION = $${VERSION}" \
@ -100,12 +111,17 @@ else: \
write_file($$MODULE_PRI, MODULE_PRI_CONT)|error("Aborting.")
MODULE_PRI_FILES = $$MODULE_PRI
force_independent {
need_fwd_pri {
split_incpath: \
MODULE_BASE_INCDIR = $$MODULE_BASE_INDIR
else: \
MODULE_BASE_INCDIR = $$MODULE_BASE_OUTDIR
# Create a forwarding module .pri file
MODULE_FWD_PRI_CONT = \
"QT_MODULE_BIN_BASE = $$MODULE_BASE_OUTDIR/bin" \
"QT_MODULE_INCLUDE_BASE = $$MODULE_BASE_OUTDIR/include" \
"QT_MODULE_INCLUDE_BASE = $$MODULE_BASE_INCDIR/include" \
"QT_MODULE_IMPORT_BASE = $$MODULE_BASE_OUTDIR/imports" \
"QT_MODULE_QML_BASE = $$MODULE_BASE_OUTDIR/qml" \
"QT_MODULE_LIB_BASE = $$MODULE_BASE_OUTDIR/lib" \
@ -118,7 +134,7 @@ else: \
touch($$MODULE_FWD_PRI, $$MODULE_PRI)
MODULE_PRI_FILES += $$MODULE_FWD_PRI
} else { # prefix_build
} else {
# This is needed for the direct include() below. Mirrors qt_config.prf
QT_MODULE_BIN_BASE = $$[QT_INSTALL_BINS]

View File

@ -7,8 +7,9 @@ CONFIG += no_module_headers internal_module force_bootstrap
DEFINES += \
QT_NO_CAST_FROM_ASCII
MODULE_INCLUDES = \
\$\$QT_MODULE_INCLUDE_BASE/QtDBus
MODULE_PRIVATE_INCLUDES = \
\$\$QT_MODULE_INCLUDE_BASE/QtDBus \
\$\$QT_MODULE_INCLUDE_BASE/QtDBus/$$QT_VERSION \
\$\$QT_MODULE_INCLUDE_BASE/QtDBus/$$QT_VERSION/QtDBus

View File

@ -30,12 +30,13 @@ DEFINES += \
DEFINES -= QT_EVAL
MODULE_PRIVATE_INCLUDES = \
MODULE_INCLUDES = \
\$\$QT_MODULE_INCLUDE_BASE \
\$\$QT_MODULE_INCLUDE_BASE/QtCore \
\$\$QT_MODULE_INCLUDE_BASE/QtXml
MODULE_PRIVATE_INCLUDES = \
\$\$QT_MODULE_INCLUDE_BASE/QtCore/$$QT_VERSION \
\$\$QT_MODULE_INCLUDE_BASE/QtCore/$$QT_VERSION/QtCore \
\$\$QT_MODULE_INCLUDE_BASE/QtXml \
\$\$QT_MODULE_INCLUDE_BASE/QtXml/$$QT_VERSION \
\$\$QT_MODULE_INCLUDE_BASE/QtXml/$$QT_VERSION/QtXml