cmake/Modules/FindValgrind.cmake
author Tero Marttila <terom@fixme.fi>
Thu, 21 May 2009 16:55:56 +0300
changeset 209 d240da5dbeb5
parent 191 031582f7b61b
permissions -rw-r--r--
accept NULL for log function fmt arg
#
# 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)