FindNetCDF.cmake 497 Bytes
FIND_PATH(NETCDFINCLUDE_DIR netcdf.h
  HINTS
    ${USERLOCAL_ROOT}/include
)
mark_as_advanced(NETCDFINCLUDE_DIR)

find_library(NETCDFLIBRARY 
    NAMES netcdf
    HINTS
        ${USERLOCAL_ROOT}/lib
    NO_DEFAULT_PATH
)
mark_as_advanced(NETCDFLIBRARY)

include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(NetCdf DEFAULT_MSG NETCDFLIBRARY NETCDFINCLUDE_DIR)

if(NETCDF_FOUND)
    set(NETCDFINCLUDE_DIRS ${NETCDFINCLUDE_DIR})
    set(NETCDFLIBRARIES ${NETCDFLIBRARY})
endif()