QtcPlugin.qbs 1.91 KB
Newer Older
1
import qbs 1.0
2
import qbs.FileInfo
3
import QtcFunctions
Joerg Bornemann's avatar
Joerg Bornemann committed
4

5
QtcProduct {
6
    type: ["dynamiclibrary", "pluginSpec", "qtc.dev-module"]
7
    installDir: qtc.ide_plugin_path
8
    installTags: ["dynamiclibrary"]
9
    useGuiPchFile: true
10

11
    property var pluginJsonReplacements
12
    property var pluginRecommends: []
13
    property var pluginTestDepends: []
14

15
    property string minimumQtVersion: "5.6.2"
16
    condition: QtcFunctions.versionIsAtLeast(Qt.core.version, minimumQtVersion)
Christian Kandeler's avatar
Christian Kandeler committed
17

18
    targetName: QtcFunctions.qtLibraryName(qbs, name)
19
    destinationDirectory: qtc.ide_plugin_path
Joerg Bornemann's avatar
Joerg Bornemann committed
20

21
    Depends { name: "ExtensionSystem" }
22
    Depends { name: "pluginjson" }
23
    Depends {
24
        condition: qtc.testsEnabled
25
        name: "Qt.testlib"
26 27
    }

28 29 30 31
    Properties {
        condition: qbs.targetOS.contains("unix")
        cpp.internalVersion: ""
    }
32
    cpp.defines: base.concat([name.toUpperCase() + "_LIBRARY"])
Christian Kandeler's avatar
Christian Kandeler committed
33
    cpp.sonamePrefix: qbs.targetOS.contains("macos")
34 35
        ? "@rpath"
        : undefined
Christian Kandeler's avatar
Christian Kandeler committed
36
    cpp.rpaths: qbs.targetOS.contains("macos")
37
        ? ["@loader_path/../Frameworks", "@loader_path/../PlugIns"]
38
        : ["$ORIGIN", "$ORIGIN/.."]
39
    cpp.linkerFlags: {
40 41
        var flags = base;
        if (qbs.buildVariant == "debug" && qbs.toolchain.contains("msvc"))
42
            flags.push("/INCREMENTAL:NO"); // Speed up startup time when debugging with cdb
Christian Kandeler's avatar
Christian Kandeler committed
43
        if (qbs.targetOS.contains("macos"))
44
            flags.push("-compatibility_version", qtc.qtcreator_compat_version);
45
        return flags;
46
    }
47 48 49

    property string pluginIncludeBase: ".." // #include <plugin/header.h>
    cpp.includePaths: [pluginIncludeBase]
Joerg Bornemann's avatar
Joerg Bornemann committed
50 51

    Group {
52
        name: "PluginMetaData"
53
        prefix: product.sourceDirectory + '/'
54 55
        files: [ product.name + ".json.in" ]
        fileTags: ["pluginJsonIn"]
Joerg Bornemann's avatar
Joerg Bornemann committed
56
    }
57

58
    Export {
Christian Kandeler's avatar
Christian Kandeler committed
59
        Depends { name: "ExtensionSystem" }
60
        Depends { name: "cpp" }
61
        cpp.includePaths: [product.pluginIncludeBase]
Christian Kandeler's avatar
Christian Kandeler committed
62
    }
Joerg Bornemann's avatar
Joerg Bornemann committed
63
}