Commit 274af0f2 authored by Alessandro Portale's avatar Alessandro Portale Committed by con

Fixing several issues in folder deployment

 - Also copying paths when doing in-source build,
   and not copying paths if source and target differ
 - Quote paths in order to support white spaces
 - Tolerate forward slashes as input paths

Task-Number: QTCREATORBUG-3203
Reviewed-By: ck
Merge-request: 226
parent 0ce4d068
......@@ -24,14 +24,20 @@ symbian {
contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone
contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices
} else:win32 {
!isEqual(PWD,$$OUT_PWD) {
copyCommand = @echo Copying application data...
for(deploymentfolder, DEPLOYMENTFOLDERS) {
source = $$eval($${deploymentfolder}.source)
pathSegments = $$split(source, /)
sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments)
copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\)
copyCommand =
for(deploymentfolder, DEPLOYMENTFOLDERS) {
source = $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source)
source = $$replace(source, /, \\)
sourcePathSegments = $$split(source, \\)
target = $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(sourcePathSegments)
target = $$replace(target, /, \\)
!isEqual(source,$$target) {
!isEmpty(copyCommand):copyCommand += &&
copyCommand += $(COPY_DIR) \"$$source\" \"$$target\"
}
}
!isEmpty(copyCommand) {
copyCommand = @echo Copying application data... && $$copyCommand
copydeploymentfolders.commands = $$copyCommand
first.depends = $(first) copydeploymentfolders
export(first.depends)
......@@ -41,21 +47,30 @@ symbian {
} else:unix {
maemo5 {
installPrefix = /opt/usr
desktopfile.path = /usr/share/applications/hildon
desktopfile.path = /usr/share/applications/hildon
} else {
installPrefix = /usr/local
desktopfile.path = /usr/share/applications
!isEqual(PWD,$$OUT_PWD) {
copyCommand = @echo Copying application data...
for(deploymentfolder, DEPLOYMENTFOLDERS) {
macx {
target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target)
} else {
target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
}
copyCommand += && $(MKDIR) $$target
copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target
copyCommand =
for(deploymentfolder, DEPLOYMENTFOLDERS) {
source = $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source)
source = $$replace(source, \\, /)
macx {
target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target)
} else {
target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
}
target = $$replace(target, \\, /)
sourcePathSegments = $$split(source, /)
targetFullPath = $$target/$$last(sourcePathSegments)
!isEqual(source,$$targetFullPath) {
!isEmpty(copyCommand):copyCommand += &&
copyCommand += $(MKDIR) \"$$target\"
copyCommand += && $(COPY_DIR) \"$$source\" \"$$target\"
}
}
!isEmpty(copyCommand) {
copyCommand = @echo Copying application data... && $$copyCommand
copydeploymentfolders.commands = $$copyCommand
first.depends = $(first) copydeploymentfolders
export(first.depends)
......
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