cmake/Modules/FindValgrind.cmake
author Tero Marttila <terom@fixme.fi>
Sat, 23 May 2009 00:33:23 +0300
changeset 215 85863b89e38b
parent 191 031582f7b61b
permissions -rw-r--r--
fix lua_thread_resume_state to not call lua_resume from a CFunction executing in the same state; lua_thread_done is now unprotected...
#
# 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)