diff options
Diffstat (limited to 'cmake/FindCaDiCaL.cmake')
-rw-r--r-- | cmake/FindCaDiCaL.cmake | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/cmake/FindCaDiCaL.cmake b/cmake/FindCaDiCaL.cmake index e3a045911..2976bb2bb 100644 --- a/cmake/FindCaDiCaL.cmake +++ b/cmake/FindCaDiCaL.cmake @@ -3,12 +3,28 @@ # CaDiCaL_INCLUDE_DIR - the CaDiCaL include directory # CaDiCaL_LIBRARIES - Libraries needed to use CaDiCaL + +# Check default location of CaDiCaL built with contrib/get-cadical. +# If the user provides a directory we will not search the default paths and +# fail if CaDiCaL was not found in the specified directory. +if(NOT CaDiCaL_HOME) + set(CaDiCaL_HOME ${PROJECT_SOURCE_DIR}/cadical) + set(CHECK_SYSTEM_VERSION TRUE) +endif() + find_path(CaDiCaL_INCLUDE_DIR NAMES cadical.hpp - PATHS "${PROJECT_SOURCE_DIR}/cadical/src") + PATHS ${CaDiCaL_HOME}/src + NO_DEFAULT_PATH) find_library(CaDiCaL_LIBRARIES NAMES cadical - PATHS "${PROJECT_SOURCE_DIR}/cadical/build") + PATHS ${CaDiCaL_HOME}/build + NO_DEFAULT_PATH) + +if(CHECK_SYSTEM_VERSION) + find_path(CaDiCaL_INCLUDE_DIR NAMES cadical.hpp) + find_library(CaDiCaL_LIBRARIES NAMES cadical) +endif() include(FindPackageHandleStandardArgs) find_package_handle_standard_args(CaDiCaL |