1 diff --git a/CMakeLists.txt b/CMakeLists.txt
2 index e0d3f5207..1199f6c3d 100644
5 @@ -106,7 +106,7 @@ if(Qt${QT_MAJOR_VERSION}TextToSpeech_FOUND)
6 set(HAVE_TEXT_TO_SPEECH_SUPPORT TRUE)
8 find_package(Qt${QT_MAJOR_VERSION} ${QT_REQUIRED_VERSION} CONFIG REQUIRED Network Widgets Test DBus NetworkAuth)
9 -if (QT_MAJOR_VERSION STREQUAL "5")
10 +if (QT_MAJOR_VERSION STREQUAL "5" AND BUILD_TESTING)
11 find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED XmlPatterns)
13 find_package(Qt${QT_MAJOR_VERSION}WebEngineWidgets ${QT_REQUIRED_VERSION} CONFIG)