qtcreatorplugin.pri 2.15 KB
Newer Older
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
1
include(../qtcreator.pri)
con's avatar
con committed
2

3 4 5
# use gui precompiled header for plugins by default
isEmpty(PRECOMPILED_HEADER):PRECOMPILED_HEADER = $$PWD/shared/qtcreator_gui_pch.h

con's avatar
con committed
6 7 8 9
isEmpty(PROVIDER) {
    PROVIDER = Nokia
}

Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
10
DESTDIR = $$IDE_PLUGIN_PATH/$$PROVIDER
con's avatar
con committed
11 12 13 14
LIBS += -L$$DESTDIR

# copy the plugin spec
isEmpty(TARGET) {
15
    error("qtcreatorplugin.pri: You must provide a TARGET")
con's avatar
con committed
16 17
}

18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
defineReplace(stripOutDir) {
    1 ~= s|^$$re_escape($$OUT_PWD/)||$$i_flag
    return($$1)
}

PLUGINSPEC = $$_PRO_FILE_PWD_/$${TARGET}.pluginspec
PLUGINSPEC_IN = $${PLUGINSPEC}.in
exists($$PLUGINSPEC_IN) {
    OTHER_FILES += $$PLUGINSPEC_IN
    PLUGINSPEC = $$OUT_PWD/$${TARGET}.pluginspec
    QMAKE_SUBSTITUTES += $${PLUGINSPEC}.in
    copy2build.output = $$DESTDIR/${QMAKE_FUNC_FILE_IN_stripOutDir}
} else {
    # need to support that for external plugins
    OTHER_FILES += $$PLUGINSPEC
    copy2build.output = $$DESTDIR/${QMAKE_FUNC_FILE_IN_stripSrcDir}
}
copy2build.input = PLUGINSPEC
36
isEmpty(vcproj):copy2build.variable_out = PRE_TARGETDEPS
37
copy2build.commands = $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT}
38 39 40
copy2build.name = COPY ${QMAKE_FILE_IN}
copy2build.CONFIG += no_link
QMAKE_EXTRA_COMPILERS += copy2build
con's avatar
con committed
41 42

macx {
43
    !isEmpty(TIGER_COMPAT_MODE) {
con's avatar
con committed
44
        QMAKE_LFLAGS_SONAME = -Wl,-install_name,@executable_path/../PlugIns/$${PROVIDER}/
45 46 47 48
    } else {
        QMAKE_LFLAGS_SONAME = -Wl,-install_name,@rpath/PlugIns/$${PROVIDER}/
        QMAKE_LFLAGS += -Wl,-rpath,@loader_path/../../
    }
con's avatar
con committed
49 50
} else:linux-* {
    #do the rpath by hand since it's not possible to use ORIGIN in QMAKE_RPATHDIR
Daniel Molkentin's avatar
Daniel Molkentin committed
51
    QMAKE_RPATHDIR += \$\$ORIGIN
con's avatar
con committed
52
    QMAKE_RPATHDIR += \$\$ORIGIN/..
Daniel Molkentin's avatar
Daniel Molkentin committed
53
    QMAKE_RPATHDIR += \$\$ORIGIN/../..
con's avatar
con committed
54 55 56 57 58 59 60
    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
61

con's avatar
con committed
62
CONFIG += plugin plugin_with_soname
63

64
!macx {
65
    target.path = /$$IDE_LIBRARY_BASENAME/qtcreator/plugins/$$PROVIDER
Daniel Molkentin's avatar
Daniel Molkentin committed
66
    pluginspec.files += $${TARGET}.pluginspec
67
    pluginspec.path = /$$IDE_LIBRARY_BASENAME/qtcreator/plugins/$$PROVIDER
Daniel Molkentin's avatar
Daniel Molkentin committed
68
    INSTALLS += target pluginspec
69
}
dt's avatar
dt committed
70

71
TARGET = $$qtLibraryName($$TARGET)
dt's avatar
dt committed
72