Skip to content

Instantly share code, notes, and snippets.

Created November 9, 2011 18:12
Show Gist options
  • Select an option

  • Save anonymous/1352315 to your computer and use it in GitHub Desktop.

Select an option

Save anonymous/1352315 to your computer and use it in GitHub Desktop.
commit b9619f215be77cf79a08fce4a4736e5795becb13
Author: Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
Date: Wed Nov 9 18:57:33 2011 +0100
[Qt] Make sure headers.pri has the right relative paths for install
The install rules are generated from api.pri which lives in Source,
which means the paths in headers.pri, which is the basis for the
install rules, needs to be relative to Source as well.
We were also installing the headers from the forwarding headers
directory, which was wrong, as those headers contained relative paths.
We now install the actual headers, by using headers.pri as a basis.
https://bugs.webkit.org/show_bug.cgi?id=71697
diff --git a/Source/QtWebKit.pro b/Source/QtWebKit.pro
index 9c861d5..8fa5cdd 100644
--- a/Source/QtWebKit.pro
+++ b/Source/QtWebKit.pro
@@ -34,9 +34,14 @@ SUBDIRS += examples
win32-msvc*: command = $$command -windows
outdir = $$toSystemPath($${ROOT_BUILD_DIR})
- rootdir = $$toSystemPath($${ROOT_WEBKIT_DIR})
- fwheader_generator.commands = perl $${command} -outdir $${outdir} -separate-module $${TARGET}$${DIRLIST_SEPARATOR}$${rootdir}$${DIRLIST_SEPARATOR}$$toSystemPath(Source/WebKit/qt/Api)
+ # The module root has to be the same as directory of the pro-file that generates
+ # the install rules (api.pri), otherwise the relative paths in the generated
+ # headers.pri will be incorrect.
+ module_rootdir = $$toSystemPath($${_PRO_FILE_PWD_})
+
+ module = $${TARGET}$${DIRLIST_SEPARATOR}$${module_rootdir}$${DIRLIST_SEPARATOR}$$toSystemPath(WebKit/qt/Api)
+ fwheader_generator.commands = perl $${command} -outdir $${outdir} -separate-module $${module}
fwheader_generator.depends = $${syncqt}
variables = $$computeSubdirVariables(api)
diff --git a/Source/api.pri b/Source/api.pri
index 35a94e2..7afc99a 100644
--- a/Source/api.pri
+++ b/Source/api.pri
@@ -37,10 +37,6 @@ CONFIG(release) {
unix:contains(QT_CONFIG, reduce_relocations):CONFIG += bsymbolic_functions
}
-MODULE_FILE = $${ROOT_WEBKIT_DIR}/Tools/qmake/qt_webkit.pri
-include($${MODULE_FILE})
-VERSION = $${QT.webkit.MAJOR_VERSION}.$${QT.webkit.MINOR_VERSION}.$${QT.webkit.PATCH_VERSION}
-
!static: DEFINES += QT_MAKEDLL
SOURCES += \
@@ -164,13 +160,24 @@ contains(CONFIG, texmap) {
DEFINES += WTF_USE_TEXTURE_MAPPER=1
}
-modulefile.files = $${MODULE_FILE}
+
+# ------------- Install rules -------------
+
+modulefile.files = $${ROOT_WEBKIT_DIR}/Tools/qmake/qt_webkit.pri
mkspecs = $$[QMAKE_MKSPECS]
mkspecs = $$split(mkspecs, :)
modulefile.path = $$last(mkspecs)/modules
INSTALLS += modulefile
-headers.files = $${ROOT_BUILD_DIR}/include/$${TARGET}/*
+include($$first(modulefile.files))
+VERSION = $${QT.webkit.VERSION}
+
+# Syncqt has already run at this point, so we can use headers.pri
+# as a basis for our install-rules
+HEADERS_PRI = $${ROOT_BUILD_DIR}/include/$$TARGET/headers.pri
+!include($$HEADERS_PRI): error(Failed to resolve install headers)
+
+headers.files = $$SYNCQT.HEADER_FILES $$SYNCQT.HEADER_CLASSES
!isEmpty(INSTALL_HEADERS): headers.path = $$INSTALL_HEADERS/$${TARGET}
else: headers.path = $$[QT_INSTALL_HEADERS]/$${TARGET}
INSTALLS += headers
@@ -203,7 +210,7 @@ mac {
# For debug_and_release configs, only copy headers in release
!debug_and_release|if(build_pass:CONFIG(release, debug|release)) {
FRAMEWORK_HEADERS.version = Versions
- FRAMEWORK_HEADERS.files = $$files($$headers.files, false)
+ FRAMEWORK_HEADERS.files = $${headers.files}
FRAMEWORK_HEADERS.path = Headers
QMAKE_BUNDLE_DATA += FRAMEWORK_HEADERS
}
diff --git a/sync.profile b/sync.profile
index 953027b..b5ac45e 100644
--- a/sync.profile
+++ b/sync.profile
@@ -1,8 +1,10 @@
%modules = ( # path to module name map
- "QtWebKit" => "$basedir"
+ # Has to be the same directory as the pro file that generates install rules,
+ # otherwise the relative paths in headers.pri will not be correct.
+ "QtWebKit" => "$basedir/Source"
);
%moduleheaders = ( # restrict the module headers to those found in relative path
- "QtWebKit" => "Source/WebKit/qt/Api;Source/WebKit2/UIProcess/API/qt",
+ "QtWebKit" => "WebKit/qt/Api;WebKit2/UIProcess/API/qt",
);
%classnames = (
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment