if (NOT (TPL_METIS_INCLUDE_DIRS AND TPL_METIS_LIBRARIES))
  find_path(METIS_INCLUDES NAMES metis.h PATHS $ENV{METISDIR} PATH_SUFFIXES include)
  find_library(METIS_LIBRARY metis PATHS $ENV{METISDIR} PATH_SUFFIXES lib)
  set(METIS_LIBRARIES ${METIS_LIBRARY})
else()
  set(METIS_LIBRARIES ${TPL_METIS_LIBRARIES})
  set(METIS_INCLUDES ${TPL_METIS_INCLUDE_DIRS})
endif()

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(METIS DEFAULT_MSG METIS_INCLUDES METIS_LIBRARIES)
