aboutsummaryrefslogtreecommitdiff
path: root/cmake/FindSameBoyTemplate.cmake
blob: 47692952bfd108f5bb4a0c0cf686a3dcee14e7dc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#
# SAMEBOY_TEMPLATE_SOURCES

find_package(SameBoy REQUIRED)
set(SAMEBOY_QUICKLOOK_PATH ${SAMEBOY_PATH}/QuickLook)

list(APPEND
    TEMPLATE_LIST
    CartridgeTemplate
    ColorCartridgeTemplate
    UniversalCartridgeTemplate
)

foreach(TEMPLATE_FILE ${TEMPLATE_LIST})
    add_custom_command(
        OUTPUT ${TEMPLATE_FILE}_png.c
        COMMAND ${CMAKE_COMMAND}
        "-Dbin_in=${SAMEBOY_QUICKLOOK_PATH}/${TEMPLATE_FILE}.png"
        -P ${CMAKE_SOURCE_DIR}/cmake/FileEmbed.cmake
    )
    list(APPEND
        SAMEBOY_TEMPLATE_SOURCES
        ${TEMPLATE_FILE}_png.c
    )
endforeach()

add_custom_target(sameboy_template DEPENDS ${SAMEBOY_TEMPLATE_SOURCES})