CMakeLists.txt 14 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} -g -Wall -DDEBUG=0")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -DDEBUG=1 -O0")
13
set(COMPILEFLAGS "-DAMDIS_VERSION=${CurrentRevision}")
14 15 16 17 18 19

#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
20
#option(ENABLE_INTEL "use intel compiler" false)
21
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
22 23
option(USE_PETSC_DEV false)
option(ENABLE_ZOLTAN false)
Naumann, Andreas's avatar
Naumann, Andreas committed
24 25
option(ENABLE_UMFPACK "use umfpack solver" false)

26

Naumann, Andreas's avatar
Naumann, Andreas committed
27 28 29 30 31 32 33 34
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)

35

36 37
find_package(Boost 1.42 REQUIRED)
if(Boost_FOUND)
38
  list(APPEND AMDIS_INCLUDE_DIRS ${Boost_INCLUDE_DIR})
39 40 41 42 43
  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")
44
  endif(WIN32)
45
  list(APPEND AMDIS_LINK_DIRS ${Boost_LIBRARY_DIRS})
46
endif(Boost_FOUND)
Naumann, Andreas's avatar
Naumann, Andreas committed
47

48

Thomas Witkowski's avatar
Thomas Witkowski committed
49 50
SET(AMDIS_SRC ${SOURCE_DIR}/AdaptBase.cc
	      ${SOURCE_DIR}/AdaptInfo.cc
51
	      ${SOURCE_DIR}/AdaptInstationary.cc
Thomas Witkowski's avatar
Thomas Witkowski committed
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
	      ${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
68
	      ${SOURCE_DIR}/Debug.cc
Thomas Witkowski's avatar
Thomas Witkowski committed
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
	      ${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
87
              ${SOURCE_DIR}/Initfile.cc
Thomas Witkowski's avatar
Thomas Witkowski committed
88 89 90 91 92 93 94 95 96 97 98 99 100
	      ${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
101 102 103
	      ${SOURCE_DIR}/ProblemInterpol.cc
	      ${SOURCE_DIR}/ProblemStat.cc
	      ${SOURCE_DIR}/ProblemStatDbg.cc
Thomas Witkowski's avatar
Thomas Witkowski committed
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119
	      ${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
120
	      ${SOURCE_DIR}/Serializer.cc
Thomas Witkowski's avatar
Thomas Witkowski committed
121
	      ${SOURCE_DIR}/StandardProblemIteration.cc
122
	      ${SOURCE_DIR}/SolverMatrix.cc
Thomas Witkowski's avatar
Thomas Witkowski committed
123 124 125 126 127 128 129 130 131 132
	      ${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
133 134
	      ${SOURCE_DIR}/io/ArhReader.cc
	      ${SOURCE_DIR}/io/ArhWriter.cc
Thomas Witkowski's avatar
Thomas Witkowski committed
135 136 137 138 139 140 141 142 143 144 145 146 147 148 149
	      ${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
150
	      ${SOURCE_DIR}/time/RosenbrockMethod.cc
Thomas Witkowski's avatar
Thomas Witkowski committed
151
	      ${SOURCE_DIR}/time/RosenbrockStationary.cc
Naumann, Andreas's avatar
Naumann, Andreas committed
152 153
	      )

154
if(ENABLE_PARALLEL_DOMAIN)
155 156 157
	
	### Search for MPI compiler and get compile flags and include paths. ###

Naumann, Andreas's avatar
Naumann, Andreas committed
158
	find_package(MPI REQUIRED)
159
	if(MPI_FOUND)
160
	  list(APPEND COMPILEFLAGS "${MPI_COMPILE_FLAGS}")
161 162
	  include_directories(${MPI_INCLUDE_PATH})
	endif(MPI_FOUND)
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


	### 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 ###

188
	if(ENABLE_ZOLTAN)
189 190
	  find_file(ZOLTAN_HEADER_FILE "zoltan_cpp.h" PATH ENV CPATH)
	  if(ZOLTAN_HEADER_FILE)
191
		get_filename_component(ZOLTAN_HEADER_DIR "${ZOLTAN_HEADER_FILE}" PATH CACHE)
192
		include_directories(${ZOLTAN_HEADER_DIR})
193
	  else()
194 195 196
		message(FATAL_ERROR "Could not find Zoltan include file!")
	  endif(ZOLTAN_HEADER_FILE)

197
	  list(APPEND COMPILEFLAGS "-DHAVE_ZOLTAN")
198 199
	endif(ENABLE_ZOLTAN)

200 201


202
	list(APPEND COMPILEFLAGS "-DHAVE_PARALLEL_DOMAIN_AMDIS=1")
Naumann, Andreas's avatar
Naumann, Andreas committed
203
	SET(PARALLEL_DOMAIN_AMDIS_SRC
204
               	${SOURCE_DIR}/parallel/ParMetisPartitioner.cc
205
		${SOURCE_DIR}/parallel/CheckerPartitioner.cc
Thomas Witkowski's avatar
Thomas Witkowski committed
206
		${SOURCE_DIR}/parallel/ElementObjectData.cc
207
		${SOURCE_DIR}/parallel/MeshDistributor.cc 
208
		${SOURCE_DIR}/parallel/MeshManipulation.cc
Thomas Witkowski's avatar
Thomas Witkowski committed
209
		${SOURCE_DIR}/parallel/MeshPartitioner.cc
210
		${SOURCE_DIR}/parallel/MpiHelper.cc
Thomas Witkowski's avatar
Thomas Witkowski committed
211
		${SOURCE_DIR}/parallel/ParallelDebug.cc
212
		${SOURCE_DIR}/parallel/ParallelProblemStatBase.cc
Thomas Witkowski's avatar
Thomas Witkowski committed
213 214
                ${SOURCE_DIR}/parallel/ParMetisPartitioner.cc
		${SOURCE_DIR}/parallel/StdMpi.cc
215
		${SOURCE_DIR}/parallel/ZoltanPartitioner.cc)
216 217 218 219 220 221
		
	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)
222
		list(APPEND AMDIS_INCLUDE_DIRS ${PETSC_DIR}/include ${PETSC_DIR}/${PETSC_ARCH}/include)
223 224 225 226 227 228 229 230 231 232
		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)
233
		list(APPEND AMDIS_LIBS ${MTL_LIBRARIES})
234
	else()
235
		message(SEND_ERROR "Set the domain-decomposition version correctly.")
236 237
	endif()

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

245

246 247

if(ENABLE_UMFPACK)
248
	find_file(UMFPACK_H umfpack.h
249
			    HINTS ENV CPATH /usr/include /usr/include/suitesparse /usr/include/ufsparse
250 251
			    DOC "headerfile umfpack.h for UMFPACK")
	if(UMFPACK_H)
252 253
		get_filename_component(UMFPACK_PATH ${UMFPACK_H} PATH)
		include_directories(${UMFPACK_PATH} ${UFCONFIG_PATH} ${AMD_PATH})
254
		list(APPEND COMPILEFLAGS "-DHAVE_UMFPACK=1" "-DMTL_HAS_UMFPACK")
255
	else()
256
		message(FATAL_ERROR "Could not find the UMFPACK headers.")
257
	endif()
258
	SET(RPM_DEPEND_STR "blas")
Naumann, Andreas's avatar
Naumann, Andreas committed
259 260
endif(ENABLE_UMFPACK)

261
SET(COMPOSITE_SOURCE_DIR ${SOURCE_DIR}/compositeFEM)
Thomas Witkowski's avatar
Thomas Witkowski committed
262 263 264 265 266 267 268 269
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
270 271
		      ${COMPOSITE_SOURCE_DIR}/SubElementAssembler.cc )

272 273 274 275
set(REINIT_SOURCE_DIR ${SOURCE_DIR}/reinit)
file(GLOB REINIT_SRC ${REINIT_SOURCE_DIR}/*.cc)
include_directories(${REINIT_SOURCE_DIR})

276 277

#muparser includes
278
set(MUPARSER_SOURCE_DIR ${AMDIS_SOURCE_DIR}/lib/muparser_v134)
279
file(GLOB MUPARSER_SRC ${MUPARSER_SOURCE_DIR}/src/*.cpp)
280
list(APPEND AMDIS_INCLUDE_DIRS ${MUPARSER_SOURCE_DIR}/include)
281

Naumann, Andreas's avatar
Naumann, Andreas committed
282
#mtl4 includes
283
list(APPEND AMDIS_INCLUDE_DIRS ${MTL_INCLUDE_DIR})
284
#include_directories(${MTL_INCLUDE_DIR})
285
list(APPEND AMDIS_INCLUDE_DIRS ${SOURCE_DIR})
286
#include_directories(${SOURCE_DIR})
287
include_directories(${AMDIS_INCLUDE_DIRS})
Naumann, Andreas's avatar
Naumann, Andreas committed
288

289
add_library(amdis SHARED ${AMDIS_SRC} ${PARALLEL_DOMAIN_AMDIS_SRC})
Naumann, Andreas's avatar
Naumann, Andreas committed
290
add_library(compositeFEM SHARED ${COMPOSITE_FEM_SRC})
Praetorius, Simon's avatar
Praetorius, Simon committed
291
add_library(reinit SHARED ${REINIT_SRC})
292
add_library(muparser SHARED ${MUPARSER_SRC})
Praetorius, Simon's avatar
Praetorius, Simon committed
293 294
#target_link_libraries(compositeFEM amdis)
#target_link_libraries(reinit amdis)
295
list(APPEND AMDIS_LIBS amdis ${Boost_LIBRARIES})
296

297
if(WIN32)
298
	list(APPEND COMPILEFLAGS "-D_SCL_SECURE_NO_WARNINGS" "-D_CRT_SECURE_NO_WARNINGS")
299
endif(WIN32)
300
message("compileflags: ${COMPILEFLAGS}")
301 302
#SET_TARGET_PROPERTIES(amdis PROPERTIES COMPILE_FLAGS "${COMPILEFLAGS}")
add_definitions(${COMPILEFLAGS})
303

Naumann, Andreas's avatar
Naumann, Andreas committed
304 305 306 307
if(ENABLE_MARMOT)
	Message("please set marmotcc manually")
endif(ENABLE_MARMOT)

308
#dont change this destination. the GUI depends on it to guess the buildsystem
309

310
FILE(GLOB HEADERS "${SOURCE_DIR}/*.h")
311 312
INSTALL(FILES ${HEADERS} 
	DESTINATION include/amdis/)
Naumann, Andreas's avatar
Naumann, Andreas committed
313 314
list(APPEND deb_add_dirs "include/amdis")

315
FILE(GLOB HEADERS "${SOURCE_DIR}/*.hh")
316 317
INSTALL(FILES ${HEADERS} 
	DESTINATION include/amdis/)
Naumann, Andreas's avatar
Naumann, Andreas committed
318

319
FILE(GLOB HEADERS "${SOURCE_DIR}/parallel/*.h")
320 321
INSTALL(FILES ${HEADERS} 
	DESTINATION include/amdis/parallel/)
Naumann, Andreas's avatar
Naumann, Andreas committed
322 323
list(APPEND deb_add_dirs "include/amdis/parallel")

324
FILE(GLOB HEADERS "${SOURCE_DIR}/time/*.h")
325 326
INSTALL(FILES ${HEADERS} 
	DESTINATION include/amdis/time/)
Naumann, Andreas's avatar
Naumann, Andreas committed
327 328
list(APPEND deb_add_dirs "include/amdis/time")

329
FILE(GLOB HEADERS "${SOURCE_DIR}/itl/*.hpp")
330 331
INSTALL(FILES ${HEADERS} 
	DESTINATION include/amdis/itl)
Naumann, Andreas's avatar
Naumann, Andreas committed
332 333
list(APPEND deb_add_dirs "include/amdis/itl")

334
FILE(GLOB HEADERS "${SOURCE_DIR}/io/*.h")
Naumann, Andreas's avatar
Naumann, Andreas committed
335 336
INSTALL(FILES ${HEADERS}
	DESTINATION include/amdis/io)
Naumann, Andreas's avatar
Naumann, Andreas committed
337 338
list(APPEND deb_add_dirs "include/amdis/io")

339
FILE(GLOB HEADERS "${SOURCE_DIR}/io/*.hh")
Naumann, Andreas's avatar
Naumann, Andreas committed
340 341
INSTALL(FILES ${HEADERS}
	DESTINATION include/amdis/io)
342

Praetorius, Simon's avatar
Praetorius, Simon committed
343 344 345 346 347 348 349 350 351 352
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")

353 354 355 356 357
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
358
list(APPEND deb_add_dirs "lib/amdis")
359
install(TARGETS amdis compositeFEM reinit muparser
Praetorius, Simon's avatar
Praetorius, Simon committed
360 361
	LIBRARY DESTINATION lib/amdis/ )

362 363
configure_file(${AMDIS_SOURCE_DIR}/AMDISConfig.cmake.in
		${AMDIS_BINARY_DIR}/AMDISConfig.cmake
364 365
		@ONLY
	      )
366

367
INSTALL(FILES ${AMDIS_BINARY_DIR}/AMDISConfig.cmake 
368
	DESTINATION share/amdis/)
Naumann, Andreas's avatar
Naumann, Andreas committed
369 370
list(APPEND deb_add_dirs "share/amdis/")

371
INSTALL(FILES ${AMDIS_SOURCE_DIR}/AMDISUse.cmake 
372
	DESTINATION share/amdis/)
Naumann, Andreas's avatar
Naumann, Andreas committed
373

374
#install mtl
375
INSTALL(DIRECTORY ${AMDIS_SOURCE_DIR}/lib/mtl4/
376 377 378 379 380 381
	DESTINATION include/amdis/mtl4/
	FILES_MATCHING PATTERN "*.hpp"
	PATTERN ".svn" EXCLUDE
	PATTERN ".svn/*" EXCLUDE
	PATTERN "mtl4/libs" EXCLUDE
	PATTERN "mtl4/extern" EXCLUDE
382
       )
Naumann, Andreas's avatar
Naumann, Andreas committed
383
FILE(GLOB_RECURSE mtl4_files 
384 385
		RELATIVE ${AMDIS_SOURCE_DIR}/lib/mtl4/boost/ 
		${AMDIS_SOURCE_DIR}/lib/mtl4/boost/*.hpp)
Naumann, Andreas's avatar
Naumann, Andreas committed
386 387
foreach(mtl4_file in ${mtl4_files})
 get_filename_component(mtl4File_path ${mtl4_file} PATH)
388
 list(APPEND deb_add_dirs "include/amdis/mtl4/boost/${mtl4File_path}")
Naumann, Andreas's avatar
Naumann, Andreas committed
389 390
endforeach(mtl4_file)
list(REMOVE_DUPLICATES deb_add_dirs)
391 392

#PACKAGES
393
set(CPACK_PACKAGE_NAME "AMDIS")
394
set(CPACK_PACKAGE_CONTACT "Andreas.Naumann@tu-dresden.de")
395
set(CPACK_PACKAGE_VERSION "${CurrentRevision}")
396 397 398
set(CPACK_GENERATOR "RPM" "DEB" "TGZ")
set(CPACK_INSTALL_PREFIX "/usr/")

399 400
configure_file(${AMDIS_SOURCE_DIR}/preinst.in 
  ${AMDIS_BINARY_DIR}/preinst 
Naumann, Andreas's avatar
Naumann, Andreas committed
401 402
  @ONLY)

403 404
configure_file(${AMDIS_SOURCE_DIR}/postrm.in 
  ${AMDIS_BINARY_DIR}/postrm 
Naumann, Andreas's avatar
Naumann, Andreas committed
405
  @ONLY)
406
set(CPACK_RPM_PACKAGE_REQUIRES "boost-devel >= 1.42, ${RPM_DEPEND_STR}")
407
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libboost-dev (>= 1.42), libboost-iostreams-dev (>= 1.42), libboost-system-dev (>= 1.42), libboost-filesystem-dev (>= 1.42)")
408
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${AMDIS_BINARY_DIR}/preinst" "${AMDIS_BINARY_DIR}/postrm")
Naumann, Andreas's avatar
Naumann, Andreas committed
409

410
include(CPack)