Copy directory structure to deployment folder
-
wrote on 16 Jan 2021, 04:55 last edited by ocgltd
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?
-
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.
-
Hi,
See the iOS platform notes for the technique to bundle your files.
-
wrote on 16 Jan 2021, 13:36 last edited by ocgltd
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.
-
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.
-
wrote on 16 Jan 2021, 18:22 last edited by
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
-
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.
1/6