0

The question is simple, I've even seen similar here, but still can't reach the desired result((

I wand to configure qt pro-file, so that additional resource files would be copied into the output, in msvs it's a matter of one checkbox, like "copy resource to the output", but currently Qt Creator is used, so i tried this in a pro-file:

DESTDIR = ../../../bin
CONFIG(debug, debug|release):DESTDIR = $$join(DESTDIR,,,_debug)

#copyfiles.commands = cp $$(TARGET)/user_accounts.sqlite $$(DESTDIR)/user_accounts.sqlite
copyfiles.commands = cp user_accounts.sqlite $$(DESTDIR)/user_accounts.sqlite

QMAKE_EXTRA_TARGETS += copyfiles
POST_TARGETDEPS += copyfiles

cp is provided by msys, works ok from the command line. Still, when I build & run my project nothing happens. The recipe was taken from here, not that i missed googling. Why so, could you help?

Community
  • 1
  • 1
MasterAler
  • 1,614
  • 3
  • 23
  • 35

1 Answers1

0

One of possible solution:

win32 {
#convert to windows slash
PWD_WIN = $${PWD}
PWD_WIN ~= s,/,\\,g
OUT_PWD_WIN = $${OUT_PWD}
OUT_PWD_WIN ~= s,/,\\,g
#copy command      -> copy <from_project_dir> <to_build_dir>
copyfiles.commands = $(COPY_FILE) $${PWD_WIN}\\myFile.txt $${OUT_PWD_WIN}
}

QMAKE_EXTRA_TARGETS += copyfiles
POST_TARGETDEPS += copyfiles
Blueman
  • 781
  • 10
  • 13