aboutsummaryrefslogtreecommitdiffstats
path: root/src/qworkbenchplugin.pri
blob: a6143a9c77b1a485451e63e21875e45436fd1c6f (plain)
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
61
isEmpty(IDE_BUILD_TREE) {
  IDE_BUILD_TREE = $$OUT_PWD/../../..
}
include(../qtcreator.pri)

isEmpty(PROVIDER) {
    PROVIDER = Nokia
}

DESTDIR = $$IDE_PLUGIN_PATH/$$PROVIDER
LIBS += -L$$DESTDIR
INCLUDEPATH += $$IDE_SOURCE_TREE/src/plugins
DEPENDPATH += $$IDE_SOURCE_TREE/src/plugins

# copy the plugin spec
isEmpty(TARGET) {
    error("qworkbenchplugin.pri: You must provide a TARGET")
}

# Copy the pluginspec file to the library directory.
# Note: On Windows/MinGW with some sh.exe in the path,
# QMAKE_COPY is some cp command that does not understand
# "\". Force the standard windows copy.
COPYDEST = $${DESTDIR}
COPYSRC = $${_PRO_FILE_PWD_}/$${TARGET}.pluginspec

TARGET = $$qtLibraryTarget($$TARGET)

win32 {
    COPYDEST ~= s|/+|\|
    COPYSRC ~= s|/+|\|
    COPY_CMD=xcopy /y
} else {
    COPY_CMD=$${QMAKE_COPY}
}

QMAKE_POST_LINK += $${COPY_CMD} $${COPYSRC} $${COPYDEST}

macx {
        QMAKE_LFLAGS_SONAME = -Wl,-install_name,@executable_path/../PlugIns/$${PROVIDER}/
} else:linux-* {
    #do the rpath by hand since it's not possible to use ORIGIN in QMAKE_RPATHDIR
    QMAKE_RPATHDIR += \$\$ORIGIN
    QMAKE_RPATHDIR += \$\$ORIGIN/..
    QMAKE_RPATHDIR += \$\$ORIGIN/../..
    IDE_PLUGIN_RPATH = $$join(QMAKE_RPATHDIR, ":")
    QMAKE_LFLAGS += -Wl,-z,origin \'-Wl,-rpath,$${IDE_PLUGIN_RPATH}\'
    QMAKE_RPATHDIR =
}


contains(QT_CONFIG, reduce_exports):CONFIG += hide_symbols

CONFIG += plugin plugin_with_soname

linux-* {
    target.path = /$$IDE_LIBRARY_BASENAME/qtcreator/plugins/$$PROVIDER
    pluginspec.files += $${TARGET}.pluginspec
    pluginspec.path = /$$IDE_LIBRARY_BASENAME/qtcreator/plugins/$$PROVIDER
    INSTALLS += target pluginspec
}