Various CMake build improvements