Hello all,
I'm trying to get qmake to run qhelpgenerator and qcollectiongenerator for me at build time, and that part works - however, the problem I'm having is that I can't seem to get the contents of OTHER_FILES to be copied into the build directory during build. I tried adding a manual copy command, but the PWD variable always includes the build directory (not where the project file is located, as per the docs), and OUT_PWD is always blank. Take the following example (which is a .pri file, included from a subdirectory):
# load correct help libraries for specific OSes
# and copy correct files to correct locations during build
help_copy.target = dox
help_copy.commands = @echo "Building Help Collections";
win32 {
CONFIG += help
}
macx {
LIBS += -framework QtHelp
help_copy.commands += echo "cp $$(PWD)/docs/* $$(OUT_PWD)/";
help_copy.commands += $$[QT_INSTALL_BINS]/qhelpgenerator docs.qhp -o docs.qch;
help_copy.commands += $$[QT_INSTALL_BINS]/qcollectiongenerator docs.qhcp -o docs.qhc;
}
QMAKE_EXTRA_TARGETS += help_copy
POST_TARGETDEPS += dox
OTHER_FILES += \
docs/foodoc.html \
docs/foo-ovr.png \
docs/docs.qhp \
docs/docs.qhcp \
docs/docs.qhc \
docs/docs.qch
HEADERS += \
docs/helpwindow.h \
docs/helpbrowser.h
SOURCES += \
docs/helpwindow.cpp \
docs/helpbrowser.cpp
FORMS += \
docs/helpwindow.ui
# load correct help libraries for specific OSes
# and copy correct files to correct locations during build
help_copy.target = dox
help_copy.commands = @echo "Building Help Collections";
win32 {
CONFIG += help
}
macx {
LIBS += -framework QtHelp
help_copy.commands += echo "cp $$(PWD)/docs/* $$(OUT_PWD)/";
help_copy.commands += $$[QT_INSTALL_BINS]/qhelpgenerator docs.qhp -o docs.qch;
help_copy.commands += $$[QT_INSTALL_BINS]/qcollectiongenerator docs.qhcp -o docs.qhc;
}
QMAKE_EXTRA_TARGETS += help_copy
POST_TARGETDEPS += dox
OTHER_FILES += \
docs/foodoc.html \
docs/foo-ovr.png \
docs/docs.qhp \
docs/docs.qhcp \
docs/docs.qhc \
docs/docs.qch
HEADERS += \
docs/helpwindow.h \
docs/helpbrowser.h
SOURCES += \
docs/helpwindow.cpp \
docs/helpbrowser.cpp
FORMS += \
docs/helpwindow.ui
To copy to clipboard, switch view to plain text mode
The build output produces the following:
Building Help Collections
cp /Users/user/Source/Software/Foo/trunk/Foo-build-desktop-Desktop_Qt_4_8_0_RC_for_GCC__Qt_SDK__Debug/gui/docs/* /
Could not open /Users/user/Source/Software/Foo/trunk/Foo-build-desktop-Desktop_Qt_4_8_0_RC_for_GCC__Qt_SDK__Debug/gui/docs.qhp.
Could not open /Users/user/Source/Software/Foo/trunk/Foo-build-desktop-Desktop_Qt_4_8_0_RC_for_GCC__Qt_SDK__Debug/gui/docs.qhcp.
make[1]: *** [dox] Error 255
Building Help Collections
cp /Users/user/Source/Software/Foo/trunk/Foo-build-desktop-Desktop_Qt_4_8_0_RC_for_GCC__Qt_SDK__Debug/gui/docs/* /
Could not open /Users/user/Source/Software/Foo/trunk/Foo-build-desktop-Desktop_Qt_4_8_0_RC_for_GCC__Qt_SDK__Debug/gui/docs.qhp.
Could not open /Users/user/Source/Software/Foo/trunk/Foo-build-desktop-Desktop_Qt_4_8_0_RC_for_GCC__Qt_SDK__Debug/gui/docs.qhcp.
make[1]: *** [dox] Error 255
To copy to clipboard, switch view to plain text mode
Where the .pro file is located in /Users/user/Source/Software/Foo/trunk/Foo/, the .pri file is located in /Users/user/Source/Software/Foo/trunk/Foo/docs/, and the build directory is /Users/user/Source/Software/Foo/trunk/Foo-build-desktop-Desktop_Qt_4_8_0_RC_for_GCC__Qt_SDK__Debug/
Any advice on what I've done wrong here? Is there a an easier way than a manual copy command to get OTHER_FILES into the build directory?
Thanks!
Bookmarks