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. Using 'staticlib' and 'lib_bundle' together
Forum Updated to NodeBB v4.3 + New Features

Using 'staticlib' and 'lib_bundle' together

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
5 Posts 2 Posters 1.0k 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.
  • Uncle_MastaU Offline
    Uncle_MastaU Offline
    Uncle_Masta
    wrote on last edited by A Former User
    #1

    On Mac or iOS, with Qt 5.9.3 or Qt 5.10, in my .pro, I have:
    CONFIG += lib_bundle

    And when I use:
    CONFIG += shared

    This will result in a .framework bundle, but
    CONFIG += staticlib
    or
    CONFIG += static

    This will only build the lib$$TARGET.a, and not a contained .framework. Is there another variable or tweak to get this to work?

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

      Hi,

      AFAIK, there’s no concept of static framework. It’s either one or the other.

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

      Uncle_MastaU 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        AFAIK, there’s no concept of static framework. It’s either one or the other.

        Uncle_MastaU Offline
        Uncle_MastaU Offline
        Uncle_Masta
        wrote on last edited by
        #3

        @SGaist You could only make static frameworks under iOS until fairly recently.

        Either way, at the end, it's headers and the library under one directory, which isn't hard to do, but I would just rather use the existing system to do that.

        1 Reply Last reply
        0
        • Uncle_MastaU Offline
          Uncle_MastaU Offline
          Uncle_Masta
          wrote on last edited by
          #4

          Well, I couldn't figure out any magic incantation, so I just added the following:

                      QMAKE_POST_LINK += mkdir -p $${TARGET}.framework/Headers && \
                          $$QMAKE_COPY $$PWD/*.h $${TARGET}.framework/Headers && \
                          $$QMAKE_COPY $$OUT_PWD/lib$${TARGET}.a $${TARGET}.framework/$${TARGET} && \
                          $$QMAKE_RANLIB -s $${TARGET}.framework/$${TARGET}
          

          Obviously, this only works on unix-like systems, and not versioned frameworks. But, for static linking, I think this is sufficient.

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

            Thanks for the feedback

            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