CMakeLists.txt 16.6 KB
Newer Older
1
project(AMDIS)
Naumann, Andreas's avatar
Naumann, Andreas committed
2

3
cmake_minimum_required(VERSION 2.6)
4
5
6

SET(LIB_DIR ${AMDIS_SOURCE_DIR}/lib)
SET(SOURCE_DIR ${AMDIS_SOURCE_DIR}/src)
7

8
#TODO: use the cmake build type
9
SET(MTL_INCLUDE_DIR ${LIB_DIR}/mtl4/ CACHE PATH "mtl4 directory")
10

11
12
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DDEBUG=0") #-Wno-unused-but-set-variable
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG=1 -O0") #-Wno-unused-but-set-variable
13
14
15
16
17
18
19
20
21
22
23
24
25
26
if(NOT CurrentRevision)
	find_package(Subversion)
	if(Subversion_FOUND)
	  Subversion_WC_INFO(${CMAKE_CURRENT_SOURCE_DIR} svn_info)
	  #message("svn-rev: ${svn_info_WC_REVISION}")
	  set(CurrentRevision "0.9.${svn_info_WC_REVISION}")
	endif()
endif()
if(NOT AMDIS_MAJOR)
  set(AMDIS_MAJOR "0")
endif()
if(NOT AMDIS_MINOR)
  set(AMDIS_MINOR "9")
endif()
27
set(COMPILEFLAGS "-DAMDIS_VERSION=${CurrentRevision}")
28
29
30
31
32
33

#define the build type, empty can be everything and nothing
if(CMAKE_BUILD_TYPE STREQUAL "")
	set(CMAKE_BUILD_TYPE "Release")
endif()

34
35
36
37
38
if(CMAKE_CXX_COMPILER MATCHES ".*icpc")
	Message("Compiler: Intel")
	set(CMAKE_CXX_FLAGS "-diag-disable 654 -diag-disable 858") 
endif()

39
SET(ENABLE_PARALLEL_DOMAIN "OFF" CACHE STRING "use parallel domain decomposition. please set to one of: PMTL, PETSC, OFF" )
Naumann, Andreas's avatar
Naumann, Andreas committed
40
41
option(USE_PETSC_DEV false)
option(ENABLE_ZOLTAN false)
42
option(ENABLE_UMFPACK "Use of UMFPACK solver" false)
Praetorius, Simon's avatar
Praetorius, Simon committed
43
option(ENABLE_PNG "use png reader/writer" false)
44
option(ENABLE_BDDCML "Use of BDDCML library" false)
Naumann, Andreas's avatar
Naumann, Andreas committed
45

46
47
find_package(Boost 1.42 REQUIRED)
if(Boost_FOUND)
48
  list(APPEND AMDIS_INCLUDE_DIRS ${Boost_INCLUDE_DIR})
49
50
51
52
53
  message("boost lib-dirs: ${Boost_LIBRARY_DIRS}")
  message("use the boost dir: ${Boost_INCLUDE_DIR}")
  if(WIN32)
	message("the windows find_boost does not set the boost library paths, please set it")
	SET(Boost_LIBRARY_DIRS CACHE PATH "The directory containing the boost libraries")
54
  endif(WIN32)
55
  list(APPEND AMDIS_LINK_DIRS ${Boost_LIBRARY_DIRS})
56
endif(Boost_FOUND)
Naumann, Andreas's avatar
Naumann, Andreas committed
57

58

