-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
56 lines (46 loc) · 1.27 KB
/
CMakeLists.txt
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
cmake_minimum_required(VERSION 3.23)
project(pp-EnKF LANGUAGES CXX)
# Add cmake helpers
list(INSERT CMAKE_MODULE_PATH 0 "${CMAKE_SOURCE_DIR}/cmake")
set(BACKEND AUTO CACHE STRING "CHOICE OF PARALLEL BACKEND")
set(PROGRAMMING_MODEL AUTO CACHE STRING "CHOICE OF PARALLEL BACKEND")
if(BACKEND STREQUAL "HIP")
set(PROGRAMMING_MODEL "THRUST")
endif()
# Keep BUILD_TESTING
set(PRIVATE_BUILD_TESTING ${BUILD_TESTING})
# Find external libraries
if(NOT BACKEND STREQUAL "HIP")
find_package(Threads REQUIRED)
find_package(stdexec CONFIG)
# In order to disable testing for stdexec
set(STDEXEC_BUILD_EXAMPLES OFF)
set(STDEXEC_BUILD_TESTS OFF)
set(BUILD_TESTING OFF)
if(NOT stdexec_FOUND)
add_subdirectory(ext_lib/stdexec)
endif()
endif()
# Libraries
add_subdirectory(lib)
add_subdirectory(ext_lib/json)
add_subdirectory(ext_lib/mdspan)
if(BACKEND STREQUAL "OPENMP")
add_subdirectory(ext_lib/eigen)
endif()
# Test
set(BUILD_TESTING ${PRIVATE_BUILD_TESTING})
include(CTest)
if(BUILD_TESTING)
find_package(GTest CONFIG)
if(NOT GTest_FOUND)
add_subdirectory(ext_lib/googletest)
endif()
add_subdirectory(tests)
endif()
# Tutorial
if(NOT BACKEND STREQUAL "HIP")
add_subdirectory(tutorial)
endif()
# Mini-apps
add_subdirectory(mini-apps)