cmake: Fixed if()/endif() mismatch

This was mistake was introduced in 62a0ab5e.