set(CART_INCLUDES
    ${ARCH_INCLUDES}
    ${CMAKE_SOURCE_DIR}/src
    ${CMAKE_SOURCE_DIR}/src/core
    ${CMAKE_SOURCE_DIR}/src/drive
    ${CMAKE_SOURCE_DIR}/src/rtc
    ${CMAKE_SOURCE_DIR}/src/c64
    ${CMAKE_SOURCE_DIR}/src/sid
    ${CMAKE_SOURCE_DIR}/src/lib/p64
    ${CMAKE_SOURCE_DIR}/src/vicii
    ${CMAKE_SOURCE_DIR}/src/rtc
    ${CMAKE_SOURCE_DIR}/src/samplerdrv
    ${CMAKE_SOURCE_DIR}/src/rs232drv
    )

set(C64CARTSYSTEM_SOURCES
    c64cart.c
    c64carthooks.c
    c64cartmem.c
    c64cartmem.h
    c64cartsystem.h
    crt.c
    crt.h
    )

set(C64CART_SOURCES
    actionreplay2.c
    actionreplay2.h
    actionreplay3.c
    actionreplay3.h
    actionreplay4.c
    actionreplay4.h
    actionreplay.c
    actionreplay.h
    atomicpower.c
    atomicpower.h
    c64-generic.c
    c64-generic.h
    c64-midi.c
    c64-midi.h
    c64tpi.c
    c64tpi.h
    capture.c
    capture.h
    clockport.c
    clockport.h
    clockport-mp3at64.c
    clockport-mp3at64.h
    clockport-rrnet.c
    clockport-rrnet.h
    comal80.c
    comal80.h
    cpmcart.c
    cpmcart.h
    daa.c
    daa.h
    debugcart.c
    debugcart.h
    delaep256.c
    delaep256.h
    delaep64.c
    delaep64.h
    delaep7x8.c
    delaep7x8.h
    diashowmaker.c
    diashowmaker.h
    dinamic.c
    dinamic.h
    dqbb.c
    dqbb.h
    easycalc.c
    easycalc.h
    easyflash.c
    easyflash.h
    epyxfastload.c
    epyxfastload.h
    exos.c
    exos.h
    expert.c
    expert.h
    final.c
    final.h
    final3.c
    final3.h
    finalplus.c
    finalplus.h
    formel64.c
    formel64.h
    freezeframe.c
    freezeframe.h
    freezemachine.c
    freezemachine.h
    funplay.c
    funplay.h
    gamekiller.c
    gamekiller.h
    gmod2.c
    gmod2.h
    gs.c
    gs.h
    ide64.c
    ide64.h
    isepic.c
    isepic.h
    kcs.c
    kcs.h
    kingsoft.c
    kingsoft.h
    mach5.c
    mach5.h
    magicdesk.c
    magicdesk.h
    magicformel.c
    magicformel.h
    magicvoice.c
    magicvoice.h
    maxbasic.c
    maxbasic.h
    mikroass.c
    mikroass.h
    mmcreplay.c
    mmcreplay.h
    mmc64.c
    mmc64.h
    ocean.c
    ocean.h
    pagefox.c
    pagefox.h
    prophet64.c
    prophet64.h
    ramcart.c
    ramcart.h
    retroreplay.c
    retroreplay.h
    reu.c
    reu.h
    rexep256.c
    rexep256.h
    rexutility.c
    rexutility.h
    rgcd.c
    rgcd.h
    ross.c
    ross.h
    rrnetmk3.c
    rrnetmk3.h
    shortbus.c
    shortbus.h
    shortbus_digimax.c
    shortbus_digimax.h
    shortbus_etfe.c
    shortbus_etfe.h
    silverrock128.c
    silverrock128.h
    simonsbasic.c
    simonsbasic.h
    snapshot64.c
    snapshot64.h
    stardos.c
    stardos.h
    stb.c
    stb.h
    superexplode5.c
    superexplode5.h
    supergames.c
    supergames.h
    supersnapshot.c
    supersnapshot.h
    supersnapshot4.c
    supersnapshot4.h
    warpspeed.c
    warpspeed.h
    westermann.c
    westermann.h
    zaxxon.c
    zaxxon.h
    )

set(C64COMMONCART_SOURCES
    c64acia.h
    c64acia1.c
    cs8900io.c
    cs8900io.h
    digimax.c
    digimax.h
    ds12c887rtc.c
    ds12c887rtc.h
    ethernetcart.c
    ethernetcart.h
    georam.c
    georam.h
    sfx_soundexpander.c
    sfx_soundexpander.h
    sfx_soundsampler.c
    sfx_soundsampler.h
    )

add_library(c64cartsystem STATIC ${C64CARTSYSTEM_SOURCES})
add_library(c64cart STATIC ${C64CART_SOURCES})
add_library(c64commoncart STATIC ${C64COMMONCART_SOURCES})

target_include_directories(c64cartsystem PRIVATE ${CART_INCLUDES})
target_include_directories(c64cart PRIVATE ${CART_INCLUDES})
target_include_directories(c64commoncart PRIVATE ${CART_INCLUDES})

