[CMake] Using gcov/lcov and valgrind with cmake

Gerhard Gappmeier gerhard.gappmeier at ascolab.com
Wed Nov 3 09:11:42 EDT 2010


Hi all,

I'm trying to figure out how to use gcov and maybe also lcov with cmake.
I know it works using ctest, I've seen that in several wiki entries,
but I could not find one single example on how to use it.
The wiki only shows the commandline args for GCC, but no cmake examples.

I attached a simple hello world project with two tests (ADD_TEST) which work.
I tried to add the "ctest_coverage" and "ctest_memcheck" commands but I can't 
get them working.

Maybe somebody can complete this example.

IMO a new section about gcov and valgrind should be added to 
http://www.cmake.org/cmake/help/cmake_tutorial.html
This would help a lot of people.

-- 
mit freundlichen Grüßen / best regards

*Gerhard Gappmeier*
ascolab GmbH - automation systems communication laboratory
Tel.: +49 9131 691 123
Fax: +49 9131 691 128
Web: http://www.ascolab.com
GPG Key Id: 5AAC50C4
GPG Fingerprint: 967A 15F1 2788 164D CCA3 6C46 07CD 6F82 5AAC 50C4

--
*ascolab GmbH*
Geschäftsführer: Gerhard Gappmeier, Matthias Damm, Uwe Steinkrauß
Sitz der Gesellschaft: Am Weichselgarten 7 . 91058 Erlangen . Germany
Registernummer: HRB 9360
Registergericht: Amtsgericht Fürth
-------------- next part --------------
A non-text attachment was scrubbed...
Name: helloworld.tar.gz
Type: application/x-compressed-tar
Size: 629 bytes
Desc: not available
URL: <http://www.cmake.org/pipermail/cmake/attachments/20101103/2d9072c5/attachment.bin>


More information about the CMake mailing list