# Only enable unit testing if assertions are enabled. Otherwise, unit tests
# that expect AssertionException to be thrown will fail.
if(NOT ENABLE_ASSERTIONS)
- message(WARNING "Disabling unit tests since assertions are disabled.")
+ message(STATUS "Disabling unit tests since assertions are disabled.")
set(ENABLE_UNIT_TESTING OFF)
endif()
set(BUILD_SHARED_LIBS ON)
if(ENABLE_STATIC_BINARY)
set(ENABLE_STATIC_BINARY OFF)
- message(WARNING "Disabling static binary since shared build is enabled.")
+ message(STATUS "Disabling static binary since shared build is enabled.")
endif()
# Set visibility to default if unit tests are enabled
# Never build unit tests as static binaries, otherwise we'll end up with
# ~300MB per unit test.
if(ENABLE_UNIT_TESTING)
- message(WARNING "Disabling unit tests since static build is enabled.")
+ message(STATUS "Disabling unit tests since static build is enabled.")
set(ENABLE_UNIT_TESTING OFF)
endif()
if(THREADS_HAVE_PTHREAD_ARG)
add_c_cxx_flag(-pthread)
endif()
- find_package(CryptoMiniSat REQUIRED)
+ find_package(CryptoMiniSat 5.8 REQUIRED)
add_definitions(-DCVC5_USE_CRYPTOMINISAT)
endif()
endif()
if(NOT ANTLR3_FOUND_SYSTEM)
- check_auto_download("ANTLR3" "")
+ check_ep_downloaded("ANTLR3-EP-jar")
+ if(NOT ANTLR3-EP-jar_DOWNLOADED)
+ check_auto_download("ANTLR3" "")
+ endif()
+
include(ExternalProject)
set(ANTLR3_VERSION "3.4")
endif()
if(NOT CLN_FOUND_SYSTEM)
- check_auto_download("CLN" "--no-cln")
+ check_ep_downloaded("CLN-EP")
+ if(NOT CLN-EP_DOWNLOADED)
+ check_auto_download("CLN" "--no-cln")
+ endif()
+
include(ExternalProject)
fail_if_cross_compiling("Windows" "" "CLN" "autoconf fails")
endif()
if(NOT CaDiCaL_FOUND_SYSTEM)
- check_auto_download("CaDiCaL" "--no-cadical")
+ check_ep_downloaded("CaDiCaL-EP")
+ if(NOT CaDiCaL-EP_DOWNLOADED)
+ check_auto_download("CaDiCaL" "--no-cadical")
+ endif()
+
include(CheckSymbolExists)
include(ExternalProject)
message(STATUS "Found CaDiCaL ${CaDiCaL_VERSION}: ${CaDiCaL_LIBRARIES}")
else()
message(STATUS "Building CaDiCaL ${CaDiCaL_VERSION}: ${CaDiCaL_LIBRARIES}")
- add_dependencies(CaDiCaL CaDiCaL-EP)
endif()
set(CryptoMiniSat_FOUND_SYSTEM FALSE)
if(cryptominisat5_FOUND)
+ set(CryptoMiniSat_VERSION ${cryptominisat5_VERSION})
set(CryptoMiniSat_FOUND_SYSTEM TRUE)
add_library(CryptoMiniSat INTERFACE IMPORTED GLOBAL)
target_link_libraries(CryptoMiniSat INTERFACE cryptominisat5)
CryptoMiniSat PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
"${CRYPTOMINISAT5_INCLUDE_DIRS}"
)
-
endif()
if(NOT CryptoMiniSat_FOUND_SYSTEM)
- check_auto_download("CryptoMiniSat" "--no-cryptominisat")
- include(ExternalProject)
-
set(CryptoMiniSat_VERSION "5.8.0")
+ check_ep_downloaded("CryptoMiniSat-EP")
+ if(NOT CryptoMiniSat-EP_DOWNLOADED)
+ check_auto_download("CryptoMiniSat" "--no-cryptominisat")
+ endif()
+
+ include(ExternalProject)
+
ExternalProject_Add(
CryptoMiniSat-EP
${COMMON_EP_CONFIG}
endif()
if(NOT GMP_FOUND_SYSTEM)
- check_auto_download("GMP" "")
+ check_ep_downloaded("GMP-EP")
+ if(NOT GMP-EP_DOWNLOADED)
+ check_auto_download("GMP" "")
+ endif()
+
include(ExternalProject)
set(GMP_VERSION "6.2.1")
endif()
if(NOT GTest_FOUND_SYSTEM)
- check_auto_download("GTest" "")
+ check_ep_downloaded("GTest-EP")
+ if(NOT GTest-EP_DOWNLOADED)
+ check_auto_download("GTest" "")
+ endif()
+
include(ExternalProject)
set(GTest_VERSION "1.10.0")
endif()
if(NOT Kissat_FOUND_SYSTEM)
- check_auto_download("Kissat" "--no-kissat")
+ check_ep_downloaded("Kissat-EP")
+ if(NOT Kissat-EP_DOWNLOADED)
+ check_auto_download("Kissat" "--no-kissat")
+ endif()
+
include(ExternalProject)
fail_if_include_missing("sys/resource.h" "Kissat")
endif()
if(NOT Poly_FOUND_SYSTEM)
- check_auto_download("Poly" "--no-poly")
+ check_ep_downloaded("Poly-EP")
+ if(NOT Poly-EP_DOWNLOADED)
+ check_auto_download("Poly" "--no-poly")
+ endif()
+
include(ExternalProject)
set(Poly_VERSION "0.1.9")
endif()
if(NOT SymFPU_FOUND_SYSTEM)
- check_auto_download("SymFPU" "--no-symfpu")
+ check_ep_downloaded("SymFPU-EP")
+ if(NOT SymFPU-EP_DOWNLOADED)
+ check_auto_download("SymFPU" "--no-symfpu")
+ endif()
+
include(ExternalProject)
include(deps-helper)
set(depname "${name}")
endif()
if("${disable_option}" STREQUAL "")
- message(FATAL_ERROR "Could not find the required dependency
+ message(FATAL_ERROR "Could not find the required dependency \
${depname} in the system. Please install it yourself or use --auto-download to \
let us download and build it for you.")
else()
- message(FATAL_ERROR "Could not find the optional dependency
+ message(FATAL_ERROR "Could not find the optional dependency \
${depname} in the system. You can disable this dependency with \
${disable_option}, install it yourself or use --auto-download to let us \
download and build it for you.")
endif()
endmacro(check_auto_download)
+# Check if the given external project was already set up in a previous
+# configure call.
+macro(check_ep_downloaded name)
+ if(EXISTS "${DEPS_PREFIX}/src/${name}")
+ set(${name}_DOWNLOADED TRUE)
+ else()
+ set(${name}_DOWNLOADED FALSE)
+ endif()
+endmacro()
+
macro(check_system_version name)
# find_package sets this variable when called with a version
# https://cmake.org/cmake/help/latest/command/find_package.html#version-selection