cmake: Fix function detection