Commit 3ae8ddf1 authored by Alessandro Portale's avatar Alessandro Portale
Browse files

Outsourcing the dirty bulk into the new "qmlapplication.pri"

parent d3677abd
......@@ -27,82 +27,4 @@ symbian:TARGET.UID3 = 0xE1111234
# QMLINSPECTOR_PATH #
QMLINSPECTOR_PATH = $$PWD/../../qmljsdebugger
# Edit the code below on your own risk.
QT += declarative
SOURCES += cpp/main.cpp cpp/qmlapplicationview.cpp
HEADERS += cpp/qmlapplicationview.h
INCLUDEPATH += cpp
contains(DEFINES, QMLINSPECTOR) {
CONFIG(debug, debug|release) {
include($$QMLINSPECTOR_PATH/qmljsdebugger-lib.pri)
} else {
DEFINES -= QMLINSPECTOR
}
}
symbian {
ICON = cpp/symbianicon.svg
contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -leiksrv -lcone
contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices
for(deploymentfolder, DEPLOYMENTFOLDERS) {
item = item$${deploymentfolder}
itemsources = $${item}.sources
$$itemsources = $$eval($${deploymentfolder}.source)
itempath = $${item}.path
$$itempath= $$eval($${deploymentfolder}.target)
DEPLOYMENT += $$item
}
} else:win32 {
!isEqual(PWD,$$OUT_PWD) {
copyCommand = @echo Copying application data...
for(deploymentfolder, DEPLOYMENTFOLDERS) {
source = $$eval($${deploymentfolder}.source)
pathSegments = $$split(source, /)
sourceAndTarget = $$PWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments)
copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\)
}
copydeploymentfolders.commands = $$copyCommand
first.depends = $(first) copydeploymentfolders
QMAKE_EXTRA_TARGETS += first copydeploymentfolders
}
} else:if(maemo5|maemo6) {
for(deploymentfolder, DEPLOYMENTFOLDERS) {
item = item$${deploymentfolder}
itemfiles = $${item}.files
$$itemfiles = $$eval($${deploymentfolder}.source)
itempath = $${item}.path
$$itempath = /opt/share/$$eval($${deploymentfolder}.target)
INSTALLS += $$item
}
desktopfile.files = $${TARGET}.desktop
desktopfile.path = /usr/share/applications/hildon
target.path = /opt/bin
INSTALLS += desktopfile target
} else:macx {
!isEqual(PWD,$$OUT_PWD) {
copyCommand = @echo Copying application data...
for(deploymentfolder, DEPLOYMENTFOLDERS) {
target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target)
copyCommand += && $(MKDIR) $$target
copyCommand += && $(COPY_DIR) $$PWD/$$eval($${deploymentfolder}.source) $$target
}
copydeploymentfolders.commands = $$copyCommand
first.depends = $(first) copydeploymentfolders
QMAKE_EXTRA_TARGETS += first copydeploymentfolders
}
} else { #linux
!isEqual(PWD,$$OUT_PWD) {
copyCommand = @echo Copying application data...
for(deploymentfolder, DEPLOYMENTFOLDERS) {
target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
copyCommand += && $(MKDIR) $$target
copyCommand += && $(COPY_DIR) $$PWD/$$eval($${deploymentfolder}.source) $$target
}
copydeploymentfolders.commands = $$copyCommand
first.depends = $(first) copydeploymentfolders
QMAKE_EXTRA_TARGETS += first copydeploymentfolders
}
}
include($$PWD/qmlapplication.pri)
# This file should not be edited.
# Following versions of Qt Creator might offer new version.
QT += declarative
SOURCES += cpp/main.cpp cpp/qmlapplicationview.cpp
HEADERS += cpp/qmlapplicationview.h
INCLUDEPATH += cpp
contains(DEFINES, QMLINSPECTOR) {
CONFIG(debug, debug|release) {
include($$QMLINSPECTOR_PATH/qmljsdebugger-lib.pri)
} else {
DEFINES -= QMLINSPECTOR
}
}
symbian {
ICON = cpp/symbianicon.svg
contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -leiksrv -lcone
contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices
for(deploymentfolder, DEPLOYMENTFOLDERS) {
item = item$${deploymentfolder}
itemsources = $${item}.sources
$$itemsources = $$eval($${deploymentfolder}.source)
itempath = $${item}.path
$$itempath= $$eval($${deploymentfolder}.target)
DEPLOYMENT += $$item
}
} else:win32 {
!isEqual(PWD,$$OUT_PWD) {
copyCommand = @echo Copying application data...
for(deploymentfolder, DEPLOYMENTFOLDERS) {
source = $$eval($${deploymentfolder}.source)
pathSegments = $$split(source, /)
sourceAndTarget = $$PWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments)
copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\)
}
copydeploymentfolders.commands = $$copyCommand
first.depends = $(first) copydeploymentfolders
QMAKE_EXTRA_TARGETS += first copydeploymentfolders
}
} else:if(maemo5|maemo6) {
for(deploymentfolder, DEPLOYMENTFOLDERS) {
item = item$${deploymentfolder}
itemfiles = $${item}.files
$$itemfiles = $$eval($${deploymentfolder}.source)
itempath = $${item}.path
$$itempath = /opt/share/$$eval($${deploymentfolder}.target)
INSTALLS += $$item
}
desktopfile.files = $${TARGET}.desktop
desktopfile.path = /usr/share/applications/hildon
target.path = /opt/bin
INSTALLS += desktopfile target
} else:macx {
!isEqual(PWD,$$OUT_PWD) {
copyCommand = @echo Copying application data...
for(deploymentfolder, DEPLOYMENTFOLDERS) {
target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target)
copyCommand += && $(MKDIR) $$target
copyCommand += && $(COPY_DIR) $$PWD/$$eval($${deploymentfolder}.source) $$target
}
copydeploymentfolders.commands = $$copyCommand
first.depends = $(first) copydeploymentfolders
QMAKE_EXTRA_TARGETS += first copydeploymentfolders
}
} else { #linux
!isEqual(PWD,$$OUT_PWD) {
copyCommand = @echo Copying application data...
for(deploymentfolder, DEPLOYMENTFOLDERS) {
target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
copyCommand += && $(MKDIR) $$target
copyCommand += && $(COPY_DIR) $$PWD/$$eval($${deploymentfolder}.source) $$target
}
copydeploymentfolders.commands = $$copyCommand
first.depends = $(first) copydeploymentfolders
QMAKE_EXTRA_TARGETS += first copydeploymentfolders
}
}
......@@ -144,6 +144,7 @@ QString QmlStandaloneApp::path(Path path, Location location) const
const QString cppSourceSubDir = QLatin1String("cpp/");
const QString cppTargetSubDir = cppSourceSubDir;
const QString qmlExtension = QLatin1String(".qml");
const QString appPri = QLatin1String("qmlapplication.pri");
const QString mainCpp = QLatin1String("main.cpp");
const QString appViewCpp = QLatin1String("qmlapplicationview.cpp");
const QString appViewH = QLatin1String("qmlapplicationview.h");
......@@ -155,6 +156,7 @@ QString QmlStandaloneApp::path(Path path, Location location) const
switch (path) {
case MainQml: return templatesRoot + QLatin1String("qml/app/app.qml");
case AppProfile: return templatesRoot + QLatin1String("app.pro");
case AppPri: return templatesRoot + appPri;
case MainCpp: return templatesRoot + cppSourceSubDir + mainCpp;
case AppViewerCpp: return templatesRoot + cppSourceSubDir + appViewCpp;
case AppViewerH: return templatesRoot + cppSourceSubDir + appViewH;
......@@ -170,8 +172,9 @@ QString QmlStandaloneApp::path(Path path, Location location) const
case MainQml: return useExistingMainQml() ? m_mainQmlFile.canonicalFilePath()
: pathBase + qmlRootFolder + m_projectName + qmlExtension;
case AppProfile: return pathBase + m_projectName + QLatin1String(".pro");
case AppProfilePath: return pathBase;
case AppPri: return pathBase + appPri;
case MainCpp: return pathBase + cppTargetSubDir + mainCpp;
case AppProfilePath: return pathBase;
case AppViewerCpp: return pathBase + cppTargetSubDir + appViewCpp;
case AppViewerH: return pathBase + cppTargetSubDir + appViewH;
case SymbianSvgIcon: return pathBase + cppTargetSubDir + symbianIcon;
......@@ -351,6 +354,7 @@ Core::GeneratedFiles QmlStandaloneApp::generateFiles(QString *errorMessage) cons
generatedProFile.setContents(generateProFile(errorMessage));
generatedProFile.setAttributes(Core::GeneratedFile::OpenProjectAttribute);
files.append(generatedProFile);
files.append(generateFileCopy(path(AppPri, Source), path(AppPri, Target)));
if (!useExistingMainQml())
files.append(generateFileCopy(path(MainQml, Source), path(MainQml, Target), true));
......
......@@ -53,6 +53,7 @@ public:
MainQml,
MainCpp,
AppProfile,
AppPri,
AppProfilePath,
AppViewerCpp,
AppViewerH,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment