include_guard(GLOBAL)

function (coven_options_init)
  foreach (option IN ITEMS BENCHMARKS EXAMPLES TESTS DOCS)
    string(MAKE_C_IDENTIFIER "${PROJECT_NAME}" project)
    string(TOUPPER ${project} project)
    string(TOLOWER "${option}" lower)
    if (PROJECT_STANDALONE)
      option(BUILD_${option} "Build ${lower}" ON)
    endif()
    set(name ${project}_BUILD_${option})
    set(docs "Build ${lower} for '${PROJECT_NAME}'")
    set(initial OFF)
    if (BUILD_${option} OR PROJECT_STANDALONE)
      set(initial ON)
    endif()
    option(${name} "${docs}" ${initial})
  endforeach ()
endfunction ()
