-
Notifications
You must be signed in to change notification settings - Fork 4
/
CMakeLists.txt
60 lines (41 loc) · 2.13 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
# (C) Copyright 1996- 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.14 FATAL_ERROR)
find_package(ecbuild 3.4 REQUIRED HINTS ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/../ecbuild)
project(mir LANGUAGES CXX)
set(PERSISTENT_NAMESPACE "eckit" CACHE INTERNAL "") # needed for generating .b files for persistent support
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
ecbuild_add_option(FEATURE BUILD_TOOLS DEFAULT OFF DESCRIPTION "build the command line tools (install)")
ecbuild_add_option(FEATURE MIR_DOWNLOAD_MASKS DEFAULT ON DESCRIPTION "download LSM files")
ecbuild_add_option(FEATURE NETCDF DEFAULT ON DESCRIPTION "support for netCDF" REQUIRED_PACKAGES "NetCDF COMPONENTS C CXX")
ecbuild_add_option(FEATURE PNG DEFAULT OFF DESCRIPTION "support for PNG encoding" REQUIRED_PACKAGES PNG)
ecbuild_add_option(FEATURE OMP DEFAULT OFF DESCRIPTION "support for OpenMP shared memory parallelism" REQUIRED_PACKAGES "OpenMP COMPONENTS CXX")
if(NOT TARGET OpenMP::OpenMP_CXX)
set(mir_HAVE_OMP 0)
endif()
ecbuild_find_package(NAME eccodes VERSION 2.32 REQUIRED)
ecbuild_find_package(NAME eckit VERSION 1.22 REQUIRED)
ecbuild_add_option(FEATURE ATLAS DEFAULT ON DESCRIPTION "support for Atlas" REQUIRED_PACKAGES "atlas VERSION 0.35.1")
set(MIR_LIBRARIES mir)
if(HAVE_BUILD_TOOLS)
set(mir_INSTALL_TOOLS)
else()
set(mir_INSTALL_TOOLS NOINSTALL)
endif()
include(cmake/compiler_warnings.cmake) # optionally handle compiler specific warnings
add_subdirectory(src)
add_subdirectory(etc)
add_subdirectory(share)
if(HAVE_TESTS)
add_subdirectory(tests)
endif()
ecbuild_add_resources(TARGET ${PROJECT_NAME}_top_files SOURCES AUTHORS README.md NOTICE LICENSE INSTALL COPYING)
ecbuild_install_project(NAME ${PROJECT_NAME})
ecbuild_print_summary()