set(MEDIAINFO_FEATURE_LIST 
    7Z
    AAC
    AAF
    AC3
    AC4
    ACE
    ADM
    ADPCM
    ADVANCED
    ADVANCED2
    AES
    AFDBARDATA
    AIC
    ALL
    ALS
    AMR
    AMV
    ANCILLARY
    APE
    APETAG
    APTX100
    APV
    ARCHIVE
    ARIBSTDB24B37
    ARRIRAW
    AU
    AUDIO
    AV1
    AV2
    AVC
    AVSV
    AVSV3
    BDAV
    BDMV
    BMP
    BPG
    BZIP2
    C2PA
    CAF
    CANOPUS
    CDP
    CDXA
    CELT
    CINEFORM
    CMML
    COMPRESS
    CONFORMANCE
    CSV
    CUSTOM
    DASHMPD
    DAT
    DCP
    DDS
    DECODE
    DEMUX
    DIRAC
    DIRECTORY
    DOLBYE
    DPG
    DPX
    DSDIFF
    DSF
    DTS
    DTSUHD
    DTVCCTRANSPORT
    DUMMY
    DUPLICATE
    DVBSUBTITLE
    DVDIF
    DVDIF_ANALYZE
    DVDV
    DXW
    EBUCORE
    EIA608
    EIA708
    ELF
    EVENTS
    EXIF
    EXPORT
    EXR
    FFV1
    FILE
    FILTER
    FIMS
    FIXITY
    FLAC
    FLIC
    FLV
    FRAPS
    GIF
    GRAPH
    GRAPHVIZ
    GXF
    GZIP
    H263
    HDSF4M
    HEVC
    HLS
    HTML
    HUFFYUV
    IAB
    IAMF
    IBI
    IBIUSAGE
    ICC
    ICO
    ID3
    ID3V2
    IIM
    IMAGE
    ISM
    ISO9660
    IT
    IVF
    JNI
    JPEG
    JSON
    KATE
    LA
    LAGARITH
    LATM
    LIBCURL
    LIBMMS
    LXF
    LYRICS3
    LYRICS3V2
    MACHO
    MACROBLOCKS
    MD5
    MGA
    MIDI
    MINIMAL
    MIXML
    MK
    MOD
    MPC
    MPCSV8
    MPEG4
    MPEG4V
    MPEG7
    MPEGA
    MPEGHA
    MPEGPS
    MPEGTS
    MPEGTS_PCR
    MPEGTS_PESTIMESTAMP
    MPEGV
    MULTI
    MXF
    MZ
    N19
    NEXTPACKET
    NISO
    NSV
    NUT
    OGG
    OPENMG
    OPUS
    OTHER
    OTHERTEXT
    P2
    PAC
    PBCORE
    PCM
    PCMM2TS
    PCMVOB
    PCX
    PDF
    PGS
    PMP
    PNG
    PROPERTYLIST
    PRORES
    PS2A
    PSD
    PTX
    RAR
    READER
    READTHREAD
    REFERENCES
    REVTMD
    RIFF
    RKAU
    RLE
    RM
    S3M
    SCC
    SCTE20
    SDP
    SEEK
    SEQUENCEINFO
    SHA1
    SHA2
    SKM
    SMPTEST0302
    SMPTEST0331
    SMPTEST0337
    SPEEX
    SPHERICALVIDEO
    SUBRIP
    SWF
    TAG
    TAK
    TAR
    TELETEXT
    TEXT
    TGA
    THEORA
    TIFF
    TIMECODE
    TIMEDTEXT
    TRACE
    TRACE_FFV1CONTENT
    TSP
    TTA
    TTML
    TWINVQ
    UMF
    UNKNOWN
    VBI
    VC1
    VC3
    VIDEO
    VORBIS
    VORBISCOM
    VP8
    VP9
    VVC
    WEBP
    WM
    WTV
    WVPK
    XDCAM
    XM
    XML
    XMP
    Y4M
    ZIP
)

foreach(_MI_FEAT ${MEDIAINFO_FEATURE_LIST})
    set(_MI_VAR_NAME "MEDIAINFO_${_MI_FEAT}")
    set(_MI_CURRENT_VAL "${${_MI_VAR_NAME}}")
    if("${_MI_CURRENT_VAL}" STREQUAL "")
        set(_MI_CURRENT_VAL "DEFAULT")
    endif()
    set(${_MI_VAR_NAME} "${_MI_CURRENT_VAL}" CACHE STRING "Enable/disable ${_MI_FEAT} (DEFAULT/ON/OFF)" FORCE)
    set_property(CACHE ${_MI_VAR_NAME} PROPERTY STRINGS "DEFAULT" "ON" "OFF")
    string(TOUPPER "${_MI_CURRENT_VAL}" _MI_CHOICE)
    if(NOT "${_MI_CHOICE}" STREQUAL "DEFAULT")
        if(${_MI_CHOICE})
            add_compile_definitions(${_MI_VAR_NAME}_YES)
        else()
            add_compile_definitions(${_MI_VAR_NAME}_NO)
        endif()
    endif()
endforeach()
unset(_MI_FEAT)
unset(_MI_VAR_NAME)
unset(_MI_CURRENT_VAL)
unset(_MI_CHOICE)
