Fix cmake functions