Use infinitime_fonts target if fonts/CMakeLists.txt exists

Since https://github.com/InfiniTimeOrg/InfiniTime/pull/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`.
This commit is contained in:
Reinhold Gschweicher
2022-05-10 23:56:45 +02:00
committed by NeroBurner
parent d9d729d40f
commit f0c6ef9cd6
2 changed files with 16 additions and 2 deletions

View File

@@ -238,6 +238,13 @@ set_target_properties(QCBOR PROPERTIES LINKER_LANGUAGE C)
# )
target_link_libraries(infinisim PRIVATE QCBOR)
if(EXISTS ${InfiniTime_DIR}/src/displayapp/fonts/CMakeLists.txt)
# available since https://github.com/InfiniTimeOrg/InfiniTime/pull/1097
message(STATUS "add subdirectory ${InfiniTime_DIR}/src/displayapp/fonts for 'infinitime_fonts' target")
add_subdirectory(${InfiniTime_DIR}/src/displayapp/fonts fonts)
target_link_libraries(infinisim PRIVATE infinitime_fonts)
endif()
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
# Special case for SDL2 dependency, goal is to find a config that exports SDL2::SDL2 target
# libsdl2-dev has a `sdl2-config.cmake` that doesn't export this, but vcpkg does..