Thomas Witkowski's avatar
Thomas Witkowski committed
59
60
SET(AMDIS_SRC ${SOURCE_DIR}/AdaptBase.cc
	      ${SOURCE_DIR}/AdaptInfo.cc
61
	      ${SOURCE_DIR}/AdaptInstationary.cc
Thomas Witkowski's avatar
Thomas Witkowski committed
62
	      ${SOURCE_DIR}/AdaptStationary.cc
63
	      ${SOURCE_DIR}/AMDiS.cc
Thomas Witkowski's avatar
Thomas Witkowski committed
64
65
66
67
	      ${SOURCE_DIR}/Assembler.cc
	      ${SOURCE_DIR}/BasisFunction.cc
	      ${SOURCE_DIR}/Boundary.cc
	      ${SOURCE_DIR}/BoundaryManager.cc
68
	      ${SOURCE_DIR}/BoundaryObject.cc
Thomas Witkowski's avatar
Thomas Witkowski committed
69
70
71
72
73
74
	      ${SOURCE_DIR}/Cholesky.cc
	      ${SOURCE_DIR}/CoarseningManager.cc
	      ${SOURCE_DIR}/CoarseningManager1d.cc
	      ${SOURCE_DIR}/CoarseningManager2d.cc
	      ${SOURCE_DIR}/CoarseningManager3d.cc
	      ${SOURCE_DIR}/ComponentTraverseInfo.cc
Praetorius, Simon's avatar
Praetorius, Simon committed
75
              ${SOURCE_DIR}/CouplingIterationInterface.cc
Thomas Witkowski's avatar
Thomas Witkowski committed
76
77
78
79
80
	      ${SOURCE_DIR}/CreatorMap.cc
	      ${SOURCE_DIR}/DOFAdmin.cc
	      ${SOURCE_DIR}/DOFIndexed.cc
	      ${SOURCE_DIR}/DOFMatrix.cc
	      ${SOURCE_DIR}/DOFVector.cc
Naumann, Andreas's avatar
Naumann, Andreas committed
81
	      ${SOURCE_DIR}/Debug.cc
Thomas Witkowski's avatar
Thomas Witkowski committed
82
83
84
85
86
87
88
89
90
91
	      ${SOURCE_DIR}/DirichletBC.cc
	      ${SOURCE_DIR}/DualTraverse.cc
	      ${SOURCE_DIR}/ElInfo.cc
	      ${SOURCE_DIR}/ElInfo1d.cc
	      ${SOURCE_DIR}/ElInfo2d.cc
	      ${SOURCE_DIR}/ElInfo3d.cc
	      ${SOURCE_DIR}/ElInfoStack.cc
	      ${SOURCE_DIR}/Element.cc
	      ${SOURCE_DIR}/ElementData.cc
	      ${SOURCE_DIR}/ElementDofIterator.cc
92
	      ${SOURCE_DIR}/ElementRegion_ED.cc	
Thomas Witkowski's avatar
Thomas Witkowski committed
93
94
95
96
97
98
99
	      ${SOURCE_DIR}/FiniteElemSpace.cc
	      ${SOURCE_DIR}/FirstOrderAssembler.cc
	      ${SOURCE_DIR}/FirstOrderTerm.cc
	      ${SOURCE_DIR}/FixVec.cc
	      ${SOURCE_DIR}/Global.cc
	      ${SOURCE_DIR}/GlobalDOFNumbering.cc
	      ${SOURCE_DIR}/GlobalElementNumbering.cc
Praetorius, Simon's avatar
Praetorius, Simon committed
100
              ${SOURCE_DIR}/Initfile.cc
Thomas Witkowski's avatar
Thomas Witkowski committed
101
102
103
104
105
106
107
108
109
110
111
112
113
	      ${SOURCE_DIR}/Lagrange.cc
	      ${SOURCE_DIR}/LeafData.cc
	      ${SOURCE_DIR}/Line.cc
	      ${SOURCE_DIR}/MacroElement.cc
	      ${SOURCE_DIR}/Marker.cc
	      ${SOURCE_DIR}/Mesh.cc
	      ${SOURCE_DIR}/MeshStructure.cc
	      ${SOURCE_DIR}/Operator.cc
	      ${SOURCE_DIR}/OperatorTerm.cc
	      ${SOURCE_DIR}/Parametric.cc
	      ${SOURCE_DIR}/PeriodicBC.cc
	      ${SOURCE_DIR}/ProblemImplicit.cc
	      ${SOURCE_DIR}/ProblemInstat.cc
114
115
116
	      ${SOURCE_DIR}/ProblemInterpol.cc
	      ${SOURCE_DIR}/ProblemStat.cc
	      ${SOURCE_DIR}/ProblemStatDbg.cc
Thomas Witkowski's avatar
Thomas Witkowski committed
117
118
119
120
121
122
123
124
125
126
127
128
129
130
	      ${SOURCE_DIR}/Projection.cc
	      ${SOURCE_DIR}/QPInfo.cc
	      ${SOURCE_DIR}/QPsiPhi.cc
	      ${SOURCE_DIR}/Quadrature.cc
	      ${SOURCE_DIR}/RCNeighbourList.cc
	      ${SOURCE_DIR}/Recovery.cc
	      ${SOURCE_DIR}/RefinementManager.cc
	      ${SOURCE_DIR}/RefinementManager1d.cc
	      ${SOURCE_DIR}/RefinementManager2d.cc
	      ${SOURCE_DIR}/RefinementManager3d.cc
	      ${SOURCE_DIR}/RobinBC.cc
	      ${SOURCE_DIR}/ScalableQuadrature.cc
	      ${SOURCE_DIR}/SecondOrderAssembler.cc
	      ${SOURCE_DIR}/SecondOrderTerm.cc
131
	      ${SOURCE_DIR}/Serializer.cc
Thomas Witkowski's avatar
Thomas Witkowski committed
132
	      ${SOURCE_DIR}/StandardProblemIteration.cc
133
	      ${SOURCE_DIR}/SolverMatrix.cc
Thomas Witkowski's avatar
Thomas Witkowski committed
134
135
136
137
	      ${SOURCE_DIR}/SubAssembler.cc
	      ${SOURCE_DIR}/SubElInfo.cc
	      ${SOURCE_DIR}/SubQuadrature.cc
	      ${SOURCE_DIR}/SurfaceQuadrature.cc
138
139
	      ${SOURCE_DIR}/SurfaceRegion_ED.cc
	      ${SOURCE_DIR}/SystemVector.cc
Thomas Witkowski's avatar
Thomas Witkowski committed
140
	      ${SOURCE_DIR}/Tetrahedron.cc
Naumann, Andreas's avatar
Naumann, Andreas committed
141
	      ${SOURCE_DIR}/Timer.cc
Thomas Witkowski's avatar
Thomas Witkowski committed
142
143
144
145
146
	      ${SOURCE_DIR}/Traverse.cc
	      ${SOURCE_DIR}/Triangle.cc
	      ${SOURCE_DIR}/VertexVector.cc
	      ${SOURCE_DIR}/ZeroOrderAssembler.cc
	      ${SOURCE_DIR}/ZeroOrderTerm.cc
147
148
149
150
	      ${SOURCE_DIR}/est/Estimator.cc
	      ${SOURCE_DIR}/est/RecoveryEstimator.cc
	      ${SOURCE_DIR}/est/ResidualEstimator.cc
	      ${SOURCE_DIR}/est/SimpleResidualEstimator.cc
151
152
	      ${SOURCE_DIR}/io/ArhReader.cc
	      ${SOURCE_DIR}/io/ArhWriter.cc
Thomas Witkowski's avatar
Thomas Witkowski committed
153
154
155
156
157
158
159
	      ${SOURCE_DIR}/io/DofWriter.cc
	      ${SOURCE_DIR}/io/ElementFileWriter.cc
	      ${SOURCE_DIR}/io/FileWriter.cc
	      ${SOURCE_DIR}/io/GNUPlotWriter.cc
	      ${SOURCE_DIR}/io/MacroInfo.cc
	      ${SOURCE_DIR}/io/MacroReader.cc
	      ${SOURCE_DIR}/io/MacroWriter.cc
Praetorius, Simon's avatar
Praetorius, Simon committed
160
	      ${SOURCE_DIR}/io/PngReader.cc
Thomas Witkowski's avatar
Thomas Witkowski committed
161
162
	      ${SOURCE_DIR}/io/PngWriter.cc
	      ${SOURCE_DIR}/io/PovrayWriter.cc
163
	      ${SOURCE_DIR}/io/Spreadsheet.cc
Thomas Witkowski's avatar
Thomas Witkowski committed
164
165
166
	      ${SOURCE_DIR}/io/ValueReader.cc
	      ${SOURCE_DIR}/io/ValueWriter.cc
	      ${SOURCE_DIR}/io/VtkWriter.cc
167
	      ${SOURCE_DIR}/io/VtkVectorWriter.cc
168
	      ${SOURCE_DIR}/nonlin/ProblemNonLin.cc
Thomas Witkowski's avatar
Thomas Witkowski committed
169
	      ${SOURCE_DIR}/time/RosenbrockAdaptInstationary.cc
170
	      ${SOURCE_DIR}/time/RosenbrockMethod.cc
Thomas Witkowski's avatar
Thomas Witkowski committed
171
	      ${SOURCE_DIR}/time/RosenbrockStationary.cc
Naumann, Andreas's avatar
Naumann, Andreas committed
172
173
	      )

