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] Framework - Adding .framework to my .app
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] Framework - Adding .framework to my .app

Scheduled Pinned Locked Moved Installation and Deployment
12 Posts 2 Posters 8.1k Views 2 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.
  • M Offline
    M Offline
    maximus
    wrote on 7 May 2015, 20:14 last edited by maximus 5 Nov 2015, 20:46
    #1

    I have a few private .framework that I would like to bundle in my app

    I have linked the framework in my .pro file this way :

    #SFML
    INCLUDEPATH +=  /Users/tourlou2/Dropbox/SFML-2.2-osx-clang-universal/include
    QMAKE_LFLAGS += -F/Users/tourlou2/Dropbox/SFML-2.2-osx-clang-universal/Frameworks
    QMAKE_LFLAGS += -F/Users/tourlou2/Dropbox/SFML-2.2-osx-clang-universal/extlibs
    LIBS += -framework sfml-audio
    LIBS += -framework sfml-system
    LIBS += -framework freetype
    LIBS += -framework sndfile
    
    #OSX Libs
    LIBS += -framework IOKit
    LIBS += -framework CoreFoundation
    

    That seems to work fine, but the frameworks don't get copied inside my myApp.app/Content/Framework/ when I run macdeployqt. (like normal Qt frameworks do) Is there a specific flag I should put if I want the .framework to get copied in my .app?

    Thanks for any help, having a hard time creating the OSX bundle


    Free Indoor Cycling Software - https://maximumtrainer.com

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 8 May 2015, 19:56 last edited by
      #2

      Hi,

      Which version of Qt are you using ?

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

      M 1 Reply Last reply 9 May 2015, 17:41
      0
      • S SGaist
        8 May 2015, 19:56

        Hi,

        Which version of Qt are you using ?

        M Offline
        M Offline
        maximus
        wrote on 9 May 2015, 17:41 last edited by
        #3

        @SGaist

        Hey SGaist, always using the greatest and latest (5.4.1)!
        What I would like is an easy way to link my custom libs (.dylib or .framework) on OSX like on windows.
        On windows, I just link the .lib and copy the lib into /release afterward.

        But for OSX, It seems I need to have the lib installed on my system, which can get complicated when upgrading.
        For example, I just upgraded my project from using SFML 2.1 to 2.2 and I don't like having to put custom lib inside /usr/lib, I would prefer a way that just rely on QMake and and lib linkings in my .pro so that the .dylib or .framework are copied inside the bundled .app and I don't need to install the libs on my dev system.

        Will try a little bit more, just upgraded to OSX 10.10, running in VMware
        Thanks for your help!


        Free Indoor Cycling Software - https://maximumtrainer.com

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 9 May 2015, 23:08 last edited by
          #4

          No you don't. On OS X you provide everything inside your application bundle (except of course system libraries). macdeployqt should find, copy and update your dependencies inside your application bundle.

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

          M 1 Reply Last reply 10 May 2015, 01:01
          0
          • S SGaist
            9 May 2015, 23:08

            No you don't. On OS X you provide everything inside your application bundle (except of course system libraries). macdeployqt should find, copy and update your dependencies inside your application bundle.

            M Offline
            M Offline
            maximus
            wrote on 10 May 2015, 01:01 last edited by maximus 5 Oct 2015, 19:36
            #5

            @SGaist

            Here is the list of dependency for my app:
            The only one being copied correctly: qwt.framework

            otool

            tourlou3s-Mac:MacOS tourlou3$ otool -L MaximumTrainer
            MaximumTrainer:
            /usr/lib/libcrypto.0.9.8.dylib (compatibility version 0.9.8, current version 0.9.8)
            /usr/lib/libssl.0.9.8.dylib (compatibility version 0.9.8, current version 0.9.8)
            /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
            /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1153.18.0)
            @rpath/libsfml-audio.2.3.dylib (compatibility version 2.3.0, current version 2.3.0)
            @executable_path/../Frameworks/qwt.framework/Versions/6/qwt (compatibility version 6.1.0, current version 6.1.0)
            @loader_path/lib/libvlc.5.dylib (compatibility version 11.0.0, current version 11.0.0)
            @loader_path/lib/libvlccore.8.dylib (compatibility version 9.0.0, current version 9.0.0)
            @loader_path/lib/liblzma.5.dylib (compatibility version 6.0.0, current version 6.3.0)
            @executable_path/../Frameworks/QtWebKitWidgets.framework/Versions/5/QtWebKitWidgets (compatibility version 5.4.0, current version 5.4.1)
            @executable_path/../Frameworks/QtWidgets.framework/Versions/5/QtWidgets (compatibility version 5.4.0, current version 5.4.1)
            @executable_path/../Frameworks/QtGui.framework/Versions/5/QtGui (compatibility version 5.4.0, current version 5.4.1)
            @executable_path/../Frameworks/QtCore.framework/Versions/5/QtCore (compatibility version 5.4.0, current version 5.4.1)
            /System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration (compatibility version 1.0.0, current version 1.0.0)
            @executable_path/../Frameworks/QtWebKit.framework/Versions/5/QtWebKit (compatibility version 5.4.0, current version 5.4.1)
            @executable_path/../Frameworks/QtNetwork.framework/Versions/5/QtNetwork (compatibility version 5.4.0, current version 5.4.1)
            @executable_path/../Frameworks/QtPrintSupport.framework/Versions/5/QtPrintSupport (compatibility version 5.4.0, current version 5.4.1)
            @executable_path/../Frameworks/QtSvg.framework/Versions/5/QtSvg (compatibility version 5.4.0, current version 5.4.1)
            @executable_path/../Frameworks/QtConcurrent.framework/Versions/5/QtConcurrent (compatibility version 5.4.0, current version 5.4.1)
            /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0)
            /System/Library/Frameworks/AGL.framework/Versions/A/AGL (compatibility version 1.0.0, current version 1.0.0)
            /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.0.0)
            /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1213.0.0)


            Shoud I assume the user to have libc++.1.dylib, libcrypto.0.9.8.dylib and libssl.0.9.8.dylib ?
            I'm not sure what @rpath mean, I tried to copy the .dylib all over the place in the bundle without success.
            Thanks!

            Here is my .pro part for SFML libs
            INCLUDEPATH += /Users/tourlou3/Dropbox/SFML-2.3-osx-clang-universal/include
            LIBS += /Users/tourlou3/Dropbox/SFML-2.3-osx-clang-universal/lib/libsfml-audio.2.3.0.dylibsystem.2.2.0.dylib


            Free Indoor Cycling Software - https://maximumtrainer.com

            1 Reply Last reply
            0
            • M Offline
              M Offline
              maximus
              wrote on 10 May 2015, 01:31 last edited by maximus 5 Oct 2015, 19:36
              #6

              To include a 3rd party library in the application bundle, copy the library into the bundle manually, after the bundle is created.

              Really? no other way?

              So I have to copy the .dylibs, change the linking with Otool manually?
              This is a lot of work to do at each release

              Having problem doing an "install_name_tool" on the library that is causing problem

              tourlou3s-Mac:MacOS tourlou3$ install_name_tool -change /@rpath/libsfml-audio.2.3.dylib @executable_path/../Frameworks/libsfml-audio.2.3.dylib
              Usage: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool [-change old new] ... [-rpath old new] ... [-add_rpath new] ... [-delete_rpath old] ... [-id name] input


              Free Indoor Cycling Software - https://maximumtrainer.com

              1 Reply Last reply
              0
              • S Offline
                S Offline
                SGaist
                Lifetime Qt Champion
                wrote on 10 May 2015, 21:27 last edited by
                #7

                How are you calling macdeployqt ?

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

                M 1 Reply Last reply 11 May 2015, 14:13
                0
                • S SGaist
                  10 May 2015, 21:27

                  How are you calling macdeployqt ?

                  M Offline
                  M Offline
                  maximus
                  wrote on 11 May 2015, 14:13 last edited by maximus 5 Nov 2015, 16:14
                  #8

                  @SGaist
                  Yes finally I rolled back to SFML 2.1, since 2.2 they use @rpath and this seem to be causing the problem.
                  I was not able to use "install_name_tool" to change the @rpath to @executable_path/../Frameworks. Probably me not knowing how to use install_name_tool correctly


                  Free Indoor Cycling Software - https://maximumtrainer.com

                  1 Reply Last reply
                  0
                  • S Offline
                    S Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on 11 May 2015, 20:16 last edited by
                    #9

                    install_name_tool -change @rpath/libsfml-audio.2.3.dylib @executable_path/../Frameworks/libsfmlaudio.2.3.dylib path/to/your/executable/in/bundle/name_of_your_executable_or_library

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

                    M 1 Reply Last reply 11 May 2015, 20:46
                    0
                    • S SGaist
                      11 May 2015, 20:16

                      install_name_tool -change @rpath/libsfml-audio.2.3.dylib @executable_path/../Frameworks/libsfmlaudio.2.3.dylib path/to/your/executable/in/bundle/name_of_your_executable_or_library

                      M Offline
                      M Offline
                      maximus
                      wrote on 11 May 2015, 20:46 last edited by
                      #10

                      @SGaist
                      Thanks this command worked, will save it for later.
                      SFML 2.3 relies on a bunch of external frameworks (5) compared to (1) for 2.1 so I'll stick to 2.1. Using all theses install_name_tool commands for each deployment is killing me! Windows deployment is much easier..


                      Free Indoor Cycling Software - https://maximumtrainer.com

                      1 Reply Last reply
                      0
                      • S Offline
                        S Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote on 11 May 2015, 22:26 last edited by
                        #11

                        You can write a script for such cases

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

                        M 1 Reply Last reply 12 May 2015, 21:13
                        0
                        • S SGaist
                          11 May 2015, 22:26

                          You can write a script for such cases

                          M Offline
                          M Offline
                          maximus
                          wrote on 12 May 2015, 21:13 last edited by
                          #12

                          Just wanted to say, I finally figured how to set RPATH when building the project.
                          This way it's much easier and no need for install_name_tool

                          #set RPATH (place to look for .dylib & framework by default)
                          QMAKE_RPATHDIR += @executable_path/../Frameworks
                          QMAKE_RPATHDIR += @executable_path/lib
                          

                          Thank you for your help!


                          Free Indoor Cycling Software - https://maximumtrainer.com

                          1 Reply Last reply
                          1

                          1/12

                          7 May 2015, 20:14

                          • Login

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