From: Mathias Preiner Date: Tue, 11 Sep 2018 17:54:20 +0000 (-0700) Subject: cmake: Add module finder for Valgrind. X-Git-Tag: cvc5-1.0.0~4561 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6f564edc3baed8cf1c4bbd0467c29dfca3a120b6;p=cvc5.git cmake: Add module finder for Valgrind. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index b4e567769..8e2a61c1f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -456,7 +456,8 @@ if(ENABLE_STATISTICS) endif() if(ENABLE_VALGRIND) - #TODO check if valgrind available + find_package(Valgrind REQUIRED) + libcvc4_include_directories(${Valgrind_INCLUDE_DIR}) add_definitions(-DCVC4_VALGRIND) endif() diff --git a/cmake/FindValgrind.cmake b/cmake/FindValgrind.cmake new file mode 100644 index 000000000..4c5cb1d28 --- /dev/null +++ b/cmake/FindValgrind.cmake @@ -0,0 +1,11 @@ +# Find Valgrind +# Valgrind_FOUND - system has Valgrind lib +# Valgrind_INCLUDE_DIR - the Valgrind include directory +# +# Note: We only require the valgrind/memcheck.h header, so we don't check if +# the valgrind executable is installed. + +find_path(Valgrind_INCLUDE_DIR NAMES valgrind/memcheck.h) + +find_package_handle_standard_args(Valgrind REQUIRED_VARS Valgrind_INCLUDE_DIR) +mark_as_advanced(Valgrind_INCLUDE_DIR)