Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. [Solved][Moved]How to build static Mac Qt file for distribution...
Forum Updated to NodeBB v4.3 + New Features

[Solved][Moved]How to build static Mac Qt file for distribution...

Scheduled Pinned Locked Moved Installation and Deployment
5 Posts 3 Posters 7.1k 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.
  • S Offline
    S Offline
    st2000
    wrote on last edited by
    #1

    Hi...

    I'm a bit new to Qt and really new to Qt on a Mac. I'm still getting my head around what an Apple bundle is and if that is what I really want. Add to that, I am uncertain on how to include Qt "*.ini" files as well as an SQL data base file into a bundle (if a bundle is waht I need). And if that was not enough, I am trying to read this:
    http://developer.qt.nokia.com/doc/qt-4.7/deployment-mac.html
    and am quickly getting no where.

    My background is Unix, then Windows then a little bit of Mac.

    Perhaps it is best to state what I have & need:

    1. I have a working Qt application which runs on a Window, Linux and Mac machine.
    2. All these computers are loaded up with a Qt development package.
    3. My Qt application uses a Qt *.ini file and a SQL database file.
    4. I would like to give a self contained copy of the program to the marketer who has a Mac where Qt is not installed and is never going to be installed.

    So, I'm trying to make #4 above to happen. I am reading the above web page. But I don't even know where the Mac's Qt directory is so I can't even carry out the configure step to install the Qt Static Libraries.

    Any help would be appreciated.

    -thanks

    1 Reply Last reply
    0
    • D Offline
      D Offline
      dangelog
      wrote on last edited by
      #2

      Don't use static libraries -- compile Qt as frameworks and use the macdeployqt script (or follow the instructions manually) to create an application bundle, containing both your application and Qt libraries.

      Software Engineer
      KDAB (UK) Ltd., a KDAB Group company

      1 Reply Last reply
      0
      • S Offline
        S Offline
        st2000
        wrote on last edited by
        #3

        @peppe
        Thanks, that worked. Although I am still struggling along in Mac land. It is very difficult to figure out where OSX puts executables. And the fact that the names of the executables in the instructions do not match what is downloaded (I am not sure if any unpacking occurred) doesn't help. I tried using the Unix/Linux updatedb and locate utilities but I am wondering if they operate the same here in Mac land. Regardless, I was able to create a "Mac bundle" (I think that's what they are called) that executed our Qt application on a Mac which (I believe) had not had any Qt support installed. Yeah!

        1 Reply Last reply
        0
        • G Offline
          G Offline
          goetz
          wrote on last edited by
          #4

          A Mac OS X application bundle is just a directory with a special extension (.app in this case). From the file system view it is a directory, the Finder shows it as a file (you can view the contens by right-click on the app and choosing "show package contentes").

          The anatomy of an application is described in "Apple's Bundle Programming Guide":http://developer.apple.com/library/mac/#documentation/CoreFoundation/Conceptual/CFBundles/Introduction/Introduction.html.

          Mac users are used to just drag an application bundle and drop it wherever they want. The usual place is the /Applications folder, but it is by no means a "must". One can happily drag the bundle to the desktop, for instance.

          In order to distribute the application, you have basically two options:

          • compress the bundle and distribute the resulting archive (eg. myapp.zip)
          • create a disk image file, copy the bundle there and distribute the disk image (a disk image is similar to an iso image)

          The ZIP alternative is easier for you, the disk image is what's more commonly but slightly more work for you.

          A quick and short way to create an image is this command line:

          @
          cd /path/to/the/dir/with-your-app
          hdiutil create -format UDBZ -quiet -srcfolder YourApp.app YourAppArchive.dmg
          @

          This will create a compressed disk image named YourAppArchive.dmg in the same folder and copies the application bundle into it. You then can distribute the dmg to your Mac users.

          http://www.catb.org/~esr/faqs/smart-questions.html

          1 Reply Last reply
          0
          • S Offline
            S Offline
            st2000
            wrote on last edited by
            #5

            @Volker
            Thank you - that's clear enough even I can follow it. Very nice of you to take the time.

            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