FIND_PATH(NETCDFINCLUDE_DIR netcdf.h HINTS $ENV{NETCDF_ROOT}/include ${NETCDF_ROOT}/include ) mark_as_advanced(NETCDFINCLUDE_DIR) find_library(NETCDFLIBRARY NAMES netcdf HINTS $ENV{NETCDF_ROOT} ${NETCDF_ROOT} PATH_SUFFIXES lib ) 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()