Various CMake configuration improvements.