forked from OPM/IFEM-PoroElasticity
-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
96 lines (79 loc) · 2.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
cmake_minimum_required(VERSION 3.5)
project(PoroElasticity)
# Add local modules
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}
${PROJECT_SOURCE_DIR}/../../cmake/Modules
$ENV{HOME}/cmake/Modules)
# Required packages
if(NOT IFEM_CONFIGURED)
find_package(IFEM REQUIRED)
include_directories(${IFEM_INCLUDE_DIRS})
add_definitions(${IFEM_DEFINITIONS})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${IFEM_CXX_FLAGS}")
endif()
set(ELASTICITY_DIR ${PROJECT_SOURCE_DIR}/../IFEM-Elasticity)
if(NOT EXISTS ${ELASTICITY_DIR})
set(ELASTICITY_DIR ${PROJECT_SOURCE_DIR}/../Elasticity)
endif()
include_directories(${IFEM_INCLUDES} ../Common ${PROJECT_SOURCE_DIR}
${ELASTICITY_DIR} ${PROJECT_SOURCE_DIR}/PoroElastic)
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
if(NOT TARGET Elasticity)
add_subdirectory(${ELASTICITY_DIR} Elasticity)
endif()
if(NOT TARGET PoroElastic)
add_subdirectory(PoroElastic)
endif()
add_executable(PoroElasticity main.C)
target_link_libraries(PoroElasticity PoroElastic Elasticity ${IFEM_LIBRARIES})
list(APPEND CHECK_SOURCES main.C)
# Installation
install(TARGETS PoroElasticity DESTINATION bin COMPONENT bin)
# For generating the doxy
set(EXTRA_DOXY_PATHS "${PROJECT_SOURCE_DIR} \\
${PROJECT_BINARY_DIR} \\
${PROJECT_SOURCE_DIR}/PoroElastic \\
${ELASTICITY_DIR}")
add_doc_target(PoroElasticity PoroElasticity)
# Testing
enable_testing()
include(IFEMTesting)
# Regression tests
if(MPI_FOUND)
# Add parallel tests here
endif()
if(NOT MPI_FOUND OR IFEM_SERIAL_TESTS_IN_PARALLEL)
ifem_add_test(Plaxis1DVerif.reg PoroElasticity)
ifem_add_test(Plaxis1DVerif-mixed_C0.reg PoroElasticity)
ifem_add_test(Plaxis1DVerif-nonmixed.reg PoroElasticity)
ifem_add_test(Plaxis1DVerif-nondim.reg PoroElasticity)
ifem_add_test(OGSBenchmark1D.reg PoroElasticity)
ifem_add_test(OGSBenchmark1D-nonmixed.reg PoroElasticity)
ifem_add_test(Terzhagi.reg PoroElasticity)
ifem_add_test(Terzhagi-nondim.reg PoroElasticity)
ifem_add_test(SoilColumn3D.reg PoroElasticity)
ifem_add_test(SoilColumn3D-nonmixed.reg PoroElasticity)
ifem_add_test(VolFlux.reg PoroElasticity)
if(LRSpline_FOUND)
ifem_add_test(Plaxis1DVerif-LR.reg PoroElasticity)
ifem_add_test(OGSBenchmark1D-LR.reg PoroElasticity)
endif()
if(HDF5_FOUND AND CEREAL_FOUND)
ifem_add_restart_test(Terzhagi-restart.reg PoroElasticity 5)
endif()
ifem_add_vtf_test(SoilColumn3D.vreg PoroElasticity)
ifem_add_hdf5_test(Terzhagi.hreg PoroElasticity)
ifem_add_hdf5_test(SoilColumn3D.hreg PoroElasticity)
ifem_add_hdf5_test(SoilColumn3D-nonmixed.hreg PoroElasticity)
endif()
list(APPEND TEST_APPS PoroElasticity)
# Unit tests
IFEM_add_test_app(${PROJECT_SOURCE_DIR}/Test/*.C
${PROJECT_SOURCE_DIR}/Test
PoroElasticity 0
PoroElastic Elasticity ${IFEM_LIBRARIES})
if(IFEM_COMMON_APP_BUILD)
set(TEST_APPS ${TEST_APPS} PARENT_SCOPE)
else()
add_check_target()
endif()