Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Is there an easy way of recursively copying files with QMAKE_BUNDLE_DATA?
Forum Update on Monday, May 27th 2025

Is there an easy way of recursively copying files with QMAKE_BUNDLE_DATA?

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
iosqmakeosx
1 Posts 1 Posters 981 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    timday
    wrote on 2 Nov 2015, 23:14 last edited by timday 11 Feb 2015, 23:24
    #1

    I have a recursive directory structure I'd like to copy into OSX/iOS app bundles. For example

    MyStuff/
      Mystuff/dir0/
        Mystuff/dir0/file0
        Mystuff/dir0/file1
      Mystuff/dir1/
        Mystuff/dir1/file2
        Mystuff/dir1/file3
    

    I have no problem doing this directory by directory with

      MYSTUFF_DIR0.path = MyStuff/dir0
      MYSTUFF_DIR0.files += $$files(MyStuff/dir0/file*)
      QMAKE_BUNDLE_DATA +=  MYSTUFF_DIR0
      MYSTUFF_DIR1.path = MyStuff/dir1
      MYSTUFF_DIR1.files += $$files(MyStuff/dir1/file*)
      QMAKE_BUNDLE_DATA +=  MYSTUFF_DIR1
    

    but as directory hierarchies become deeper this gets painful.

    An obvious solution looked like it might be to use the recursive option of $$files:

      MYSTUFF.path = MyStuff/
      MYSTUFF.files += $$files(Mystuff/*,true)
      QMAKE_BUNDLE_DATA +=  MYSTUFF_DIR0
    

    but all that does is flatten the files into MyStuff/file0, MyStuff/file1, MyStuff/file2, MyStuff/file3 which isn't what I want.

    Is there an easy trick for doing this?

    Yes I do know about qrc files! Normally they'd be my first choice for including this sort of data (a few lines of script can generate the .qrc XML), but in this case I have good reason for wanting to keep the .app's data out of a qrc: my collaborators like to be able to hack on the files in the built osx app bundle to try out changes.

    1 Reply Last reply
    0

    1/1

    2 Nov 2015, 23:14

    • Login

    • Login or register to search.
    1 out of 1
    • First post
      1/1
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved