aboutsummaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorDaniel Kirchner <daniel@ekpyron.org>2018-08-08 23:23:15 +0800
committerDaniel Kirchner <daniel@ekpyron.org>2018-08-09 01:02:59 +0800
commitc7a0f441591de8b3ee0adc09c70146319e79dc93 (patch)
treeeb8ce4f0462486aa5c4ed687ff21e3111e2660f1 /cmake
parent9b4546c487bc59e790716a11531e660110ca81e9 (diff)
downloaddexon-solidity-c7a0f441591de8b3ee0adc09c70146319e79dc93.tar.gz
dexon-solidity-c7a0f441591de8b3ee0adc09c70146319e79dc93.tar.zst
dexon-solidity-c7a0f441591de8b3ee0adc09c70146319e79dc93.zip
Do not force GMP to be present as dependency of CVC4, but also allow CLN instead.
Diffstat (limited to 'cmake')
-rw-r--r--cmake/FindCLN.cmake3
-rw-r--r--cmake/FindCVC4.cmake22
2 files changed, 19 insertions, 6 deletions
diff --git a/cmake/FindCLN.cmake b/cmake/FindCLN.cmake
new file mode 100644
index 00000000..f2234bb4
--- /dev/null
+++ b/cmake/FindCLN.cmake
@@ -0,0 +1,3 @@
+find_library(CLN_LIBRARY NAMES cln)
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(CLN DEFAULT_MSG CLN_LIBRARY)
diff --git a/cmake/FindCVC4.cmake b/cmake/FindCVC4.cmake
index 900a123e..2649d7c7 100644
--- a/cmake/FindCVC4.cmake
+++ b/cmake/FindCVC4.cmake
@@ -4,12 +4,22 @@ if (USE_CVC4)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(CVC4 DEFAULT_MSG CVC4_LIBRARY CVC4_INCLUDE_DIR)
if(CVC4_FOUND)
- find_library(CLN_LIBRARY NAMES cln)
- if(CLN_LIBRARY)
- set(CVC4_LIBRARIES ${CVC4_LIBRARY} ${CLN_LIBRARY})
- else()
- set(CVC4_LIBRARIES ${CVC4_LIBRARY})
- endif()
+ # CVC4 may depend on either CLN or GMP.
+ # We can assume that the one it requires is present on the system,
+ # so we quietly try to find both and link against them, if they are
+ # present.
+ find_package(CLN QUIET)
+ find_package(GMP QUIET)
+
+ set(CVC4_LIBRARIES ${CVC4_LIBRARY})
+
+ if (CLN_FOUND)
+ set(CVC4_LIBRARIES ${CVC4_LIBRARIES} ${CLN_LIBRARY})
+ endif ()
+
+ if (GMP_FOUND)
+ set(CVC4_LIBRARIES ${CVC4_LIBRARIES} ${GMP_LIBRARY})
+ endif ()
endif()
else()
set(CVC4_FOUND FALSE)