CMake: simplify conditions
`if` tends to interpret NOTFOUND suffix as false. our code did this
check explicitly, however it seems this either recently broke, or the
quotes caused issues, as my local build failed with:
```
CMake Error in qtvirtualkeyboard/src/virtualkeyboard/CMakeLists.txt:
IMPORTED_LOCATION or IMPORTED_IMPLIB not set for imported target
"MyScript::VOIM" configuration "Debug".
CMake Error in qtvirtualkeyboard/src/virtualkeyboard/CMakeLists.txt:
IMPORTED_LOCATION or IMPORTED_IMPLIB not set for imported target
"MyScript::VOIM" configuration "Debug".
```
relying on cmake's `if` makes this issue disappear.
Pick-to: 6.11 6.10 6.8 6.5
Change-Id: I56c891db7578274d678d11abd9c9b226e6c1d60b
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>