CMake: Fix build on gles Debian CI due to optional deps missing


We need to do some target checks before adding the subdirectories,
because some of the optional dependencies might be missing.

Avoids errors like the following in the Debian CI packaging:

  CMake Error at /opt/qt-6.13.0/aarch64-linux-gnu/lib/cmake/Qt6/
    QtFindPackageHelpers.cmake:715 (get_target_property):
   get_target_property() called with non-existent target
   "Qt6::QuickTimeline".
 Call Stack (most recent call first):
   QtTargetHelpers.cmake:300
    (qt_internal_register_target_dependencies)
   QtModuleHelpers.cmake:716 (qt_internal_extend_target)
   src/lottiegenerator/CMakeLists.txt:4 (qt_internal_add_module)

Pick-to: 6.12
Change-Id: Icfb9f2181e85caac059738bb45acf7226dced712
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Simo Fält <simo.falt@qt.io>
commit430e90a398e29c84e5f109647ca7f32f22f971a2
parent22e501b62b79c65a227e12025dad7c50a248425a
authorAlexandru Croitor <alexandru.croitor@qt.io>
committerAlexandru Croitor <alexandru.croitor@qt.io>
commit timeFri, 21 Aug 2026 12:47:14 +0000