From cb80248524371090c31048c406fae6ae9d5c3047 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Thu, 8 Apr 2021 17:28:14 +0200 Subject: [PATCH] Add support for Qt 6 --- CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2407fca86..d3b232b74 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -460,8 +460,10 @@ endif() option(SENTRY_INTEGRATION_QT "Build Qt integration") if(SENTRY_INTEGRATION_QT) - find_package(Qt5 COMPONENTS Core REQUIRED) - target_link_libraries(sentry PRIVATE Qt5::Core) + find_package(Qt NAMES Qt6 Qt5 COMPONENTS Core REQUIRED) + find_package(Qt${Qt_VERSION_MAJOR} COMPONENTS Core REQUIRED) + message(STATUS "Found Qt: ${Qt${Qt_VERSION_MAJOR}_DIR} " "(found version \"${Qt_VERSION}\")") + target_link_libraries(sentry PRIVATE Qt${Qt_VERSION_MAJOR}::Core) endif() include(CMakePackageConfigHelpers)