-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
79 lines (65 loc) · 2.11 KB
/
CMakeLists.txt
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
cmake_minimum_required(VERSION 3.0)
project(cassette_deck)
set(CMAKE_CXX_STANDARD 17)
include(3rd_party/gifenc.cmake)
add_library(tape_parser
src/tape_parser/tape_parser.cpp
src/tape_parser/parser_util.cpp
)
target_include_directories(tape_parser PUBLIC ./src/tape_parser)
add_executable(tape_parser_test
src/tape_parser/tape_parser.test.cpp
)
target_link_libraries(tape_parser_test tape_parser)
add_library(tape_player
src/tape_player/tape_player.cpp
)
target_link_libraries(tape_player PUBLIC
pthread
tape_parser
)
add_executable(mkfont_bdf
src/tools/mkfont_bdf.c
src/tools/mkfont_bdf.h
src/tools/bdf.h
src/tools/util.h
)
# custom target to build glyph.h
add_custom_command(
OUTPUT ${CMAKE_BINARY_DIR}/glyph.h
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMAND $<TARGET_FILE:mkfont_bdf>
./fonts/milkjf/milkjf_k16.bdf
./fonts/milkjf/milkjf_8x16r.bdf
./fonts/milkjf/milkjf_8x16.bdf
./fonts/terminus/ter-u16n.bdf
> ${CMAKE_BINARY_DIR}/glyph.h
DEPENDS mkfont_bdf
)
add_executable(theme_generator ./tool/theme_generator)
add_custom_command(
OUTPUT ${CMAKE_BINARY_DIR}/themes.h
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMAND $<TARGET_FILE:theme_generator>
./themes/
${CMAKE_BINARY_DIR}/themes.h
DEPENDS theme_generator
)
set(CASSETE_DECK_SOURCES
src/x/yaftx.c
src/x/x.h
${CMAKE_BINARY_DIR}/glyph.h
${CMAKE_BINARY_DIR}/themes.h
)
add_executable(cassette_deck_preview ${CASSETE_DECK_SOURCES})
find_package(X11 COMPONENTS X11)
target_link_libraries(cassette_deck_preview PRIVATE X11 gifenc tape_player)
target_include_directories(cassette_deck_preview PRIVATE ${CMAKE_BINARY_DIR})
add_executable(cassette_deck_headless ${CASSETE_DECK_SOURCES})
target_compile_definitions(cassette_deck_headless PRIVATE HEADLESS)
target_link_libraries(cassette_deck_headless PRIVATE gifenc tape_player)
target_include_directories(cassette_deck_headless PRIVATE ${CMAKE_BINARY_DIR})
file(GENERATE
OUTPUT ${CMAKE_BINARY_DIR}/cassette_deck
INPUT ${CMAKE_SOURCE_DIR}/bin/cassette_deck.in
)