CMakeLists.txt 1.35 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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)
15
#option(USE_OPENMP "check if amdis is compiled with openmp" false)
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37

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)

38
39
40
41
42
43
44
45
46
47
48
set(DONTBUILD "couple" "parallelellipt" "parallelheat")

file(GLOB sources src/*.cc)
foreach(s ${sources})
  get_filename_component(swe ${s} NAME_WE)
  list(FIND DONTBUILD ${swe} DBUILD)
  if( ${DBUILD} EQUAL -1 )
	add_executable(${swe} ${s})
	target_link_libraries(${swe} ${BASIS_LIBS})
  endif()
endforeach(s)