forked from CExA-project/ddc
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDDCConfig.cmake.in
More file actions
69 lines (55 loc) · 2.26 KB
/
DDCConfig.cmake.in
File metadata and controls
69 lines (55 loc) · 2.26 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# Copyright (C) The DDC development team, see COPYRIGHT.md file
#
# SPDX-License-Identifier: MIT
@PACKAGE_INIT@
# This macro extends the cmake macro `check_required_components`.
# It checks if all required components for a package are found and
# sets a custom NOT_FOUND_MESSAGE listing missing required components.
macro(ddc_check_required_components _NAME)
set(REQUIRED_COMPONENTS_NOT_FOUND "")
foreach(comp ${${_NAME}_FIND_COMPONENTS})
if(NOT ${_NAME}_${comp}_FOUND)
if(${_NAME}_FIND_REQUIRED_${comp})
list(APPEND REQUIRED_COMPONENTS_NOT_FOUND "${comp}")
set(${_NAME}_FOUND FALSE)
endif()
endif()
endforeach()
if(REQUIRED_COMPONENTS_NOT_FOUND)
set(${_NAME}_NOT_FOUND_MESSAGE "Component(s) not found: ${REQUIRED_COMPONENTS_NOT_FOUND}")
endif()
unset(REQUIRED_COMPONENTS_NOT_FOUND)
endmacro()
# Workaround for rocm <6 setting a cmake_minimum_required <3.12.
# When redefining `find_dependency` we get a better chance
# to use the NEW policy for CMP0074.
macro(ddc_find_dependency)
include(CMakeFindDependencyMacro)
find_dependency(${ARGN})
endmacro()
set(DDC_BUILD_DOUBLE_PRECISION @DDC_BUILD_DOUBLE_PRECISION@)
ddc_find_dependency(Kokkos 4.4...<5)
include(${CMAKE_CURRENT_LIST_DIR}/DDCCoreTargets.cmake)
if(@DDC_BUILD_KERNELS_FFT@ AND ("fft" IN_LIST DDC_FIND_COMPONENTS))
ddc_find_dependency(KokkosFFT 0.3.0...<1)
include(${CMAKE_CURRENT_LIST_DIR}/DDCFftTargets.cmake)
set(DDC_fft_FOUND TRUE)
endif()
if(@DDC_BUILD_KERNELS_SPLINES@ AND ("splines" IN_LIST DDC_FIND_COMPONENTS))
ddc_find_dependency(Ginkgo 1.8...<2)
# DDC installs a FindLAPACKE.cmake file.
# We choose to rely on it by prepending to CMAKE_MODULE_PATH
# only the time of calling ddc_find_dependency.
list(PREPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})
ddc_find_dependency(LAPACKE)
list(POP_FRONT CMAKE_MODULE_PATH)
ddc_find_dependency(KokkosKernels 4.5.1...<5)
include(${CMAKE_CURRENT_LIST_DIR}/DDCSplinesTargets.cmake)
set(DDC_splines_FOUND TRUE)
endif()
if(@DDC_BUILD_PDI_WRAPPER@ AND ("pdi" IN_LIST DDC_FIND_COMPONENTS))
ddc_find_dependency(PDI 1.6...<2 COMPONENTS C)
include(${CMAKE_CURRENT_LIST_DIR}/DDCPdiTargets.cmake)
set(DDC_pdi_FOUND TRUE)
endif()
ddc_check_required_components(DDC)