include_guard(GLOBAL)

import(IXM::Generate::*)

function (generate subcommand)
  set(response-file "RSP" "RESPONSE_FILE")
  set(protobuf "PROTO" "PROTOBUF")
  set(bison "BISON" "YACC")
  set(flex "FLEX" "LEX")

  if (subcommand IN_LIST response-file)
    ixm_generate_response_file(${ARGN})
  elseif (subcommand IN_LIST protobuf)
    ixm_generate_protobuf(${ARGN})
  elseif (subcommand IN_LIST bison)
    ixm_generate_bison(${ARGN})
  elseif (subcommand IN_LIST flex)
    ixm_generate_flex(${ARGN})
  else()
    log(FATAL "generate(${subcommand}) is not a valid subcommand")
  endif()
endfunction()
