diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0d3b95a..c63f7d2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -5,8 +5,8 @@ set(PROJECT_VERSION 1.6.1)
 project(PulseAudioQt VERSION ${PROJECT_VERSION})
 
 include(FeatureSummary)
-find_package(ECM 6.0.0  NO_MODULE)
-set(KDE_COMPILERSETTINGS_LEVEL "5.82")
+find_package(ECM 5.90.0  NO_MODULE)
+set (KDE_COMPILERSETTINGS_LEVEL "5.82")
 set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake Modules." URL "https://kde.org/products/frameworks/")
 feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES)
 
@@ -26,6 +26,7 @@ include(ECMGeneratePkgConfigFile)
 
 include(KDEInstallDirs)
 include(KDECompilerSettings NO_POLICY_SCOPE)
+# include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
 include(KDECMakeSettings)
 include(KDEGitCommitHooks)
 
@@ -34,33 +35,33 @@ add_feature_info(QCH ${BUILD_QCH} "API documentation in QCH format (for e.g. Qt
 
 ecm_setup_version(PROJECT VARIABLE_PREFIX PULSEAUDIOQT
                         VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/pulseaudioqt_version.h"
-                        PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF6PulseAudioQtConfigVersion.cmake"
+                        PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF${QT_MAJOR_VERSION}PulseAudioQtConfigVersion.cmake"
                         SOVERSION 5)
 
-set(REQUIRED_QT_VERSION 6.7.0)
-find_package(Qt6 ${REQUIRED_QT_VERSION} CONFIG REQUIRED Core Gui DBus)
+set(REQUIRED_QT_VERSION 5.15.0)
+find_package(Qt${QT_MAJOR_VERSION} ${REQUIRED_QT_VERSION} CONFIG REQUIRED Core Gui DBus)
 
-find_package(Qt6Test ${REQUIRED_QT_VERSION} CONFIG)
-set_package_properties(Qt6Test PROPERTIES DESCRIPTION "Autotests for PulseAudioQt" TYPE OPTIONAL)
+find_package(Qt${QT_MAJOR_VERSION}Test ${REQUIRED_QT_VERSION} CONFIG)
+set_package_properties(Qt${QT_MAJOR_VERSION}Test PROPERTIES DESCRIPTION "Autotests for PulseAudioQt" TYPE OPTIONAL)
 
-find_package(Qt6Qml ${REQUIRED_QT_VERSION} CONFIG)
-set_package_properties(Qt6Qml PROPERTIES DESCRIPTION "Tests for PulseAudioQt" TYPE OPTIONAL)
+find_package(Qt${QT_MAJOR_VERSION}Qml ${REQUIRED_QT_VERSION} CONFIG)
+set_package_properties(Qt${QT_MAJOR_VERSION}Qml PROPERTIES DESCRIPTION "Tests for PulseAudioQt" TYPE OPTIONAL)
 
-find_package(Qt6Quick ${REQUIRED_QT_VERSION} CONFIG)
-set_package_properties(Qt6Quick PROPERTIES DESCRIPTION "Tests for PulseAudioQt" TYPE OPTIONAL)
+find_package(Qt${QT_MAJOR_VERSION}Quick ${REQUIRED_QT_VERSION} CONFIG)
+set_package_properties(Qt${QT_MAJOR_VERSION}Quick PROPERTIES DESCRIPTION "Tests for PulseAudioQt" TYPE OPTIONAL)
 
 # create a Config.cmake and a ConfigVersion.cmake file and install them
-set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF6PulseAudioQt")
+set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF${QT_MAJOR_VERSION}PulseAudioQt")
 
 
-install(FILES  "${CMAKE_CURRENT_BINARY_DIR}/KF6PulseAudioQtConfig.cmake"
-               "${CMAKE_CURRENT_BINARY_DIR}/KF6PulseAudioQtConfigVersion.cmake"
+install(FILES  "${CMAKE_CURRENT_BINARY_DIR}/KF${QT_MAJOR_VERSION}PulseAudioQtConfig.cmake"
+               "${CMAKE_CURRENT_BINARY_DIR}/KF${QT_MAJOR_VERSION}PulseAudioQtConfigVersion.cmake"
         DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
         COMPONENT Devel )
 
 configure_package_config_file(
-  "${CMAKE_CURRENT_SOURCE_DIR}/KF6PulseAudioQtConfig.cmake.in"
-  "${CMAKE_CURRENT_BINARY_DIR}/KF6PulseAudioQtConfig.cmake"
+  "${CMAKE_CURRENT_SOURCE_DIR}/KF${QT_MAJOR_VERSION}PulseAudioQtConfig.cmake.in"
+  "${CMAKE_CURRENT_BINARY_DIR}/KF${QT_MAJOR_VERSION}PulseAudioQtConfig.cmake"
   INSTALL_DESTINATION  ${CMAKECONFIG_INSTALL_DIR}
 )
 
@@ -77,22 +78,22 @@ add_subdirectory(src)
 
 if (BUILD_TESTING)
     add_subdirectory(tests)
-    if(Qt6Test_FOUND)
+    if(Qt${QT_MAJOR_VERSION}Test_FOUND)
         add_subdirectory(autotests)
     endif()
 endif()
 
 if (BUILD_QCH)
     ecm_install_qch_export(
-        TARGETS KF6PulseAudioQt_QCH
-        FILE KF6PulseAudioQtQchTargets.cmake
+        TARGETS KF${QT_MAJOR_VERSION}PulseAudioQt_QCH
+        FILE KF${QT_MAJOR_VERSION}PulseAudioQtQchTargets.cmake
         DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
         COMPONENT Devel
     )
-    set(PACKAGE_INCLUDE_QCHTARGETS "include(\"\${CMAKE_CURRENT_LIST_DIR}/KF6PulseAudioQtQchTargets.cmake\")")
+    set(PACKAGE_INCLUDE_QCHTARGETS "include(\"\${CMAKE_CURRENT_LIST_DIR}/KF${QT_MAJOR_VERSION}PulseAudioQtQchTargets.cmake\")")
 endif()
 
-install(EXPORT PulseAudioQtTargets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" FILE KF6PulseAudioQtTargets.cmake NAMESPACE KF6:: )
+install(EXPORT PulseAudioQtTargets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" FILE KF${QT_MAJOR_VERSION}PulseAudioQtTargets.cmake NAMESPACE KF${QT_MAJOR_VERSION}:: )
 
 install(FILES
         ${CMAKE_CURRENT_BINARY_DIR}/pulseaudioqt_version.h
diff --git a/KF5PulseAudioQtConfig.cmake.in b/KF5PulseAudioQtConfig.cmake.in
new file mode 100644
index 0000000..78b571b
--- /dev/null
+++ b/KF5PulseAudioQtConfig.cmake.in
@@ -0,0 +1,8 @@
+@PACKAGE_INIT@
+
+include(CMakeFindDependencyMacro)
+find_dependency(Qt@QT_MAJOR_VERSION@Core @REQUIRED_QT_VERSION@)
+
+@PACKAGE_SETUP_AUTOMOC_VARIABLES@
+include("${CMAKE_CURRENT_LIST_DIR}/KF5PulseAudioQtTargets.cmake")
+@PACKAGE_INCLUDE_QCHTARGETS@
diff --git a/autotests/CMakeLists.txt b/autotests/CMakeLists.txt
index 042b04b..271200f 100644
--- a/autotests/CMakeLists.txt
+++ b/autotests/CMakeLists.txt
@@ -7,5 +7,5 @@ ecm_add_test(
     ${CMAKE_BINARY_DIR}/src/debug.cpp
     mapstest.cpp
     TEST_NAME mapstest
-    LINK_LIBRARIES Qt6::Test KF6PulseAudioQt PkgConfig::LIBPULSE
+    LINK_LIBRARIES Qt${QT_MAJOR_VERSION}::Test KF${QT_MAJOR_VERSION}PulseAudioQt PkgConfig::LIBPULSE
 )
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 4a5d9ff..8282ffb 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,6 +1,6 @@
-add_library(KF6PulseAudioQt SHARED)
+add_library(KF${QT_MAJOR_VERSION}PulseAudioQt SHARED)
 
-target_sources(KF6PulseAudioQt PRIVATE
+target_sources(KF${QT_MAJOR_VERSION}PulseAudioQt PRIVATE
     card.cpp
     cardport.cpp
     client.cpp
@@ -24,31 +24,31 @@ target_sources(KF6PulseAudioQt PRIVATE
     indexedpulseobject.cpp
 )
 
-ecm_qt_declare_logging_category(KF6PulseAudioQt
+ecm_qt_declare_logging_category(KF${QT_MAJOR_VERSION}PulseAudioQt
     HEADER debug.h
     IDENTIFIER PULSEAUDIOQT
     CATEGORY_NAME org.kde.pulseaudio
 )
 
-ecm_qt_declare_logging_category(KF6PulseAudioQt
+ecm_qt_declare_logging_category(KF${QT_MAJOR_VERSION}PulseAudioQt
     HEADER debug_object.h
     IDENTIFIER PAOBJECT
     CATEGORY_NAME org.kde.pulseaudio.object
 )
 
-target_link_libraries(KF6PulseAudioQt
+target_link_libraries(KF${QT_MAJOR_VERSION}PulseAudioQt
     PUBLIC
-        Qt6::Core
+        Qt${QT_MAJOR_VERSION}::Core
     PRIVATE
-        Qt6::Gui
-        Qt6::DBus
+        Qt${QT_MAJOR_VERSION}::Gui
+        Qt${QT_MAJOR_VERSION}::DBus
         PkgConfig::LIBPULSE
         PkgConfig::LIBPULSE_MAINLOOP
 )
 
-target_include_directories(KF6PulseAudioQt INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR_KF}/KF6PulseAudioQt>" )
+target_include_directories(KF${QT_MAJOR_VERSION}PulseAudioQt INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR_KF}/KF${QT_MAJOR_VERSION}PulseAudioQt>" )
 
-set_target_properties(KF6PulseAudioQt PROPERTIES VERSION ${PULSEAUDIOQT_VERSION}
+set_target_properties(KF${QT_MAJOR_VERSION}PulseAudioQt PROPERTIES VERSION ${PULSEAUDIOQT_VERSION}
                                                    SOVERSION ${PULSEAUDIOQT_SOVERSION}
                                                    EXPORT_NAME PulseAudioQt
 )
@@ -76,35 +76,35 @@ ecm_generate_headers(PulseAudioQt_HEADERS
         VolumeObject
     REQUIRED_HEADERS PulseAudioQt_HEADERS
 )
-ecm_generate_export_header(KF6PulseAudioQt
+ecm_generate_export_header(KF${QT_MAJOR_VERSION}PulseAudioQt
     BASE_NAME PulseAudioQt
     GROUP_BASE_NAME KF
     VERSION ${PROJECT_VERSION}
 )
 
-ecm_generate_pkgconfig_file(BASE_NAME KF6PulseAudioQt
-      INCLUDE_INSTALL_DIR ${KDE_INSTALL_INCLUDEDIR_KF5}/KF6PulseAudioQt/
-      DEPS "Qt6Core"
+ecm_generate_pkgconfig_file(BASE_NAME KF${QT_MAJOR_VERSION}PulseAudioQt
+      INCLUDE_INSTALL_DIR ${KDE_INSTALL_INCLUDEDIR_KF5}/KF${QT_MAJOR_VERSION}PulseAudioQt/
+      DEPS "Qt${QT_MAJOR_VERSION}Core"
     INSTALL)
 
-install(TARGETS KF6PulseAudioQt EXPORT PulseAudioQtTargets ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
+install(TARGETS KF${QT_MAJOR_VERSION}PulseAudioQt EXPORT PulseAudioQtTargets ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
 install(FILES
     ${PulseAudioQt_HEADERS}
     ${CMAKE_CURRENT_BINARY_DIR}/pulseaudioqt_export.h
-    DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF}/KF6PulseAudioQt/PulseAudioQt COMPONENT Devel
+    DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF}/KF${QT_MAJOR_VERSION}PulseAudioQt/PulseAudioQt COMPONENT Devel
 )
 
 if(BUILD_QCH)
     ecm_add_qch(
-        KF6PulseAudioQt_QCH
+        KF${QT_MAJOR_VERSION}PulseAudioQt_QCH
         NAME PulseAudioQt
-        BASE_NAME KF6PulseAudioQt
+        BASE_NAME KF${QT_MAJOR_VERSION}PulseAudioQt
         VERSION ${PULSEAUDIOQT_VERSION}
         ORG_DOMAIN org.kde
         SOURCES
             ${PulseAudioQt_HEADERS}
         LINK_QCHS
-            Qt6Gui_QCH
+            Qt${QT_MAJOR_VERSION}Gui_QCH
         BLANK_MACROS
             PulseAudioQt_EXPORT
             PulseAudioQt_DEPRECATED
diff --git a/tests/painspector/CMakeLists.txt b/tests/painspector/CMakeLists.txt
index 449627d..5e635f7 100644
--- a/tests/painspector/CMakeLists.txt
+++ b/tests/painspector/CMakeLists.txt
@@ -8,7 +8,7 @@ qt_add_resources(painspector_SRCS
 
 add_executable(painspector ${painspector_SRCS})
 target_link_libraries(painspector
-    Qt6::Qml
-    Qt6::Quick
-    KF6PulseAudioQt
+    Qt${QT_MAJOR_VERSION}::Qml
+    Qt${QT_MAJOR_VERSION}::Quick
+    KF${QT_MAJOR_VERSION}PulseAudioQt
 )
