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. Include Qt6 libs in CMake project on macOS
Forum Updated to NodeBB v4.3 + New Features

Include Qt6 libs in CMake project on macOS

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 364 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.
  • D Offline
    D Offline
    developer23
    wrote on last edited by
    #1

    Hi,

    I'm trying to transfer project from Qt5 to Qt6 on macOS, but there's some problem. In Qt6 modules (QtCore, QtGui, ...) have structure: QtCore.framework - Headers, QtCore, Resources, Versions. In CMake I include Headers and nested folders and then compiler emit error: "qtstring.h:14:10 fatal error 'QtCore/qchar.h' not found".

    Is there some solution to fix that? Maybe there is alias for "QtCore.framework" to "QtCore" folder name?

    jsulmJ 1 Reply Last reply
    0
    • D developer23

      Hi,

      I'm trying to transfer project from Qt5 to Qt6 on macOS, but there's some problem. In Qt6 modules (QtCore, QtGui, ...) have structure: QtCore.framework - Headers, QtCore, Resources, Versions. In CMake I include Headers and nested folders and then compiler emit error: "qtstring.h:14:10 fatal error 'QtCore/qchar.h' not found".

      Is there some solution to fix that? Maybe there is alias for "QtCore.framework" to "QtCore" folder name?

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by jsulm
      #2

      @developer23 said in Include Qt6 libs in CMake project on macOS:

      In CMake I include Headers and nested folders and then compiler emit

      This sounds wrong. You should only tell CMake which Qt modules you need, like:

      find_package(Qt6 REQUIRED COMPONENTS Core)
      target_link_libraries(mytarget PRIVATE Qt6::Core)
      

      Also, there is no need to have module names in includes:

      #include <QChar>
      

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved