Files
qhotkey-mirror/HotkeyTest/CMakeLists.txt
T
Daniel Bermond 25f21849b3 Add support for Qt6 (#51)
CMake:
The 'QT_MAJOR' CMake variable controls which major version
of Qt is used for building. Defaults to '5', so nothing
changes when using the default 'cmake' invocation, as it
will default to search/build for Qt5.

qmake:
Just build in the usual way with 'qmake6 && make' or
'qmake-qt5 && make'.

When building with Qt6 on GNU/Linux and similar UNIXes,
the minimium required Qt version is 6.2.0, as Qt 6.1
and 6.0 lacks support for getting the X11 display.
2021-09-30 20:46:35 +03:00

18 lines
529 B
CMake

set(CMAKE_INCLUDE_CURRENT_DIR ON)
if(QT_MAJOR GREATER_EQUAL 6)
qt_wrap_ui(test_UI_HEADERS hottestwidget.ui)
qt_wrap_cpp(test_MOC_HEADERS hottestwidget.h)
else()
qt5_wrap_ui(test_UI_HEADERS hottestwidget.ui)
qt5_wrap_cpp(test_MOC_HEADERS hottestwidget.h)
endif()
add_executable(HotkeyTest
main.cpp
hottestwidget.cpp
${test_UI_HEADERS}
${test_MOC_HEADERS})
target_link_libraries(HotkeyTest Qt${QT_MAJOR}::Widgets qhotkey)
target_include_directories(HotkeyTest PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})