From 1ad78400727871a4b8dbfe90ef52c7be998c1518 Mon Sep 17 00:00:00 2001 From: Jean-François Milants Date: Tue, 19 Dec 2023 16:37:04 +0100 Subject: Watch face selection at build time Replace the options that allowed to select the user apps independently by a single string variable that contains the ordered list of apps to build. --- CMakeLists.txt | 40 ++++++---------------------------------- 1 file changed, 6 insertions(+), 34 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index c5d30874..1537bda6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,18 +34,11 @@ endif() set(TARGET_DEVICE "PINETIME" CACHE STRING "Target device") set_property(CACHE TARGET_DEVICE PROPERTY STRINGS PINETIME MOY_TFK5 MOY_TIN5 MOY_TON5 MOY_UNK) -option(ENABLE_APP_STOPWATCH "Enable the Stopwatch application" True) -option(ENABLE_APP_ALARM "Enable the Alarm application" True) -option(ENABLE_APP_TIMER "Enable the Timer application" True) -option(ENABLE_APP_STEPS "Enable the Steps application" True) -option(ENABLE_APP_HEARTRATE "Enable the HeartRate application" True) -option(ENABLE_APP_MUSIC "Enable the Music application" True) -option(ENABLE_APP_PAINT "Enable the Paint application" True) -option(ENABLE_APP_PADDLE "Enable the Paddle game" True) -option(ENABLE_APP_TWOS "Enable the Twos game" True) -option(ENABLE_APP_METRONOME "Enable the Metronome application" True) -option(ENABLE_APP_NAVIGATION "Enable the Navigation application" True) -option(ENABLE_APP_MOTION "Enable the Motion application" False) +if(ENABLE_USERAPPS) + set(USERAPP_TYPES ${ENABLE_USERAPPS}) +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") +endif () set(PROJECT_GIT_COMMIT_HASH "") @@ -77,34 +70,13 @@ if(BUILD_RESOURCES) else() message(" * Build resources : Disabled") endif() +message(" * User apps : " ${USERAPP_TYPES}) set(VERSION_EDIT_WARNING "// Do not edit this file, it is automatically generated by CMAKE!") configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/Version.h.in ${CMAKE_CURRENT_BINARY_DIR}/src/Version.h) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/docker/post_build.sh.in ${CMAKE_CURRENT_BINARY_DIR}/post_build.sh) -function(AddToListIfEnabled list enabled type) - if(${enabled}) - list(APPEND ${list} ${type}) - endif () - #return(PROPAGATE ${list}) - set(${list} "${${list}}" PARENT_SCOPE) -endfunction() - # Generate the list of user apps to be compiled into the firmware -AddToListIfEnabled(USERAPP_TYPES_LIST ${ENABLE_APP_STOPWATCH} "Apps::StopWatch") -AddToListIfEnabled(USERAPP_TYPES_LIST ${ENABLE_APP_ALARM} "Apps::Alarm") -AddToListIfEnabled(USERAPP_TYPES_LIST ${ENABLE_APP_TIMER} "Apps::Timer") -AddToListIfEnabled(USERAPP_TYPES_LIST ${ENABLE_APP_STEPS} "Apps::Steps") -AddToListIfEnabled(USERAPP_TYPES_LIST ${ENABLE_APP_HEARTRATE} "Apps::HeartRate") -AddToListIfEnabled(USERAPP_TYPES_LIST ${ENABLE_APP_MUSIC} "Apps::Music") -AddToListIfEnabled(USERAPP_TYPES_LIST ${ENABLE_APP_PAINT} "Apps::Paint") -AddToListIfEnabled(USERAPP_TYPES_LIST ${ENABLE_APP_PADDLE} "Apps::Paddle") -AddToListIfEnabled(USERAPP_TYPES_LIST ${ENABLE_APP_TWOS} "Apps::Twos") -AddToListIfEnabled(USERAPP_TYPES_LIST ${ENABLE_APP_METRONOME} "Apps::Metronome") -AddToListIfEnabled(USERAPP_TYPES_LIST ${ENABLE_APP_NAVIGATION} "Apps::Navigation") -AddToListIfEnabled(USERAPP_TYPES_LIST ${ENABLE_APP_MOTION} "Apps::Motion") - -list(JOIN USERAPP_TYPES_LIST "," USERAPP_TYPES) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/displayapp/Apps.h.in ${CMAKE_CURRENT_BINARY_DIR}/src/displayapp/Apps.h) add_subdirectory(src) -- cgit v1.2.3-70-g09d2