Add opensmt2 interface

This commit is contained in:
Leonardo Alt
2021-02-02 12:11:50 +01:00
parent dde6353c5d
commit 1718f4ff39
6 changed files with 280 additions and 11 deletions
+1
View File
@@ -224,6 +224,7 @@ if(UNIX AND NOT APPLE)
option(USE_Z3_DLOPEN "Dynamically load the Z3 SMT solver instead of linking against it." OFF)
endif()
option(USE_CVC4 "Allow compiling with CVC4 SMT solver integration" ON)
option(USE_OSMT2 "Allow compiling with OpenSMT2 SMT solver integration" ON)
if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang"))
option(USE_LD_GOLD "Use GNU gold linker" ON)
+27
View File
@@ -0,0 +1,27 @@
if (USE_OSMT2)
find_path(OSMT2_INCLUDE_DIR opensmt/opensmt2.h)
find_library(OSMT2_LIBRARY NAMES opensmt2)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(OSMT2 DEFAULT_MSG OSMT2_LIBRARY OSMT2_INCLUDE_DIR)
if(OSMT2_FOUND)
# OSMT2 depends on GMP.
# We can assume that GMP is present on the system,
# so we quietly try to find it and link against it, if it is present.
find_package(GMP QUIET)
set(OSMT2_LIBRARIES ${OSMT2_LIBRARY})
if (GMP_FOUND)
set(OSMT2_LIBRARIES ${OSMT2_LIBRARIES} GMP::GMP)
endif ()
if (NOT TARGET OSMT2::OSMT2)
add_library(OSMT2::OSMT2 UNKNOWN IMPORTED)
set_property(TARGET OSMT2::OSMT2 PROPERTY IMPORTED_LOCATION ${OSMT2_LIBRARY})
set_property(TARGET OSMT2::OSMT2 PROPERTY INTERFACE_LINK_LIBRARIES ${OSMT2_LIBRARIES})
set_property(TARGET OSMT2::OSMT2 PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${OSMT2_INCLUDE_DIR})
endif()
endif()
else()
set(OSMT2_FOUND FALSE)
endif()