Important: Please read the Qt Code of Conduct -

QMAKE_BUNDLE_DATA doesn't remove old folders

  • Hi. There's such piece in my .pro which copies 'translations' and 'data' folders:
    @macx {
    appresources.files += resources/translations
    appresources.files += resources/data
    appresources.path = Contents/Resources
    QMAKE_BUNDLE_DATA += appresources

    If these folders don't exist in .app/Contents/Resources, then they're copied just fine. But if they do, then old folders aren't removed, although makefile says that they must be removed (the @$(DEL_FILE) lines):
    @COPY_DIR = cp -f -R
    DEL_FILE = rm -f /Users/svp/mxl_offline_tools/resources/translations
    @$(CHK_DIR_EXISTS) || $(MKDIR)
    @$(DEL_FILE) -r
    @$(COPY_DIR) /Users/svp/mxl_offline_tools/resources/translations /Users/svp/mxl_offline_tools/resources/data
    @$(CHK_DIR_EXISTS) || $(MKDIR)
    @$(DEL_FILE) -r
    @$(COPY_DIR) /Users/svp/mxl_offline_tools/resources/data

    Is it possible to make the folders be removed somehow? QMAKE_PRE_LINK and QMAKE_EXTRA_TARGETS with rm -rf command doesn't work the way I want because QMAKE_BUNDLE_DATA copying is done before building the target:
    @all: Makefile $(TARGET)@

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    You might want to try asking on the interest mailing list, you'll find Qt's developers/maintainers there (this forum is more user oriented).

    Maybe also check the "bug report system": to see if it's a known issue

Log in to reply