forked from ecmwf/multio
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
105 lines (70 loc) · 3.15 KB
/
CMakeLists.txt
File metadata and controls
105 lines (70 loc) · 3.15 KB
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# (C) Copyright 2011- ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
# In applying this licence, ECMWF does not waive the privileges and immunities
# granted to it by virtue of its status as an intergovernmental organisation nor
# does it submit to any jurisdiction.
########################################################################################################################
cmake_minimum_required( VERSION 3.12 FATAL_ERROR )
find_package( ecbuild 3.6 REQUIRED HINTS ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/../ecbuild)
project( multio LANGUAGES CXX )
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
### dependencies
ecbuild_find_package( NAME eccodes VERSION 2.18 REQUIRED )
ecbuild_find_package( NAME eckit VERSION 1.16 REQUIRED )
ecbuild_find_package( NAME metkit VERSION 1.7 REQUIRED )
if( NOT metkit_HAVE_GRIB )
ecbuild_critical( "metkit must be built with GRIB support" )
endif()
if( NOT eckit_HAVE_MPI )
ecbuild_critical( "eckit must be built with MPI support" )
endif()
### fdb5 plugin
ecbuild_add_option( FEATURE FDB5
DEFAULT ON
DESCRIPTION "Send data to FDB5"
REQUIRED_PACKAGES "NAME fdb5 VERSION 5.10.1" )
### interpolate action
ecbuild_add_option( FEATURE MIR
DEFAULT ON
DESCRIPTION "Interpolate data using MIR"
REQUIRED_PACKAGES "NAME mir VERSION 1.13.0" )
ecbuild_add_option( FEATURE FORTRAN
DEFAULT ON
DESCRIPTION "Build Fortran API and examples" )
### legacy IFS I/O
ecbuild_add_option( FEATURE LEGACY_IFSIO
DEFAULT OFF
DESCRIPTION "Legacy (FDB4) IFS I/O interface" )
if( HAVE_FORTRAN )
ecbuild_enable_fortran( REQUIRED MODULE_DIRECTORY ${PROJECT_BINARY_DIR}/module)
ecbuild_find_package( NAME fckit VERSION 0.10.0 REQUIRED )
find_package( MPI COMPONENTS Fortran) # Add explict mpi for errocodes -- isn't there a better way?
endif()
### Maestro plugin
ecbuild_add_option( FEATURE MAESTRO
DEFAULT OFF
DESCRIPTION "Pass data to Maestro middleware"
REQUIRED_PACKAGES "NAME Maestro" "NAME pgen" )
### sandbox
ecbuild_add_option( FEATURE SANDBOX
DEFAULT OFF
DESCRIPTION "Sanbox for exploring io server design" )
### export package info
set( MULTIO_CONFIG_DIR share/multio/config )
set( MULTIO_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_CURRENT_BINARY_DIR}/src )
set( MULTIO_LIBRARIES multio )
get_directory_property( MULTIO_DEFINITIONS COMPILE_DEFINITIONS )
### sources
include(cmake/compiler_warnings.cmake) # optionally handle compiler specific warnings
include_directories( ${MULTIO_INCLUDE_DIRS} )
add_subdirectory( src )
add_subdirectory( tests )
### finalize project
ecbuild_pkgconfig(NAME multio
DESCRIPTION "ECMWF Multiplexing IO library"
LIBRARIES multio )
ecbuild_install_project( NAME ${PROJECT_NAME} )
ecbuild_print_summary()