Skip to content

CMake builds: support system-installed CaDiCaL #8159

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/solvers/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,19 @@ foreach(SOLVER ${sat_impl})
${cadical_SOURCE_DIR}/src
)
target_link_libraries(solvers cadical_ipasir)
elseif("${SOLVER}" STREQUAL "system-cadical")
include(CheckIncludeFileCXX)
# if/when we move to CMake 3.12 (or later) we could also check for the
# library via CMAKE_REQUIRED_LIBRARIES
find_path(cadical_header_found "cadical.hpp")
if(cadical_header_found)
message(STATUS "Building solvers with cadical (${cadical_header_found})")
target_compile_definitions(solvers PUBLIC SATCHECK_CADICAL HAVE_CADICAL)
target_include_directories(solvers PRIVATE ${cadical_header_found})
target_link_libraries(solvers cadical)
else()
message(FATAL_ERROR "Unable to find header file for preinstalled cadical")
endif()
elseif("${SOLVER}" STREQUAL "ipasir-custom")
message(STATUS "Building with IPASIR solver linking: custom solver provided")

Expand Down