174
if(ENABLE_PARALLEL_DOMAIN)
175
176
177
	
	### Search for MPI compiler and get compile flags and include paths. ###

Naumann, Andreas's avatar
Naumann, Andreas committed
178
	find_package(MPI REQUIRED)
179
	if(MPI_FOUND)
180
	  list(APPEND COMPILEFLAGS "${MPI_COMPILE_FLAGS}")
181
182
	  include_directories(${MPI_INCLUDE_PATH})
	endif(MPI_FOUND)
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


	### Search for ParMetis ###

	find_file(PARMETIS_HEADER_FILE "parmetis.h" PATH ENV CPATH)
	if(PARMETIS_HEADER_FILE)
		get_filename_component(PARMETIS_INCLUDE_PATH "${PARMETIS_HEADER_FILE}" PATH CACHE)
		include_directories(${PARMETIS_INCLUDE_PATH})
	else()
		message(FATAL_ERROR "Could not find ParMetis header file!")
	endif(PARMETIS_HEADER_FILE)

	find_file(PARMETIS_LIB_FILE "libparmetis.a" PATH ENV LIBRARY_PATH)
	if(PARMETIS_LIB_FILE)
		get_filename_component(PARMETIS_LINK_PATH "${PARMETIS_LIB_FILE}" PATH CACHE)
		link_directories(${PARMETIS_LINK_PATH})
	else()
		message(FATAL_ERROR "Could not find ParMetis library file!")
	endif(PARMETIS_LIB_FILE)


	
	### Search for Zoltan ###

