[Orxonox-commit 4811] r9480 - code/branches/testing/cmake/tools
landauf at orxonox.net
landauf at orxonox.net
Sun Dec 2 21:19:56 CET 2012
Author: landauf
Date: 2012-12-02 21:19:55 +0100 (Sun, 02 Dec 2012)
New Revision: 9480
Modified:
code/branches/testing/cmake/tools/TargetUtilities.cmake
Log:
added cmake flag ENABLE_GCOV to enable code coverage analysis with gcov
Modified: code/branches/testing/cmake/tools/TargetUtilities.cmake
===================================================================
--- code/branches/testing/cmake/tools/TargetUtilities.cmake 2012-11-30 20:41:09 UTC (rev 9479)
+++ code/branches/testing/cmake/tools/TargetUtilities.cmake 2012-12-02 20:19:55 UTC (rev 9480)
@@ -350,6 +350,13 @@
TARGET_LINK_LIBRARIES(${_target_name} ${_arg_LINK_LIBS_UNIX})
ENDIF()
+ # Enable gcov (gcc code coverage analysis tool) if ENABLE_GCOV flag is defined
+ IF(ENABLE_GCOV)
+ TARGET_LINK_LIBRARIES(${_target_name} gcov)
+ ADD_COMPILER_FLAGS("-fprofile-arcs")
+ ADD_COMPILER_FLAGS("-ftest-coverage")
+ ENDIF()
+
# Visual Leak Detector specific stuff (avoids the include)
IF(VISUAL_LEAK_DETECTOR_ENABLE)
TARGET_LINK_LIBRARIES(${_target_name} debug ${VLD_LIBRARY})
More information about the Orxonox-commit
mailing list