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/FindCryptoMiniSat.cmake | |
parent | 7be6be7dec00579cb7eaae32bed1217d6c35ee83 (diff) |
cmake: Add options for specifying install directories for dependencies.
Diffstat (limited to 'cmake/FindCryptoMiniSat.cmake')
-rw-r--r-- | cmake/FindCryptoMiniSat.cmake | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/cmake/FindCryptoMiniSat.cmake b/cmake/FindCryptoMiniSat.cmake index 1706efb9c..aecd92226 100644 --- a/cmake/FindCryptoMiniSat.cmake +++ b/cmake/FindCryptoMiniSat.cmake @@ -3,12 +3,28 @@ # CryptoMiniSat_INCLUDE_DIR - the CryptoMiniSat include directory # CryptoMiniSat_LIBRARIES - Libraries needed to use CryptoMiniSat + +# Check default location of CryptoMiniSat built with contrib/get-cryptominisat. +# If the user provides a directory we will not search the default paths and +# fail if CryptoMiniSat was not found in the specified directory. +if(NOT CryptoMiniSat_HOME) + set(CryptoMiniSat_HOME ${PROJECT_SOURCE_DIR}/cryptominisat5/install) + set(CHECK_SYSTEM_VERSION TRUE) +endif() + find_path(CryptoMiniSat_INCLUDE_DIR NAMES cryptominisat5/cryptominisat.h - PATHS "${PROJECT_SOURCE_DIR}/cryptominisat5/install/include") + PATHS ${CryptoMiniSat_HOME}/include + NO_DEFAULT_PATH) find_library(CryptoMiniSat_LIBRARIES NAMES cryptominisat5 - PATHS "${PROJECT_SOURCE_DIR}/cryptominisat5/install/lib") + PATHS ${CryptoMiniSat_HOME}/lib + NO_DEFAULT_PATH) + +if(CHECK_SYSTEM_VERSION) + find_path(CryptoMiniSat_INCLUDE_DIR NAMES cryptominisat5/cryptominisat.h) + find_library(CryptoMiniSat_LIBRARIES NAMES cryptominisat5) +endif() include(FindPackageHandleStandardArgs) find_package_handle_standard_args(CryptoMiniSat |