add_executable(spot main.c)

target_sources(spot PRIVATE
    BASE.c
    BASE.h
    BBOX.c
    BBOX.h
    bitstr.h
    BLND.c
    BLND.h
    CFF_.c
    CFF_.h
    cffread.c
    cffread.h
    CID_.c
    CID_.h
    cmap.c
    cmap.h
    da.c
    da.h
    desc.c
    desc.h
    dictops.h
    dump.c
    dump.h
    EBLC.c
    EBLC.h
    ENCO.c
    ENCO.h
    excs0.h
    excs.h
    exenc0.h
    exenccd.h
    exsubcs0.h
    exsubcs.h
    fdsc.c
    fdsc.h
    feat.c
    feat.h
    file.c
    file.h
    FNAM.c
    FNAM.h
    fvar.c
    fvar.h
    gasp.c
    gasp.h
    GDEF.c
    GDEF.h
    global.c
    global.h
    GLOB.c
    GLOB.h
    glyf.c
    glyf.h
    GPOS.c
    GPOS.h
    GSUB.c
    GSUB.h
    hdmx.c
    hdmx.h
    head.c
    head.h
    HFMX.c
    HFMX.h
    hhea.c
    hhea.h
    hmtx.c
    hmtx.h
    isocs0.h
    isocs.h
    kern.c
    kern.h
    loca.c
    loca.h
    LTSH.c
    LTSH.h
    map.c
    map.h
    maxp.c
    maxp.h
    META.c
    META.h
    MMFX.c
    MMFX.h
    MMSD.c
    MMSD.h
    MMVR.c
    MMVR.h
    name.c
    name.h
    nicename.h
    numtypes.h
    opt.c
    opt.h
    OS_2.c
    OS_2.h
    package.h
    pathbuild.c
    pathbuild.h
    post.c
    post.h
    proof.c
    proof.h
    res.c
    res.h
    sfnt.c
    sfnt.h
    SING.c
    SING.h
    spot.h
    spotmsgs.c
    spotmsgs.h
    stdenc0.h
    stdenccd.h
    stdstr1.h
    stdstr.h
    strftime.c
    sys.c
    sys.h
    trak.c
    trak.h
    TTdumpinstrs.c
    TTdumpinstrs.h
    tto.c
    tto.h
    txops.h
    TYP1.c
    TYP1.h
    vhea.c
    vhea.h
    vmtx.c
    vmtx.h
    VORG.c
    VORG.h
    WDTH.c
    WDTH.h
)

target_include_directories(spot PRIVATE ../../spot/sfnt_includes ../../shared/include .)
if(HAVE_M_LIB)
    target_link_libraries(spot PRIVATE m)
endif()
target_compile_definitions(spot PRIVATE EXECUTABLE=1)
install(TARGETS spot DESTINATION bin)
