-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
58 lines (44 loc) · 1.84 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
# ------------------------------------------------------------------------------
# (c) Crown copyright 2022 Met Office. All rights reserved.
# The file LICENCE, distributed with this code, contains details of the terms
# under which the code may be used.
# ------------------------------------------------------------------------------
# Set the minimum version of CMake required by the build system.
cmake_minimum_required(VERSION 3.13 FATAL_ERROR)
# Include file containing in-source build prevention.
include(cmake/PreventInSourceBuilds.cmake)
# Set project name and the languages required to build the project and a
# project description. Also set the version of the library being built.
project(vernier LANGUAGES CXX C Fortran
DESCRIPTION "Met Office Vernier profiler"
VERSION 0.1.0)
# OpenMP required
find_package(OpenMP 2.5 REQUIRED)
# MPI required?
option(ENABLE_MPI "Enable MPI" ON)
if (ENABLE_MPI)
find_package(MPI REQUIRED)
include_directories(SYSTEM ${MPI_INCLUDE_PATH})
add_compile_definitions(USE_MPI)
else()
message(STATUS "ENABLE_MPI disabled.")
endif()
# Defines some standard install directories such as $(prefix)/include.
include(GNUInstallDirs)
# Instructions only relevant if current project is Vernier
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
# Include general project setting files.
include(cmake/StandardProjectSettings.cmake)
include(cmake/CompilerWarnings.cmake)
# Include the testing setup.
include(cmake/TestingSetup.cmake)
# Include documentation related files.
include(cmake/Doxygen.cmake)
include(cmake/Sphinx.cmake)
# Include option to build with/without OpenMP
include(cmake/BuildOptions.cmake)
endif()
# Add src directory to build.
add_subdirectory(src)
# Include the installation options.
include(cmake/Installation.cmake)