1isEmpty(TARGET) {
2    error("plugin.pri: You must provide a TARGET")
3}
4
5TEMPLATE = lib
6CONFIG += plugin
7contains(QT_CONFIG, reduce_exports): CONFIG += hide_symbols
8win32 {
9    DESTDIR = $$OUT_PWD/../../../plugins/tiled
10} else:macx {
11    DESTDIR = $$OUT_PWD/../../../bin/Tiled.app/Contents/PlugIns
12} else {
13    DESTDIR = $$OUT_PWD/../../../lib/tiled/plugins
14}
15
16include(../../tiled.pri)
17target.path = $${LIBDIR}/tiled/plugins
18INSTALLS += target
19
20include(../libtiled/libtiled.pri)
21macx {
22    QMAKE_LIBDIR += $$OUT_PWD/../../../bin/Tiled.app/Contents/Frameworks
23} else:win32 {
24    LIBS += -L$$OUT_PWD/../../../lib
25} else {
26    QMAKE_LIBDIR += $$OUT_PWD/../../../lib
27}
28
29# Set rpath so that the plugin will resolve libtiled correctly
30!win32:!macx:!cygwin:contains(RPATH, yes) {
31    QMAKE_RPATHDIR += \$\$ORIGIN/../..
32
33    # It is not possible to use ORIGIN in QMAKE_RPATHDIR, so a bit manually
34    QMAKE_LFLAGS += -Wl,-z,origin \'-Wl,-rpath,$$join(QMAKE_RPATHDIR, ":")\'
35    QMAKE_RPATHDIR =
36}
37