qxtglobalshortcut/cmake/qt6.cmake

14 lines
454 B
CMake
Raw Normal View History

2025-08-27 10:53:32 +08:00
find_package(Qt6 REQUIRED COMPONENTS Widgets)
if (NOT Qt6_FOUND)
message(FATAL_ERROR "Qt 6 is unavailable. To compile with Qt 5 use -DWITH_QT6=OFF.")
endif()
message(STATUS "Building with Qt 6.")
include_directories(${Qt6Gui_PRIVATE_INCLUDE_DIRS})
target_link_libraries(${bin} Qt6::Widgets)
qt6_wrap_cpp(${bin}_mocced ${${bin}_moc})
target_sources(${bin} PRIVATE ${${bin}_mocced})
set(${bin}_pkg_config_requires ${${bin}_pkg_config_requires} Qt6)