-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathSetupChaiThirdparty.cmake
50 lines (46 loc) · 2.52 KB
/
SetupChaiThirdparty.cmake
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
##############################################################################
# Copyright (c) 2016-25, Lawrence Livermore National Security, LLC and CHAI
# project contributors. See the CHAI LICENSE file for details.
#
# SPDX-License-Identifier: BSD-3-Clause
##############################################################################
if (NOT TARGET umpire)
if (DEFINED umpire_DIR OR DEFINED UMPIRE_DIR)
message(STATUS "[CHAI] Using external Umpire")
find_package(umpire CONFIG REQUIRED NO_DEFAULT_PATH PATHS ${umpire_DIR} ${UMPIRE_DIR})
else ()
if (NOT EXISTS ${PROJECT_SOURCE_DIR}/src/tpl/umpire/CMakeLists.txt)
message(FATAL_ERROR "[CHAI] Umpire not found! Set umpire_DIR to the install location of Umpire or run 'git submodule update --init --recursive' in the CHAI repository, then try building again.")
else ()
message(STATUS "[CHAI] Using internal Umpire")
set(UMPIRE_ENABLE_BENCHMARKS Off CACHE BOOL "Enable benchmarks in Umpire")
set(UMPIRE_ENABLE_C Off CACHE BOOL "Enable C in Umpire")
set(UMPIRE_ENABLE_DOCS Off CACHE BOOL "Enable documentation in Umpire")
set(UMPIRE_ENABLE_EXAMPLES Off CACHE BOOL "Enable examples in Umpire")
set(UMPIRE_ENABLE_FORTRAN Off CACHE BOOL "Enable Fortran in Umpire")
set(UMPIRE_ENABLE_TESTS Off CACHE BOOL "Enable tests in Umpire")
set(UMPIRE_ENABLE_TOOLS Off CACHE BOOL "Enable tools in Umpire")
add_subdirectory(${PROJECT_SOURCE_DIR}/src/tpl/umpire)
endif ()
endif ()
endif ()
if (CHAI_ENABLE_RAJA_PLUGIN)
if (NOT TARGET RAJA)
if (DEFINED raja_DIR OR DEFINED RAJA_DIR)
message(STATUS "[CHAI] Using external RAJA")
find_package(raja CONFIG REQUIRED NO_DEFAULT_PATH PATHS ${raja_DIR} ${RAJA_DIR})
else ()
if (NOT EXISTS ${PROJECT_SOURCE_DIR}/src/tpl/raja/CMakeLists.txt)
message(FATAL_ERROR "[CHAI] RAJA not found! Set raja_DIR to the install location of RAJA or run 'git submodule update --init --recursive' in the CHAI repository, then try building again.")
else ()
message(STATUS "[CHAI] Using internal RAJA")
set(RAJA_ENABLE_BENCHMARKS Off CACHE BOOL "Enable benchmarks in RAJA")
set(RAJA_ENABLE_DOCS Off CACHE BOOL "Enable documentation in RAJA")
set(RAJA_ENABLE_EXAMPLES Off CACHE BOOL "Enable examples in RAJA")
set(RAJA_ENABLE_EXERCISES Off CACHE BOOL "Enable exercises in RAJA")
set(RAJA_ENABLE_TESTS Off CACHE BOOL "Enable tests in RAJA")
add_subdirectory(${PROJECT_SOURCE_DIR}/src/tpl/raja)
endif ()
endif ()
endif ()
endif ()