208
	if(ENABLE_ZOLTAN)
209
210
	  find_file(ZOLTAN_HEADER_FILE "zoltan_cpp.h" PATH ENV CPATH)
	  if(ZOLTAN_HEADER_FILE)
211
		get_filename_component(ZOLTAN_HEADER_DIR "${ZOLTAN_HEADER_FILE}" PATH CACHE)
212
		include_directories(${ZOLTAN_HEADER_DIR})
213
	  else()
214
215
216
		message(FATAL_ERROR "Could not find Zoltan include file!")
	  endif(ZOLTAN_HEADER_FILE)

217
	  list(APPEND COMPILEFLAGS "-DHAVE_ZOLTAN")
218
219
	endif(ENABLE_ZOLTAN)

220
221


222
	list(APPEND COMPILEFLAGS "-DHAVE_PARALLEL_DOMAIN_AMDIS=1")
Naumann, Andreas's avatar
Naumann, Andreas committed
223
	SET(PARALLEL_DOMAIN_AMDIS_SRC
224
               	${SOURCE_DIR}/parallel/DofComm.cc
225
		${SOURCE_DIR}/parallel/CheckerPartitioner.cc
226
		${SOURCE_DIR}/parallel/ElementObjectDatabase.cc
227
		${SOURCE_DIR}/parallel/InteriorBoundary.cc
228
		${SOURCE_DIR}/parallel/MatrixNnzStructure.cc
229
		${SOURCE_DIR}/parallel/MeshDistributor.cc 
230
		${SOURCE_DIR}/parallel/MeshLevelData.cc 
231
		${SOURCE_DIR}/parallel/MeshManipulation.cc
Thomas Witkowski's avatar
Thomas Witkowski committed
232
		${SOURCE_DIR}/parallel/MeshPartitioner.cc
233
		${SOURCE_DIR}/parallel/MpiHelper.cc
Thomas Witkowski's avatar
Thomas Witkowski committed
234
		${SOURCE_DIR}/parallel/ParallelDebug.cc
235
		${SOURCE_DIR}/parallel/ParallelDofMapping.cc
236
		${SOURCE_DIR}/parallel/ParallelProblemStatBase.cc
237
		${SOURCE_DIR}/parallel/PeriodicMap.cc
Thomas Witkowski's avatar
Thomas Witkowski committed
238
239
                ${SOURCE_DIR}/parallel/ParMetisPartitioner.cc
		${SOURCE_DIR}/parallel/StdMpi.cc
240
		${SOURCE_DIR}/parallel/ZoltanPartitioner.cc)
