2
votes

I'm using QtCreator and I want to specify some pre-build event before build can happen. I've a project that must install some header file on a directory. This is the root of the projects.

root
   |
   |-- AProjectWorkSpace
   |  |-- ProjectA
   |  |  |-- source
   |  |  |-- .pro
   |  |-- ProjectB
   |     |-- source
   |     |-- .pro
   |-- AnotherProjectWorkspace
   |  |-- ProjectC
   |  |   |-- source
   |  |   |-- .pro
   |  |-- ProjectD
   |      |-- source
   |      |-- .pro 
library
   |-- include
   |-- lib

When I build Project A, B, C or D. I want first copy all headers inside library/include. How can I do?

1

1 Answers

1
votes

Write a shell script that copies your header files from each source directory into library/include. Then add a custom build step in Qt Creator, where you can call your script. Move the custom build step between qmake and make build steps by clicking on the ^ icon on the upper-right corner of the custom build panel so that your script is run before the make command is run by Qt Creator.