From ada9d1628ed1171f6cf57f4fef9ba9d05a502a0c Mon Sep 17 00:00:00 2001 From: Tasuku Suzuki Date: Mon, 21 Jan 2013 00:32:21 +0900 Subject: [PATCH] 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 --- share/qtcreator/templates/qtquick2app/app.pro | 3 +++ share/qtcreator/templates/qtquickapp/app.pro | 3 +++ share/qtcreator/templates/shared/deployment.pri | 12 +++++++++--- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/share/qtcreator/templates/qtquick2app/app.pro b/share/qtcreator/templates/qtquick2app/app.pro index df37cf767b2..2495771e53d 100644 --- a/share/qtcreator/templates/qtquick2app/app.pro +++ b/share/qtcreator/templates/qtquick2app/app.pro @@ -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) # diff --git a/share/qtcreator/templates/qtquickapp/app.pro b/share/qtcreator/templates/qtquickapp/app.pro index 9fe3c6fdcf4..e96d5e0c4be 100644 --- a/share/qtcreator/templates/qtquickapp/app.pro +++ b/share/qtcreator/templates/qtquickapp/app.pro @@ -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) # diff --git a/share/qtcreator/templates/shared/deployment.pri b/share/qtcreator/templates/shared/deployment.pri index e2a4bcab1f7..cf304118e84 100644 --- a/share/qtcreator/templates/shared/deployment.pri +++ b/share/qtcreator/templates/shared/deployment.pri @@ -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 }