forked from NOAA-EMC/saber
-
Notifications
You must be signed in to change notification settings - Fork 0
/
saber-import.cmake.in
56 lines (45 loc) · 1.78 KB
/
saber-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
# saber-import.cmake
# find_dependency calls for OOPS target dependencies
include(CMakeFindDependencyMacro)
if(@jedicmake_FOUND@ AND NOT jedicmake_FOUND)
find_dependency(jedicmake REQUIRED)
endif()
if(@OPENMP@)
find_dependency(OpenMP REQUIRED COMPONENTS Fortran)
endif()
if(NOT MPI_Fortran_FOUND)
find_dependency(MPI REQUIRED COMPONENTS Fortran)
endif()
if(NOT NetCDF_Fortran_FOUND)
find_dependency(NetCDF REQUIRED COMPONENTS Fortran)
endif()
if(NOT eckit_FOUND)
find_dependency(eckit REQUIRED)
endif()
if(NOT fckit_FOUND)
find_dependency(fckit REQUIRED)
endif()
if(NOT atlas_FOUND)
find_package(atlas REQUIRED COMPONENTS OMP_Fortran)
endif()
if((@LAPACK_FOUND@ AND NOT LAPACK_FOUND) OR (@MKL_FOUND@ AND NOT MKL_FOUND))
if( @MKL_FOUND@ )
find_dependency( MKL REQUIRED )
set( LAPACK_LIBRARIES ${MKL_LIBRARIES} )
else()
find_dependency( LAPACK REQUIRED )
endif()
endif()
if(@oops_FOUND@) # oops_FOUND
find_dependency(oops)
set(saber_oops_FOUND True) #COMPONENT 'oops'
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()