-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
58 lines (46 loc) · 1.99 KB
/
CMakeLists.txt
File metadata and controls
58 lines (46 loc) · 1.99 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
################################################################################
# GSIbec
################################################################################
cmake_minimum_required( VERSION 3.12 )
project( gsibec VERSION 1.4.3 LANGUAGES Fortran )
## Ecbuild integration
set( ECBUILD_DEFAULT_BUILD_TYPE Release )
find_package( ecbuild 3.3.2 REQUIRED )
include( ecbuild_system NO_POLICY_SCOPE )
ecbuild_declare_project()
list( APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake )
set( CMAKE_DIRECTORY_LABELS ${PROJECT_NAME} )
################################################################################
# Standard compiler flags
################################################################################
option( ENABLE_MKL "Use MKL for LAPACK implementation (if available)" ON )
include( gsibec_compiler_flags )
include( gsibec_extra_macros )
################################################################################
# Dependencies
################################################################################
if( ENABLE_MKL )
find_package( MKL )
endif()
if( MKL_FOUND )
set( LAPACK_LIBRARIES ${MKL_LIBRARIES} )
else()
find_package( LAPACK REQUIRED )
endif()
find_package( jedicmake QUIET ) # Prefer find modules from jedi-cmake
find_package( MPI REQUIRED COMPONENTS Fortran )
find_package( NetCDF REQUIRED COMPONENTS Fortran )
# NCEP spectral library (optional)
find_package(ip 5.1 QUIET)
################################################################################
# Sources
################################################################################
add_subdirectory( src/gsibec )
add_subdirectory( test )
################################################################################
# Finalise configuration
################################################################################
# prepares a tar.gz of the sources and/or binaries
ecbuild_install_project( NAME ${PROJECT_NAME} )
# print the summary of the configuration
ecbuild_print_summary()