如何将Qt专用标头添加到CMakeLists.txt?
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core Quick QuickPrivate REQUIRED)
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Quick QuickPrivate REQUIRED)
如果要使用“ QTMOD”子模块的专用API,则必须仅使用变量包含标头:
Qt${QT_VERSION_MAJOR}QTMOD_INCLUDE_DIRS
在你的情况下:
include_directories(${Qt${QT_VERSION_MAJOR}Quick_PRIVATE_INCLUDE_DIRS})
注意:不存在QuickPrivate