cmake/Modules/FindLCOV.cmake
author Tero Marttila <terom@fixme.fi>
Thu, 28 May 2009 01:17:36 +0300
branchnew-lib-errors
changeset 219 cefec18b8268
parent 186 33ef336dbb4b
permissions -rw-r--r--
some of the lib/transport stuff compiles
#
# 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)