241
242
243
244
245
246
		
	if(ENABLE_PARALLEL_DOMAIN STREQUAL "PETSC")
		set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};/usr/share/cmake-2.8/Modules/;${CMAKE_SOURCE_DIR}/")
		set(PETSC_EXECUTABLE_RUNS ON)
		find_package(PETSc REQUIRED)
		include_directories(${PETSC_DIR}/include ${PETSC_DIR}/${PETSC_ARCH}/include)
247
		list(APPEND AMDIS_INCLUDE_DIRS ${PETSC_DIR}/include ${PETSC_DIR}/${PETSC_ARCH}/include)
248
249
250
		list(APPEND PARALLEL_DOMAIN_AMDIS_SRC 
			${SOURCE_DIR}/parallel/BddcMlSolver.cc
		        ${SOURCE_DIR}/parallel/PetscMultigridPrecon.cc
Thomas Witkowski's avatar
Thomas Witkowski committed
251
			${SOURCE_DIR}/parallel/PetscSolver.cc
252
253
254
			${SOURCE_DIR}/parallel/PetscProblemStat.cc
			${SOURCE_DIR}/parallel/PetscSolverFeti.cc
			${SOURCE_DIR}/parallel/PetscSolverGlobalMatrix.cc
255
			${SOURCE_DIR}/parallel/PetscSolverGlobalBlockMatrix.cc
256
			${SOURCE_DIR}/parallel/PetscSolverSchur.cc)
257
258
259
260
261
	elseif(ENABLE_PARALLEL_DOMAIN STREQUAL "PMTL")
		set(MTL_INCLUDE_DIR "")
		find_package(MTL REQUIRED)
		list(APPEND COMPILEFLAGS "-DMTL_HAS_MPI" "-DHAVE_PARALLEL_MTL4")
		list(APPEND PARALLEL_DOMAIN_AMDIS_SRC ${SOURCE_DIR}/parallel/Mtl4Solver.cc)
262
		list(APPEND AMDIS_LIBS ${MTL_LIBRARIES})
263
	else()
264
		message(SEND_ERROR "Set the domain-decomposition version correctly.")
265
266
	endif()

267
268
	INSTALL(FILES ResolveCompilerPaths.cmake FindPackageMultipass.cmake FindPETSc.cmake
		DESTINATION share/amdis/)
269
	if(USE_PETSC_DEV)
270
	  list(APPEND COMPILEFLAGS "-DHAVE_PETSC_DEV")
Naumann, Andreas's avatar
Naumann, Andreas committed
271
	endif( USE_PETSC_DEV)
Naumann, Andreas's avatar
Naumann, Andreas committed
272
273
endif(ENABLE_PARALLEL_DOMAIN)

274

275
276

if(ENABLE_UMFPACK)
277
	find_file(UMFPACK_H umfpack.h
278
			    HINTS ENV CPATH /usr/include /usr/include/suitesparse /usr/include/ufsparse
279
280
			    DOC "headerfile umfpack.h for UMFPACK")
	if(UMFPACK_H)
281
282
		get_filename_component(UMFPACK_PATH ${UMFPACK_H} PATH)
		include_directories(${UMFPACK_PATH} ${UFCONFIG_PATH} ${AMD_PATH})
283
		list(APPEND COMPILEFLAGS "-DHAVE_UMFPACK=1" "-DMTL_HAS_UMFPACK")
284
	else()
Praetorius, Simon's avatar
Praetorius, Simon committed
285
		message(FATAL_ERROR "Could not find the UMFPACK header umfpack.h.")
286
	endif()
287
	SET(RPM_DEPEND_STR "blas")
Naumann, Andreas's avatar
Naumann, Andreas committed
288
endif(ENABLE_UMFPACK)
Praetorius, Simon's avatar
Praetorius, Simon committed
289
290
291
292
293
294
295
296
297
298
299
300
301
302


if(ENABLE_PNG)
	find_file(PNG_H png.h
			    HINTS ENV CPATH /usr/include
			    DOC "headerfile png.h for PNG-READER")
	if(PNG_H)
		get_filename_component(PNG_PATH ${PNG_H} PATH)
		include_directories(${PNG_PATH})
		list(APPEND COMPILEFLAGS "-DHAVE_PNG=1")
	else()
		message(FATAL_ERROR "Could not find the PNG header png.h.")
	endif()
