summaryrefslogtreecommitdiffstats
path: root/mkspecs
diff options
context:
space:
mode:
authorMarius Storm-Olsen <marius.storm-olsen@nokia.com>2011-04-20 13:57:51 -0500
committerOlivier Goffart <olivier.goffart@nokia.com>2011-05-02 15:30:08 +0200
commit1287361f64c6d429535e65c8dd248a94dfc633d1 (patch)
treeb53e7cc3d3efb44513c97f257316bba9e69abbef /mkspecs
parent2e8b6dcb4a6fa8ff42e967eb5dc27a461e721858 (diff)
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.
Diffstat (limited to 'mkspecs')
-rw-r--r--mkspecs/features/designer.prf2
-rw-r--r--mkspecs/features/help.prf2
-rw-r--r--mkspecs/features/qt.prf18
-rw-r--r--mkspecs/features/qt_functions.prf24
4 files changed, 38 insertions, 8 deletions
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
+ # <module privates include path>/
+ # and <module privates include path>/<module name>
+ # since we have code using both #include <QtCore/private/foo> and #include <private/foo>
+ # 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)