#
# This module looks for an installed LCOV environment, and sets some paths for the executables
#
# see:
# http://ltp.sourceforge.net/coverage/lcov.php
#
# It will set the following variables:
#
# LCOV_FOUND
# LCOV_EXECUTABLE
# LCOV_GENHTML_EXECUTABLE
#
find_program (LCOV_EXECUTABLE
lcov
DOC "Path to `lcov` binary"
)
find_program (LCOV_GENHTML_EXECUTABLE
genhtml
DOC "Path to LCOV `genhtml` binary"
)
# set LCOV_FOUND flag
if (LCOV_EXECUTABLE AND LCOV_GENHTML_EXECUTABLE)
set (LCOV_FOUND TRUE)
# status message, unless QUIETLY
if (NOT LCOV_FIND_QUIETLY)
message (STATUS "Found lcov at '${LCOV_EXECUTABLE}', and genhtml at '${LCOV_GENHTML_EXECUTABLE}'")
endif (NOT LCOV_FIND_QUIETLY)
else (LCOV_EXECUTABLE AND LCOV_GENHTML_EXECUTABLE)
set (LCOV_FOUND FALSE)
endif (LCOV_EXECUTABLE AND LCOV_GENHTML_EXECUTABLE)
# enforce REQUIRED
if (NOT LCOV_FOUND AND LCOV_FIND_REQUIRED)
message (FATAL_ERROR "Could not find lcov executables")
endif (NOT LCOV_FOUND AND LCOV_FIND_REQUIRED)