AMDISConfig.cmake.in 2.33 KB
Newer Older
1
# This configuration file is shipped with the FEM-Toolbox AMDiS.
2
3
# It simplifies the configure of different amdis-versions.
#
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
12
13
14
15
16
17
18
19
#   find_package(AMDiS REQUIRED [PARALLEL|SEQUENTIAL])
#   add_executable(yourTarget <yourSources>)
#   include_directories(${AMDIS_INCLUDE_DIRS})
#   compile_definitions(${AMDIS_COMPILEFLAGS})
#   target_link_libraries(yourTarget ${AMDIS_LIBRARIES})
#
# Or directly link against target AMDiS:
#
#   find_package(AMDiS REQUIRED [ [PARALLEL|SEQUENTIAL] ])
20
21
22
#   add_executable(yourTarget <yourSources>)
#   target_link_libraries(yourTarget AMDiS)
#
23
24
# The default component for this package is SEQUENTIAL DEBUG.
#
25

Praetorius, Simon's avatar
Praetorius, Simon committed
26
if (${CMAKE_VERSION} VERSION_LESS "3.2")
27
  message(FATAL_ERROR "The Configuration file was created for CMake version >= 3.2")
28
29
30
31
endif ()

list(APPEND CMAKE_MODULE_PATH ${AMDIS_DIR})

32
33
set(IS_AMDISCONFIG true)

Praetorius, Simon's avatar
Praetorius, Simon committed
34
set(AMDIS_USE_FILE ${AMDIS_DIR}/AMDISUse.cmake)
35

36
37
38
# Include macros
include(target_enable_cxx11)
include(target_enable_mtl4)
39
include(target_enable_boost)
40
41
42
43
44
45
46
47
48
49
50
51
52
53
include(target_enable_umfpack)
include(target_enable_petsc)
include(target_enable_zoltan)
include(target_enable_bddcml)
include(target_enable_hypre)
include(target_enable_png)

# enable components
# -----------------

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 ()
54

55
set(AMDIS_CONFIGURATION "")
56

57
58
59
60
61
# parallel of sequential version
if (AMDIS_FIND_REQUIRED_PARALLEL)
  set(AMDIS_HAS_PARALLEL_DOMAIN ON)
  set(POSTFIX "-p")
  list(APPEND AMDIS_CONFIGURATION "PARALLEL")
62
else ()
63
64
65
  set(AMDIS_HAS_PARALLEL_DOMAIN OFF)
  set(POSTFIX "-s")
  list(APPEND AMDIS_CONFIGURATION "SEQUENTIAL")
66
67
endif ()

68
69
70
71
if (MSVC)
  add_definitions(-DNOMINMAX -D_CONSOLE -DSTRICT -D_SCL_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS)
endif (MSVC)

72
73
if (NOT EXISTS ${AMDIS_DIR}/AMDIS${POSTFIX}.cmake)
  message(FATAL_ERROR "Configuration ${AMDIS_CONFIGURATION} can not be found in ${AMDIS_DIR}.")
74
endif ()
Praetorius, Simon's avatar
Praetorius, Simon committed
75

76
77
# include component configuration
include(AMDIS${POSTFIX})