diff --git a/CMakeLists.txt b/CMakeLists.txt index b7add87..f35aefd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,8 @@ project(QtZeroConf) cmake_minimum_required(VERSION 2.8.11) -find_package(Qt5 COMPONENTS Core Network) +find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core Network) +find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core Network) set(CMAKE_AUTOMOC ON) set(CMAKE_INCLUDE_CURRENT_DIR ON) @@ -50,7 +51,7 @@ target_include_directories(QtZeroConf PUBLIC $ $ ) -target_link_libraries(QtZeroConf PUBLIC Qt5::Core Qt5::Network) +target_link_libraries(QtZeroConf PUBLIC Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Network) if(WIN32) target_sources(QtZeroConf PRIVATE diff --git a/README.md b/README.md index 69a0b45..46688cf 100644 --- a/README.md +++ b/README.md @@ -116,7 +116,7 @@ QZeroConf can be used in QML applications ### Build Dependencies -Qt5 +Qt5 or Qt6 On Linux, libavahi-client-dev and libavahi-common-dev diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt index 1216105..5b79091 100644 --- a/example/CMakeLists.txt +++ b/example/CMakeLists.txt @@ -1,7 +1,7 @@ project(QtZeroConfExample) cmake_minimum_required(VERSION 2.8.11) -find_package(Qt5 COMPONENTS Gui Widgets REQUIRED) +find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Gui Widgets REQUIRED) set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) @@ -21,5 +21,5 @@ add_executable(QtZeroConfExample target_link_libraries(QtZeroConfExample QtZeroConf - Qt5::Gui Qt5::Widgets + Qt${QT_VERISON_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::Widgets )