10

Is it possible to have post-build events (as in VC++) in Qt Creator? In particular, I would like to copy the executable to a different folder after it has been built. Can it be done?

m.s.
  • 16,063
  • 7
  • 53
  • 88
laurent
  • 88,262
  • 77
  • 290
  • 428

2 Answers2

6

Add execution of a script to copy the files as a build step as below, alt text

Sulla
  • 7,631
  • 9
  • 45
  • 71
3

You will find here all the variables you can use in your project file (.pro): http://doc.qt.nokia.com/4.7/qmake-variable-reference.html.

The one you are searching for is: DESTDIR

Anyway, in QtCreator you can customize all the build and link operation by adding/removing instructions in the Project tab.

Christophe Weis
  • 2,518
  • 4
  • 28
  • 32
Patrice Bernassola
  • 14,136
  • 6
  • 46
  • 59
  • You can also use [QMAKE_POST_LINK](http://doc.qt.io/qt-5/qmake-variable-reference.html#qmake-post-link) in your. .pro file, which couples it closer to the .pro file than the Project Build Settings. But it only runs when the link triggers, not every time you fire the build. – JimB Jun 16 '18 at 12:05