diff options
author | Mathias Preiner <mathias.preiner@gmail.com> | 2018-08-29 08:20:31 -0700 |
---|---|---|
committer | Mathias Preiner <mathias.preiner@gmail.com> | 2018-09-22 16:30:59 -0700 |
commit | 8f311f52037a9fb6a82d062342fec4b5396173c6 (patch) | |
tree | d20966972af4872d7b30dca1de41c1fc55f2decf /cmake/FindCaDiCaL.cmake | |
parent | 7be6be7dec00579cb7eaae32bed1217d6c35ee83 (diff) |
cmake: Add options for specifying install directories for dependencies.
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 |