CMakeLists.txt 2.26 KB
Newer Older
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
project("amdis_demo")
cmake_minimum_required(VERSION 2.8)

#SET(AMDiS_DIR ../AMDiS)
#find_package(AMDiS REQUIRED COMPONENTS umfpack )
find_package(AMDiS REQUIRED)

if(AMDiS_FOUND)
	message("amdis was found\n")
	include(${AMDiS_USE_FILE})
	SET(BASIS_LIBS ${AMDiS_LIBRARIES})
endif(AMDiS_FOUND)

option(USE_PARALLEL "check if the parallel demo are also used" false)
option(USE_OPENMP "check if amdis is compiled with openmp" false)

if(USE_PARALLEL)
  #Message("look for mpi package")
  find_package(MPI REQUIRED)
#  if(NOT MPI_FOUND)
#    Message(ERROR_FATAL "Mpi not found")
#  endif(NOT MPI_FOUND)

  INCLUDE(CMakeForceCompiler)
  CMAKE_FORCE_CXX_COMPILER(mpicxx "MPI C++ Compiler")
  CMAKE_FORCE_C_COMPILER(mpicc "MPI C Compiler")

  SET(PARALLEL_ELLIPT_SRC src/parallelellipt.cc)
  SET(PARALLEL_HEAT_SRC src/parallelheat.cc)

  add_executable(parallelellipt ${PARALLEL_ELLIPT_SRC})
  add_executable(parallelheat ${PARALLEL_HEAT_SRC})

  target_link_libraries(parallelellipt ${BASIS_LIBS})
  target_link_libraries(parallelheat ${BASIS_LIBS})
endif(USE_PARALLEL)

SET(ELLIPT_SRC src/ellipt.cc)
SET(HEAT_SRC src/heat.cc)
SET(VECELLIPT_SRC src/vecellipt.cc)
SET(VECHEAT_SRC src/vecheat.cc)
SET(SPHERE_SRC src/sphere.cc)
SET(BALL_SRC src/ball.cc)
SET(PARAMETRIC_SRC src/parametric.cc)
SET(TORUS_SRC src/torus.cc)
SET(BUNNY_SRC src/bunny.cc)
SET(PERIODIC_SRC src/periodic.cc)
#SET(COUPLE_SRC src/couple.cc)

add_executable(ellipt ${ELLIPT_SRC})
add_executable(heat ${HEAT_SRC})
add_executable(vecellipt ${VECELLIPT_SRC})
add_executable(vecheat ${VECHEAT_SRC})
add_executable(sphere ${SPHERE_SRC})
add_executable(ball ${BALL_SRC})
add_executable(parametric ${PARAMETRIC_SRC})
add_executable(torus ${TORUS_SRC})
add_executable(bunny ${BUNNY_SRC})
add_executable(periodic ${PERIODIC_SRC})
#add_executable(couple ${COUPLE_SRC})

target_link_libraries(ellipt ${BASIS_LIBS})
target_link_libraries(heat ${BASIS_LIBS})
target_link_libraries(vecellipt ${BASIS_LIBS})
target_link_libraries(vecheat ${BASIS_LIBS})
target_link_libraries(sphere ${BASIS_LIBS})
target_link_libraries(ball ${BASIS_LIBS})
target_link_libraries(parametric ${BASIS_LIBS})
target_link_libraries(torus ${BASIS_LIBS})
target_link_libraries(bunny ${BASIS_LIBS})
target_link_libraries(periodic ${BASIS_LIBS})
#target_link_libraries(couple ${BASIS_LIBS})