Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Create a C++ plugin: how to install headers?
Forum Updated to NodeBB v4.3 + New Features

Create a C++ plugin: how to install headers?

Scheduled Pinned Locked Moved General and Desktop
pluginqml
1 Posts 1 Posters 670 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.
  • L Offline
    L Offline
    lorenzo.luci
    wrote on last edited by
    #1

    Hi!
    I've written a plugin following this guide http://doc.qt.io/qt-5/qtqml-modules-cppplugins.html, and now I've something perfectly working that I can instantiate from qml.
    The last building step install the file .so in default qml dir of qt.
    However, I would like to install it as a "library" as well. I can explain my case: I need to create one of the object defined in the plugin from the c++ code of another project, and in order to do it, I need the header and the relative library to be placed in QT_INSTALL_HEADERS and QT_INSTALL_LIBS.

    How can I setup the project to build the plugin as both "QML plugin" and "library like"?

    From this https://wiki.qt.io/How_to_create_a_library_with_Qt_and_use_it_in_an_application,
    it's seems that I've to add to the .pro these lines:

    headersDataFiles.path = $$[QT_INSTALL_HEADERS]/MyLib/
    headersDataFiles.files = $$PWD/src/*.h
    INSTALLS += headersDataFiles

    libraryFiles.path = $$[QT_INSTALL_LIBS]
    Debug:libraryFiles.files = $$OUT_PWD/debug/.a $$OUT_PWD/debug/.prl
    Release:libraryFiles.files = $$OUT_PWD/release/.a $$OUT_PWD/release/.prl
    INSTALLS += libraryFiles

    Is it the right procedure?

    Thanks

    This is the code of the plugin https://github.com/chili-epfl/qml-3dmouseinterface

    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