-
Notifications
You must be signed in to change notification settings - Fork 26
/
mp++-config.cmake.in
55 lines (44 loc) · 1.67 KB
/
mp++-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
49
50
51
52
53
54
55
# Get current dir.
get_filename_component(_MPPP_CONFIG_SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
# Find the deps. Alter the cmake module path.
set(_MPPP_CONFIG_OLD_MODULE_PATH "${CMAKE_MODULE_PATH}")
list(APPEND CMAKE_MODULE_PATH "${_MPPP_CONFIG_SELF_DIR}")
# Mandatory dep on GMP.
find_package(mp++_GMP REQUIRED)
# Public optional deps.
if(@MPPP_WITH_MPFR@)
find_package(mp++_MPFR REQUIRED)
endif()
set(mp++_WITH_MPFR @MPPP_WITH_MPFR@)
if(@MPPP_WITH_MPC@)
find_package(mp++_MPC REQUIRED)
endif()
set(mp++_WITH_MPC @MPPP_WITH_MPC@)
if(@MPPP_WITH_BOOST_S11N@)
# NOTE: we look for Boost in CONFIG mode first, as that has become the official supported way
# of locating Boost in recent Boost/CMake versions. If we fail, we try again in
# MODULE mode as last resort.
find_package(Boost @_MPPP_MIN_BOOST_VERSION@ QUIET COMPONENTS serialization CONFIG)
if(NOT ${Boost_FOUND})
find_package(Boost @_MPPP_MIN_BOOST_VERSION@ QUIET MODULE COMPONENTS serialization)
endif()
if(NOT ${Boost_FOUND})
message(FATAL_ERROR "Could not locate Boost in either CONFIG or MODULE mode.")
endif()
endif()
set(mp++_WITH_BOOST_S11N @MPPP_WITH_BOOST_S11N@)
if(@MPPP_WITH_FMT@)
find_package(fmt @_MPPP_MIN_FMT_VERSION@ REQUIRED CONFIG)
endif()
set(mp++_WITH_FMT @MPPP_WITH_FMT@)
# Private optional deps.
set(mp++_WITH_ARB @MPPP_WITH_ARB@)
set(mp++_WITH_QUADMATH @MPPP_WITH_QUADMATH@)
# Export the ABI version.
set(mp++_ABI_VERSION @MPPP_ABI_VERSION@)
# Restore original module path.
set(CMAKE_MODULE_PATH "${_MPPP_CONFIG_OLD_MODULE_PATH}")
unset(_MPPP_CONFIG_OLD_MODULE_PATH)
include(${_MPPP_CONFIG_SELF_DIR}/mp++_export.cmake)
# Clean up.
unset(_MPPP_CONFIG_SELF_DIR)