Skip to content

Commit f0c6ef9

Browse files
committed
Use infinitime_fonts target if fonts/CMakeLists.txt exists
Since InfiniTimeOrg/InfiniTime#1097 the fonts are generated. Support this new way of using fonts. When InfiniTime isn't a subdirectory of InfiniSim we need to provide the binary dir when using `add_subdirectory()`. Use `fonts`. Update README with instructions to install `lv_font_conv`.
1 parent d9d729d commit f0c6ef9

2 files changed

Lines changed: 16 additions & 2 deletions

File tree

CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,13 @@ set_target_properties(QCBOR PROPERTIES LINKER_LANGUAGE C)
238238
# )
239239
target_link_libraries(infinisim PRIVATE QCBOR)
240240

241+
if(EXISTS ${InfiniTime_DIR}/src/displayapp/fonts/CMakeLists.txt)
242+
# available since https://github.com/InfiniTimeOrg/InfiniTime/pull/1097
243+
message(STATUS "add subdirectory ${InfiniTime_DIR}/src/displayapp/fonts for 'infinitime_fonts' target")
244+
add_subdirectory(${InfiniTime_DIR}/src/displayapp/fonts fonts)
245+
target_link_libraries(infinisim PRIVATE infinitime_fonts)
246+
endif()
247+
241248
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
242249
# Special case for SDL2 dependency, goal is to find a config that exports SDL2::SDL2 target
243250
# libsdl2-dev has a `sdl2-config.cmake` that doesn't export this, but vcpkg does..

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,18 @@ For a history on how this simulator started and the challenges on its way visit
1414
- CMake
1515
- SDL2 (provides the simulator window, handles mouse and keyboard input)
1616
- Compiler (g++ or clang++)
17+
- [lv_font_conv](https://github.com/lvgl/lv_font_conv#install-the-script) (for `font.c` generation since [InfiniTime#1097](https://github.com/InfiniTimeOrg/InfiniTime/pull/1097))
1718

1819
On Ubuntu/Debian install the following packages:
1920

2021
```sh
21-
sudo apt install -y cmake libsdl2-dev g++
22+
sudo apt install -y cmake libsdl2-dev g++ npm
2223
```
2324

2425
On Arch Linux the following packages are needed:
2526

2627
```sh
27-
sudo pacman -S cmake sdl2 gcc
28+
sudo pacman -S cmake sdl2 gcc npm
2829
```
2930

3031
On Fedora the following packages are needed:
@@ -33,6 +34,12 @@ On Fedora the following packages are needed:
3334
sudo dnf install cmake SDL2-devel gcc
3435
```
3536

37+
Then install the `lv_font_conv` executable to the source directory (will be installed at `node_modules/.bin/lv_font_conv`)
38+
39+
```sh
40+
npm install lv_font_conv@1.5.2
41+
```
42+
3643
## Get the Sources
3744

3845
Clone this repository and tell `git` to recursively download the submodules as well

0 commit comments

Comments
 (0)