-
Notifications
You must be signed in to change notification settings - Fork 103
/
ufo-import.cmake.in
75 lines (57 loc) · 2.08 KB
/
ufo-import.cmake.in
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
# ufo-import.cmake
include(CMakeFindDependencyMacro)
if( @jedicmake_FOUND@ AND NOT jedicmake_FOUND )
find_dependency(jedicmake REQUIRED)
endif()
if(NOT (MPI_C_FOUND AND MPI_CXX_FOUND AND MPI_Fortran_FOUND))
find_dependency(MPI REQUIRED COMPONENTS C CXX Fortran)
endif()
if(NOT Boost_FOUND)
find_dependency(Boost REQUIRED)
endif()
if(NOT (NetCDF_C_FOUND AND NetCDF_Fortran_FOUND))
find_dependency(NetCDF REQUIRED COMPONENTS C Fortran)
endif()
if(NOT (Eigen3_FOUND OR EIGEN3_FOUND))
find_dependency( Eigen3 REQUIRED NO_MODULE HINTS @EIGEN3_ROOT_DIR@ )
endif()
if(NOT gsl-lite_FOUND)
find_dependency(gsl-lite REQUIRED)
endif()
if(NOT eckit_FOUND)
find_dependency(eckit REQUIRED)
endif()
if(NOT fckit_FOUND)
find_dependency(fckit REQUIRED)
endif()
if(NOT ioda_FOUND)
find_dependency(ioda REQUIRED)
endif()
if(NOT oops_FOUND)
find_dependency(oops REQUIRED)
endif()
# Optional dependencies
if(@crtm_FOUND@ AND NOT crtm_FOUND)
find_dependency(crtm REQUIRED)
endif()
if(@rttov_FOUND@ AND NOT rttov_FOUND)
find_dependency(rttov REQUIRED)
endif()
if(@gsw_FOUND@ AND NOT gsw_FOUND)
find_dependency(gsw REQUIRED)
endif()
if(@ropp-ufo_FOUND@ AND NOT ropp-ufo_FOUND)
find_dependency(ropp-ufo REQUIRED)
endif()
if(@geos-aero_FOUND@ AND NOT geos-aero_FOUND)
find_dependency(geos-aero REQUIRED)
endif()
# Export Fortran compiler version for checking module compatibility
set(@PROJECT_NAME@_MODULES_Fortran_COMPILER_ID @CMAKE_Fortran_COMPILER_ID@)
set(@PROJECT_NAME@_MODULES_Fortran_COMPILER_VERSION @CMAKE_Fortran_COMPILER_VERSION@)
if(NOT @PROJECT_NAME@_MODULES_Fortran_COMPILER_ID STREQUAL CMAKE_Fortran_COMPILER_ID
OR NOT @PROJECT_NAME@_MODULES_Fortran_COMPILER_VERSION VERSION_EQUAL CMAKE_Fortran_COMPILER_VERSION)
message(SEND_ERROR "Package @PROJECT_NAME@ provides Fortran modules built with "
"${@PROJECT_NAME@_MODULES_Fortran_COMPILER_ID}-${@PROJECT_NAME@_MODULES_Fortran_COMPILER_VERSION} "
"but this build for ${PROJECT_NAME} uses incompatible compiler ${CMAKE_Fortran_COMPILER_ID}-${CMAKE_Fortran_COMPILER_VERSION}")
endif()