From 46f2e0d16f0114c9deb68c5ef0bcf84219a8304c Mon Sep 17 00:00:00 2001 From: JF Date: Sat, 23 Dec 2023 21:54:05 +0100 Subject: [PATCH] User apps selection with CMake (#134) Integrate the new `infinitime_apps` library and enable user applications selection using the CMake variable `ENABLE_USERAPPS`. Update InfiniTime to after CMake user app selection merged --- CMakeLists.txt | 7 +++++++ InfiniTime | 2 +- README.md | 4 ++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f6286ce..edd6748 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -289,6 +289,13 @@ if(EXISTS ${InfiniTime_DIR}/src/displayapp/fonts/CMakeLists.txt) target_link_libraries(infinisim PRIVATE infinitime_fonts) endif() +if(EXISTS ${InfiniTime_DIR}/src/displayapp/apps/CMakeLists.txt) + # available since https://github.com/InfiniTimeOrg/InfiniTime/pull/1928 + message(STATUS "add subdirectory ${InfiniTime_DIR}/src/displayapp/apps for 'infinitime_apps' target") + add_subdirectory(${InfiniTime_DIR}/src/displayapp/apps displayapp/apps) + target_link_libraries(infinisim PRIVATE infinitime_apps) +endif() + option(BUILD_RESOURCES "Generate a resource.zip file to install to spi.raw file" ON) if(BUILD_RESOURCES) if(EXISTS ${InfiniTime_DIR}/src/resources/CMakeLists.txt) diff --git a/InfiniTime b/InfiniTime index ca7d8a6..fc5424c 160000 --- a/InfiniTime +++ b/InfiniTime @@ -1 +1 @@ -Subproject commit ca7d8a668d37d3377aeb38d122a9eccafdd6822d +Subproject commit fc5424cb72e477c5f1bbfaeddb5c50b851a965ae diff --git a/README.md b/README.md index 402e96e..4b8c1ea 100644 --- a/README.md +++ b/README.md @@ -85,6 +85,10 @@ The following configuration settings can be added to the first `cmake -S . -B bu Per default InfiniSim tries to use `libpng` to create screenshots in PNG format. This requires `libpng` development libraries as build and runtime dependency. Can be disabled with cmake config setting `-DWITH_PNG=OFF`. +- `-DENABLE_USERAPPS`: ordered list of user applications to build into InfiniTime. + Values must be fields from the enumeration `Pinetime::Applications::Apps` and must be separated by a comma. + Ex: `-DENABLE_USERAPPS="Apps::Timer, Apps::Alarm"`. + The default list of user applications will be selected if this variable is not set. ## Run Simulator