CMakeLists.txt 3.14 KB
Newer Older
1
set(CMAKE_LEGACY_CYGWIN_WIN32 0)
2
3
4
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
project(AMDiS)

5
6
7
8
9
10
set(AMDiS_VERSION "1.1.0")

set(BASE_DIR ${AMDiS_SOURCE_DIR})
set(SOURCE_DIR ${BASE_DIR}/src)

if (NOT CMAKE_BUILD_TYPE)
11
12
  set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING
      "Choose the type of build, options are: None Debug Release [RelWithDebInfo] MinSizeRel."
13
14
15
16
17
18
      FORCE)
endif ()

# ------------------------------------------------------------------------------

# some options to control the build process
19
option(ENABLE_MPI             "Compile with MPI compiler and library" false)
20
21
22
23
option(ENABLE_UMFPACK         "Enable support for the UMFPACK solver" true)
option(ENABLE_EXTENSIONS      "Use extensions for AMDiS"              false)
option(ENABLE_HYPRE           "Use HYPRE AMG solver"                  false)
option(ENABLE_PNG             "Use png reader/writer"                 false)
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44

include(CMakeDependentOption)
cmake_dependent_option(ENABLE_PARALLEL_DOMAIN
  "Use parallel domain decomposition" true
  "ENABLE_MPI" false)

# additional options for parallel_domain
# {
cmake_dependent_option(ENABLE_ZOLTAN
  "Add support for the Parallel Partitioning suite Zoltan" false
  "ENABLE_PARALLEL_DOMAIN" false)

cmake_dependent_option(ENABLE_PARALLEL_SOLVERS
  "Add some problem dependent solver, e.g. Feti, Navier-Stokes and Cahn-Hilliard" true
  "ENABLE_PARALLEL_DOMAIN" false)

cmake_dependent_option(ENABLE_BDDCML
  "Add support for the BDDCML library" false
  "ENABLE_PARALLEL_DOMAIN" false)
# }

45
46
47
48
49
50
51
52
53
54
55

# enable/disable some more features
option(ENABLE_COMPRESSION "Use output compression for vtu and arh files" true)
mark_as_advanced(ENABLE_COMPRESSION)

option(ENABLE_REINIT "Compile reinit library" true)
mark_as_advanced(ENABLE_REINIT)

option(ENABLE_COMPOSITE_FEM "Compile compositeFEM library" true)
mark_as_advanced(ENABLE_COMPOSITE_FEM)

56
57
58
59
60
61
option(ENABLE_OPENMP "Compile with OpenMP flags. (Experimental)" false)
mark_as_advanced(ENABLE_OPENMP)

option(ENABLE_SEQ_PETSC "Use sequential PETSc solvers" false)
mark_as_advanced(ENABLE_SEQ_PETSC)

62
63
64
65
66
67
68
option(BUILD_SHARED_LIBS "Build all libraries as shared or static, default: shared" true)
mark_as_advanced(BUILD_SHARED_LIBS)

if (MSVC)
  set(BUILD_SHARED_LIBS false)
  mark_as_advanced(BUILD_SHARED_LIBS)
  message(WARNING "Currently we can only build static libraries with Visual Studio")
69
70

  add_definitions(-DNOMINMAX -D_CONSOLE -DSTRICT -D_SCL_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS)
71
72
73
74
endif (MSVC)

# parallel of sequential version
if (ENABLE_PARALLEL_DOMAIN)
75
  set(POSTFIX "-p")
76
else ()
77
  set(POSTFIX "-s")
78
79
80
81
82
endif ()

# ------------------------------------------------------------------------------

if (${CMAKE_VERSION} VERSION_LESS "3.2")
83
84
  # Fallback to classical CMakeLists file
  include(${AMDiS_SOURCE_DIR}/cmake/CMakeLists.txt)
85
86
else ()
  include(${AMDiS_SOURCE_DIR}/cmake3/CMakeLists.txt)
87
endif ()
88
89
90
91
92
93
94
95
96
97

# ------------------------------------------------------------------------------

include(CMakePackageConfigHelpers)
write_basic_package_version_file(
  ${AMDiS_BINARY_DIR}/AMDISConfigVersion.cmake
  VERSION ${AMDiS_VERSION}
  COMPATIBILITY SameMajorVersion
)
install(FILES ${AMDiS_BINARY_DIR}/AMDISConfigVersion.cmake DESTINATION share/amdis/)