Added test coverage generation in Xcode and tidied CMakeLists.txt.