-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathCMakeLists.txt
88 lines (71 loc) · 2.61 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
75
76
77
78
79
80
81
82
83
84
85
86
87
#Disable in-source builds to prevent source tree corruption.
if(" ${CMAKE_SOURCE_DIR}" STREQUAL " ${CMAKE_BINARY_DIR}")
message(FATAL_ERROR
"In-source builds disabled.
NOTE: You must delete CMakeCache.txt and CMakeFiles/* in
the source folder if they exist.")
endif()
cmake_minimum_required(VERSION 3.15)
include(cmake/policies.cmake)
project(zerork LANGUAGES C CXX Fortran VERSION 3.0.8)
include(CMakeDependentOption)
find_package (Python3 REQUIRED COMPONENTS Interpreter)
set(ZERORK_SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR})
set(ZERORK_DATA_DIR ${ZERORK_SOURCE_DIR}/data)
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED True)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH ON)
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/inst_dir" CACHE PATH "Path to install zerork" FORCE)
endif()
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose the type of build." FORCE)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif()
option(ENABLE_SHARED_LIBS "" OFF)
option(ENABLE_MPI "" ON)
option(ENABLE_OPENMP "Enable OpenMP (currently only used in cfd_plugin_tester)" OFF)
option(ZERORK_TESTS "Enable Zero-RK Tests" ON)
option(ZERORK_EXP_LIBC "Use libc exponential function instead of platform fast exponential" OFF)
if(WIN32)
set(ZERORK_EXTERNALS_BUILD_TYPE "${CMAKE_BUILD_TYPE}" CACHE STRING "Build type for external dependencies built during config.")
else()
set(ZERORK_EXTERNALS_BUILD_TYPE "Release" CACHE STRING "Build type for external dependencies built during config.")
endif()
set_property(CACHE ZERORK_EXTERNALS_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
if(${ENABLE_SHARED_LIBS})
set(BUILD_SHARED_LIBS ON CACHE INTERNAL "")
else()
set(BUILD_SHARED_LIBS OFF CACHE INTERNAL "")
endif()
if(${ENABLE_MPI})
include(cmake/mpi.cmake)
endif()
if(${ENABLE_OPENMP})
find_package(OpenMP)
endif()
include(cmake/platform.cmake)
include(cmake/git.cmake)
include(cmake/gpu.cmake)
include(cmake/spify.cmake)
include(cmake/blas.cmake)
include(cmake/lapack.cmake)
include(cmake/vmath.cmake)
include(cmake/superlu.cmake)
if(${ENABLE_MPI})
include(cmake/superlu_dist.cmake)
endif()
include(cmake/sundials.cmake)
add_subdirectory(src)
add_subdirectory(tools)
add_subdirectory(applications)
add_subdirectory(python)
add_subdirectory(examples)
add_subdirectory(data)
if(${ZERORK_TESTS})
include(cmake/tests.cmake)
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND})
add_subdirectory(tests)
endif()