1 # -------------------------------------------------------------------
2 # QtWebKit defaults for qmake. These rules are parsed before the
5 # See 'Tools/qmake/README' for an overview of the build system
6 # -------------------------------------------------------------------
10 # Derived sources often need QMAKE_MOC
14 # FIXME: In this case we probably want to exit early so that we
15 # don't load all of the custom build tweaks needlessly.
16 pro_file = $$_PRO_FILE_ # Checking the variable directly does not work
17 isEmpty(pro_file): CONFIG += recursive_include
19 # We default to release builds
25 # Resolve root directories for source and build
26 ROOT_WEBKIT_DIR = $$replace(IN_PWD, /Tools/qmake/mkspecs/features$,)
27 WEBKIT_SUBDIR = $$replace(_PRO_FILE_PWD_, $${ROOT_WEBKIT_DIR},)
28 ROOT_BUILD_DIR = $$replace(OUT_PWD, $${WEBKIT_SUBDIR}$,)
30 # We want the QtWebKit API forwarding includes to live in the root build dir,
31 # except when we are running the config.tests in Tools/qmake.
32 pro_file_name = $$basename(_PRO_FILE_)
33 !equals(pro_file_name, configure.pro): QMAKE_SYNCQT_OUTDIR = $$ROOT_BUILD_DIR
35 # Load Qt's defaults after we've resolved the build directory. This will also
36 # run syncqt if there is a sync.profile in the $$_PRO_FILE_PWD_. We never want
37 # to enable Qt's concept of a developer-build, since we take care of installing
38 # our own module file. See api.pri for details about how we utilize this.
40 QTDIR=no-developer-build-please
44 # Load results of config tests (only supported in Qt 5)
45 haveQt(5): include($${ROOT_BUILD_DIR}/Tools/qmake/.qmake.cache, , true)
47 unix:contains(config_test_gccdepends, yes) {
48 # We have a compiler that supports the -MD option (and neither
49 # teambuilder nor icecream is messing up the .d file output).
50 CONFIG += GNUmake gcc_MD_depends
53 equals(OUT_PWD, $${ROOT_BUILD_DIR}) {
54 !recursive_include:CONFIG += root_project_file
55 BUILD_ROOT_RELATIVE_TO_OUT_PWD = .
57 subdir_parts = $$replace(OUT_PWD, ^$${ROOT_BUILD_DIR}$${QMAKE_DIR_SEP},)
58 subdir_parts = $$split(subdir_parts, $${QMAKE_DIR_SEP})
59 for(subdir, subdir_parts) {
60 BUILD_ROOT_RELATIVE_TO_OUT_PWD += ..
62 BUILD_ROOT_RELATIVE_TO_OUT_PWD = $$join(BUILD_ROOT_RELATIVE_TO_OUT_PWD, $${QMAKE_DIR_SEP})
65 # Try to detect if we're running under Windows cmd.exe or not
67 pwd = $$(PWD) # Normally empty for cmd.exe
68 pwd_starts_with_slash = $$find(pwd, ^/)
69 isEmpty(pwd_starts_with_slash): CONFIG += win_cmd_shell
72 # Make sure QMAKEPATH is set for recursive targets
73 win_cmd_shell: QMAKE_QMAKE = \(set QMAKEPATH=$$(QMAKEPATH)\) && $$QMAKE_QMAKE
74 else: QMAKE_QMAKE = QMAKEPATH=$$(QMAKEPATH) $$QMAKE_QMAKE
76 # Default location of generated sources
77 GENERATED_SOURCES_DESTDIR = generated
80 DOUBLE_ESCAPED_QUOTE = ""
86 DOUBLE_ESCAPED_QUOTE = "\\\'"
89 MAKEFILE_NOOP_COMMAND = @echo -n
90 win32-msvc*: MAKEFILE_NOOP_COMMAND = @echo >NUL
92 # Set up a default python version
93 scratchbox: PYTHON = python2.6
96 !haveQt(4, 8):!haveQt(5):!recursive_include: error("Building WebKit with Qt versions older than 4.8 is not supported.")
98 !haveQt(5):!no_webkit2 {
100 message("Building WebKit2 with Qt versions older than 5.0 is not supported. Disabling WebKit2.")
101 message("Read http://www.mail-archive.com/webkit-qt@lists.webkit.org/msg01674.html for more information.")
107 isEmpty(QT.widgets.name)|isEmpty(QT.printsupport.name) {
108 root_project_file: message("WebKit1 requires the QtWidgets and QtPrintSupport modules. Disabling WebKit1.")
113 # We use private_tests to detect developer build, since the destdir will
114 # always be our webkit build dir. This might change as configure changes.
115 contains(QT_CONFIG, private_tests): CONFIG += qt_developer_build
118 # Qt5 will automatically load the module files for us, but for Qt4
119 # we have to do it manually so that the various QT.webkit.foo names
121 include($${ROOT_WEBKIT_DIR}/Tools/qmake/qt_webkit.pri)
124 # Set some defaults for specific platforms
125 CONFIG += include_webinspector