#
# This module looks for an installed valgrind executable
#
# see:
# http://valgrind.org/
#
# It will set the following variables:
#
# Valgrind_FOUND
# Valgrind_EXECUTABLE
#
find_program (Valgrind_EXECUTABLE
valgrind
DOC "Path to `valgrind` binary"
)
# set Valgrind_FOUND flag
if (Valgrind_EXECUTABLE)
set (Valgrind_FOUND TRUE)
# status message, unless QUIETLY
if (NOT Valgrind_FIND_QUIETLY)
message (STATUS "Found valgrind at '${Valgrind_EXECUTABLE}'")
endif (NOT Valgrind_FIND_QUIETLY)
else (Valgrind_EXECUTABLE)
set (Valgrind_FOUND FALSE)
endif (Valgrind_EXECUTABLE)
# enforce REQUIRED
if (NOT Valgrind_FOUND AND Valgrind_FIND_REQUIRED)
message (FATAL_ERROR "Could not find valgrind executables")
endif (NOT Valgrind_FOUND AND Valgrind_FIND_REQUIRED)