install qml files to the same path as target.path

An app with Qt Quick {1,2} Application template is installed under /opt/
and there is no easy way to change the installation path.
This change allows users to set installation path in the main pro file.

Change-Id: I0325c54187f781b1ceaaddfd41e913117fa445e6
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
This commit is contained in:
Tasuku Suzuki
2013-01-21 00:32:21 +09:00
committed by Kai Koehne
parent a17f96d42a
commit ada9d1628e
3 changed files with 15 additions and 3 deletions

View File

@@ -17,6 +17,9 @@ QML_IMPORT_PATH =
# The .cpp file which was generated for your project. Feel free to hack it.
SOURCES += main.cpp
# Installation path
# target.path =
# Please do not modify the following two lines. Required for deployment.
include(qtquick2applicationviewer/qtquick2applicationviewer.pri)
# REMOVE_NEXT_LINE (wizard will remove the include and append deployment.pri to qmlapplicationviewer.pri, instead) #

View File

@@ -21,6 +21,9 @@ QML_IMPORT_PATH =
# The .cpp file which was generated for your project. Feel free to hack it.
SOURCES += main.cpp
# Installation path
# target.path =
# Please do not modify the following two lines. Required for deployment.
include(qmlapplicationviewer/qmlapplicationviewer.pri)
# REMOVE_NEXT_LINE (wizard will remove the include and append deployment.pri to qmlapplicationviewer.pri, instead) #

View File

@@ -113,7 +113,11 @@ android {
QMAKE_EXTRA_TARGETS += first copydeploymentfolders
}
}
installPrefix = /opt/$${TARGET}
!isEmpty(target.path) {
installPrefix = $${target.path}
} else {
installPrefix = /opt/$${TARGET}
}
for(deploymentfolder, DEPLOYMENTFOLDERS) {
item = item$${deploymentfolder}
itemfiles = $${item}.files
@@ -133,8 +137,10 @@ android {
INSTALLS += icon desktopfile
}
target.path = $${installPrefix}/bin
export(target.path)
isEmpty(target.path) {
target.path = $${installPrefix}/bin
export(target.path)
}
INSTALLS += target
}