From 8566f3e369ead9510dc7a52e4ee93588c2eebed3 Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Tue, 25 Sep 2012 15:23:59 +0200 Subject: QtSensors examples: Install plugins under the example tree structure QtSensors 'Grue' and 'Sensor Explorer' examples include qml imports, a Qt plugin and a shared library. Modify the related .pro files to install everything under QT_INSTALL_EXAMPLES, instead of the main Qt install directory. Task-number: QTBUG-26860 Change-Id: I32d4f66e5b18468c17b668ecb76f969ed15e4c50 Reviewed-by: Stephen Kelly Reviewed-by: Alex Reviewed-by: Lorn Potter --- examples/sensors/grue/import/import.pro | 6 +++++- examples/sensors/grue/import/qmldir | 1 + examples/sensors/grue/lib/lib.pro | 2 +- examples/sensors/grue/plugin/plugin.pro | 8 +++++++- examples/sensors/grue/qml.pro | 4 ++-- examples/sensors/sensor_explorer/import/import.pro | 2 +- examples/sensors/sensor_explorer/import/qmldir | 1 + 7 files changed, 18 insertions(+), 6 deletions(-) (limited to 'examples/sensors') diff --git a/examples/sensors/grue/import/import.pro b/examples/sensors/grue/import/import.pro index 3f46103f..71e2249d 100644 --- a/examples/sensors/grue/import/import.pro +++ b/examples/sensors/grue/import/import.pro @@ -9,9 +9,13 @@ QT = core gui qml sensors INCLUDEPATH += $$PWD/../lib LIBS += -L$$OUT_PWD/../lib -lgruesensor +# 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/.. + SOURCES = main.cpp -DESTPATH=$$[QT_INSTALL_IMPORTS]/Grue +DESTPATH=$$[QT_INSTALL_EXAMPLES]/qtsensors/grue/Grue target.path=$$DESTPATH INSTALLS += target diff --git a/examples/sensors/grue/import/qmldir b/examples/sensors/grue/import/qmldir index 266b7c11..529b9093 100644 --- a/examples/sensors/grue/import/qmldir +++ b/examples/sensors/grue/import/qmldir @@ -1 +1,2 @@ +module Grue plugin declarative_grue diff --git a/examples/sensors/grue/lib/lib.pro b/examples/sensors/grue/lib/lib.pro index 9185e294..4d12062e 100644 --- a/examples/sensors/grue/lib/lib.pro +++ b/examples/sensors/grue/lib/lib.pro @@ -12,5 +12,5 @@ HEADERS += gruesensor.h\ SOURCES += gruesensor.cpp\ -target.path=$$[QT_INSTALL_LIBS] +target.path=$$[QT_INSTALL_EXAMPLES]/qtsensors/grue INSTALLS += target diff --git a/examples/sensors/grue/plugin/plugin.pro b/examples/sensors/grue/plugin/plugin.pro index 03e66851..90453537 100644 --- a/examples/sensors/grue/plugin/plugin.pro +++ b/examples/sensors/grue/plugin/plugin.pro @@ -8,12 +8,18 @@ QT = core sensors INCLUDEPATH += $$PWD/../lib LIBS += -L$$OUT_PWD/../lib -lgruesensor +# 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/.. + HEADERS += gruesensorimpl.h\ SOURCES += gruesensorimpl.cpp\ main.cpp\ -target.path=$$[QT_INSTALL_PLUGINS]/sensors + +# Install the plugin under Grue example directory +target.path=$$[QT_INSTALL_EXAMPLES]/qtsensors/grue/$$PLUGIN_TYPE INSTALLS += target OTHER_FILES += \ diff --git a/examples/sensors/grue/qml.pro b/examples/sensors/grue/qml.pro index 3e1097b2..7593538c 100644 --- a/examples/sensors/grue/qml.pro +++ b/examples/sensors/grue/qml.pro @@ -8,6 +8,6 @@ app.files = \ $$files(*.qml) \ grue.png -target.path = $$[QT_INSTALL_EXAMPLES]/sensors/grue -app.path = $$[QT_INSTALL_EXAMPLES]/sensors/grue +target.path = $$[QT_INSTALL_EXAMPLES]/qtsensors/grue +app.path = $$[QT_INSTALL_EXAMPLES]/qtsensors/grue INSTALLS += target app diff --git a/examples/sensors/sensor_explorer/import/import.pro b/examples/sensors/sensor_explorer/import/import.pro index 1248b14a..85f471c6 100644 --- a/examples/sensors/sensor_explorer/import/import.pro +++ b/examples/sensors/sensor_explorer/import/import.pro @@ -9,7 +9,7 @@ QT += qml sensors SOURCES = main.cpp explorer.cpp sensoritem.cpp propertyinfo.cpp HEADERS = explorer.h sensoritem.h propertyinfo.h -DESTPATH=$$[QT_INSTALL_IMPORTS]/Explorer +DESTPATH=$$[QT_INSTALL_EXAMPLES]/qtsensors/sensor_explorer/Explorer target.path=$$DESTPATH INSTALLS += target diff --git a/examples/sensors/sensor_explorer/import/qmldir b/examples/sensors/sensor_explorer/import/qmldir index 60d8f883..31c037fa 100644 --- a/examples/sensors/sensor_explorer/import/qmldir +++ b/examples/sensors/sensor_explorer/import/qmldir @@ -1 +1,2 @@ +module Explorer plugin declarative_explorer -- cgit v1.2.3