Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Copy directory structure to deployment folder
Forum Update on Monday, May 27th 2025

Copy directory structure to deployment folder

Scheduled Pinned Locked Moved Solved Mobile and Embedded
6 Posts 2 Posters 657 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.
  • O Offline
    O Offline
    ocgltd
    wrote on 16 Jan 2021, 04:55 last edited by ocgltd
    #1

    My source try includes audio files with identical names, in different directories. Eg:

    • assets/snd/page1/hello.wav
    • assets/snd/page2/hello.wav

    In order to deploy on ios I need to copy these files to the deployment (I think) directory.

    copydata.commands = $(COPY_DIR) $$PWD/assets/snd $$OUT_PWD/assets/snd
    first.depends = $(first) copydata
    export(first.depends)
    export(copydata.commands)
    QMAKE_EXTRA_TARGETS += first copydata
    

    So this works, but the files might be in the wrong place. I want them accessible from my QML program under assets/snd however, the above copies them to the BUILD directory. Does putting them in the build directory get them deployed?

    If not, how can I fix this?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 16 Jan 2021, 16:12 last edited by
      #4

      So your directly structure is the same but shifted in a different folder, correct ?

      The thing is: the bundle follows a pretty strict structure so your application might get rejected because of that. Nothing Qt specific.

      See here for the recommendations.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • S Offline
        S Offline
        SGaist
        Lifetime Qt Champion
        wrote on 16 Jan 2021, 07:58 last edited by
        #2

        Hi,

        See the iOS platform notes for the technique to bundle your files.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        2
        • O Offline
          O Offline
          ocgltd
          wrote on 16 Jan 2021, 13:36 last edited by ocgltd
          #3

          I tried that - I assume you mean:

          ios {
              fontFiles.files = $$files(fonts/*.ttf)
              fontFiles.path = fonts
              QMAKE_BUNDLE_DATA += fontFiles
          }
          

          The problem is that all the files get dumped into a single directory. Since I have identical file names this does not work. I need to preserve the directory structure

          I see an identical question asked here in 2015 but no answer.

          1 Reply Last reply
          0
          • S Offline
            S Offline
            SGaist
            Lifetime Qt Champion
            wrote on 16 Jan 2021, 16:12 last edited by
            #4

            So your directly structure is the same but shifted in a different folder, correct ?

            The thing is: the bundle follows a pretty strict structure so your application might get rejected because of that. Nothing Qt specific.

            See here for the recommendations.

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            1
            • O Offline
              O Offline
              ocgltd
              wrote on 16 Jan 2021, 18:22 last edited by
              #5

              Interesting read...it the doc identifies where to put certain resources, but doesn't say where to put anything that doesn't fit their categories.

              So if that means sound (resource) files should reside in root of the app folder, then I suppose each resource must have a unique name. I'm hoping not to go back and redesign my app at this point. So I'll see what happens with current structure

              1 Reply Last reply
              0
              • S Offline
                S Offline
                SGaist
                Lifetime Qt Champion
                wrote on 16 Jan 2021, 18:39 last edited by
                #6

                IIRCR there's one "Resources" folder that is one the same level as the folder containing the executable (or maybe one above) where you can put the various bits and pieces that are not Framework and plugins.

                Then all that would be required for you is to have a "prefix" that you configure using an ifdef and use it when needing to load these files.

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply
                1

                1/6

                16 Jan 2021, 04:55

                • Login

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