endif(ENABLE_PNG)
Naumann, Andreas's avatar
Naumann, Andreas committed
303

304
305

if(ENABLE_BDDCML)
306
307
	SET(BDDCML_LINK_LIST "" CACHE STRING "Further libraries to be linked with BDDCML")
		
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
	find_file(BDDCML_H bddcml_interface_c.h
			   HINTS ENV CPATH
			   DOC "Header bddcml_interface_c.h for the BDDCML library.")

	if(BDDCML_H)
		get_filename_component(BDDCML_PATH ${BDDCML_H} PATH)
		include_directories(${BDDCML_PATH})		
		list(APPEND COMPILEFLAGS "-DHAVE_BDDC_ML=1")
		list(APPEND COMPILEFLAGS "-DAdd_")
	else()
		message(FATAL_ERROR "Could not find BDDCML headers.")
	endif()

	find_library(BDDCML_LIB bddcml
				HINTS ENV LIBRARY_PATH
				DOC "BDDCML library")

	if(BDDCML_LIB)
		list(APPEND AMDIS_LIBS ${BDDCML_LIB})
	else()
		message(FATAL_ERROR "Could not find the BDDCML library")
	endif()
330

Thomas Witkowski's avatar
Thomas Witkowski committed
331
332
333
334

	find_file(BLOPEX_PATH blopex
			      HINTS ENV CPATH
			      DOC "Path to BLOPEX library.")
335
336
337
338
endif(ENABLE_BDDCML)



339
SET(COMPOSITE_SOURCE_DIR ${SOURCE_DIR}/compositeFEM)
Thomas Witkowski's avatar
Thomas Witkowski committed
340
341
342
343
344
345
346
347
SET(COMPOSITE_FEM_SRC ${COMPOSITE_SOURCE_DIR}/CFE_Integration.cc 
		      ${COMPOSITE_SOURCE_DIR}/CFE_NormAndErrorFcts.cc 
		      ${COMPOSITE_SOURCE_DIR}/CompositeFEMMethods.cc 
		      ${COMPOSITE_SOURCE_DIR}/CompositeFEMOperator.cc 
		      ${COMPOSITE_SOURCE_DIR}/LevelSetAdaptMesh.cc 
		      ${COMPOSITE_SOURCE_DIR}/PenaltyOperator.cc 
		      ${COMPOSITE_SOURCE_DIR}/ElementLevelSet.cc 
		      ${COMPOSITE_SOURCE_DIR}/SubPolytope.cc 
Naumann, Andreas's avatar
Naumann, Andreas committed
348
349
		      ${COMPOSITE_SOURCE_DIR}/SubElementAssembler.cc )

