Find OPTIONAL_COMPONENTS seperately. When the REQUIRED keyword is used,
Qt5Config.cmake handles all components as required causing failure if
optional components are missing.

--- CMakeLists.txt.orig	2023-09-19 20:48:15 UTC
+++ CMakeLists.txt
@@ -195,7 +195,8 @@ endif()
   list(APPEND QT_COMPONENTS X11Extras)
 endif()
 
-find_package(Qt${QT_VERSION_MAJOR} ${QT_MIN_VERSION} COMPONENTS ${QT_COMPONENTS} REQUIRED OPTIONAL_COMPONENTS ${QT_OPTIONAL_COMPONENTS})
+find_package(Qt${QT_VERSION_MAJOR} ${QT_MIN_VERSION} REQUIRED COMPONENTS ${QT_COMPONENTS})
+find_package(Qt${QT_VERSION_MAJOR} ${QT_MIN_VERSION} OPTIONAL_COMPONENTS ${QT_OPTIONAL_COMPONENTS})
 
 if(Qt${QT_VERSION_MAJOR}DBus_FOUND)
   get_target_property(QT_DBUSXML2CPP_EXECUTABLE Qt${QT_VERSION_MAJOR}::qdbusxml2cpp LOCATION)
