From 738d5c7c85230c740a7e86cb66c452c5719cc7e8 Mon Sep 17 00:00:00 2001 From: Marius Storm-Olsen Date: Wed, 30 Mar 2011 11:59:54 -0500 Subject: Make sure we don't always pull in modules from installed mkspecs When building Qt, qmake should not pull in mkspecs from an installed version, as this will lead to incorrect paths for the current build. So, here we ensure only to pull in modules from there we detected the qconfig.pri, and ensure we still handle the QMAKEPATH case used by some. --- mkspecs/features/qt_config.prf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mkspecs') diff --git a/mkspecs/features/qt_config.prf b/mkspecs/features/qt_config.prf index 5afd82c84a..071bb6c237 100644 --- a/mkspecs/features/qt_config.prf +++ b/mkspecs/features/qt_config.prf @@ -12,7 +12,7 @@ isEmpty(QMAKE_QT_CONFIG)|!exists($$QMAKE_QT_CONFIG) { } else { debug(1, "Loaded .qconfig.pri from ($$QMAKE_QT_CONFIG)") for(dir, $$list($$unique($$list($$dirname(QMAKE_QT_CONFIG) \ - $$split($$list($$[QMAKE_MKSPECS]), $$DIRLIST_SEPARATOR))))) { + $$replace($$list($$split($$list($$(QMAKEPATH)), $$DIRLIST_SEPARATOR)), $, /mkspecs))))) { debug(1, "Loading modules from $${dir}") for(mod, $$list($$files($$dir/modules/qt_*.pri))) { # For installed Qt these paths will be common for all modules -- cgit v1.2.3 From 6319779bedcc590af165e2ed7d3f1ab74d4b2329 Mon Sep 17 00:00:00 2001 From: Marius Storm-Olsen Date: Fri, 1 Apr 2011 05:47:28 -0500 Subject: Add module.prf, and install MODULE_PRI for each module Output warning if not present --- mkspecs/features/module.prf | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 mkspecs/features/module.prf (limited to 'mkspecs') diff --git a/mkspecs/features/module.prf b/mkspecs/features/module.prf new file mode 100644 index 0000000000..248f7f516a --- /dev/null +++ b/mkspecs/features/module.prf @@ -0,0 +1,7 @@ +!isEmpty(MODULE_PRI) { + pritarget.path = $$[QT_INSTALL_DATA]/mkspecs/modules + pritarget.files = $$MODULE_PRI + INSTALLS = pritarget +} else { + warning("Project $$basename(_PRO_FILE_) is a module, but has not defined MODULE_PRI, which is required for Qt to expose the module to other projects") +} -- cgit v1.2.3 From 1287361f64c6d429535e65c8dd248a94dfc633d1 Mon Sep 17 00:00:00 2001 From: Marius Storm-Olsen Date: Wed, 20 Apr 2011 13:57:51 -0500 Subject: Move private headers into versioned subdirectory This will allow us to expose private headers in a controlled manner, and ensure that they are not used by accident. This also means that we internally will have to enable the private headers for the modules we wish to use in the project. --- mkspecs/features/designer.prf | 2 +- mkspecs/features/help.prf | 2 +- mkspecs/features/qt.prf | 18 +++++++++++++++++- mkspecs/features/qt_functions.prf | 24 +++++++++++++++++++----- 4 files changed, 38 insertions(+), 8 deletions(-) (limited to 'mkspecs') diff --git a/mkspecs/features/designer.prf b/mkspecs/features/designer.prf index fa40caab3f..63a7e76a34 100644 --- a/mkspecs/features/designer.prf +++ b/mkspecs/features/designer.prf @@ -4,4 +4,4 @@ qt:load(qt) plugin:DEFINES += QDESIGNER_EXPORT_WIDGETS -qtAddLibrary(QtDesigner) +qtAddLibrary(QtDesigner, true) diff --git a/mkspecs/features/help.prf b/mkspecs/features/help.prf index d8ba8c3537..c96ecae8fe 100644 --- a/mkspecs/features/help.prf +++ b/mkspecs/features/help.prf @@ -1,3 +1,3 @@ QT += xml sql -qtAddModule(help) +qtAddModule(help, true) diff --git a/mkspecs/features/qt.prf b/mkspecs/features/qt.prf index 21fdd38e70..61e1d575bc 100644 --- a/mkspecs/features/qt.prf +++ b/mkspecs/features/qt.prf @@ -131,7 +131,16 @@ QMAKE_LIBDIR += $$QMAKE_LIBDIR_QT QT = $$resolve_depends($$QT, "QT.") QT_DEPENDS= +unset(using_privates) for(QTLIB, $$list($$lower($$unique(QT)))) { + # Figure out if we're wanting to use the private headers of a module + contains(QTLIB, .*-private) { + QTLIB ~= s/-private// + use_private = UsePrivate + } else { + use_private = NoPrivate + } + isEmpty(QT.$${QTLIB}.name) { message("Warning: unknown QT module: $$QTLIB") next() @@ -141,14 +150,21 @@ for(QTLIB, $$list($$lower($$unique(QT)))) { warning($$TARGET cannot have a QT of $$QTLIB) next() } - qtAddModule($$QTLIB) + qtAddModule($$QTLIB, $$use_private) QT_DEPENDS += $$eval(QT.$${QTLIB}.depends) + isEqual(use_private, UsePrivate):using_privates = true } # add include paths for all .depends, since module/application might need f.ex. template specializations etc. QT_DEPENDS -= $$QT for(QTLIB, $$list($$lower($$unique(QT_DEPENDS)))):INCLUDEPATH += $$INCLUDEPATH $$eval(QT.$${QTLIB}.includes) +!isEmpty(using_privates):!no_private_qt_headers_warning:if(!debug_and_release|!build_pass) { + 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!") +} + qt_compat { !qt_compat_no_warning:QTDIR_build:warning(***USE of COMPAT inside of QTDIR!**) #just for us INCLUDEPATH *= $$QMAKE_INCDIR_QT/Qt diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf index b16c84864f..50a85d86ce 100644 --- a/mkspecs/features/qt_functions.prf +++ b/mkspecs/features/qt_functions.prf @@ -102,6 +102,16 @@ defineTest(qtAddModule) { INCLUDEPATH -= $$MODULE_INCLUDES INCLUDEPATH = $$MODULE_INCLUDES $$INCLUDEPATH + isEqual(2, UsePrivate) { # Tests function parameter 2 ($$2) being equal to 'UsePrivate' + # This adds both + # / + # and / + # since we have code using both #include and #include + # Both need to be supported with the new private includes structure + MODULE_INCLUDES_PRIVATES = $$eval(QT.$${1}.private_includes) + INCLUDEPATH -= $$MODULE_INCLUDES_PRIVATES $$MODULE_INCLUDES_PRIVATES/$$MODULE_NAME + INCLUDEPATH = $$MODULE_INCLUDES_PRIVATES $$MODULE_INCLUDES_PRIVATES/$$MODULE_NAME $$INCLUDEPATH + } unset(LINKAGE) mac { @@ -140,12 +150,16 @@ defineTest(qtAddModule) { } isEmpty(LINKAGE):LINKAGE = -l$${MODULE_NAME}$${QT_LIBINFIX} } - !isEmpty(QMAKE_LSB) { - QMAKE_LFLAGS *= --lsb-libpath=$$$$QMAKE_LIBDIR_QT - QMAKE_LFLAGS *= -L/opt/lsb/lib - QMAKE_LFLAGS *= --lsb-shared-libs=$${MODULE_NAME}$${QT_LIBINFIX} + # Only link to this module if a libs directory is set, else this is just a module + # to give access to sources or include files, and not for linking. + !isEmpty(MODULE_LIBS) { + !isEmpty(QMAKE_LSB) { + QMAKE_LFLAGS *= --lsb-libpath=$$$$QMAKE_LIBDIR_QT + QMAKE_LFLAGS *= -L/opt/lsb/lib + QMAKE_LFLAGS *= --lsb-shared-libs=$${MODULE_NAME}$${QT_LIBINFIX} + } + LIBS += $$LINKAGE } - LIBS += $$LINKAGE export(CONFIG) export(DEFINES) export(LIBS) -- cgit v1.2.3