aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2026-06-11 21:04:06 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2026-06-11 21:04:06 +0200
commitd20734dcb6fcc6c5204dcd0b2154c8dea5457e05 (patch)
treede2e2e3c72d2e3a0919b3bfba65a51d39b1b86c4 /examples
parentf33cda5c57dab104163fe6884e2e15f3bac79c07 (diff)
parent5f421ccac8c37c7ef20d0eb2d1a7d06bbe574088 (diff)
downloadqmenumodel-d20734dcb6fcc6c5204dcd0b2154c8dea5457e05.tar.gz
qmenumodel-d20734dcb6fcc6c5204dcd0b2154c8dea5457e05.tar.bz2
qmenumodel-d20734dcb6fcc6c5204dcd0b2154c8dea5457e05.zip
Merge branch 'OPNA2608-port-qt6'
Attributes GH PR #29: https://github.com/AyatanaIndicators/qmenumodel/pull/29
Diffstat (limited to 'examples')
-rw-r--r--examples/CMakeLists.txt15
1 files changed, 12 insertions, 3 deletions
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
index 67e1348..2fcfd30 100644
--- a/examples/CMakeLists.txt
+++ b/examples/CMakeLists.txt
@@ -7,13 +7,22 @@ cmake_minimum_required(VERSION 2.8.9)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
-find_package(Qt5Core REQUIRED)
+option(ENABLE_QT6 "Enable building with Qt6" OFF)
+set(QT_VERSION_MAJOR 5)
+set(QMENUMODEL_PKGCONFIG_SUFFIX)
+if(ENABLE_QT6)
+ set(QT_VERSION_MAJOR 6)
+ string(APPEND QMENUMODEL_PKGCONFIG_SUFFIX "-qt6")
+endif()
+
+find_package(QT NAMES Qt${QT_VERSION_MAJOR})
+find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core)
include(FindPkgConfig)
-pkg_check_modules(QMENUMODEL REQUIRED qmenumodel)
+pkg_check_modules(QMENUMODEL REQUIRED qmenumodel${QMENUMODEL_PKGCONFIG_SUFFIX})
add_executable(info-menumodel info-menumodel.cpp)
include_directories(${QMENUMODEL_INCLUDE_DIRS})
-target_link_libraries(info-menumodel ${QMENUMODEL_LDFLAGS} Qt5::Core)
+target_link_libraries(info-menumodel ${QMENUMODEL_LDFLAGS} Qt::Core)