forked from gitter-badger/salvus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
107 lines (95 loc) · 4.04 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
97
98
99
100
101
102
103
104
105
106
107
cmake_minimum_required(VERSION 2.8.7)
project(salvus)
###############################################
# Set all necessary variables here.
# These variables can be set at the command line:
# `cmake ../ -DPETSC_DIR=/opt/petsc`
# or via `ccmake ../`, hitting `c`, editing the
# respective variable, and then `g`
SET(PETSC_DIR /opt/petsc CACHE PATH "PETSC install directory")
SET(EIGEN_INCLUDE /usr/include/eigen3 CACHE PATH "Eigen install directory")
###############################################
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING
"Choose the type of the builds, options are: Debug Release RelWithDebInfo MinSizeRel."
FORCE)
endif (NOT CMAKE_BUILD_TYPE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g -std=c++11")
set(CMAKE_CXX_FLAGS_COVERAGE "-fprofile-arcs -ftest-coverage -O3 -DNDEBUG -std=c++11")
MARK_AS_ADVANCED(
CMAE_CXX_FLAGS_COVERAGE )
find_package(MPI REQUIRED)
link_directories(${PETSC_DIR}/lib)
FILE(GLOB QuadAutoGen src/cxx/Element/HyperCube/Quad/Autogen/*.c)
FILE(GLOB HexAutoGen src/cxx/Element/HyperCube/Hex/Autogen/*.c)
FILE(GLOB TriAutoGen src/cxx/Element/Simplex/Triangle/Autogen/*.c)
FILE(GLOB TetAutoGen src/cxx/Element/Simplex/Tetrahedra/Autogen/*.c)
include_directories(
${MPI_INCLUDE_PATH}
${PETSC_DIR}/include/
${EIGEN_INCLUDE}
include/)
set(SALVUS_SOURCES
src/cxx/Mesh/Mesh.cpp
src/cxx/Problem/Problem.cpp
src/cxx/Problem/Order2Newmark.cpp
src/cxx/Element/Simplex/Triangle.cpp
src/cxx/Element/Simplex/Triangle/TriP1.cpp
src/cxx/Element/Simplex/Tetrahedra.cpp
src/cxx/Element/Simplex/Tetrahedra/TetP1.cpp
src/cxx/Model/ExodusModel.cpp
src/cxx/Utilities/Utilities.cpp
src/cxx/Utilities/Options.cpp
src/cxx/Source/Source.cpp
src/cxx/Source/Ricker.cpp
src/cxx/Source/SourceHdf5.cpp
src/cxx/Receiver/Receiver.cpp
src/cxx/Receiver/ReceiverHdf5.cpp
src/cxx/Element/HyperCube/TensorQuad.cpp
src/cxx/Element/HyperCube/Quad/QuadP1.cpp
src/cxx/Element/HyperCube/Hexahedra.cpp
src/cxx/Element/HyperCube/Hex/HexP1.cpp
src/cxx/Physics/Element/Scalar.cpp
src/cxx/Physics/Element/ScalarTri.cpp
src/cxx/Physics/Element/Elastic2D.cpp
src/cxx/Physics/Element/Elastic3D.cpp
src/cxx/Physics/Boundary/HomogeneousDirichlet.cpp
src/cxx/Utilities/kdtree.c
src/cxx/Utilities/Logging.cpp
src/cxx/Element/Element.cpp
src/cxx/Element/HyperCube/Hexahedra.cpp
src/cxx/Physics/Coupling/AcousticToElastic2D.cpp
src/cxx/Physics/Coupling/ElasticToAcoustic.cpp
${QuadAutoGen}
${HexAutoGen}
${TriAutoGen}
${TetAutoGen}
)
# build most of our project as a "library", which is shared between
# the main executable and the testing suite.
add_library(salvusCommon ${SALVUS_SOURCES})
add_executable(salvus
src/cxx/Main.cpp)
add_executable(salvus_test
src/cxx/Testing/test_main.cpp
src/cxx/Testing/test_QuadP1.cpp
src/cxx/Testing/test_TensorQuad.cpp
src/cxx/Testing/test_TriP1.cpp
src/cxx/Testing/test_Tetrahedra.cpp
src/cxx/Testing/test_source.cpp
src/cxx/Testing/test_HexP1.cpp
src/cxx/Testing/test_Scalar_3D.cpp
src/cxx/Testing/test_Scalar_2D.cpp
src/cxx/Testing/test_TensorHex.cpp
src/cxx/Testing/test_receiver.cpp
src/cxx/Testing/test_Element.cpp
src/cxx/Testing/test_Mesh.cpp
src/cxx/Testing/test_Model.cpp
src/cxx/Testing/test_Options.cpp
src/cxx/Testing/test_Quad_Elastic_2D.cpp)
# run `make` (or `make -j5`) to build `salvus` executable
target_link_libraries(salvus salvusCommon ${MPI_LIBRARIES} petsc exodus netcdf hdf5 hdf5_hl)
# run `make salvus_test` to build testing executable.
target_link_libraries(salvus_test salvusCommon ${MPI_LIBRARIES} petsc exodus netcdf hdf5 hdf5_hl)
set_target_properties(salvus_test PROPERTIES EXCLUDE_FROM_ALL TRUE) # doesn't get built by `make`