--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -39,7 +39,7 @@
 #
 
 # qt
-find_package(Qt5 COMPONENTS Core Gui REQUIRED)
+find_package(Qt6 COMPONENTS Core Gui REQUIRED)
 add_definitions(-DQT_NO_KEYWORDS)
 set(CMAKE_AUTOMOC ON)
 
@@ -60,7 +60,7 @@
 target_link_libraries(
   qheif
   PRIVATE
-  Qt5::Gui
+  Qt6::Gui
   ${libheif_LIBRARIES}
 )
 
@@ -70,7 +70,7 @@
 
 # Use qmake to find plugin dir (adapted from lxqt-qtplugin)
 get_target_property(
-  QT_QMAKE_EXECUTABLE ${Qt5Core_QMAKE_EXECUTABLE} IMPORTED_LOCATION)
+  QT_QMAKE_EXECUTABLE Qt6::qmake IMPORTED_LOCATION)
 
 if (NOT QT_QMAKE_EXECUTABLE)
   message(FATAL_ERROR "qmake is not found.")
@@ -82,9 +82,9 @@
   OUTPUT_STRIP_TRAILING_WHITESPACE)
 
 if (QT_PLUGINS_DIR)
-  message(STATUS "Qt5 plugin directory: " "${QT_PLUGINS_DIR}")
+  message(STATUS "Qt6 plugin directory: " "${QT_PLUGINS_DIR}")
 else ()
-  message(FATAL_ERROR "Qt5 plugin directory cannot be detected.")
+  message(FATAL_ERROR "Qt6 plugin directory cannot be detected.")
 endif ()
 
 # Prefix with DESTDIR if available to allow packaging
