find_package(jsoncpp REQUIRED)
find_package(CURL REQUIRED)

# ICU Components Reference:
# https://cmake.org/cmake/help/latest/module/FindICU.html
# ICU components = data, i18n, io, le, lx, test, tu and uc.
find_package(ICU 77.1 COMPONENTS uc i18n)

FetchContent_Declare(
  IDNA
  GIT_REPOSITORY https://github.com/ada-url/idna.git
  GIT_TAG        0.5.0
)
FetchContent_MakeAvailable(IDNA)

add_executable(validate validate.cxx)
target_link_libraries(validate ada-idna jsoncpp_lib CURL::libcurl)
if (ICU_FOUND)
  target_link_libraries(validate ICU::uc ICU::i18n)
endif()
