AMDISConfig.cmake.in 1.96 KB
Newer Older
1
# This configuration file is shipped with the FEM-Toolbox AMDiS.
2
# It simplifies the configure of different amdis-versions.
3
#
4
5
6
7
# We set the following variables:
#   AMDIS_INCLUDE_DIRS    all include directories (mtl, umfpack, parmetis, metis, ...)
#   AMDIS_LIBRARIES       the needed libraries
#   AMDiS_COMPILEFLAGS    some compile flags for amdis
8
#
9
# Use this package in the following way:
10
#
11
#   find_package(AMDiS REQUIRED [PARALLEL|SEQUENTIAL])
12
#   add_executable(yourTarget <yourSources>)
13
14
15
16
17
#   include_directories(${AMDIS_INCLUDE_DIRS})
#   compile_definitions(${AMDIS_COMPILEFLAGS})
#   target_link_libraries(yourTarget ${AMDIS_LIBRARIES})
#
# The default component for this package is SEQUENTIAL.
18
19
#

20
if (${CMAKE_VERSION} VERSION_LESS "2.8.10")
21
    message(FATAL_ERROR "The Configuration file was created for CMake version >= 2.8.10")
22
endif ()
23

24
list(APPEND CMAKE_MODULE_PATH ${AMDIS_DIR})
25

26
set(IS_AMDISCONFIG true)
27

28
set(AMDIS_USE_FILE ${AMDIS_DIR}/AMDISUse.cmake)
29

30
31
32
33
34
35
36
37
38
39
40
# Include macros
include(enable_cxx11)
include(enable_mtl4)
include(enable_boost)
include(enable_umfpack)
include(enable_petsc)
include(enable_zoltan)
include(enable_bddcml)
include(enable_hypre)
include(enable_png)

41
42
# enable components
# -----------------
43
44
45
46
47
48

if (AMDIS_FIND_REQUIRED_PARALLEL AND AMDIS_FIND_REQUIRED_SEQUENTIAL)
  message(WARNING "Choose either SEQUENTIAL or PARALLEL as component, not both! Falling back to the default SEQUENTIAL.")
  set(AMDIS_FIND_REQUIRED_PARALLEL OFF)
endif ()

49
50
51
set(AMDIS_CONFIGURATION "")

# parallel of sequential version
52
53
if (AMDIS_FIND_REQUIRED_PARALLEL)
  set(AMDIS_HAS_PARALLEL_DOMAIN ON)
54
55
  set(POSTFIX "-p")
  list(APPEND AMDIS_CONFIGURATION "PARALLEL")
56
57
else ()
  set(AMDIS_HAS_PARALLEL_DOMAIN OFF)
58
59
  set(POSTFIX "-s")
  list(APPEND AMDIS_CONFIGURATION "SEQUENTIAL")
60
endif ()
61

62
63
if (NOT EXISTS ${AMDIS_DIR}/AMDIS${POSTFIX}.cmake)
  message(FATAL_ERROR "Configuration ${AMDIS_CONFIGURATION} can not be found in ${AMDIS_DIR}.")
64
endif ()
65

66
67
# include component configuration
include(AMDIS${POSTFIX})