Improvements to cmake.