Fix a cmake test linker error with Qt 5.9

I got the following error while trying to make a full Release build in
openSUSE Leap 15.1:
.../bin/ld: test_cmakefileapi.cpp...: undefined reference to `bool QTest::qCompare<QString, char [4]>(...)'
1 job for !109 with fix-qt59-linker-error in 60 minutes (queued for 8 seconds)
detached
Status Job ID Name Coverage
  Build
failed #35127
linux kf5-qt5 qt5.12

01:00:00

 
Name Stage Failure
failed
linux kf5-qt5 qt5.12 Build The script exceeded the maximum execution time set for the job
kf5.kinit.klauncher: KLauncher: launching new slave "/home/jenkins/install-prefix/lib64/plugins/kf5/kio/file.so" with protocol= "file" args= ("file", "local:/tmp/runtime-kdeci/klauncherXGFseo.1.slave-socket", "local:/tmp/runtime-kdeci/test_ctestfindsuitesjlQdMA.1.slave-socket")
kf5.kinit.klauncher: Asking kdeinit to start "/home/jenkins/install-prefix/lib64/plugins/kf5/kio/file.so" ("file", "local:/tmp/runtime-kdeci/klauncherXGFseo.1.slave-socket", "local:/tmp/runtime-kdeci/test_ctestfindsuitesjlQdMA.1.slave-socket") cmd= EXEC_NEW
kdeinit5: Got EXEC_NEW '/home/jenkins/install-prefix/lib64/plugins/kf5/kio/file.so' from launcher.
kdeinit5: preparing to launch '/home/jenkins/install-prefix/lib64/plugins/kf5/kio/file.so'
kf5.kinit.klauncher: "/home/jenkins/install-prefix/lib64/plugins/kf5/kio/file.so" (pid 24717) up and running.
kf5.kinit.klauncher: removing done request "/home/jenkins/install-prefix/lib64/plugins/kf5/kio/file.so" PID 24717
org.kde.kcrash: Could not find drkonqi in search paths: ("/home/jenkins/install-prefix/bin", "/usr/lib64/qt5/libexec", "/home/jenkins/install-prefix/lib64/libexec")
Pulling docker image gitlab/gitlab-runner-helper:x86_64-003fe500 ...
ERROR: Job failed: execution took longer than 1h0m0s seconds