Qmake copy files generated during build
I have a qmake project for a library:
QT += gui
TARGET = qturtle
TEMPLATE = lib
DEFINES += QTURTLE_LIBRARY
SOURCES += qturtle.cpp
HEADERS += qturtle.h\
qturtle_global.h
docMake.commands = doxygen;
QMAKE_EXTRA_TARGETS += docMake
PRE_TARGETDEPS += docMake
QMAKE_DISTCLEAN += $$PWD/html/ -r
QMAKE_DISTCLEAN += doxygen_sqlite3.db
unix {
docInstall.path = /usr/share/doc/qturtle
docInstall.files = $$PWD/html/
headerInstall.files = $$HEADERS
headerInstall.path = /usr/include/qturtle
target.path = /usr/lib
INSTALLS += docInstall
INSTALLS += target
INSTALLS += headerInstall
}
docMake
starts doxygen
in the project directory and creates the "html" directory and its contents (at build time!) "html" and its contents should now be copied to / usr / share / doc / qturtle using a variable INSTALL
. BUT: qmake does not generate the docInstall
install code because $$PWD/html
its contents do not exist at the time the makefile is created. Can anyone tell me how to avoid this problem, or should I use cp
?
Thanks in advance, Marius
source to share
There are two approaches to solving this problem.
Don't check again the original empty directory
docInstall.CONFIG += no_check_exist directory
Since this directory will be created on the fly, I would personally choose this.
Create directory explicitly
createDirs.commands = $$QMAKE_MKDIR $$PWD/html
This can be done either in the target or even in the call system("$$QMAKE_MKDIR $$PWD/html")
, depending on your needs.
source to share