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):

Qt Code:
  1. # load correct help libraries for specific OSes
  2. # and copy correct files to correct locations during build
  3.  
  4. help_copy.target = dox
  5. help_copy.commands = @echo "Building Help Collections";
  6.  
  7.  
  8. win32 {
  9. CONFIG += help
  10. }
  11.  
  12. macx {
  13. LIBS += -framework QtHelp
  14. help_copy.commands += echo "cp $$(PWD)/docs/* $$(OUT_PWD)/";
  15. help_copy.commands += $$[QT_INSTALL_BINS]/qhelpgenerator docs.qhp -o docs.qch;
  16. help_copy.commands += $$[QT_INSTALL_BINS]/qcollectiongenerator docs.qhcp -o docs.qhc;
  17. }
  18.  
  19. QMAKE_EXTRA_TARGETS += help_copy
  20. POST_TARGETDEPS += dox
  21.  
  22. OTHER_FILES += \
  23. docs/foodoc.html \
  24. docs/foo-ovr.png \
  25. docs/docs.qhp \
  26. docs/docs.qhcp \
  27. docs/docs.qhc \
  28. docs/docs.qch
  29.  
  30. HEADERS += \
  31. docs/helpwindow.h \
  32. docs/helpbrowser.h
  33.  
  34. SOURCES += \
  35. docs/helpwindow.cpp \
  36. docs/helpbrowser.cpp
  37.  
  38. FORMS += \
  39. docs/helpwindow.ui
To copy to clipboard, switch view to plain text mode 

The build output produces the following:

Qt Code:
  1. Building Help Collections
  2. cp /Users/user/Source/Software/Foo/trunk/Foo-build-desktop-Desktop_Qt_4_8_0_RC_for_GCC__Qt_SDK__Debug/gui/docs/* /
  3. 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.
  4. 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.
  5. 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!