diff options
author | Dominic Chen <d.c.ddcc@gmail.com> | 2017-04-04 19:52:25 +0000 |
---|---|---|
committer | Dominic Chen <d.c.ddcc@gmail.com> | 2017-04-04 19:52:25 +0000 |
commit | fe95f3ca3634529cecfe3dddb88095c273e36722 (patch) | |
tree | aada8dbed7495102a2599e91fc01fb36cf8fbe80 /cmake | |
parent | a64aac47da8b3bf66b2fd3cf973508a8ce7d23a8 (diff) |
[analyzer] Add new Z3 constraint manager backend
Summary: Implement new Z3 constraint manager backend.
Reviewers: zaks.anna, dcoughlin, NoQ, xazax.hun
Subscribers: mgorny, cfe-commits
Differential Revision: https://reviews.llvm.org/D28952
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@299463 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/modules/FindZ3.cmake | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/cmake/modules/FindZ3.cmake b/cmake/modules/FindZ3.cmake new file mode 100644 index 0000000000..d95f073af1 --- /dev/null +++ b/cmake/modules/FindZ3.cmake @@ -0,0 +1,28 @@ +find_path(Z3_INCLUDE_DIR NAMES z3.h + PATH_SUFFIXES libz3 + ) + +find_library(Z3_LIBRARIES NAMES z3 libz3 + ) + +find_program(Z3_EXECUTABLE z3) + +if(Z3_INCLUDE_DIR AND Z3_EXECUTABLE) + execute_process (COMMAND ${Z3_EXECUTABLE} -version + OUTPUT_VARIABLE libz3_version_str + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE) + + string(REGEX REPLACE "^Z3 version ([0-9.]+)" "\\1" + Z3_VERSION_STRING "${libz3_version_str}") + unset(libz3_version_str) +endif() + +# handle the QUIETLY and REQUIRED arguments and set Z3_FOUND to TRUE if +# all listed variables are TRUE +include(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(Z3 + REQUIRED_VARS Z3_LIBRARIES Z3_INCLUDE_DIR + VERSION_VAR Z3_VERSION_STRING) + +mark_as_advanced(Z3_INCLUDE_DIR Z3_LIBRARIES) |