diff --git a/CMakeLists.txt b/CMakeLists.txt index cef0e02..16e72f0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -289,6 +289,19 @@ if(EXISTS ${InfiniTime_DIR}/src/displayapp/fonts/CMakeLists.txt) target_link_libraries(infinisim PRIVATE infinitime_fonts) endif() +if(DEFINED ENABLE_USERAPPS) + set(USERAPP_TYPES ${ENABLE_USERAPPS} CACHE STRING "List of user apps to build into the firmware") +else () + set(USERAPP_TYPES "Apps::Navigation, Apps::StopWatch, Apps::Alarm, Apps::Timer, Apps::Steps, Apps::HeartRate, Apps::Music, Apps::Paint, Apps::Paddle, Apps::Twos, Apps::Metronome" CACHE STRING "List of user apps to build into the firmware") +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/README.md b/README.md index 402e96e..5b46574 100644 --- a/README.md +++ b/README.md @@ -84,7 +84,8 @@ The following configuration settings can be added to the first `cmake -S . -B bu - `-DWITH_PNG=ON`: enable/disable the screenshot to `PNG` support. 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`. + 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