forked from geodynamics/Rayleigh
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
70 lines (55 loc) · 2.32 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#
# Copyright (C) 2024 by the authors of the RAYLEIGH code.
#
# This file is part of RAYLEIGH.
#
# RAYLEIGH is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# RAYLEIGH is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with RAYLEIGH; see the file LICENSE. If not see
# <http://www.gnu.org/licenses/>.
cmake_minimum_required(VERSION 3.13)
project(rayleigh LANGUAGES C Fortran)
# load in version info and export it
file(STRINGS "${CMAKE_SOURCE_DIR}/VERSION" RAYLEIGH_PACKAGE_VERSION LIMIT_COUNT 1)
message(STATUS "")
message(STATUS "====================================================")
message(STATUS "===== Configuring Rayleigh ${RAYLEIGH_PACKAGE_VERSION}")
message(STATUS "====================================================")
message(STATUS "")
# Set up CMAKE_BUILD_TYPE to Debug if it is not set by the user.
if ("${CMAKE_BUILD_TYPE}" STREQUAL "")
set(CMAKE_BUILD_TYPE
"Release"
CACHE STRING
"Choose the type of build, options are: Debug, Release, RelWithDebInfo, MinSizeRel."
FORCE)
# Set the possible values of build type for cmake-gui
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
"Debug" "Release" "RelWithDebInfo" "MinSizeRel")
endif()
message(STATUS "Configuring in \"" ${CMAKE_BUILD_TYPE} "\" mode.")
message(STATUS "")
# Set the default install directory, if run for the first time
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set_property(CACHE CMAKE_INSTALL_PREFIX PROPERTY VALUE "${CMAKE_SOURCE_DIR}")
endif()
message(STATUS "Installing executable in ${CMAKE_INSTALL_PREFIX}/bin")
message(STATUS "")
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
message(STATUS "===== Configuring external libraries ===============")
message(STATUS "")
find_package(MPI COMPONENTS C REQUIRED Fortran REQUIRED)
find_package(LAPACK COMPONENTS Fortran REQUIRED)
find_package(FFTW REQUIRED)
add_subdirectory(src)
add_subdirectory(doc)