Fix cmake build issues on Darwin.