Improvements to cmake