-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
209 lines (152 loc) · 7.24 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
# ------------------------------------------------------------------------
# CMakeLists.txt for physsurfGeneric
# more documentation in http://www.cmake.org/cmake/help/cmake2.6docs.html
# ------------------------------------------------------------------------
cmake_minimum_required(VERSION 2.6)
project(helmholtzNd)
message(STATUS "---------------------------")
message(STATUS "PROJECT: helmholtzNd --")
message(STATUS "---------------------------")
set(DEVROOT ${CMAKE_CURRENT_SOURCE_DIR}/../..)
list(APPEND CMAKE_MODULE_PATH ${DEVROOT}/Xfiles/Util/cmakeUtil/ )
include(common_functions)
list(APPEND CMAKE_MODULE_PATH ${DEVROOT} )
#include(ExternalLibrariesPaths)
#=======================================================================================
# libs and executables files root directory:
# variables CMAKE_INSTALL_DIR, CMAKE_SYSTEM_PREFIX_PATH and DESTDIR are not used.
#=======================================================================================
#set(LIBRARIES_INSTALL_PATH "${DEVROOT}/LibDir" CACHE INTERNAL "librairies root destination")
#set(EXECUTABLES_INSTALL_PATH "${DEVROOT}/ExecDir" CACHE INTERNAL "executables root destination")
#BUILD_ROOT defini dans le CMakeLists principal
set(EXECUTABLES_INSTALL_PATH "${BUILD_ROOT}/ExecDir" CACHE INTERNAL "executables root destination")
# Set C++ standard to cxx14 (because of bessel)
set(CMAKE_CXX_FLAGS "-std=c++14 -pthread" CACHE STRING "inforced c++ standard")
#=======================================================================================
# definition of options
#=======================================================================================
option(VERBOSE "Verbose mode for CMake output" ON )
# USE options are mandatory to find interface headers
option(USE_MUMPS "use MUMPS interface" ON)
# options for solver : only one is on
option(MUMPSAPPLI "APPLI using MUMPS " OFF)
#
# to obtain compressed result files
option(GZIPOUTPUT "Use of boost iostream to compress output" OFF)
# use of hash map or hash set for map, set, ...
option(USE_HASH_TABLE "use hash table (default is ON)" ON)
# for special environement
option(MYENV "use special target for test and include in project attached project " OFF)
#option(HE_USE_OCTREE "Use Octree" ON )
option(HE_USE_EIGEN "Use Eigen" ON )
#=======================================================================================
# treatment of options
#=======================================================================================
# # setting cxx_compiler following chosen option
# set_cxx_compiler(EXTERNAL_INCLUDES EXTERNAL_LIBRARIES)
# # list of external package if needed
# set_external_def()
# set_internal_def()
#=======================================================================================
# Definitions
#=======================================================================================
if(NOT USE_XLEGACYSIMPLECUT)
message(FATAL_ERROR AUTHOR_WARNING "
**************************************************************************
physsurfGeneric library need xLegacySimpleCut. You must set USE_XLEGACYSIMPLECUT to ON and (re)build xFEM with this option. If you do not need xPhysics, set BUILD_XPHYSICS to OFF
**************************************************************************
")
else()
add_definitions( -DWITH_XLEGACYSIMPLECUT)
endif()
#=======================================================================================
# EXCEPTIONS
#=======================================================================================
#=======================================================================================
#=======================================================================================
# ---------------------------------------
# definition of the library
# ---------------------------------------
file(GLOB src_files
src/*.cc
src/*.h
)
# librairy can be SHARED or STATIC
set(BUILD_SHARED_LIBS "SHARED")
define_archos_suffixe(ARCHOS)
add_library(helmholtzNd ${BUILD_SHARED_LIBS} ${src_files} )
set(LIBRARY_OUTPUT_PATH ${DEVROOT}/lib/${ARCHOS} )
find_package(xTool REQUIRED)
find_package(xSolverBase REQUIRED)
find_package(xInterfaceMumps REQUIRED)
find_package(xInterfaceAOMDGeneral REQUIRED)
find_package(Trellis REQUIRED)
find_package(xFEM REQUIRED)
#find_package(xOctree REQUIRED)
find_package(BLAS)
find_package(LAPACK2)
find_and_set(xInterfaceLapack xInterfaceLapack HE_EXTERNAL_INCLUDES HE_EXTERNAL_LIBRARIES)
find_package(METIS)
find_package(Boost REQUIRED)
find_package(xLegacySimpleCut REQUIRED)
find_package(Sisl REQUIRED)
find_package(xGeomTools REQUIRED)
find_package(xQuadrature REQUIRED)
#find_package(xMeshTool REQUIRED)
#find_package(xInterfaceAOMDGeneral REQUIRED)
find_and_set(xDistMesh xDistMesh HE_EXTERNAL_INCLUDES HE_EXTERNAL_LIBRARIES)
find_and_set(xInterfaceParMetis xInterfaceParMetis HE_EXTERNAL_INCLUDES HE_EXTERNAL_LIBRARIES )
#find_and_set(xPhyssurfGeneric xPhyssurfGeneric HE_EXTERNAL_INCLUDES HE_EXTERNAL_LIBRARIES )
find_package(xPhyssurfGeneric REQUIRED)
message("========================================PSG : ${xPSG_LIBRARIES}")
message("========================================PSG : ${xPSG_INCLUDE_DIR}")
if(HE_USE_OCTREE)
find_package(xOctree REQUIRED)
list(APPEND HE_EXTERNAL_INCLUDES ${OCTREE_INCLUDE_DIR})
list(APPEND HE_EXTERNAL_LIBRARIES ${OCTREE_LIBRARIES})
find_package(xInterfacexOctree REQUIRED)
list(APPEND HE_EXTERNAL_INCLUDES ${XoctreeInterface_INCLUDE_DIR})
list(APPEND HE_EXTERNAL_LIBRARIES ${XoctreeInterface_LIBRARIES})
endif()
if(HE_USE_EIGEN)
find_package(Eigen3)
list(APPEND HE_EXTERNAL_INCLUDES ${EIGEN3_INCLUDE_DIR})
endif()
if (USE_MUMPS)
find_package(xInterfaceMumps)
list(APPEND HE_EXTERNAL_INCLUDES ${xInterfaceMumps_INCLUDE_DIR} )
add_definitions(-DUSE_MUMPS)# #define USE_MUMPS can be used in the source code
endif()
list(APPEND HE_EXTERNAL_INCLUDES ${PARMETIS_INCLUDE_DIR} )
list(APPEND HE_EXTERNAL_INCLUDES ${METIS_INCLUDE_DIR} )
list(APPEND HE_EXTERNAL_LIBRARIES ${PARMETIS_LIBRARIES} )
list(APPEND HE_EXTERNAL_LIBRARIES ${METIS_LIBRARIES} )
list(APPEND HE_EXTERNAL_INCLUDES ${MPI_CXX_INCLUDE_PATH} )
list(APPEND HE_EXTERNAL_LIBRARIES ${MPI_CXX_LIBRARIES} )
list(APPEND HE_EXTERNAL_INCLUDES
/develop/complex_bessel/install/include
${xTool_INCLUDE_DIR}
${xFEM_INCLUDE_DIR}
${Trellis_INCLUDE_DIR}
${xOctree_INCLUDE_DIR}
${xInterfaceAOMDGeneral_INCLUDE_DIR}
${xInterfacexOctree_INCLUDE_DIR}
${xSolverBase_INCLUDE_DIR}
#${InterfaceMumps_INCLUDE_DIR}
${Lapack_INCLUDE_DIR}
#${LIBIGL_INCLUDE_DIRS}
${xLegacySimpleCut_INCLUDE_DIR}
${xInterfaceLapack_INCLUDE_DIR}
${LAPACK_INCLUDE_DIR}
${xGeomTools_INCLUDE_DIR}
${xQuadrature_INCLUDE_DIR}
${LIBSISL_INCLUDE_DIR}
${xPSG_INCLUDE_DIR}
)
include_directories( ${HE_EXTERNAL_INCLUDES}
)
set_target_properties(helmholtzNd PROPERTIES COMPILE_FLAGS "-w -Wno-deprecated ${CXXFLAGS}" )
# ---------------------------------------
# adding devel/test
# ---------------------------------------
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/devel)