-
Notifications
You must be signed in to change notification settings - Fork 12
/
heyoka-config.cmake.in
48 lines (39 loc) · 1.76 KB
/
heyoka-config.cmake.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Remember several build options.
set(heyoka_WITH_SLEEF @HEYOKA_WITH_SLEEF@)
set(heyoka_WITH_MPPP @HEYOKA_WITH_MPPP@)
set(heyoka_WITH_REAL128 @_HEYOKA_WITH_REAL128@)
set(heyoka_WITH_REAL @_HEYOKA_WITH_REAL@)
set(heyoka_ABI_VERSION @HEYOKA_ABI_VERSION@)
# Record the LLVM major version against which
# heyoka was built.
set(heyoka_LLVM_VERSION_MAJOR @LLVM_VERSION_MAJOR@)
# Record also the versions of the public dependencies.
set(heyoka_Boost_VERSION @Boost_VERSION@)
set(heyoka_fmt_VERSION @fmt_VERSION@)
if(${heyoka_WITH_MPPP})
set(heyoka_mp++_VERSION @mp++_VERSION@)
endif()
# Mandatory public dependencies on Boost and fmt.
find_package(Boost @_HEYOKA_MIN_BOOST_VERSION@ REQUIRED serialization)
find_package(fmt REQUIRED CONFIG)
if(${fmt_VERSION_MAJOR} VERSION_LESS @_HEYOKA_MIN_SUPPORTED_FMT_VERSION@ OR
${fmt_VERSION_MAJOR} VERSION_GREATER @_HEYOKA_MAX_SUPPORTED_FMT_VERSION@)
message(FATAL_ERROR "The supported fmt versions are in the range [@_HEYOKA_MIN_SUPPORTED_FMT_VERSION@, @_HEYOKA_MAX_SUPPORTED_FMT_VERSION@], but version ${fmt_VERSION_MAJOR} was found instead.")
endif()
# Optional public dependency on mp++.
if(${heyoka_WITH_MPPP})
find_package(mp++ @_HEYOKA_MPPP_VERSION@ REQUIRED CONFIG)
# NOTE: this is necessary for the serialisation of several classes.
if(NOT mp++_WITH_BOOST_S11N)
message(FATAL_ERROR "mp++ must be installed with support for Boost.serialization.")
endif()
# NOTE: needed for formatting numbers.
if(NOT mp++_WITH_FMT)
message(FATAL_ERROR "mp++ must be installed with support for fmt.")
endif()
endif()
# Get current dir.
get_filename_component(_HEYOKA_CONFIG_SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
include(${_HEYOKA_CONFIG_SELF_DIR}/heyoka_export.cmake)
# Clean up.
unset(_HEYOKA_CONFIG_SELF_DIR)