cmake/Modules/FindValgrind.cmake
author Tero Marttila <terom@fixme.fi>
Fri, 15 May 2009 00:05:01 +0300
changeset 200 c414343101df
parent 191 031582f7b61b
permissions -rw-r--r--
don't keep console SIGINT behaviour after it was destroyed, instead, have nexus handle it like SIGTERM, and have console override that
#
# 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)