Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [solved] using wildcard characters with .path/.files and QMAKE_BUNDLE_DATA
Forum Updated to NodeBB v4.3 + New Features

[solved] using wildcard characters with .path/.files and QMAKE_BUNDLE_DATA

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 2.2k Views 1 Watching
  • 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.
  • K Offline
    K Offline
    kloveridge
    wrote on last edited by
    #1

    I've been at this now for a day and its been a frustrating learning experience. After many hours of testing, I got this loading content into the bundle on ios (this is in my .pro file):

    @packets.files = ../Ankh/assets/packets/cube.gly
    ../Ankh/assets/packets/libtest.gly
    packets.path = packets

    textures.files = ../Ankh/assets/textures/bridgewood.tga
    ../Ankh/assets/textures/coinPickup.tga
    ../Ankh/assets/textures/cube_lmap_1.tga
    ../Ankh/assets/textures/cube_lmap_2.tga
    ../Ankh/assets/textures/cube_lmap_3.tga
    ../Ankh/assets/textures/cube_lmap_4.tga
    ../Ankh/assets/textures/cube_lmap_5.tga
    ../Ankh/assets/textures/cube_lmap_6.tga
    ../Ankh/assets/textures/default_diffuse.tga
    ../Ankh/assets/textures/default_lm.tga
    ../Ankh/assets/textures/default_nm.tga
    ../Ankh/assets/textures/default_ramp.tga
    ../Ankh/assets/textures/forest_Tree_Bark.tga
    ../Ankh/assets/textures/overlay2x.tga
    textures.path =textures
    QMAKE_BUNDLE_DATA += packets textures@

    Two problems. One, I would prefer to use a wild card character like this:

    @packets.files = ../Ankh/assets/packets/*.gly
    packets.path = packets

    textures.files = ../Ankh/assets/textures/*.tga
    textures.path =textures
    QMAKE_BUNDLE_DATA += packets textures@

    but it doesn't like it. I thought I might just specify the folder and maybe it would get the hint to include everything in the folder like this:

    @packets.files = ../Ankh/assets/packets
    packets.path = packets

    textures.files = ../Ankh/assets/textures
    textures.path =textures
    QMAKE_BUNDLE_DATA += packets textures@

    It doesn't like that either.

    The second problem is the path. I wanted to specify a path that isn't relative to the project such as this:

    @packets.files = $(HOME)/toon/assets/packets/*.tga
    packets.path = packets

    textures.files = $(HOME)/toon/assets/texture/*.tga
    textures.path =textures
    QMAKE_BUNDLE_DATA += packets textures@

    And it doesn't like that either! Anyone have any advice here?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      With Qt 5 you have the file function. Something like:

      @packets.files = $$files($(HOME)/toon/assets/packets/*.tga)@

      should do the job

      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
      0
      • K Offline
        K Offline
        kloveridge
        wrote on last edited by
        #3

        You magnificient bast####! That worked! Thats why you are paid the big bucks! Thanks so much!

        Not to look a gift horse in the mouth, how/where did you read about this solution? I've looked and looked and finally had to shelf the problem.

        My final code now looks like this:

        @packets.files = $$files($(HOME)/toon/assets/packets/*.gly)
        packets.path = packets

        textures.files = $$files($(HOME)/toon/assets/textures/*.tga)
        textures.path =textures
        QMAKE_BUNDLE_DATA += packets textures@

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Big bucks ? Where ? :D

          You're welcome !

          I remembered that there already was a similar question once but "files" was not yet documented. It is now the Qt 5 qmake manual under Test Functions

          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
          0

          • Login

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