From 9cd257f6c2285b82d9cce8c2b7c1a259f6a431e3 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Fri, 26 May 2017 14:06:43 +0200 Subject: Fix grue sensor example building on macOS Task-number: QTBUG-33875 Change-Id: Idd72b689aaae727df77daecb616d5c47b9bb809c Reviewed-by: Lorn Potter --- examples/sensors/grue/console_app/console_app.pro | 1 + examples/sensors/grue/import/import.pro | 8 +++++--- examples/sensors/grue/lib/lib.pri | 6 ++++++ examples/sensors/grue/lib/lib.pro | 5 ++++- examples/sensors/grue/plugin/plugin.pro | 6 +++--- 5 files changed, 19 insertions(+), 7 deletions(-) create mode 100644 examples/sensors/grue/lib/lib.pri diff --git a/examples/sensors/grue/console_app/console_app.pro b/examples/sensors/grue/console_app/console_app.pro index 3d3915f6..7b082d39 100644 --- a/examples/sensors/grue/console_app/console_app.pro +++ b/examples/sensors/grue/console_app/console_app.pro @@ -1,6 +1,7 @@ TEMPLATE = app TARGET = detect_grue CONFIG += console +CONFIG -= app_bundle QT = core sensors DESTDIR = $$OUT_PWD/.. diff --git a/examples/sensors/grue/import/import.pro b/examples/sensors/grue/import/import.pro index ab4d1779..17d7713e 100644 --- a/examples/sensors/grue/import/import.pro +++ b/examples/sensors/grue/import/import.pro @@ -2,16 +2,18 @@ TEMPLATE = lib CONFIG += plugin TARGET = $$qtLibraryTarget(declarative_grue) -DESTDIR = ../Grue + +macos: DESTDIR = ../grue_app.app/Contents/MacOS/Grue +else: DESTDIR = ../Grue QT = core gui qml sensors -INCLUDEPATH += $$PWD/../lib -LIBS += -L$$OUT_PWD/.. -lgruesensor +include(../lib/lib.pri) # Shared gruesensor library will be installed in parent directory. # Define rpath so that this plugin will know where to look for it. unix:!mac: QMAKE_LFLAGS += -Wl,-rpath,\\\$\$ORIGIN/.. +macos: QMAKE_RPATHDIR += @loader_path/../../Frameworks SOURCES = main.cpp diff --git a/examples/sensors/grue/lib/lib.pri b/examples/sensors/grue/lib/lib.pri new file mode 100644 index 00000000..0e3da252 --- /dev/null +++ b/examples/sensors/grue/lib/lib.pri @@ -0,0 +1,6 @@ +INCLUDEPATH += $$PWD + +macos: LIBS += -L$$OUT_PWD/../grue_app.app/Contents/Frameworks +else: LIBS += -L$$OUT_PWD/.. + +LIBS += -lgruesensor diff --git a/examples/sensors/grue/lib/lib.pro b/examples/sensors/grue/lib/lib.pro index 6106f9ed..cc10e5c4 100644 --- a/examples/sensors/grue/lib/lib.pro +++ b/examples/sensors/grue/lib/lib.pro @@ -1,7 +1,10 @@ TEMPLATE = lib TARGET = gruesensor -DESTDIR = $$OUT_PWD/.. +macos: DESTDIR = ../grue_app.app/Contents/Frameworks +else: DESTDIR = $$OUT_PWD/.. + +macos: QMAKE_SONAME_PREFIX = @rpath DEFINES *= QT_BUILD_GRUE_LIB QT = core sensors diff --git a/examples/sensors/grue/plugin/plugin.pro b/examples/sensors/grue/plugin/plugin.pro index 7edda279..e198140d 100644 --- a/examples/sensors/grue/plugin/plugin.pro +++ b/examples/sensors/grue/plugin/plugin.pro @@ -5,10 +5,10 @@ PLUGIN_TYPE = sensors QT = core sensors -DESTDIR = ../$$PLUGIN_TYPE +macos: DESTDIR = ../grue_app.app/Contents/MacOS/$$PLUGIN_TYPE +else: DESTDIR = ../$$PLUGIN_TYPE -INCLUDEPATH += $$PWD/../lib -LIBS += -L$$OUT_PWD/.. -lgruesensor +include(../lib/lib.pri) # Shared gruesensor library will be installed in parent directory. # Define rpath so that this plugin will know where to look for it. -- cgit v1.2.3