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

3
cmake_minimum_required(VERSION 2.6)
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#if revision is not set, let cmake look for the svn-version
if( NOT CurrentRevision )
	find_package(Subversion)
	if(Subversion_FOUND)
		Subversion_WC_INFO(${AMDiS_SOURCE_DIR} mtlSubinfo)
		set(CurrentRevision "0.9${mtlSubinfo_WC_REVISION}")
	#       message("current revision: ${mtlSubinfo_WC_REVISION}")
	endif(Subversion_FOUND)
endif( NOT CurrentRevision )
#split the current revision in MAJOR.MINOR
string(REGEX MATCH "([0-9]+).([0-9]+)" AMDIS_MAJOR "${CurrentRevision}" )
set(AMDIS_MINOR ${CMAKE_MATCH_2})
set(AMDIS_MAJOR ${CMAKE_MATCH_1})
message("major: ${AMDIS_MAJOR}")
message("minor: ${AMDIS_MINOR}")
Naumann, Andreas's avatar
Naumann, Andreas committed
19

20
21
SET(LIB_DIR ${AMDiS_SOURCE_DIR}/lib)
SET(SOURCE_DIR ${AMDiS_SOURCE_DIR}/src)
22

23
#TODO: use the cmake build type
24
SET(MTL_INCLUDE_DIR ${LIB_DIR}/mtl4/ CACHE PATH "mtl4 directory")
25

26
27
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -g -Wall -DDEBUG=0")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -DDEBUG=1 -O0")
28
set(COMPILEFLAGS "-DAMDIS_VERSION=${CurrentRevision}")
29
30
31
32
33
34

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

Naumann, Andreas's avatar
Naumann, Andreas committed
35
#option(ENABLE_INTEL "use intel compiler" false)
36
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
37
option(USE_PETSC_DEV false)
38
#parmetis is not optional
Naumann, Andreas's avatar
Naumann, Andreas committed
39
40
set(ENABLE_PARMETIS false)
option(ENABLE_ZOLTAN false)
Naumann, Andreas's avatar
Naumann, Andreas committed
41
42
43
44
45
46
47
48
49
50
option(ENABLE_UMFPACK "use umfpack solver" false)

if(ENABLE_INTEL)
	Message("please set the icc manually")
	INCLUDE (CMakeForceCompiler)
	CMAKE_FORCE_C_COMPILER(icc "intel C compiler")
	CMAKE_FORCE_CXX_COMPILER(icpc "intel C++ compiler")
	#SET(CMAKE_C_COMPILER "icc")
endif(ENABLE_INTEL)

51
52
find_package(Boost 1.42 REQUIRED)
if(Boost_FOUND)
53
54
#  include_directories(${Boost_INCLUDE_DIR})
  list(APPEND AMDiS_INCLUDE_DIRS ${Boost_INCLUDE_DIR})
55
56
57
58
59
  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")
60
61
62
  endif(WIN32)
  list(APPEND AMDiS_LINK_DIRS ${Boost_LIBRARY_DIRS})
#  link_directories(${Boost_LIBRARY_DIRS})
63
endif(Boost_FOUND)
Naumann, Andreas's avatar
Naumann, Andreas committed
64

