-
Notifications
You must be signed in to change notification settings - Fork 11
/
CMakeLists.txt
150 lines (105 loc) · 4.82 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
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
# (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.8 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.31.2 REQUIRED )
ecbuild_find_package( NAME eckit VERSION 1.24 REQUIRED )
ecbuild_find_package( NAME metkit VERSION 1.10 REQUIRED )
ecbuild_find_package( NAME atlas VERSION 0.35 REQUIRED )
if( NOT metkit_HAVE_GRIB )
ecbuild_critical( "metkit must be built with GRIB support" )
endif()
### fdb5 plugin
ecbuild_add_option( FEATURE FDB5
DEFAULT ON
DESCRIPTION "Send data to FDB5"
REQUIRED_PACKAGES "NAME fdb5 VERSION 5.11.20" )
### atlas-io plugin
ecbuild_add_option( FEATURE ATLAS_IO
DEFAULT ON
DESCRIPTION "Use atlasIO for the restart"
REQUIRED_PACKAGES "NAME atlas_io VERSION 0.33" )
### interpolate action
ecbuild_add_option( FEATURE MIR
DEFAULT ON
DESCRIPTION "Interpolate data using MIR"
REQUIRED_PACKAGES "NAME mir VERSION 1.17.0" )
ecbuild_add_option( FEATURE PGEN
DEFAULT OFF
DESCRIPTION "Use pgen for Maestro product-generation workflow"
REQUIRED_PACKAGES "NAME pgen 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" )
### Enable creation of Dummy api
ecbuild_add_option( FEATURE MULTIO_DUMMY_API
DEFAULT OFF
DESCRIPTION "Enable creation of multio Dummy API" )
if( HAVE_FORTRAN )
ecbuild_enable_fortran( REQUIRED MODULE_DIRECTORY ${PROJECT_BINARY_DIR}/module)
ecbuild_find_package( NAME fckit VERSION 0.10.0 REQUIRED )
if (eckit_HAVE_MPI)
find_package( MPI COMPONENTS Fortran) # Add explicit mpi for errorcodes -- isn't there a better way?
endif (eckit_HAVE_MPI)
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/fortran_compile_flags.cmake)
endif()
### Maestro plugin
ecbuild_add_option( FEATURE MAESTRO
DEFAULT OFF
DESCRIPTION "Pass data to Maestro middleware"
REQUIRED_PACKAGES "NAME Maestro" )
### sandbox
ecbuild_add_option( FEATURE SANDBOX
DEFAULT OFF
DESCRIPTION "Sanbox for exploring io server design" )
### HEALPix tests
ecbuild_add_option( FEATURE HEALPIX_EXAMPLES
DEFAULT OFF
DESCRIPTION "Enable creation of HEALPix examples" )
### Definitions used by the output manager
ecbuild_add_option( FEATURE OUTPUT_MANAGER
DEFAULT ON
DESCRIPTION "Build the output manager" )
ecbuild_add_option( FEATURE OUTPUT_MANAGER_ENCODER_REPORT
CONDITION HAVE_OUTPUT_MANAGER
DEFAULT OFF
DESCRIPTION "Enable generation of the encoding report" )
ecbuild_add_option( FEATURE OUTPUT_MANAGER_TOOL
CONDITION HAVE_OUTPUT_MANAGER
DEFAULT ON
DESCRIPTION "Enable generation of standalone tool" )
### 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} )
if( HAVE_FORTRAN AND ECBUILD_INSTALL_FORTRAN_MODULES )
install( DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/${CMAKE_CFG_INTDIR}
DESTINATION module/${PROJECT_NAME}
COMPONENT modules )
endif()
ecbuild_print_summary()