1 # -------------------------------------------------------------------
2 # Project file for the QtWebKit C++ APIs
4 # See 'Tools/qmake/README' for an overview of the build system
5 # -------------------------------------------------------------------
10 WEBKIT_DESTDIR = $${ROOT_BUILD_DIR}/lib
13 # Use Qt5's module system
16 MODULE_PRI = ../Tools/qmake/qt_webkit.pri
18 # ---------------- Custom developer-build handling -------------------
20 # The assumption for Qt developer builds is that the module file
21 # will be put into qtbase/mkspecs/modules, and the libraries into
22 # qtbase/lib, with rpath/install_name set to the Qt lib dir.
24 # For WebKit we don't want that behavior for the libraries, as we want
25 # them to be self-contained in the WebKit build dir.
27 CONFIG += force_independent
29 BASE_TARGET = $$TARGET
31 load(qt_module_config)
33 # Make sure the module config doesn't override our preferred build config.
34 debug_and_release:if(!debug|!release) {
35 # Removing debug_and_release causes issues with lib suffixes when building debug on Windows.
36 # Work around it by only removing build_all, and still create the Makefiles for both configurations.
37 win32*: CONFIG -= build_all
38 else: CONFIG -= debug_and_release
41 # Allow doing a debug-only build of WebKit (not supported by Qt)
42 macx:!debug_and_release:debug: TARGET = $$BASE_TARGET
44 # Make sure the install_name of the QtWebKit library point to webkit
46 # We do our own absolute path so that we can trick qmake into
47 # using the webkit build path instead of the Qt install path.
48 CONFIG -= absolute_library_soname
49 QMAKE_LFLAGS_SONAME = $$QMAKE_LFLAGS_SONAME$$WEBKIT_DESTDIR/
51 !debug_and_release|build_pass {
52 # We also have to make sure the install_name is correct when
53 # the library is installed.
54 change_install_name.depends = install_target
56 # The install rules generated by qmake for frameworks are busted in
57 # that both the debug and the release makefile copy QtWebKit.framework
58 # into the install dir, so whatever changes we did to the release library
59 # will get overwritten when the debug library is installed. We work around
60 # that by running install_name on both, for both configs.
61 change_install_name.commands = framework_dir=\$\$(dirname $(TARGETD)); \
62 for file in \$\$(ls $$[QT_INSTALL_LIBS]/\$\$framework_dir/$$BASE_TARGET*); do \
63 install_name_tool -id \$\$file \$\$file; \
65 default_install_target.target = install
66 default_install_target.depends += change_install_name
68 QMAKE_EXTRA_TARGETS += change_install_name default_install_target
72 VERSION = $$QT_VERSION
73 DESTDIR = $$WEBKIT_DESTDIR
76 runSyncQt() # Generate forwarding headers for the QtWebKit API
80 WEBKIT += javascriptcore
87 # Ensure that changes to the WebKit1 and WebKit2 API will trigger a qmake of this
88 # file, which in turn runs syncqt to update the forwarding headers.
89 QMAKE_INTERNAL_INCLUDED_FILES *= WebKit2/Target.pri
90 QMAKE_INTERNAL_INCLUDED_FILES *= WebKit/WebKit1.pro
93 !no_webkit1: WEBKIT += webkit1
95 # ------------- Install rules -------------
98 # Install rules handled by Qt's module system
100 # For Qt4 we have to set up install rules manually
102 # Syncqt has already run at this point, so we can use headers.pri
103 # as a basis for our install-rules
104 HEADERS_PRI = $${ROOT_BUILD_DIR}/include/$${QT.webkit.name}/headers.pri
105 !include($$HEADERS_PRI): error(Failed to resolve install headers)
107 headers.files = $$SYNCQT.HEADER_FILES $$SYNCQT.HEADER_CLASSES
108 !isEmpty(INSTALL_HEADERS): headers.path = $$INSTALL_HEADERS/$${TARGET}
109 else: headers.path = $$[QT_INSTALL_HEADERS]/$${TARGET}
112 !isEmpty(INSTALL_LIBS): target.path = $$INSTALL_LIBS
113 else: target.path = $$[QT_INSTALL_LIBS]
117 CONFIG += create_pc create_prl
118 QMAKE_PKGCONFIG_LIBDIR = $$target.path
119 QMAKE_PKGCONFIG_INCDIR = $$headers.path
120 QMAKE_PKGCONFIG_DESTDIR = pkgconfig
121 lib_replace.match = $$re_escape($$DESTDIR)
122 lib_replace.replace = $$[QT_INSTALL_LIBS]
123 QMAKE_PKGCONFIG_INSTALL_REPLACE += lib_replace
127 !static:contains(QT_CONFIG, qt_framework) {
128 # Build QtWebKit as a framework, to match how Qt was built
129 CONFIG += lib_bundle qt_no_framework_direct_includes qt_framework
131 # For debug_and_release configs, only copy headers in release
132 !debug_and_release|if(build_pass:CONFIG(release, debug|release)) {
133 FRAMEWORK_HEADERS.version = Versions
134 FRAMEWORK_HEADERS.files = $${headers.files}
135 FRAMEWORK_HEADERS.path = Headers
136 QMAKE_BUNDLE_DATA += FRAMEWORK_HEADERS
140 QMAKE_LFLAGS_SONAME = "$${QMAKE_LFLAGS_SONAME}$${DESTDIR}$${QMAKE_DIR_SEP}"