350
351
352
353
set(REINIT_SOURCE_DIR ${SOURCE_DIR}/reinit)
file(GLOB REINIT_SRC ${REINIT_SOURCE_DIR}/*.cc)
include_directories(${REINIT_SOURCE_DIR})

354
355

#muparser includes
356
set(MUPARSER_SOURCE_DIR ${AMDIS_SOURCE_DIR}/lib/muparser_v134)
357
file(GLOB MUPARSER_SRC ${MUPARSER_SOURCE_DIR}/src/*.cpp)
358
list(APPEND AMDIS_INCLUDE_DIRS ${MUPARSER_SOURCE_DIR}/include)
359

Naumann, Andreas's avatar
Naumann, Andreas committed
360
#mtl4 includes
361
list(APPEND AMDIS_INCLUDE_DIRS ${MTL_INCLUDE_DIR})
362
#include_directories(${MTL_INCLUDE_DIR})
363
list(APPEND AMDIS_INCLUDE_DIRS ${SOURCE_DIR})
364
#include_directories(${SOURCE_DIR})
365
include_directories(${AMDIS_INCLUDE_DIRS})
Naumann, Andreas's avatar
Naumann, Andreas committed
366

367
add_library(amdis SHARED ${AMDIS_SRC} ${PARALLEL_DOMAIN_AMDIS_SRC})
Naumann, Andreas's avatar
Naumann, Andreas committed
368
add_library(compositeFEM SHARED ${COMPOSITE_FEM_SRC})
Praetorius, Simon's avatar
Praetorius, Simon committed
369
add_library(reinit SHARED ${REINIT_SRC})
370
add_library(muparser SHARED ${MUPARSER_SRC})
Praetorius, Simon's avatar
Praetorius, Simon committed
371
372
#target_link_libraries(compositeFEM amdis)
#target_link_libraries(reinit amdis)
373
list(APPEND AMDIS_LIBS amdis ${Boost_LIBRARIES})
374

375
if(WIN32)
376
	list(APPEND COMPILEFLAGS "-D_SCL_SECURE_NO_WARNINGS" "-D_CRT_SECURE_NO_WARNINGS")
377
endif(WIN32)
378
message("compileflags: ${COMPILEFLAGS}")
379
380
#SET_TARGET_PROPERTIES(amdis PROPERTIES COMPILE_FLAGS "${COMPILEFLAGS}")
add_definitions(${COMPILEFLAGS})
381

Naumann, Andreas's avatar
Naumann, Andreas committed
382
383
384
385
if(ENABLE_MARMOT)
	Message("please set marmotcc manually")
endif(ENABLE_MARMOT)

386
#dont change this destination. the GUI depends on it to guess the buildsystem
387

388
FILE(GLOB HEADERS "${SOURCE_DIR}/*.h")
389
390
INSTALL(FILES ${HEADERS} 
	DESTINATION include/amdis/)
Naumann, Andreas's avatar
Naumann, Andreas committed
391
392
list(APPEND deb_add_dirs "include/amdis")

393
FILE(GLOB HEADERS "${SOURCE_DIR}/*.hh")
394
395
INSTALL(FILES ${HEADERS} 
	DESTINATION include/amdis/)
Naumann, Andreas's avatar
Naumann, Andreas committed
396

397
FILE(GLOB HEADERS "${SOURCE_DIR}/parallel/*.h")
398
399
INSTALL(FILES ${HEADERS} 
	DESTINATION include/amdis/parallel/)
Naumann, Andreas's avatar
Naumann, Andreas committed
400
401
list(APPEND deb_add_dirs "include/amdis/parallel")

402
403
404
405
406
FILE(GLOB HEADERS "${SOURCE_DIR}/nonlin/*.h")
INSTALL(FILES ${HEADERS} 
	DESTINATION include/amdis/nonlin/)
list(APPEND deb_add_dirs "include/amdis/nonlin")

407
408
409
410
411
FILE(GLOB HEADERS "${SOURCE_DIR}/est/*.h")
INSTALL(FILES ${HEADERS} 
	DESTINATION include/amdis/est/)
list(APPEND deb_add_dirs "include/amdis/est")

412
FILE(GLOB HEADERS "${SOURCE_DIR}/time/*.h")
413
414
INSTALL(FILES ${HEADERS} 
	DESTINATION include/amdis/time/)
Naumann, Andreas's avatar
Naumann, Andreas committed
415
416
list(APPEND deb_add_dirs "include/amdis/time")

417
FILE(GLOB HEADERS "${SOURCE_DIR}/itl/*.hpp")
418
419
INSTALL(FILES ${HEADERS} 
	DESTINATION include/amdis/itl)
Naumann, Andreas's avatar
Naumann, Andreas committed
420
421
list(APPEND deb_add_dirs "include/amdis/itl")

422
FILE(GLOB HEADERS "${SOURCE_DIR}/io/*.h")
Naumann, Andreas's avatar
Naumann, Andreas committed
423
424
INSTALL(FILES ${HEADERS}
	DESTINATION include/amdis/io)
Naumann, Andreas's avatar
Naumann, Andreas committed
425
426
list(APPEND deb_add_dirs "include/amdis/io")

427
FILE(GLOB HEADERS "${SOURCE_DIR}/io/*.hh")
Naumann, Andreas's avatar
Naumann, Andreas committed
428
429
INSTALL(FILES ${HEADERS}
	DESTINATION include/amdis/io)
430

Praetorius, Simon's avatar
Praetorius, Simon committed
431
432
433
434
435
436
437
438
439
440
FILE(GLOB HEADERS "${REINIT_SOURCE_DIR}/*.h")
INSTALL(FILES ${HEADERS}
	DESTINATION include/amdis/reinit)
list(APPEND deb_add_dirs "include/amdis/reinit")

FILE(GLOB HEADERS "${COMPOSITE_SOURCE_DIR}/*.h")
INSTALL(FILES ${HEADERS}
	DESTINATION include/amdis/compositeFEM)
list(APPEND deb_add_dirs "include/amdis/compositeFEM")

441
442
443
444
445
FILE(GLOB HEADERS "${MUPARSER_SOURCE_DIR}/include/*.h")
INSTALL(FILES ${HEADERS}
	DESTINATION include/amdis/muparser)
list(APPEND deb_add_dirs "include/amdis/muparser")

Praetorius, Simon's avatar
Praetorius, Simon committed
446
list(APPEND deb_add_dirs "lib/amdis")
447
install(TARGETS amdis compositeFEM reinit muparser
Praetorius, Simon's avatar
Praetorius, Simon committed
448
449
	LIBRARY DESTINATION lib/amdis/ )

450
451
configure_file(${AMDIS_SOURCE_DIR}/AMDISConfig.cmake.in
		${AMDIS_BINARY_DIR}/AMDISConfig.cmake
452
453
		@ONLY
	      )
454

455
INSTALL(FILES ${AMDIS_BINARY_DIR}/AMDISConfig.cmake 
456
	DESTINATION share/amdis/)
Naumann, Andreas's avatar
Naumann, Andreas committed
457
458
list(APPEND deb_add_dirs "share/amdis/")

459
INSTALL(FILES ${AMDIS_SOURCE_DIR}/AMDISUse.cmake 
460
	DESTINATION share/amdis/)
Naumann, Andreas's avatar
Naumann, Andreas committed
461

462
#install mtl
463
INSTALL(DIRECTORY ${AMDIS_SOURCE_DIR}/lib/mtl4/
464
465
466
467
468
469
	DESTINATION include/amdis/mtl4/
	FILES_MATCHING PATTERN "*.hpp"
	PATTERN ".svn" EXCLUDE
	PATTERN ".svn/*" EXCLUDE
	PATTERN "mtl4/libs" EXCLUDE
	PATTERN "mtl4/extern" EXCLUDE
470
       )
Naumann, Andreas's avatar
Naumann, Andreas committed
471
FILE(GLOB_RECURSE mtl4_files 
472
473
		RELATIVE ${AMDIS_SOURCE_DIR}/lib/mtl4/boost/ 
		${AMDIS_SOURCE_DIR}/lib/mtl4/boost/*.hpp)
Naumann, Andreas's avatar
Naumann, Andreas committed
474
475
foreach(mtl4_file in ${mtl4_files})
 get_filename_component(mtl4File_path ${mtl4_file} PATH)
476
 list(APPEND deb_add_dirs "include/amdis/mtl4/boost/${mtl4File_path}")
Naumann, Andreas's avatar
Naumann, Andreas committed
477
478
endforeach(mtl4_file)
list(REMOVE_DUPLICATES deb_add_dirs)
479
480

#PACKAGES
481
set(CPACK_PACKAGE_NAME "AMDIS")
482
set(CPACK_PACKAGE_CONTACT "Andreas.Naumann@tu-dresden.de")
483
set(CPACK_PACKAGE_VERSION "${CurrentRevision}")
484
485
486
set(CPACK_GENERATOR "RPM" "DEB" "TGZ")
set(CPACK_INSTALL_PREFIX "/usr/")

487
488
configure_file(${AMDIS_SOURCE_DIR}/preinst.in 
  ${AMDIS_BINARY_DIR}/preinst 
Naumann, Andreas's avatar
Naumann, Andreas committed
489
490
  @ONLY)

491
492
configure_file(${AMDIS_SOURCE_DIR}/postrm.in 
  ${AMDIS_BINARY_DIR}/postrm 
Naumann, Andreas's avatar
Naumann, Andreas committed
493
  @ONLY)
494
495
set(CPACK_RPM_PACKAGE_REQUIRES "boost-devel == 1.42, ${RPM_DEPEND_STR}")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libboost-dev (== 1.42), libboost-iostreams-dev (== 1.42), libboost-system-dev (== 1.42), libboost-filesystem-dev (== 1.42)")
496
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${AMDIS_BINARY_DIR}/preinst" "${AMDIS_BINARY_DIR}/postrm")
Naumann, Andreas's avatar
Naumann, Andreas committed
497

498
include(CPack)