diff -rupN qtkeychain-0.13.2/CMakeLists.txt qtkeychain-0.13.2-new/CMakeLists.txt
--- qtkeychain-0.13.2/CMakeLists.txt	2021-11-18 16:34:13.000000000 +0100
+++ qtkeychain-0.13.2-new/CMakeLists.txt	2022-11-29 16:33:35.466131272 +0100
@@ -17,7 +17,6 @@ include(GNUInstallDirs)
 include(GenerateExportHeader)
 include(CMakePackageConfigHelpers)
 include(ECMSetupVersion)
-include(ECMGeneratePriFile)
 
 option(BUILD_WITH_QT6 "Build qtkeychain with Qt 6" OFF)
 option(BUILD_TEST_APPLICATION "Build test application" OFF)
@@ -28,6 +27,10 @@ if(QTKEYCHAIN_STATIC)
     message(WARNING "QTKEYCHAIN_STATIC is deprecated. Use BUILD_SHARED_LIBS=OFF instead.")
 endif()
 
+if(NOT BUILD_WITH_QT6)
+    include(ECMGeneratePriFile)
+endif()
+
 if(CMAKE_SYSTEM_NAME STREQUAL Android)
     set(ANDROID 1)
 endif()
@@ -286,6 +289,7 @@ ecm_setup_version("${QTKEYCHAIN_VERSION}
 if(UNIX AND NOT APPLE AND NOT ANDROID AND NOT HAIKU)
     set(PRI_EXTRA_DEPS "dbus")
 endif()
+if (NOT BUILD_WITH_QT6)
 ecm_generate_pri_file(BASE_NAME Qt${QTKEYCHAIN_VERSION_INFIX}Keychain
   LIB_NAME ${QTKEYCHAIN_TARGET_NAME}
   DEPS "core ${PRI_EXTRA_DEPS}"
@@ -293,6 +297,7 @@ ecm_generate_pri_file(BASE_NAME Qt${QTKE
   FILENAME_VAR pri_filename)
 
 install(FILES ${pri_filename} DESTINATION ${ECM_MKSPECS_INSTALL_DIR})
+endif ()
 
 
 install(EXPORT Qt${QTKEYCHAIN_VERSION_INFIX}KeychainLibraryDepends
