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,20 +69,24 @@ defineTest(copyToDestdir) {
message("----------------------------------------------begin------------------------------------------------")
message("Copy to" $$DDIR "after link")
for(FILE, files) {
!exists($$DDIR/$$basename(FILE)) {
# Replace slashes in paths with backslashes for Windows
win32{
FILE ~= s,/,\\,g
DDIR ~= s,/,\\,g
}
QMAKE_POST_LINK += $$VCOPY $$quote($$FILE) $$quote($$DDIR) $$escape_expand(\\n\\t)
message("Command:" $$VCOPY $$quote($$FILE) $$quote($$DDIR))
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 {
message("File:" $$DDIR/$$basename(FILE) "already exist")
}
!exists($$DDIR/$$basename(FILE)) {
# Replace slashes in paths with backslashes for Windows
win32{
FILE ~= s,/,\\,g
DDIR ~= s,/,\\,g
}
QMAKE_POST_LINK += $$VCOPY $$quote($$FILE) $$quote($$DDIR) $$escape_expand(\\n\\t)
message("Command:" $$VCOPY $$quote($$FILE) $$quote($$DDIR))
} else {
message("File:" $$DDIR/$$basename(FILE) "already exist")
}
QMAKE_CLEAN += $$DDIR/$$basename(FILE)
QMAKE_CLEAN += $$DDIR/$$basename(FILE)
}
}
export(QMAKE_POST_LINK)
@ -99,15 +103,19 @@ defineTest(forceCopyToDestdir) {
message("----------------------------------------------begin------------------------------------------------")
message("Copy to" $$DDIR "after link")
for(FILE, files) {
# Replace slashes in paths with backslashes for Windows
win32{
FILE ~= s,/,\\,g
DDIR ~= s,/,\\,g
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
win32{
FILE ~= s,/,\\,g
DDIR ~= s,/,\\,g
}
QMAKE_POST_LINK += $$VCOPY $$quote($$FILE) $$quote($$DDIR) $$escape_expand(\\n\\t)
message("Command:" $$VCOPY $$quote($$FILE) $$quote($$DDIR))
QMAKE_CLEAN += $$DDIR/$$basename(FILE)
}
QMAKE_POST_LINK += $$VCOPY $$quote($$FILE) $$quote($$DDIR) $$escape_expand(\\n\\t)
message("Command:" $$VCOPY $$quote($$FILE) $$quote($$DDIR))
QMAKE_CLEAN += $$DDIR/$$basename(FILE)
}
export(QMAKE_POST_LINK)