Re-apply change 353dcfd307853da289fdd245410e2e07358624a0 by Friedemann Kleint
[qt-netbsd.git] / src / 3rdparty / webkit / WebKit.pri
blob73a5e5c9adbf64753d5becb62d5a7c069847c001
1 # Include file to make it easy to include WebKit into Qt projects
4 isEmpty(OUTPUT_DIR) {
5     CONFIG(debug, debug|release) {
6         OUTPUT_DIR=$$PWD/WebKitBuild/Debug
7     } else { # Release
8         OUTPUT_DIR=$$PWD/WebKitBuild/Release
9     }
12 DEFINES += BUILDING_QT__=1
13 building-libs {
14     win32-msvc*: INCLUDEPATH += $$PWD/JavaScriptCore/os-win32
15 } else {
16     CONFIG(QTDIR_build) {
17         QT += webkit
18     } else {
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
23         } else {
24             LIBS += -lQtWebKit
25         }
26     }
27     DEPENDPATH += $$PWD/WebKit/qt/Api
30 DEFINES += USE_SYSTEM_MALLOC
31 CONFIG(release, debug|release) {
32     DEFINES += NDEBUG
35 BASE_DIR = $$PWD
36 INCLUDEPATH += $$PWD/WebKit/qt/Api
39 # For builds inside Qt we interpret the output rule and the input of each extra compiler manually
40 # and add the resulting sources to the SOURCES variable, because the build inside Qt contains already
41 # all the generated files. We do not need to generate any extra compiler rules in that case.
43 # In addition this function adds a new target called 'generated_files' that allows manually calling
44 # all the extra compilers to generate all the necessary files for the build using 'make generated_files'
46 defineTest(addExtraCompiler) {
47     CONFIG(QTDIR_build) {
48         outputRule = $$eval($${1}.output)
49         outVariable = $$eval($${1}.variable_out)
50         !isEqual(outVariable,GENERATED_SOURCES):return(true)
52         input = $$eval($${1}.input)
53         input = $$eval($$input)
55         for(file,input) {
56             base = $$basename(file)
57             base ~= s/\..+//
58             newfile=$$replace(outputRule,\\$\\{QMAKE_FILE_BASE\\},$$base)
59             SOURCES += $$newfile
60         }
62         export(SOURCES)
63     } else {
64         QMAKE_EXTRA_COMPILERS += $$1
65         generated_files.depends += compiler_$${1}_make_all
66         export(QMAKE_EXTRA_COMPILERS)
67         export(generated_files.depends)
68     }
69     return(true)
72 defineTest(addExtraCompilerWithHeader) {
73     addExtraCompiler($$1)
75     eval(headerFile = $${2})
76     isEmpty(headerFile) {
77         eval($${1}_header.output = $$eval($${1}.output))
78         eval($${1}_header.output ~= s/\.cpp/.h/)
79         eval($${1}_header.output ~= s/\.c/.h/)
80     } else {
81         eval($${1}_header.output = $$headerFile)
82     }
84     eval($${1}_header.input = $$eval($${1}.input))
85     eval($${1}_header.commands = @echo -n '')
86     eval($${1}_header.depends = compiler_$${1}_make_all)
87     eval($${1}_header.variable_out = GENERATED_FILES)
89     export($${1}_header.output)
90     export($${1}_header.input)
91     export($${1}_header.commands)
92     export($${1}_header.depends)
93     export($${1}_header.variable_out)
95     !CONFIG(QTDIR_build): QMAKE_EXTRA_COMPILERS += $${1}_header
97     export(QMAKE_EXTRA_COMPILERS)
98     export(generated_files.depends)
99     export(SOURCES)
101     return(true)