File: plugin-meta-data.qbs

package info (click to toggle)
qbs 3.1.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 30,968 kB
  • sloc: cpp: 120,478; ansic: 72,055; javascript: 14,887; python: 5,882; asm: 1,742; sh: 1,059; java: 693; objc: 409; lex: 194; xml: 141; perl: 137; yacc: 86; makefile: 55; cs: 41
file content (60 lines) | stat: -rw-r--r-- 1,746 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import qbs.Host
import qbs.Utilities

Project {
    QtApplication {
        condition: {
            if (Utilities.versionCompare(Qt.core.version, "5.0") < 0) {
                // qt4 moc can't be used with pluginMetaData
                console.info("using qt4");
                return false;
            }
            var result = qbs.targetPlatform === Host.platform() && qbs.architecture === Host.architecture();
            if (!result)
                console.info("target platform/arch differ from host platform/arch");
            return result;
        }

        name: "app"
        consoleApplication: true

        Depends { name: "thePlugin" }

        cpp.cxxLanguageVersion: "c++11"

        Properties {
            condition: qbs.targetOS.includes("unix")
            cpp.rpaths: [cpp.rpathOrigin]
        }
        config.install.binariesDirectory: ""

        files: ["app.cpp"]
    }

    Library {
        type: Qt.core.staticBuild ? "staticlibrary" : "dynamiclibrary"
        name: "thePlugin"

        Depends { name: "cpp" }
        Depends { name: "Qt.core" }

        Properties {
            condition: qbs.targetOS.includes("darwin")
            bundle.isBundle: false
        }
        cpp.defines: [Qt.core.staticBuild ? "QT_STATICPLUGIN" : "QT_PLUGIN"]
        cpp.cxxLanguageVersion: "c++11"
        cpp.sonamePrefix: qbs.targetOS.includes("darwin") ? "@rpath" : undefined
        cpp.includePaths: ["."]
        Qt.core.pluginMetaData: ["theKey=theValue"]
        config.install.dynamicLibrariesDirectory: ""
        config.install.staticLibrariesDirectory: ""

        files: ["theplugin.cpp"]

        Group {
            files: ["metadata.json"]
            fileTags: ["qt_plugin_metadata"]
        }
    }
}