Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. Showcase
  4. CMake Script to generate Q_IMPORT_PLUGIN to link against static Qt
QtWS25 Last Chance

CMake Script to generate Q_IMPORT_PLUGIN to link against static Qt

Scheduled Pinned Locked Moved Showcase
3 Posts 2 Posters 1.3k Views
  • 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.
  • O Offline
    O Offline
    OlivierLdff
    wrote on last edited by OlivierLdff
    #1

    Hi I would like to introduce to you a small CMake script a made in order to generate Q_IMPORT_PLUGIN macro when linking with static version of Qt. (For ios for example). This is a native feature of qmake but was missing with CMake build.
    This is composed of 2 macros, one to generate the *_plugin_import.cpp and the other to generate *_qml_plugin_import.cpp.
    I hope this will help some folks around, feel free to contribuate/test.

    Github : https://github.com/OlivierLDff/QtStaticCMake

    Ps: I Hope this is the good place to post.

    raven-worxR 1 Reply Last reply
    1
    • O OlivierLdff

      Hi I would like to introduce to you a small CMake script a made in order to generate Q_IMPORT_PLUGIN macro when linking with static version of Qt. (For ios for example). This is a native feature of qmake but was missing with CMake build.
      This is composed of 2 macros, one to generate the *_plugin_import.cpp and the other to generate *_qml_plugin_import.cpp.
      I hope this will help some folks around, feel free to contribuate/test.

      Github : https://github.com/OlivierLDff/QtStaticCMake

      Ps: I Hope this is the good place to post.

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by raven-worx
      #2

      @OlivierLdff
      nice, but if i may drop my input:

      you are importing most qml plugins. even when they aren't used. You can use the qmlimportscanner tool (located in the bin dir of the Qt installation) and parse the output. And only include the used plugins. (might require an additional script though)

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      0
      • O Offline
        O Offline
        OlivierLdff
        wrote on last edited by
        #3

        This is already what I use to generate _qml_plugin_import.cpp so I only import required plugin. I have to admit that the other one _plugin_import.cpp generation il a little bit more brute Force and may break in the future

        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