Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. Qt 6
  4. qt6_add_qml_module How to configure include directory with CMake
Forum Updated to NodeBB v4.3 + New Features

qt6_add_qml_module How to configure include directory with CMake

Scheduled Pinned Locked Moved Unsolved Qt 6
1 Posts 1 Posters 423 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.
  • T Offline
    T Offline
    Tadinu
    wrote on last edited by Tadinu
    #1

    Hi, I'm trying to expose my cpp-based class as a qml item with qml cmake api.
    Afaik, qt6_add_qml_module is introduced to CMake in Qt6 so we don't have to use qmlRegisterType, as noted in this link and this SO answer also.

    • I just have an issue with configuring include directories by target_include_directories, which works well as usual before me adding qt6_add_qml_module.
    • The example shown in the link above is quite simple in the way that both extrathing.h/.cpp stay under the same folder, but typically our sources are put into different hierarchical folders.
      -> In that case, cpp files specified under SOURCES could not recognize include paths configured by target_include_directories anymore.

    Would there be some way to help solve this do you guys happen to know? I also checked qt-custom-cmake commands but it seems to have no specific one for the purpose.
    I'd really appreciate if @SGaist or someone in the champion group could share about some idea.
    Thank you!

    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