Introduce Coverage build type
Coverage analysis usually requires special flags set, which may be different for different compilers and may also be incompatible with optimization and other flags. I propose introducing a special build type, Coverage. I've used it successfully in my projects, like this:
SET(CMAKE_C_FLAGS_COVERAGE "${CMAKE_C_FLAGS_DEBUG} --coverage")
SET(CMAKE_EXE_LINKER_FLAGS_COVERAGE "${CMAKE_EXE_LINKER_FLAGS_DEBUG} --coverage")
SET(CMAKE_SHARED_LINKER_FLAGS_COVERAGE "${CMAKE_SHARED_LINKER_FLAGS_DEBUG} --coverage")
cmake -DCMAKE_BUILD_TYPE=Coverage . && make && make test && coveralls
It would be nice to have this supported out of box and probably extended for other compilers (I currently only use it with gcc).