Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. cmake qt_add_qml_module and installation
Qt 6.11 is out! See what's new in the release blog

cmake qt_add_qml_module and installation

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 616 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.
  • I Offline
    I Offline
    inogeni
    wrote on last edited by
    #1

    Hi everyone ,

    I'm confused about the installation part of a qml module with instruction qt_add_qml_module , so if someone could explain it to me , that will be really appreciated. i went through the documentation , but there are still points that i dont get.

    in my qt_add_qml_module, i call the function like this :

    qt_add_qml_module ( MyQmlModule
    URI MyNamespace.MyQmlModule
    OUTPUT_DIRECTORY "MyNamespace/MyQmlModule"
    VERSION 1.0
    SOURCES myType.h myType.cpp
    QML_FILES MyQmlType.qml
    )
    

    something really basic.

    i understand that the function will automatically generate the associated plugin for me (
    used for the registration of the types etc.) something called MyQmlModuleplugin

    but if I use the following instruction :

    install(TARGETS MyQmlModule DESTINATION ${CMAKE_INSTALL_PREFIX}/qml)
    

    only the MyQmlModule will be install in the directory, but not the plugin nor the qmldir files or any of the other files (generated ones or qml files) .

    to install the plugin , i have to explicitly add the plugin target to the install instruction.
    can you confirm that I have to that ? and that qt_add_qml_module would not do it automatically for me ?

    what about the other files ( qmldir file etc. ) ? i know that the qml files and resources will be compiled as bytecodes and embedded into the module dll , but do i have to install those files anyway - as they are generated in the build tree ?

    Thank you in advance for any help and clarification that you can provide

    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