forked from CESM-Development/CMake_Fortran_utils
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFindNETCDF_Fortran.cmake
25 lines (21 loc) · 979 Bytes
/
FindNETCDF_Fortran.cmake
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
# - Try to find Netcdf
# Once done this will define
# NETCDF_Fortran_FOUND - System has Netcdf
# NETCDF_Fortran_INCLUDE_DIRS - The Netcdf include directories
# NETCDF_Fortran_LIBRARY - The C libraries needed to use Netcdf
# NETCDF_Fortran_LIBRARIES - All the libraries needed to use Netcdf
# NETCDF_Fortran_DEFINITIONS - Compiler switches required for using Netcdf
#
include(LibFindMacros)
find_path(NETCDF_Fortran_INCLUDE_DIR
NAMES netcdf.inc
PATHS ${NETCDF_Fortran_PKGCONF_INCLUDE_DIRS}
HINTS ${NETCDF_DIR}/include ${NETCDF_Fortran_DIR}/include)
libfind_package(NETCDF_Fortran NETCDF_C)
find_library(NETCDF_Fortran_LIBRARY
NAMES libnetcdff.a netcdff
PATHS ${NETCDF_Fortran_PKGCONF_LIBRARY_DIRS}
HINTS ${NETCDF_DIR}/lib ${NETCDF_Fortran_DIR}/lib)
set(NETCDF_Fortran_PROCESS_INCLUDES NETCDF_Fortran_INCLUDE_DIR)
set(NETCDF_Fortran_PROCESS_LIBS NETCDF_Fortran_LIBRARY)
libfind_process(NETCDF_Fortran)