# C++ command-line options parsing
# https://github.com/jarro2783/cxxopts

include(FetchContent)

FetchContent_Declare(cxxopts
  URL     ${CMAKE_CURRENT_LIST_DIR}/cxxopts-2.2.0.zip
  URL_MD5 5739b326e26b2115cf0bd996c10e1769
)

FetchContent_GetProperties(cxxopts)
if(NOT cxxopts_POPULATED)
  FetchContent_Populate(cxxopts)

  set(CXXOPTS_BUILD_EXAMPLES OFF)
  set(CXXOPTS_BUILD_TESTS OFF)
  add_subdirectory(${cxxopts_SOURCE_DIR} ${cxxopts_BINARY_DIR} EXCLUDE_FROM_ALL)

  # cxxopts does not ALIAS itself as an imported target
  add_library(cxxopts::cxxopts ALIAS cxxopts)
endif()

