1 # Include file to make it easy to include WebKit into Qt projects
5 CONFIG(debug, debug|release) {
6 OUTPUT_DIR=$$PWD/WebKitBuild/Debug
8 OUTPUT_DIR=$$PWD/WebKitBuild/Release
12 DEFINES += BUILDING_QT__=1
14 win32-msvc*: INCLUDEPATH += $$PWD/JavaScriptCore/os-win32
19 QMAKE_LIBDIR = $$OUTPUT_DIR/lib $$QMAKE_LIBDIR
20 mac:!static:contains(QT_CONFIG, qt_framework):!CONFIG(webkit_no_framework) {
21 LIBS += -framework QtWebKit
22 QMAKE_FRAMEWORKPATH = $$OUTPUT_DIR/lib $$QMAKE_FRAMEWORKPATH
25 LIBS += -lQtWebKit$${QT_MAJOR_VERSION}
31 DEPENDPATH += $$PWD/WebKit/qt/Api
34 DEFINES += USE_SYSTEM_MALLOC
35 CONFIG(release, debug|release) {
40 INCLUDEPATH += $$PWD/WebKit/qt/Api
43 # For builds inside Qt we interpret the output rule and the input of each extra compiler manually
44 # and add the resulting sources to the SOURCES variable, because the build inside Qt contains already
45 # all the generated files. We do not need to generate any extra compiler rules in that case.
47 # In addition this function adds a new target called 'generated_files' that allows manually calling
48 # all the extra compilers to generate all the necessary files for the build using 'make generated_files'
50 defineTest(addExtraCompiler) {
52 outputRule = $$eval($${1}.output)
53 outVariable = $$eval($${1}.variable_out)
54 !isEqual(outVariable,GENERATED_SOURCES):return(true)
56 input = $$eval($${1}.input)
57 input = $$eval($$input)
60 base = $$basename(file)
62 newfile=$$replace(outputRule,\\$\\{QMAKE_FILE_BASE\\},$$base)
68 QMAKE_EXTRA_COMPILERS += $$1
69 generated_files.depends += compiler_$${1}_make_all
70 export(QMAKE_EXTRA_COMPILERS)
71 export(generated_files.depends)
76 defineTest(addExtraCompilerWithHeader) {
79 eval(headerFile = $${2})
81 eval($${1}_header.output = $$eval($${1}.output))
82 eval($${1}_header.output ~= s/\.cpp/.h/)
83 eval($${1}_header.output ~= s/\.c/.h/)
85 eval($${1}_header.output = $$headerFile)
88 eval($${1}_header.input = $$eval($${1}.input))
89 eval($${1}_header.commands = @echo -n '')
90 eval($${1}_header.depends = compiler_$${1}_make_all)
91 eval($${1}_header.variable_out = GENERATED_FILES)
93 export($${1}_header.output)
94 export($${1}_header.input)
95 export($${1}_header.commands)
96 export($${1}_header.depends)
97 export($${1}_header.variable_out)
99 !CONFIG(QTDIR_build): QMAKE_EXTRA_COMPILERS += $${1}_header
101 export(QMAKE_EXTRA_COMPILERS)
102 export(generated_files.depends)