cmake/Modules/FindValgrind.cmake
author Tero Marttila <terom@fixme.fi>
Wed, 27 May 2009 23:57:48 +0300
branchnew-lib-errors
changeset 217 7728d6ec3abf
parent 191 031582f7b61b
permissions -rw-r--r--
nexus.c compiles
#
# 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)