0

In my projects folder i have a folder with the name translations where i have the translations files .ts.

What i want Qt/QMake to do on run is to put on the build folder the translation with the correspondent .qm files.

How can this be done?

Nmaster88
  • 1,405
  • 2
  • 23
  • 65
  • You might create an extra target and set its 'target' to be `$$OUT_PWD/translations` and 'command' - `$(MKDIR) $$OUT_PWD/translations && $(COPY_DIR) $SOURCE/translations $$OUT_PWD/translations` – vahancho Dec 10 '18 at 10:12

1 Answers1

1

You can run shell commands with qmake, using a custom target. Have a look at this answer here on SO.

In this case the command to invoke is lurelease, providing the right paths to your ts files and output directory.

Be aware custom commands are evaluated using the shell of the OS running qmake. That is cmd.exe on Windows and (likely) bash in several unix like systems. Therefore, a qmake script with custom commands is not platform agnostic.

Sergio Monteleone
  • 2,776
  • 9
  • 21