forked from NOAA-GFDL/FMS
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathfms-import.cmake.in
28 lines (23 loc) · 1.17 KB
/
fms-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
# fms-import.cmake
# find_dependency calls for fms target dependencies
include(CMakeFindDependencyMacro)
if(NOT NetCDF_Fortran_FOUND)
find_package( NetCDF REQUIRED COMPONENTS Fortran )
endif()
if(NOT MPI_Fortran_FOUND)
find_package( MPI REQUIRED COMPONENTS Fortran )
endif()
if(@OPENMP@)
if(NOT OpenMP_Fortran_FOUND OR NOT OpenMP_C_FOUND )
find_package( OpenMP REQUIRED COMPONENTS C Fortran )
endif()
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()