Prevent build failures when KF_IGNORE_PLATFORM_CHECK is not set
This fixes bug 461222 (https://bugs.kde.org/show_bug.cgi?id=461222)
CMake is definitely not my native language, so please let me know if the conditions could have been done in the same if statement or better in any other way. It works though (tested both with the env variable set and without it).