-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathobake-config.cmake.in
39 lines (36 loc) · 1.42 KB
/
obake-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
# Get current dir.
get_filename_component(_OBAKE_CONFIG_SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
# Find the deps. Alter the cmake module path.
set(_OBAKE_CONFIG_OLD_MODULE_PATH "${CMAKE_MODULE_PATH}")
list(APPEND CMAKE_MODULE_PATH "${_OBAKE_CONFIG_SELF_DIR}")
find_package(mp++ REQUIRED)
if(${mp++_VERSION} VERSION_LESS @_OBAKE_MIN_MPPP_VERSION@)
message(FATAL_ERROR "The minimum mp++ version required by obake is @_OBAKE_MIN_MPPP_VERSION@, but version ${mp++_VERSION} was found instead.")
endif()
# TBB. Try to find it first in config mode (supported
# since version 2021 after the oneTBB rename), and, if this
# fails, fall back to our own FindTBB.cmake. This is of course
# not an ideal solution, but it should work until oneTBB
# becomes widely deployed.
find_package(TBB QUIET CONFIG)
if(NOT TBB_FOUND)
message(STATUS "TBB not found using config mode, retrying in module mode.")
find_package(TBB REQUIRED MODULE)
else()
message(STATUS "TBB found using config mode.")
endif()
find_package(fmt REQUIRED)
if(WIN32)
find_package(DbgEng REQUIRED)
endif()
include(ObakeFindDl)
set(THREADS_PREFER_PTHREAD_FLAG YES)
find_package(Threads REQUIRED)
unset(THREADS_PREFER_PTHREAD_FLAG)
@_OBAKE_CONFIG_OPTIONAL_DEPS@
# Restore original module path.
set(CMAKE_MODULE_PATH "${_OBAKE_CONFIG_OLD_MODULE_PATH}")
unset(_OBAKE_CONFIG_OLD_MODULE_PATH)
include(${_OBAKE_CONFIG_SELF_DIR}/obake_export.cmake)
# Clean up.
unset(_OBAKE_CONFIG_SELF_DIR)