Thomas Witkowski's avatar
Thomas Witkowski committed
65
66
SET(AMDIS_SRC ${SOURCE_DIR}/AdaptBase.cc
	      ${SOURCE_DIR}/AdaptInfo.cc
67
	      ${SOURCE_DIR}/AdaptInstationary.cc
Thomas Witkowski's avatar
Thomas Witkowski committed
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
	      ${SOURCE_DIR}/AdaptStationary.cc
	      ${SOURCE_DIR}/Assembler.cc
	      ${SOURCE_DIR}/BasisFunction.cc
	      ${SOURCE_DIR}/Boundary.cc
	      ${SOURCE_DIR}/BoundaryManager.cc
	      ${SOURCE_DIR}/Cholesky.cc
	      ${SOURCE_DIR}/CoarseningManager.cc
	      ${SOURCE_DIR}/CoarseningManager1d.cc
	      ${SOURCE_DIR}/CoarseningManager2d.cc
	      ${SOURCE_DIR}/CoarseningManager3d.cc
	      ${SOURCE_DIR}/ComponentTraverseInfo.cc
	      ${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
84
	      ${SOURCE_DIR}/Debug.cc
Thomas Witkowski's avatar
Thomas Witkowski committed
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
	      ${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
	      ${SOURCE_DIR}/Estimator.cc
	      ${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
103
              ${SOURCE_DIR}/Initfile.cc
Thomas Witkowski's avatar
Thomas Witkowski committed
104
105
106
107
108
109
110
111
112
113
114
115
116
117
	      ${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}/Parameters.cc
	      ${SOURCE_DIR}/Parametric.cc
	      ${SOURCE_DIR}/PeriodicBC.cc
	      ${SOURCE_DIR}/ProblemImplicit.cc
	      ${SOURCE_DIR}/ProblemInstat.cc
118
119
120
	      ${SOURCE_DIR}/ProblemInterpol.cc
	      ${SOURCE_DIR}/ProblemStat.cc
	      ${SOURCE_DIR}/ProblemStatDbg.cc
Thomas Witkowski's avatar
Thomas Witkowski committed
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
	      ${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}/RecoveryEstimator.cc
	      ${SOURCE_DIR}/RefinementManager.cc
	      ${SOURCE_DIR}/RefinementManager1d.cc
	      ${SOURCE_DIR}/RefinementManager2d.cc
	      ${SOURCE_DIR}/RefinementManager3d.cc
	      ${SOURCE_DIR}/ResidualEstimator.cc
	      ${SOURCE_DIR}/RobinBC.cc
	      ${SOURCE_DIR}/ScalableQuadrature.cc
	      ${SOURCE_DIR}/SecondOrderAssembler.cc
	      ${SOURCE_DIR}/SecondOrderTerm.cc
137
	      ${SOURCE_DIR}/Serializer.cc
Thomas Witkowski's avatar
Thomas Witkowski committed
138
	      ${SOURCE_DIR}/StandardProblemIteration.cc
139
	      ${SOURCE_DIR}/SolverMatrix.cc
Thomas Witkowski's avatar
Thomas Witkowski committed
140
141
142
143
144
145
146
147
148
149
	      ${SOURCE_DIR}/SubAssembler.cc
	      ${SOURCE_DIR}/SubElInfo.cc
	      ${SOURCE_DIR}/SubQuadrature.cc
	      ${SOURCE_DIR}/SurfaceQuadrature.cc
	      ${SOURCE_DIR}/Tetrahedron.cc
	      ${SOURCE_DIR}/Traverse.cc
	      ${SOURCE_DIR}/Triangle.cc
	      ${SOURCE_DIR}/VertexVector.cc
	      ${SOURCE_DIR}/ZeroOrderAssembler.cc
	      ${SOURCE_DIR}/ZeroOrderTerm.cc
150
151
	      ${SOURCE_DIR}/io/ArhReader.cc
	      ${SOURCE_DIR}/io/ArhWriter.cc
Thomas Witkowski's avatar
Thomas Witkowski committed
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
	      ${SOURCE_DIR}/io/DataCollector.cc
	      ${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
	      ${SOURCE_DIR}/io/PngWriter.cc
	      ${SOURCE_DIR}/io/PovrayWriter.cc
	      ${SOURCE_DIR}/io/ValueReader.cc
	      ${SOURCE_DIR}/io/ValueWriter.cc
	      ${SOURCE_DIR}/io/VtkWriter.cc
	      ${SOURCE_DIR}/parallel/InteriorBoundary.cc
	      ${SOURCE_DIR}/time/RosenbrockAdaptInstationary.cc
167
	      ${SOURCE_DIR}/time/RosenbrockMethod.cc
Thomas Witkowski's avatar
Thomas Witkowski committed
168
	      ${SOURCE_DIR}/time/RosenbrockStationary.cc
Naumann, Andreas's avatar
Naumann, Andreas committed
169
170
	      )

171
if(ENABLE_PARALLEL_DOMAIN)
Naumann, Andreas's avatar
Naumann, Andreas committed
172
	find_package(MPI REQUIRED)
173
	if(MPI_FOUND)
174
	  list(APPEND COMPILEFLAGS "${MPI_COMPILE_FLAGS}")
175
176
	  include_directories(${MPI_INCLUDE_PATH})
	endif(MPI_FOUND)
177
178
179
180
181
 
	add_custom_target(parmetis-lib ALL
			make
			WORKING_DIRECTORY ${LIB_DIR}/ParMetis-3.1
			)
182
183
184
185
#include_directories( ${LIB_DIR}/ParMetis-3.1)
	list(APPEND AMDiS_INCLUDE_DIRS ${LIB_DIR}/ParMetis-3.1)
	list(APPEND AMDiS_LIBS ${LIB_DIR}/ParMetis-3.1/libparmetis.a ${LIB_DIR}/ParMetis-3.1/libmetis.a)
#	list(APPEND AMDiS_LINK_DIRS ${LIB_DIR}/ParMetis-3.1/)
186
        INSTALL(FILES ${LIB_DIR}/ParMetis-3.1/parmetis.h
187
188
		${LIB_DIR}/ParMetis-3.1/libparmetis.a
		${LIB_DIR}/ParMetis-3.1/libmetis.a
189
		DESTINATION lib/amdis/parmetis
190
	       )
191
	set(ENABLE_PARMETIS ON)
192
193
194
195
	if(ENABLE_ZOLTAN)
	  find_file(ZOLTAN_HEADER_FILE "zoltan_cpp.h")
	  if( ZOLTAN_HEADER_FILE )
		get_filename_component(ZOLTAN_HEADER_DIR "${ZOLTAN_HEADER_FILE}" PATH CACHE)
196
		include_directories(${ZOLTAN_HEADER_DIR})
197
	  else()
198
		message( FATAL_ERROR "could not find zoltan.")
199
	  endif( ZOLTAN_HEADER_FILE )
200
	  list(APPEND COMPILEFLAGS "-DHAVE_ZOLTAN")
201
202
	endif(ENABLE_ZOLTAN)

203
	list(APPEND COMPILEFLAGS "-DHAVE_PARALLEL_DOMAIN_AMDIS=1")
Naumann, Andreas's avatar
Naumann, Andreas committed
204
	SET(PARALLEL_DOMAIN_AMDIS_SRC
205
               	${SOURCE_DIR}/parallel/ParMetisPartitioner.cc
206
		${SOURCE_DIR}/parallel/CheckerPartitioner.cc
Thomas Witkowski's avatar
Thomas Witkowski committed
207
		${SOURCE_DIR}/parallel/ElementObjectData.cc
208
		${SOURCE_DIR}/parallel/MeshDistributor.cc 
209
		${SOURCE_DIR}/parallel/MeshManipulation.cc
Thomas Witkowski's avatar
Thomas Witkowski committed
210
		${SOURCE_DIR}/parallel/MeshPartitioner.cc
211
		${SOURCE_DIR}/parallel/MpiHelper.cc
Thomas Witkowski's avatar
Thomas Witkowski committed
212
		${SOURCE_DIR}/parallel/ParallelDebug.cc
213
		${SOURCE_DIR}/parallel/ParallelProblemStatBase.cc
Thomas Witkowski's avatar
Thomas Witkowski committed
214
215
                ${SOURCE_DIR}/parallel/ParMetisPartitioner.cc
		${SOURCE_DIR}/parallel/StdMpi.cc
216
		${SOURCE_DIR}/parallel/ZoltanPartitioner.cc)
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
		
	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)
		list(APPEND AMDiS_INCLUDE_DIRS ${PETSC_DIR}/include ${PETSC_DIR}/${PETSC_ARCH}/include)
		list(APPEND PARALLEL_DOMAIN_AMDIS_SRC ${SOURCE_DIR}/parallel/PetscSolver.cc
			${SOURCE_DIR}/parallel/PetscProblemStat.cc
			${SOURCE_DIR}/parallel/PetscSolverFeti.cc
			${SOURCE_DIR}/parallel/PetscSolverGlobalMatrix.cc
			${SOURCE_DIR}/parallel/PetscSolverSchur.cc)
	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)
		list(APPEND AMDiS_LIBS ${MTL_LIBRARIES})
#message("using the parallel mtl4 version")

	else()
		message(SEND_ERROR "please set the domain-decomposition version correctly")
	endif()

241
242
	INSTALL(FILES ResolveCompilerPaths.cmake FindPackageMultipass.cmake FindPETSc.cmake
		DESTINATION share/amdis/)
Naumann, Andreas's avatar
Naumann, Andreas committed
243
	if( USE_PETSC_DEV )
244
	  list(APPEND COMPILEFLAGS "-DHAVE_PETSC_DEV")
Naumann, Andreas's avatar
Naumann, Andreas committed
245
	endif( USE_PETSC_DEV)
Naumann, Andreas's avatar
Naumann, Andreas committed
246
247
248
endif(ENABLE_PARALLEL_DOMAIN)

if(ENABLE_UMFPACK)
249

250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
#	include_directories(${LIB_DIR}/UFconfig ${LIB_DIR}/AMD/Include ${LIB_DIR}/UMFPACK/Include)
#        FILE(GLOB UMFPACK_HEADERS "${LIB_DIR}/UMFPACK/Include/*.h")
#	INSTALL(FILES ${UMFPACK_HEADERS} 
#		DESTINATION include/amdis/umfpack/)
#	list(APPEND deb_add_dirs "include/amdis/umfpack")

#	FILE(GLOB UMFPACK_HEADERS "${LIB_DIR}/AMD/Include/*.h")
#	INSTALL(FILES ${UMFPACK_HEADERS} 
#		DESTINATION include/amdis/amd/)
#	list(APPEND deb_add_dirs "include/amdis/amd")

#	FILE(GLOB HEADERS "${LIB_DIR}/UFconfig/*.h")
#	INSTALL(FILES ${HEADERS} 
#		DESTINATION include/amdis/ufconfig/)
#	list(APPEND deb_add_dirs "include/amdis/ufconfig")

#	FILE(GLOB HEADERS "${LIB_DIR}/UFconfig/xerbla/*.h")
#	INSTALL(FILES ${HEADERS} 
#		DESTINATION include/amdis/ufconfig/xerbla)
#	list(APPEND deb_add_dirs "include/amdis/ufconfig/xerbla")
270

271
272
#add some rules to build the umfpack and amd libs
#	message("adding command for libumfpack:${CMAKE_CURRENT_SOURCE_DIR}/${LIB_DIR}/UMFPACK/Lib/libumfpack.a ")
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
#	add_custom_target(umfpack-lib ALL
#			make
#			WORKING_DIRECTORY ${LIB_DIR}/UMFPACK
#			)

#	add_custom_target(amd-lib ALL
#			 make
#			WORKING_DIRECTORY ${LIB_DIR}/AMD
#			)

#	INSTALL(FILES ${LIB_DIR}/UMFPACK/Lib/libumfpack.a 
#		DESTINATION lib/amdis/umfpack/)
#	list(APPEND deb_add_dirs "lib/amdis/umfpack")
#	INSTALL(FILES ${LIB_DIR}/AMD/Lib/libamd.a 
#		DESTINATION lib/amdis/amd/)
#	list(APPEND deb_add_dirs "lib/amdis/amd")

	#look for umfpack, we need the headers only
	find_file(UMFPACK_H umfpack.h
Praetorius, Simon's avatar
Praetorius, Simon committed
292
			HINTS /usr/include /usr/include/suitesparse /usr/include/ufsparse
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
			DOC "headerfile umfpack.h for UMFPACK")
	if( UMFPACK_H )
		#construct the include path
		get_filename_component(UMFPACK_PATH ${UMFPACK_H} PATH)
		#look for ufconfig
		find_file(UFCONFIG_H UFconfig.h
				HINTS /usr/include ${UMFPACK_PATH}
				DOC "headerfile UFConfig.h")
		if( UFCONFIG_H )
			get_filename_component(UFCONFIG_PATH ${UFCONFIG_H} PATH)
		else()
			message(FATAL_ERROR "could not find UFConfig.h, needed for umfpack")
		endif()
		#look for amd
		find_file(AMD_H amd.h
				HINTS /usr/include/ ${UMFPACK_PATH}
				DOC "headerfile amd.h")
		if( AMD_H )
			get_filename_component(AMD_PATH ${AMD_H} PATH)
		else()
			message( FATAL_ERROR "could not find amd.h, needed for umfpack")
		endif()
	
		#add the compileflags and directories
		include_directories(${UMFPACK_PATH} ${UFCONFIG_PATH} ${AMD_PATH})
318
		list(APPEND COMPILEFLAGS "-DHAVE_UMFPACK=1" "-DMTL_HAS_UMFPACK")
319
320
321
	else()
		message(FATAL_ERROR "Could not find the umfpack-headers. Please install umfpack")
	endif()
322
	SET(RPM_DEPEND_STR "blas")
Naumann, Andreas's avatar
Naumann, Andreas committed
323
324
endif(ENABLE_UMFPACK)

325
SET(COMPOSITE_SOURCE_DIR ${SOURCE_DIR}/compositeFEM)
Thomas Witkowski's avatar
Thomas Witkowski committed
326
327
328
329
330
331
332
333
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
334
335
		      ${COMPOSITE_SOURCE_DIR}/SubElementAssembler.cc )

336
337
338
339
set(REINIT_SOURCE_DIR ${SOURCE_DIR}/reinit)
file(GLOB REINIT_SRC ${REINIT_SOURCE_DIR}/*.cc)
include_directories(${REINIT_SOURCE_DIR})

Naumann, Andreas's avatar
Naumann, Andreas committed
340
#mtl4 includes
341
342
343
344
345
list(APPEND AMDiS_INCLUDE_DIRS ${MTL_INCLUDE_DIR})
#include_directories(${MTL_INCLUDE_DIR})
list(APPEND AMDiS_INCLUDE_DIRS ${SOURCE_DIR})
#include_directories(${SOURCE_DIR})
include_directories(${AMDiS_INCLUDE_DIRS})
Naumann, Andreas's avatar
Naumann, Andreas committed
346

347
add_library(amdis SHARED ${AMDIS_SRC} ${PARALLEL_DOMAIN_AMDIS_SRC})
Naumann, Andreas's avatar
Naumann, Andreas committed
348
add_library(compositeFEM SHARED ${COMPOSITE_FEM_SRC})
Praetorius, Simon's avatar
Praetorius, Simon committed
349
350
351
add_library(reinit SHARED ${REINIT_SRC})
#target_link_libraries(compositeFEM amdis)
#target_link_libraries(reinit amdis)
352
list(APPEND AMDiS_LIBS amdis ${Boost_LIBRARIES})
353

354
if(WIN32)
355
	list(APPEND COMPILEFLAGS "-D_SCL_SECURE_NO_WARNINGS" "-D_CRT_SECURE_NO_WARNINGS")
356
endif(WIN32)
357
message("compileflags: ${COMPILEFLAGS}")
358
359
#SET_TARGET_PROPERTIES(amdis PROPERTIES COMPILE_FLAGS "${COMPILEFLAGS}")
add_definitions(${COMPILEFLAGS})
360

Naumann, Andreas's avatar
Naumann, Andreas committed
361
362
363
364
if(ENABLE_MARMOT)
	Message("please set marmotcc manually")
endif(ENABLE_MARMOT)

365
#dont change this destination. the GUI depends on it to guess the buildsystem
366

367
FILE(GLOB HEADERS "${SOURCE_DIR}/*.h")
368
369
INSTALL(FILES ${HEADERS} 
	DESTINATION include/amdis/)
Naumann, Andreas's avatar
Naumann, Andreas committed
370
371
list(APPEND deb_add_dirs "include/amdis")

372
FILE(GLOB HEADERS "${SOURCE_DIR}/*.hh")
373
374
INSTALL(FILES ${HEADERS} 
	DESTINATION include/amdis/)
Naumann, Andreas's avatar
Naumann, Andreas committed
375

376
FILE(GLOB HEADERS "${SOURCE_DIR}/parallel/*.h")
377
378
INSTALL(FILES ${HEADERS} 
	DESTINATION include/amdis/parallel/)
Naumann, Andreas's avatar
Naumann, Andreas committed
379
380
list(APPEND deb_add_dirs "include/amdis/parallel")

381
FILE(GLOB HEADERS "${SOURCE_DIR}/time/*.h")
382
383
INSTALL(FILES ${HEADERS} 
	DESTINATION include/amdis/time/)
Naumann, Andreas's avatar
Naumann, Andreas committed
384
385
list(APPEND deb_add_dirs "include/amdis/time")

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

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

396
FILE(GLOB HEADERS "${SOURCE_DIR}/io/*.hh")
Naumann, Andreas's avatar
Naumann, Andreas committed
397
398
INSTALL(FILES ${HEADERS}
	DESTINATION include/amdis/io)
399

Praetorius, Simon's avatar
Praetorius, Simon committed
400
401
402
403
404
405
406
407
408
409
410
411
412
413
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")

list(APPEND deb_add_dirs "lib/amdis")
install(TARGETS amdis compositeFEM reinit 
	LIBRARY DESTINATION lib/amdis/ )

414
configure_file(${AMDiS_SOURCE_DIR}/AMDiSConfig.cmake.in
415
		${AMDiS_BINARY_DIR}/AMDISConfig.cmake
416
417
		@ONLY
	      )
418

419
INSTALL(FILES ${AMDiS_BINARY_DIR}/AMDISConfig.cmake 
420
	DESTINATION share/amdis/)
Naumann, Andreas's avatar
Naumann, Andreas committed
421
422
list(APPEND deb_add_dirs "share/amdis/")

423
INSTALL(FILES ${AMDiS_SOURCE_DIR}/AMDiSUse.cmake 
424
	DESTINATION share/amdis/)
Naumann, Andreas's avatar
Naumann, Andreas committed
425

426
#install mtl
427
INSTALL(DIRECTORY ${AMDiS_SOURCE_DIR}/lib/mtl4/
428
429
430
431
432
433
	DESTINATION include/amdis/mtl4/
	FILES_MATCHING PATTERN "*.hpp"
	PATTERN ".svn" EXCLUDE
	PATTERN ".svn/*" EXCLUDE
	PATTERN "mtl4/libs" EXCLUDE
	PATTERN "mtl4/extern" EXCLUDE
434
       )
Naumann, Andreas's avatar
Naumann, Andreas committed
435
436
437
438
439
FILE(GLOB_RECURSE mtl4_files 
		RELATIVE ${AMDiS_SOURCE_DIR}/lib/mtl4/boost/ 
		${AMDiS_SOURCE_DIR}/lib/mtl4/boost/*.hpp)
foreach(mtl4_file in ${mtl4_files})
 get_filename_component(mtl4File_path ${mtl4_file} PATH)
440
 list(APPEND deb_add_dirs "include/amdis/mtl4/boost/${mtl4File_path}")
Naumann, Andreas's avatar
Naumann, Andreas committed
441
442
endforeach(mtl4_file)
list(REMOVE_DUPLICATES deb_add_dirs)
443
444

#PACKAGES
Naumann, Andreas's avatar
Naumann, Andreas committed
445
set(CPACK_PACKAGE_NAME "AMDiS")
446
set(CPACK_PACKAGE_CONTACT "Andreas.Naumann@tu-dresden.de")
447
set(CPACK_PACKAGE_VERSION "${CurrentRevision}")
448
449
450
set(CPACK_GENERATOR "RPM" "DEB" "TGZ")
set(CPACK_INSTALL_PREFIX "/usr/")

Naumann, Andreas's avatar
Naumann, Andreas committed
451
452
453
454
455
456
457
configure_file(${AMDiS_SOURCE_DIR}/preinst.in 
  ${AMDiS_BINARY_DIR}/preinst 
  @ONLY)

configure_file(${AMDiS_SOURCE_DIR}/postrm.in 
  ${AMDiS_BINARY_DIR}/postrm 
  @ONLY)
458
set(CPACK_RPM_PACKAGE_REQUIRES "boost-devel >= 1.42, ${RPM_DEPEND_STR}")
459
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libboost-dev (>= 1.42), libboost-iostreams-dev (>= 1.42), libboost-system-dev (>= 1.42), libboost-filesystem-dev (>= 1.42)")
Naumann, Andreas's avatar
Naumann, Andreas committed
460
461
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${AMDiS_BINARY_DIR}/preinst" "${AMDiS_BINARY_DIR}/postrm")

462
include(CPack)