CMakeLists.txt 3.78 KB
Newer Older
1
2
3
project("amdis_demo")
cmake_minimum_required(VERSION 2.8)

Thomas Witkowski's avatar
Thomas Witkowski committed
4
5
#find_package(AMDIS REQUIRED COMPONENTS umfpack )
find_package(AMDIS REQUIRED)
6

Thomas Witkowski's avatar
Thomas Witkowski committed
7
if(AMDIS_FOUND)
8
	message("amdis was found\n")
Thomas Witkowski's avatar
Thomas Witkowski committed
9
10
11
	include(${AMDIS_USE_FILE})
	SET(BASIS_LIBS ${AMDIS_LIBRARIES})
endif(AMDIS_FOUND)
12

13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
set(ball src/ball.cc)
set(bunny src/bunny.cc)
set(ellipt src/ellipt.cc)
set(heat src/heat.cc)
set(neumann src/neumann.cc)
set(nonlin src/nonlin.cc)
set(parametric src/parametric.cc)
set(periodic src/periodic.cc)
set(sphere src/sphere.cc)
set(torus src/torus.cc)
set(vecellipt src/vecellipt.cc)
set(vecheat src/vecheat.cc)

add_executable("ball" ${ball})
target_link_libraries("ball" ${BASIS_LIBS})
28
install(TARGETS ball RUNTIME DESTINATION bin)
Praetorius, Simon's avatar
Praetorius, Simon committed
29

30
31
add_executable("bunny" ${bunny})
target_link_libraries("bunny" ${BASIS_LIBS})
32
install(TARGETS bunny RUNTIME DESTINATION bin)
Praetorius, Simon's avatar
Praetorius, Simon committed
33

34
35
add_executable("ellipt" ${ellipt})
target_link_libraries("ellipt" ${BASIS_LIBS})
36
install(TARGETS ellipt RUNTIME DESTINATION bin)
37
38
39

add_executable("heat" ${heat})
target_link_libraries("heat" ${BASIS_LIBS})
40
install(TARGETS heat RUNTIME DESTINATION bin)
41
42
43

add_executable("neumann" ${neumann})
target_link_libraries("neumann" ${BASIS_LIBS})
44
install(TARGETS neumann RUNTIME DESTINATION bin)
45
46
47

add_executable("nonlin" ${nonlin})
target_link_libraries("nonlin" ${BASIS_LIBS})
48
install(TARGETS nonlin ball RUNTIME DESTINATION bin)
49
50
51

add_executable("parametric" ${parametric})
target_link_libraries("parametric" ${BASIS_LIBS})
52
install(TARGETS parametric RUNTIME DESTINATION bin)
53
54
55

add_executable("periodic" ${periodic})
target_link_libraries("periodic" ${BASIS_LIBS})
56
install(TARGETS periodic RUNTIME DESTINATION bin)
57
58
59

add_executable("sphere" ${sphere})
target_link_libraries("sphere" ${BASIS_LIBS})
60
install(TARGETS sphere RUNTIME DESTINATION bin)
61
62
63

add_executable("torus" ${torus})
target_link_libraries("torus" ${BASIS_LIBS})
64
install(TARGETS torus RUNTIME DESTINATION bin)
65
66
67

add_executable("vecellipt" ${vecellipt})
target_link_libraries("vecellipt" ${BASIS_LIBS})
68
install(TARGETS vecellipt RUNTIME DESTINATION bin)
69
70
71

add_executable("vecheat" ${vecheat})
target_link_libraries("vecheat" ${BASIS_LIBS})
72
install(TARGETS vecheat RUNTIME DESTINATION bin)
73

Praetorius, Simon's avatar
Praetorius, Simon committed
74
# find tools-directory
75
find_path(TOOLS_DIR NAMES "baseProblem/BaseProblem.h" "diffuseDomain/Helpers.h" DOC "Path to tools directory in AMDiS-trunk dir" )
Praetorius, Simon's avatar
Praetorius, Simon committed
76
77
78
79
80
81
82
83
if (TOOLS_DIR)
  if (NOT EXISTS ${TOOLS_DIR}/diffuseDomain/Helpers.h OR NOT EXISTS ${TOOLS_DIR}/baseProblems/BaseProblem.h)
    message(WARNING "Wrong tools directory! Directory must contain the subdirectories 'diffuseDomain' and 'baseProblems'")
  else()

    include_directories(${TOOLS_DIR}/diffuseDomain)
    include_directories(${TOOLS_DIR}/baseProblems)

Praetorius, Simon's avatar
Praetorius, Simon committed
84
85
86
87
88
89
90
    set(elliptBase src/elliptBaseProblem.cc)
    add_executable("elliptBase" ${elliptBase})
    target_link_libraries("elliptBase" ${BASIS_LIBS})

    set(elliptImplicit src/elliptImplicit.cc)
    add_executable("elliptImplicit" ${elliptImplicit})
    target_link_libraries("elliptImplicit" ${BASIS_LIBS})
Praetorius, Simon's avatar
Praetorius, Simon committed
91
92
93
94
95

    set(cahn_hilliard src/cahn_hilliard.cc ${TOOLS_DIR}/baseProblems/CahnHilliard.cc)
    add_executable("cahn_hilliard" ${cahn_hilliard})
    target_link_libraries("cahn_hilliard" ${BASIS_LIBS})

Praetorius, Simon's avatar
Praetorius, Simon committed
96
97
98
99
    set(pfc src/pfc.cc ${TOOLS_DIR}/baseProblems/PhaseFieldCrystal_Base.cc  ${TOOLS_DIR}/diffuseDomain/Helpers.cc)
    add_executable("pfc" ${pfc})
    target_link_libraries("pfc" ${BASIS_LIBS})

Praetorius, Simon's avatar
Praetorius, Simon committed
100
101
102
103
104
105
106
107
108
109
110
111
    set(drivenCavity ${TOOLS_DIR}/diffuseDomain/POperators.cc
		    ${TOOLS_DIR}/baseProblems/CahnHilliard.cc
		    ${TOOLS_DIR}/baseProblems/NavierStokes_TaylorHood.cc
		    src/chns/drivenCavity.cc)
    add_executable("drivenCavity" ${drivenCavity})
    target_link_libraries("drivenCavity" ${BASIS_LIBS})

  endif()
else()
    message(WARNING "No tools directory specified! Some demos will not be build.")
endif(TOOLS_DIR)

112
#create the output dir
113
# file(MAKE_DIRECTORY output)