/
CMakeLists.txt
74 lines (59 loc) · 1.99 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
cmake_minimum_required(VERSION 3.14)
project( ExaEpi
DESCRIPTION "An agent-based simulation code for epidemiology modeling using the AMReX adaptive mesh refinement framework"
#VERSION ${AMREX_PKG_VERSION}
)
set( CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/cmake )
set(AMReX_PARTICLES ON)
set(AMReX_FORTRAN OFF)
set(AMReX_LINEAR_SOLVERS OFF)
set(AMReX_AMRLEVEL OFF)
set(AMReX_TINY_PROFILE ON)
set(AMReX_SPACEDIM 2 CACHE INTERNAL "")
set(AMReX_PRECISION SINGLE CACHE INTERNAL "")
set(AMReX_PARTICLES_PRECISION SINGLE CACHE INTERNAL "")
#
# Fetch amrex repo
#
set(AMReX_GIT_BRANCH "development" CACHE STRING "The AMReX branch to checkout")
set(AMReX_INSTALL "NO" CACHE INTERNAL "Disable install target for amrex")
include(FetchContent)
set(FETCHCONTENT_QUIET OFF) # Verbose ON
FetchContent_Declare(
amrex
GIT_REPOSITORY https://github.com/AMReX-Codes/amrex.git/
GIT_TAG ${AMReX_GIT_BRANCH}
)
if(NOT ${amrex}_POPULATED)
FetchContent_Populate(amrex)
list(APPEND CMAKE_MODULE_PATH ${amrex_SOURCE_DIR}/Tools/CMake)
# Load amrex options here so that they are
# available to the entire project
include(AMReXOptions)
if (AMReX_FORTRAN)
enable_language(Fortran)
endif ()
if (AMReX_GPU_BACKEND STREQUAL "CUDA")
enable_language(CUDA)
# include(AMReX_SetupCUDA)
endif ()
# Bring the populated content into the build
add_subdirectory(${amrex_SOURCE_DIR} ${amrex_BINARY_DIR})
endif()
#
# List of subdirectories to search for CMakeLists.
#
set( AMREX_AGENT_SUBDIRS src)
list(TRANSFORM AMREX_AGENT_SUBDIRS PREPEND "${CMAKE_CURRENT_LIST_DIR}/")
#
# Search for CMakelists.txt in the subdirectories defined in the list above
# and include those that contain one into the build
#
include(SetupAgent)
foreach (_subdir IN LISTS AMREX_AGENT_SUBDIRS)
file( GLOB_RECURSE _tests "${_subdir}/*CMakeLists.txt" )
foreach ( _item IN LISTS _tests)
get_filename_component(_dir ${_item} DIRECTORY )
add_subdirectory(${_dir})
endforeach ()
endforeach ()