forked from solvcon/solvcon
-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
112 lines (98 loc) · 3.76 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
108
109
110
111
112
# Copyright (c) 2016, Yung-Yu Chen <[email protected]>
# BSD 3-Clause License, see COPYING
#
# Common build command::
#
# $ cmake CMAKE_BUILD_TYPE=Debug build/debug; make -C build/debug run_gtest
# $ cmake CMAKE_BUILD_TYPE=Release build/release; make -C build/release run_gtest
#
# To create a Xcode project::
#
# $ mkdir -p build/xcode; cd build/xcode; cmake -G Xcode ../..
cmake_minimum_required(VERSION 3.7)
project(libmarch)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake/")
include(FindPythonAnaconda)
option(MARCH_RELAX_ERROR "Relax compiler error" OFF)
option(MARCH_NO_DEPRECATE_WARNING "Turn off deprecation warning" OFF)
option(MARCH_DESTINATION "SOLVCON root path" OFF)
option(MARCH_TEST "Build libmarch test cases" ON)
cmake_policy(SET CMP0074 NEW)
find_package(SCOTCH)
include_directories("include" ${SCOTCH_INCLUDE_DIRS})
set(MARCH_WARNOPT "-Werror -Wall -Wextra")
set(MARCH_WARNOPT "${MARCH_WARNOPT} -Wno-unused-function -Wno-unreachable-code -Wno-unused-private-field -Wno-missing-braces -Wno-sign-compare")
set(MARCH_WARNOPT "${MARCH_WARNOPT} -Wno-error=deprecated-declarations")
# FIXME: remove after port all legacy C code.
set(MARCH_WARNOPT "${MARCH_WARNOPT} -Wno-error=sign-compare")
if(NOT CMAKE_CXX_COMPILER_ID MATCHES "^(Apple)?Clang$")
set(MARCH_WARNOPT "${MARCH_WARNOPT} -Wno-error=maybe-uninitialized")
endif()
if(MARCH_NO_DEPRECATE_WARNING)
set(MARCH_WARNOPT "${MARCH_WARNOPT} -Wno-deprecated-declarations")
endif()
if(MARCH_RELAX_ERROR)
set(MARCH_WARNOPT "${MARCH_WARNOPT} -Wno-error=unused-variable")
endif()
if(NOT MARCH_DESTINATION)
set(MARCH_DESTINATION ${CMAKE_INSTALL_PREFIX})
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fPIC ${MARCH_WARNOPT}")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3")
set(MARCH_HEADERS
# overall
include/march.hpp
# dependency
include/march/depend/scotch.hpp
# core
include/march/core.hpp
include/march/core/memory.hpp
include/march/core/Buffer.hpp
include/march/core/LookupTable.hpp
include/march/core/Matrix.hpp
include/march/core/types.hpp
include/march/core/utility.hpp
include/march/core/Vector.hpp
include/march/core/string.hpp
include/march/core/system.hpp
# mesh
include/march/mesh.hpp
include/march/mesh/BoundaryData.hpp
include/march/mesh/CellType.hpp
include/march/mesh/ConservationElement.hpp
include/march/mesh/ConservationElement/GradientElement.hpp
include/march/mesh/ConservationElement/BasicCE.hpp
include/march/mesh/UnstructuredBlock.hpp
include/march/mesh/UnstructuredBlock/class.hpp
include/march/mesh/UnstructuredBlock/build_csr.hpp
include/march/mesh/UnstructuredBlock/build_faces_from_cells.hpp
include/march/mesh/UnstructuredBlock/build_rcells.hpp
include/march/mesh/UnstructuredBlock/calc_metric.hpp
include/march/mesh/UnstructuredBlock/fill_ghost.hpp
include/march/mesh/UnstructuredBlock/hand.hpp
# gas
include/march/gas.hpp
include/march/gas/Solution.hpp
include/march/gas/Jacobian.hpp
include/march/gas/Solver_decl.hpp
include/march/gas/Solver.hpp
include/march/gas/derivative.hpp
include/march/gas/Quantity.hpp
include/march/gas/Trim.hpp
include/march/gas/Anchor.hpp
# python
include/march/python/common.hpp
include/march/python/WrapBase.hpp
include/march/python/wrapper_core.hpp
include/march/python/wrapper_gas.hpp
include/march/python/wrapper_march.hpp
include/march/python/wrapper_mesh.hpp
)
string(REPLACE "include/" "${CMAKE_CURRENT_SOURCE_DIR}/include/"
MARCH_HEADERS "${MARCH_HEADERS}")
add_subdirectory(src)
if (MARCH_TEST)
add_subdirectory(tests)
endif()
# vim: set ff=unix fenc=utf8 nobomb et sw=4 ts=4: