c-ares provides CMake targets:

  find_package(c-ares CONFIG REQUIRED)
  target_link_libraries(main PRIVATE c-ares::cares)

c-ares provides pkg-config modules:

  # asynchronous DNS lookup library
  libcares
