CMakeLists.txt 3.23 KB
Newer Older
1
unset(ENV{LIBRARY_PATH})
2
set(CMAKE_LEGACY_CYGWIN_WIN32 0)
3

4
5
6
7
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
project(AMDiS
  VERSION 1.2.1
  LANGUAGES CXX)
8

9
10
11
12
13
if(${CMAKE_VERSION} VERSION_LESS 3.12)
  cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION})
endif()

set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
14
15

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

21
22
23
24
25
26
27
28
29
30
31
32
# This will allow us to print a feature summary.
include(FeatureSummary)

# Required to enable testing for link-time optimization.
#include(CheckIPOSupported)

# Define GNU standard installation directories CMAKE_INSTALL_xxx
include(GNUInstallDirs)

# Allow options depending on each other
include(CMakeDependentOption)

33
34
35
# ------------------------------------------------------------------------------

# some options to control the build process
36
option(ENABLE_PARALLEL_DOMAIN "Use parallel domain decomposition"     false)
37
option(ENABLE_MPI             "Compile with MPI compiler and library" false)
38
39
40
41
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)
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57

# 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)
# }

58
59
60
61
62
63
64
65
66
67
68

# 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)

69
70
71
72
73
74
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)

75
76
77
78
79
80
81
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")
82
83

  add_definitions(-DNOMINMAX -D_CONSOLE -DSTRICT -D_SCL_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS)
84
85
86
87
endif (MSVC)

# parallel of sequential version
if (ENABLE_PARALLEL_DOMAIN)
88
  set(ENABLE_MPI CACHE BOOL "Compile with MPI compiler and library" FORCE)
89
  set(POSTFIX "-p")
90
else ()
91
  set(POSTFIX "-s")
92
93
94
95
endif ()

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

96
97
98
add_subdirectory(cmake)
add_subdirectory(lib)
add_subdirectory(src)
99

100
101
102
if(TARGET AMDiS::AMDiS)
  feature_summary(WHAT ALL)
endif(TARGET AMDiS::AMDiS)