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. Qmake Mac resources
Forum Updated to NodeBB v4.3 + New Features

Qmake Mac resources

Scheduled Pinned Locked Moved Qt Creator and other tools
8 Posts 4 Posters 3.3k 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.
  • C Offline
    C Offline
    cincirin
    wrote on last edited by
    #1

    Does anybody know how to use "Mac resource compiler":https://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man1/Rez.1.html with qmake ? Basically I need to build some *.r mac resource files. I know for windows qmake exist RC_FILE variable. Am I missing something from qmake documentation ?

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      Do you need to use this compiler before compilation of your code, or is it enough to run it after? If so, you can use "QMAKE_POST_LINK":http://qt-project.org/doc/qt-4.8/qmake-variable-reference.html#qmake-post-link to pass a custom script, which would run the tool.

      (Z(:^

      1 Reply Last reply
      0
      • C Offline
        C Offline
        cincirin
        wrote on last edited by
        #3

        Hi @sierdzio. I know about QMAKE_POST_LINK but with this, Rez will produce say "rez.out". How can I link this output with my application ? I thought there is a simpler solution like RC_FILE for windows ...

        1 Reply Last reply
        0
        • sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #4

          I don't know if there is any built-in solution. You can probably use QMAKE_PRE_LINK to get the .o file, and then add it to linker options somehow.

          (Z(:^

          1 Reply Last reply
          0
          • C Offline
            C Offline
            cincirin
            wrote on last edited by
            #5

            Ok, thanks. Other solution I think would be:

            @
            MACREZ.target = rez.out
            MACREZ.commands = Rez inputFile.r -i includePaths ... etc ... all flags
            PRE_TARGETDEPS += rez.out
            @

            If other simple solutions (like RC_FILE) don't exist I'll try these, although is less ugly ...

            1 Reply Last reply
            0
            • H Offline
              H Offline
              hrodstein
              wrote on last edited by
              #6

              Assume we are creating an application named MyApp in a folder named MyFolder which is at the same level as the folder containing the .pro file.

              Assume that the Rez input file, MacResources.r, is in src/Resources relative to the .pro file.

              Then these qmake commands will compile the Rez input file and store the output in the application bundle.

              REZ_SOURCE_DIR = $${PWD}/src/Resources
              APP_BUNDLE_DIR = $${PWD}/../MyFolder/MyApp.app
              RezSource = $${REZ_SOURCE_DIR}/MacResources.r
              RezDest = $${APP_BUNDLE_DIR}/Contents/Resources/MyApp.rsrc
              QMAKE_POST_LINK += Rez $${RezSource} -o $${RezDest}

              H 1 Reply Last reply
              0
              • C Offline
                C Offline
                cincirin
                wrote on last edited by
                #7

                Hi, thanks for your input. In the meantime I solved the problem with XCode project. But, for sure I'll test your solution.

                1 Reply Last reply
                0
                • H hrodstein

                  Assume we are creating an application named MyApp in a folder named MyFolder which is at the same level as the folder containing the .pro file.

                  Assume that the Rez input file, MacResources.r, is in src/Resources relative to the .pro file.

                  Then these qmake commands will compile the Rez input file and store the output in the application bundle.

                  REZ_SOURCE_DIR = $${PWD}/src/Resources
                  APP_BUNDLE_DIR = $${PWD}/../MyFolder/MyApp.app
                  RezSource = $${REZ_SOURCE_DIR}/MacResources.r
                  RezDest = $${APP_BUNDLE_DIR}/Contents/Resources/MyApp.rsrc
                  QMAKE_POST_LINK += Rez $${RezSource} -o $${RezDest}

                  H Offline
                  H Offline
                  hope
                  wrote on last edited by
                  #8

                  @hrodstein
                  I am really quite new to the mac and QT. I need some brief explanation on the same. I have project out as "dylib" so can I link the rez output to directly to "dylib" file?
                  Quick reply will be appropriated.

                  Thanks & Regards,
                  -Harshil

                  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