Incorporate some CMakeLists changes by Akien