[CMake] Fixing the check for Ninja