[CMake] using gcov with cmake

Mathieu Malaterre mathieu.malaterre at gmail.com
Thu Oct 2 08:53:27 EDT 2008


On Thu, Oct 2, 2008 at 2:33 PM, Ioan Calin Borcoman <iborco at gmail.com> wrote:
> Hi,
>
> I am trying to use gcov with cmake (I'm new to both gcov and cmake).
>
> My first attempt was like this:
>
>   add_executable(hello main.cpp)
>   set(CMAKE_CXX_FLAGS -fprofile-arcs -ftest-coverage)
>   target_link_libraries(hello -fprofile-arcs)

No that's not the correct way to pass flags to the linker:

http://www.cmake.org/Wiki/CTest:Coverage

2cts
-- 
Mathieu


More information about the CMake mailing list