cmake_minimum_required(VERSION 3.1)
+if(POLICY CMP0075)
+ cmake_policy(SET CMP0075 NEW)
+endif()
+
#-----------------------------------------------------------------------------#
project(cvc4)
# Full release string for CVC4.
if(CVC4_RELEASE)
- set(CVC4_RELEASE_STRING "${CVC4_MAJOR}.${CVC4_MINOR}.${CVC4_RELEASE}${CVC4_EXTRAVERSION}")
+ set(CVC4_RELEASE_STRING
+ "${CVC4_MAJOR}.${CVC4_MINOR}.${CVC4_RELEASE}${CVC4_EXTRAVERSION}")
else()
set(CVC4_RELEASE_STRING "${CVC4_MAJOR}.${CVC4_MINOR}${CVC4_EXTRAVERSION}")
endif()
cvc4_option(ENABLE_ASSERTIONS "Enable assertions")
cvc4_option(ENABLE_DEBUG_SYMBOLS "Enable debug symbols")
cvc4_option(ENABLE_DUMPING "Enable dumping")
-cvc4_option(ENABLE_MUZZLE "Supress ALL non-result output")
+cvc4_option(ENABLE_MUZZLE "Suppress ALL non-result output")
cvc4_option(ENABLE_OPTIMIZED "Enable optimization")
cvc4_option(ENABLE_PORTFOLIO "Enable portfolio support")
cvc4_option(ENABLE_PROOFS "Enable proof support")
option(BUILD_BINDINGS_JAVA "Build Java bindings")
option(BUILD_BINDINGS_PYTHON "Build Python bindings")
-# All bindings: c,java,csharp,perl,php,python,ruby,tcl,ocaml
-
-
#-----------------------------------------------------------------------------#
# Internal cmake variables
-set(OPT_LEVEL 3)
+set(OPTIMIZATION_LEVEL 3)
set(GPL_LIBS "")
set(BUILD_TYPES Production Debug Testing Competition)
set(CVC4_BUILD_PROFILE_TESTING 0)
set(CVC4_BUILD_PROFILE_COMPETITION 0)
-#-----------------------------------------------------------------------------#
-# Compiler flags
-
-add_check_c_cxx_flag("-O${OPT_LEVEL}")
-add_check_c_flag("-fexceptions")
-add_check_c_cxx_flag("-Wno-deprecated")
-add_check_cxx_flag("-Wsuggest-override")
-add_check_cxx_flag("-Wnon-virtual-dtor")
-
#-----------------------------------------------------------------------------#
# Build types
# Set the default build type to Production
if(NOT CMAKE_BUILD_TYPE)
- set(CMAKE_BUILD_TYPE Production CACHE STRING "Options are: ${BUILD_TYPES}" FORCE)
+ set(CMAKE_BUILD_TYPE
+ Production CACHE STRING "Options are: ${BUILD_TYPES}" FORCE)
# Provide drop down menu options in cmake-gui
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${BUILD_TYPES})
endif()
include(ConfigTesting)
elseif(CMAKE_BUILD_TYPE STREQUAL "Competition")
include(ConfigCompetition)
- # enable_static=yes
- #TODO
- # enable_static_binary=yes
- #TODO
endif()
+#-----------------------------------------------------------------------------#
+# Compiler flags
+
+add_check_c_cxx_flag("-O${OPTIMIZATION_LEVEL}")
+add_check_c_flag("-fexceptions")
+add_check_c_cxx_flag("-Wno-deprecated")
+add_check_cxx_flag("-Wsuggest-override")
+add_check_cxx_flag("-Wnon-virtual-dtor")
+
#-----------------------------------------------------------------------------#
# Option defaults (three-valued options (cvc4_option(...)))
set(BUILD_SHARED_LIBS OFF)
endif()
-find_package(PythonInterp REQUIRED)
-
#-----------------------------------------------------------------------------#
# Enable the ctest testing framework
libcvc4_link_libraries(${GMP_LIBRARIES})
libcvc4_include_directories(${GMP_INCLUDE_DIR})
-if(BUILD_BINDINGS_JAVA OR BUILD_BINDINGS_PYTHON)
- set(BUILD_BINDINGS TRUE)
-endif()
-
if(ENABLE_ASAN)
set(CMAKE_REQUIRED_LIBRARIES -fsanitize=address)
add_required_c_cxx_flag("-fsanitize=address")
if(ENABLE_ASSERTIONS)
add_definitions(-DCVC4_ASSERTIONS)
+else()
+ add_definitions(-DNDEBUG)
endif()
if(ENABLE_COVERAGE)
if(ENABLE_DUMPING)
add_definitions(-DCVC4_DUMPING)
-else()
- add_definitions(-DNDEBUG)
endif()
if(ENABLE_DEBUG_SYMBOLS)
find_package(Boost 1.50.0 REQUIRED COMPONENTS thread)
# Disable CLN for portfolio builds since it is not thread safe (uses an
# unlocked hash table internally).
- set(USE_CLN OFF)
+ if(USE_CLN)
+ message(WARNING "Disabling CLN support since portfolio is enabled.")
+ set(USE_CLN OFF)
+ endif()
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
if(THREADS_HAVE_PTHREAD_ARG)
#-----------------------------------------------------------------------------#
-set(VERSION "1.6.0-prerelease")
-string(TIMESTAMP MAN_DATE "%Y-%m-%d")
-
-#-----------------------------------------------------------------------------#
-
include(GetGitRevisionDescription)
get_git_head_revision(GIT_REFSPEC GIT_SHA1)
git_local_changes(GIT_IS_DIRTY)
)
#-----------------------------------------------------------------------------#
+# Generate CVC4's cvc4autoconfig.h header
include(ConfigureCVC4)
-
-# Defined if using the CLN multi-precision arithmetic library.
-set(CVC4_CLN_IMP ${CVC4_USE_CLN_IMP})
-# Defined if using the GMP multi-precision arithmetic library.
-set(CVC4_GMP_IMP ${CVC4_USE_GMP_IMP})
-
configure_file(cvc4autoconfig.new.h.in cvc4autoconfig.h)
include_directories(${CMAKE_CURRENT_BINARY_DIR})
#-----------------------------------------------------------------------------#
+# Add subdirectories
# signatures needs to come before src since it adds source files to libcvc4.
if(ENABLE_PROOFS)
add_subdirectory(doc)
add_subdirectory(src)
-if(BUILD_BINDINGS)
+
+if(BUILD_BINDINGS_JAVA OR BUILD_BINDINGS_PYTHON)
add_subdirectory(src/bindings)
endif()
+
if(BUILD_BINDINGS_JAVA)
add_subdirectory(test/java)
endif()
+
add_subdirectory(test/regress)
add_subdirectory(test/system)
+
if(ENABLE_UNIT_TESTING)
add_subdirectory(test/unit)
endif()
# error). So we have to keep both happy. Probably the same underlying
# issue as the hash specialization below, but let's check separately
# for flexibility.
-
check_cxx_source_compiles(
- "#include <stdint.h>
- void foo(long) {}
- void foo(int64_t) {}
- int main() { return 0; }"
+ "
+ #include <stdint.h>
+ void foo(long) {}
+ void foo(int64_t) {}
+ int main() { return 0; }
+ "
CVC4_NEED_INT64_T_OVERLOADS
)
if(NOT CVC4_NEED_INT64_T_OVERLOADS)
# Check to see if this version/architecture of GNU C++ explicitly
# instantiates std::hash<uint64_t> or not. Some do, some don't.
# See src/util/hash.h.
-
check_cxx_source_compiles(
- "#include <cstdint>
- #include <functional>
- namespace std { template<> struct hash<uint64_t> {}; }
- int main() { return 0; }"
+ "
+ #include <cstdint>
+ #include <functional>
+ namespace std { template<> struct hash<uint64_t> {}; }
+ int main() { return 0; }
+ "
CVC4_NEED_HASH_UINT64_T_OVERLOAD
)
if(CVC4_NEED_HASH_UINT64_T_OVERLOAD)
"
STRERROR_R_CHAR_P
)
+
+# Defined if using the CLN multi-precision arithmetic library.
+set(CVC4_CLN_IMP ${CVC4_USE_CLN_IMP})
+# Defined if using the GMP multi-precision arithmetic library.
+set(CVC4_GMP_IMP ${CVC4_USE_GMP_IMP})