find_path(LIBDWARF_INCLUDE_DIR NAMES libdwarf/dwarf.h)
mark_as_advanced(LIBDWARF_INCLUDE_DIR)

find_library(LIBDWARF_LIBRARY NAMES dwarf)
mark_as_advanced(LIBDWARF_LIBRARY)

include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(
  LIBDWARF
  REQUIRED_VARS LIBDWARF_LIBRARY LIBDWARF_INCLUDE_DIR)

if(LIBDWARF_FOUND)
  set(LIBDWARF_LIBRARIES ${LIBDWARF_LIBRARY})
  set(LIBDWARF_INCLUDE_DIRS ${LIBDWARF_INCLUDE_DIR})
endif()
