FindNetCDF.cmake 1022 Bytes
# - Try to find the libnetcdf libraries
# Once done this will define
#
# libnetcdf_FOUND - flag that indicates libnetcdf is installed
# libnetcdf_INCLUDE_DIR - the libnetcdf include directory
# libnetcdf_LIBRARIES - the libnetcdf library directory

FIND_PATH(libnetcdf_INCLUDE_DIR netcdf.h PATHS /include /usr/include /usr/local/include ${USERLOCAL_ROOT}/include)
FIND_LIBRARY(libnetcdf_LIBRARIES NAMES netcdf PATHS /lib /usr/lib /usr/local/lib ${USERLOCAL_ROOT}/lib )

# set FOUND flag
IF(libnetcdf_INCLUDE_DIR AND libnetcdf_LIBRARIES)
        SET(libnetcdf_FOUND 1)
        if(NOT libnetcdf_FIND_QUIETLY)
                message(STATUS "Found libnetcdf: ${libnetcdf_LIBRARIES}")
        endif(NOT libnetcdf_FIND_QUIETLY)
ELSE(libnetcdf_INCLUDE_DIR AND libnetcdf_LIBRARIES)
        SET(libnetcdf_FOUND 0 CACHE BOOL "Not found libnetcdf library")
        message(STATUS "NOT Found libnetcdf, disabling it")
ENDIF(libnetcdf_INCLUDE_DIR AND libnetcdf_LIBRARIES)

MARK_AS_ADVANCED(libnetcdf_INCLUDE_DIR libnetcdf_LIBRARIES)