I have two sub directories docroot
and config
in my Qt project. Files in these directories shall be copied to the build directory whenever I build / debug the project.
As of https://stackoverflow.com/a/3991210/356726 this is possible by using INSTALLS
(QtDoc), which seems to be much easier than running copy command (e.g here). A similar approach is described here.
config.path = $${DESTDIR}/config
config.files = config/*
docroot.path = $${DESTDIR}/docroot
docroot.files = docroot/*
INSTALLS += config docroot
However, when I run a build in Qt Creator nothing happens. This here says I need to run make install
. Can I somehow trigger / do this from within Qt Creator automatically whenever I build. I would need always the latest version of the files.
EDIT: Eventually I have used $$OUT_PWD
instead of $$DESTDIR
Original comment from Logan here:
"Just a note: I used $$OUT_PWD
instead of $$DESTDIR
to make it work. For reference $$OUT_PWD
is the folder that the program is built to, and $$PWD
is the folder that the program is Being built from -in other words it's where the .pro file is."
What you need is a custom build step.
(The version where I checked these is Qt Creator 2.4.1.)