make it possible to override the basename of module config files
using qt$$MODULE isn't enough if the module is composed of submodules which need the final module's headers, because that would require two modules having the same module .pri file. the first thought to fix this was to just use $$lower($$TARGET), but that breaks for testlib (QtTest). while the config file name isn't public api, it's included by a public header, so changing it is risky. so instead stay with the original pattern, but make it explicitly overrideable. Change-Id: I758c46ed403620620d577ae16866ce751271b63e Reviewed-by: Michal Klocek <michal.klocek@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
This commit is contained in:
parent
6c5c1a562c
commit
95b0e4c956
@ -13,8 +13,9 @@ isEmpty(MODULE):MODULE = $$section($$list($$basename(_PRO_FILE_)), ., 0, 0)
|
|||||||
isEmpty(VERSION): VERSION = $$MODULE_VERSION
|
isEmpty(VERSION): VERSION = $$MODULE_VERSION
|
||||||
isEmpty(VERSION): error("Module does not define version.")
|
isEmpty(VERSION): error("Module does not define version.")
|
||||||
|
|
||||||
exists($$OUT_PWD/qt$${MODULE}-config.pri) {
|
isEmpty(MODULE_CFG_FILE): MODULE_CFG_FILE = qt$${MODULE}-config
|
||||||
include($$OUT_PWD/qt$${MODULE}-config.pri)
|
exists($$OUT_PWD/$${MODULE_CFG_FILE}.pri) {
|
||||||
|
include($$OUT_PWD/$${MODULE_CFG_FILE}.pri)
|
||||||
CONFIG += generated_privates
|
CONFIG += generated_privates
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -123,13 +123,14 @@ alien_syncqt: return()
|
|||||||
|
|
||||||
MODULE_INC_OUTDIR = $$MODULE_BASE_OUTDIR/include/$$MODULE_INCNAME
|
MODULE_INC_OUTDIR = $$MODULE_BASE_OUTDIR/include/$$MODULE_INCNAME
|
||||||
|
|
||||||
exists($$OUT_PWD/qt$${MODULE}-config.h) {
|
isEmpty(MODULE_CFG_FILE): MODULE_CFG_FILE = qt$${MODULE}-config
|
||||||
|
exists($$OUT_PWD/$${MODULE_CFG_FILE}.h) {
|
||||||
fwd_rel = $$relative_path($$OUT_PWD, $$MODULE_INC_OUTDIR)
|
fwd_rel = $$relative_path($$OUT_PWD, $$MODULE_INC_OUTDIR)
|
||||||
SYNCQT.INJECTIONS += \
|
SYNCQT.INJECTIONS += \
|
||||||
$$fwd_rel/qt$${MODULE}-config.h:qt$${MODULE}-config.h \
|
$$fwd_rel/$${MODULE_CFG_FILE}.h:$${MODULE_CFG_FILE}.h \
|
||||||
$$fwd_rel/qt$${MODULE}-config_p.h:$$MODULE_VERSION/$$MODULE_INCNAME/private/qt$${MODULE}-config_p.h
|
$$fwd_rel/$${MODULE_CFG_FILE}_p.h:$$MODULE_VERSION/$$MODULE_INCNAME/private/$${MODULE_CFG_FILE}_p.h
|
||||||
SYNCQT.INJECTED_HEADER_FILES += $$OUT_PWD/qt$${MODULE}-config.h
|
SYNCQT.INJECTED_HEADER_FILES += $$OUT_PWD/$${MODULE_CFG_FILE}.h
|
||||||
SYNCQT.INJECTED_PRIVATE_HEADER_FILES += $$OUT_PWD/qt$${MODULE}-config_p.h
|
SYNCQT.INJECTED_PRIVATE_HEADER_FILES += $$OUT_PWD/$${MODULE_CFG_FILE}_p.h
|
||||||
}
|
}
|
||||||
|
|
||||||
for (injection, SYNCQT.INJECTIONS) {
|
for (injection, SYNCQT.INJECTIONS) {
|
||||||
|
Loading…
Reference in New Issue
Block a user