cmake: improves error detection

No match.