where to add PrintSupport in Qt6 CMakeLists.txt
Unsolved
Qt 6
-
Hello
I want to add PrintSupport in Qt6 application, now where i can add the module in CMakeLists.txt,
there are two find_package(), in the first one or in the second one ?find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Widget ) find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets)
-
Hi,
Depending on what you do with then, both.
-
@Habib123
you should put:
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets PrintSupport)and link with the finded library:
target_link_libraries(Test PRIVATE Qt${QT_VERSION_MAJOR}::Widgets PRIVATE Qt${QT_VERSION_MAJOR}::PrintSupport)