On Unix systems create symbolic links instead of copying files.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2015-12-18 16:46:31 +02:00
parent af5a74badd
commit 1b596b325a

View File

@ -69,7 +69,10 @@ defineTest(copyToDestdir) {
message("----------------------------------------------begin------------------------------------------------") message("----------------------------------------------begin------------------------------------------------")
message("Copy to" $$DDIR "after link") message("Copy to" $$DDIR "after link")
for(FILE, files) { for(FILE, files) {
unix{
QMAKE_POST_LINK += ln -s -f $$quote($$FILE) $$quote($$DDIR/$$basename(FILE)) $$escape_expand(\\n\\t)
message("Command:" ln -s -f $$quote($$FILE) $$quote($$DDIR/$$basename(FILE)))
} else {
!exists($$DDIR/$$basename(FILE)) { !exists($$DDIR/$$basename(FILE)) {
# Replace slashes in paths with backslashes for Windows # Replace slashes in paths with backslashes for Windows
win32{ win32{
@ -84,6 +87,7 @@ defineTest(copyToDestdir) {
QMAKE_CLEAN += $$DDIR/$$basename(FILE) QMAKE_CLEAN += $$DDIR/$$basename(FILE)
} }
}
export(QMAKE_POST_LINK) export(QMAKE_POST_LINK)
export(QMAKE_CLEAN) export(QMAKE_CLEAN)
@ -99,7 +103,10 @@ defineTest(forceCopyToDestdir) {
message("----------------------------------------------begin------------------------------------------------") message("----------------------------------------------begin------------------------------------------------")
message("Copy to" $$DDIR "after link") message("Copy to" $$DDIR "after link")
for(FILE, files) { for(FILE, files) {
unix{
QMAKE_POST_LINK += ln -s -f $$quote($$FILE) $$quote($$DDIR/$$basename(FILE)) $$escape_expand(\\n\\t)
message("Command:" ln -s -f $$quote($$FILE) $$quote($$DDIR/$$basename(FILE)))
} else {
# Replace slashes in paths with backslashes for Windows # Replace slashes in paths with backslashes for Windows
win32{ win32{
FILE ~= s,/,\\,g FILE ~= s,/,\\,g
@ -109,6 +116,7 @@ defineTest(forceCopyToDestdir) {
message("Command:" $$VCOPY $$quote($$FILE) $$quote($$DDIR)) message("Command:" $$VCOPY $$quote($$FILE) $$quote($$DDIR))
QMAKE_CLEAN += $$DDIR/$$basename(FILE) QMAKE_CLEAN += $$DDIR/$$basename(FILE)
} }
}
export(QMAKE_POST_LINK) export(QMAKE_POST_LINK)
export(QMAKE_CLEAN) export(QMAKE_CLEAN)