about summary refs log tree commit diff homepage
path: root/cmake
diff options
context:
space:
mode:
authorJulian Büning <julian.buening@rwth-aachen.de>2018-06-16 20:30:00 +0200
committerMartinNowack <martin.nowack@gmail.com>2018-07-02 17:30:55 +0100
commit95cad2afcb5a25eec9774c30bc7f5deb77fa387b (patch)
tree4ee56db0518c28a6c4ee6a61b8ec921505f8f77c /cmake
parent418184ca8e35d6ced451d97fdcdda5b42ad14194 (diff)
downloadklee-95cad2afcb5a25eec9774c30bc7f5deb77fa387b.tar.gz
CMake: use cmake_{push,pop}_check_state
Diffstat (limited to 'cmake')
-rw-r--r--cmake/find_z3.cmake5
1 files changed, 3 insertions, 2 deletions
diff --git a/cmake/find_z3.cmake b/cmake/find_z3.cmake
index 60e27c26..2240d48c 100644
--- a/cmake/find_z3.cmake
+++ b/cmake/find_z3.cmake
@@ -6,6 +6,7 @@
 # License. See LICENSE.TXT for details.
 #
 #===------------------------------------------------------------------------===#
+include(CMakePushCheckState)
 
 find_package(Z3)
 # Set the default so that if the following is true:
@@ -31,12 +32,12 @@ if (ENABLE_SOLVER_Z3)
     list(APPEND KLEE_SOLVER_LIBRARIES ${Z3_LIBRARIES})
 
     # Check the signature of `Z3_get_error_msg()`
-    set (_old_CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}")
+    cmake_push_check_state()
     set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${Z3_LIBRARIES})
     check_prototype_definition(Z3_get_error_msg
       "Z3_string Z3_get_error_msg(Z3_context c, Z3_error_code err)"
       "NULL" "${Z3_INCLUDE_DIRS}/z3.h" HAVE_Z3_GET_ERROR_MSG_NEEDS_CONTEXT)
-    set(CMAKE_REQUIRED_LIBRARIES ${_old_CMAKE_REQUIRED_LIBRARIES})
+    cmake_pop_check_state()
     if (HAVE_Z3_GET_ERROR_MSG_NEEDS_CONTEXT)
       message(STATUS "Z3_get_error_msg requires context")
     else()