Skip to content

Commit

Permalink
feat: generate fonts during cmake configuration in binary folder
Browse files Browse the repository at this point in the history
  • Loading branch information
enzoevers committed May 22, 2024
1 parent 2722489 commit 3730e14
Show file tree
Hide file tree
Showing 12 changed files with 65 additions and 341 deletions.
5 changes: 3 additions & 2 deletions CI/BuildAllTargetSpecific.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ echo "//===================="
echo

sudo apt install -y clang-format
python3 -m pip install fontTools pillow argparse

echo
echo "//===================="
Expand All @@ -47,12 +48,12 @@ echo "// Build STM32F303xc"
echo "//===================="
echo

Scripts/Stm32/Stm32f303xc/BuildStm32f303xc.sh
Scripts/Stm32/Stm32f303xc/BuildStm32f303xc.sh "build"

echo
echo "//===================="
echo "// Build Desktop"
echo "//===================="
echo

Scripts/Desktop/BuildDesktop.sh
Scripts/Desktop/BuildDesktop.sh "build"
4 changes: 3 additions & 1 deletion CI/TestAll.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,15 @@ export NVM_DIR="$HOME/.nvm"
nvm install 21.1.0
nvm use 21.1.0

python3 -m pip install fontTools pillow argparse

echo
echo "//===================="
echo "// Build tests"
echo "//===================="
echo

Scripts/Test/BuildTest.sh
Scripts/Test/BuildTest.sh "build"

echo
echo "//===================="
Expand Down
10 changes: 10 additions & 0 deletions Code/TextContent/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@ add_library(TextContent STATIC
${CMAKE_CURRENT_SOURCE_DIR}/src/TextContent.cpp
)

set(FONT_INCLUDE_DIR "${CMAKE_CURRENT_BINARY_DIR}/Generated/Fonts")
set(GENERATE_FONT_SCRIPT "${PROJECT_SOURCE_DIR}/../Scripts/Fonts/GenerateFonts.sh")

execute_process(COMMAND mkdir -p ${FONT_INCLUDE_DIR})
execute_process(COMMAND ${GENERATE_FONT_SCRIPT} ${FONT_INCLUDE_DIR} "Bitstream Vera Sans Mono" 8)
execute_process(COMMAND ${GENERATE_FONT_SCRIPT} ${FONT_INCLUDE_DIR} "Bitstream Vera Sans Mono" 12)
execute_process(COMMAND ${GENERATE_FONT_SCRIPT} ${FONT_INCLUDE_DIR} "Bitstream Vera Sans Mono" 16)

target_include_directories(TextContent PUBLIC ${FONT_INCLUDE_DIR}/../)

target_include_directories(TextContent PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
target_link_libraries(TextContent Displays)

Expand Down

This file was deleted.

Loading

0 comments on commit 3730e14

Please sign in to comment.