fix cmake race condition

I saw this earlier today, and so did someone else on the mailing list.