remove desktop build (for now)

Signed-off-by: Peter Siegmund <developer@mars3142.org>
This commit is contained in:
2025-09-11 10:47:43 +02:00
parent 9612e53ca4
commit e89493e42d
7 changed files with 44 additions and 221 deletions

View File

@@ -1,106 +1,5 @@
cmake_minimum_required(VERSION 3.30)
if (DEFINED ENV{IDF_PATH})
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(system_control)
return()
else ()
set(MAJOR_VERSION 0)
set(MINOR_VERSION 0)
set(MICRO_VERSION 1)
project(
SystemControl
LANGUAGES CXX C
VERSION "${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}"
)
set(CMAKE_C_STANDARD 23)
set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD_REQUIRED YES)
set(CMAKE_CXX_EXTENSIONS YES)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_INCLUDE_PATH include)
set(CMAKE_SOURCE_DIR src)
set(CMAKE_MODULE_PATH cmake)
include(FetchContent)
function(include_dependency libName gitURL gitTag)
FetchContent_Declare(${libName}
GIT_REPOSITORY ${gitURL}
GIT_TAG ${gitTag}
GIT_SHALLOW TRUE
GIT_PROGRESS FALSE
)
FetchContent_MakeAvailable(${libName})
endfunction()
include_dependency(SDL3 https://github.com/libsdl-org/SDL release-3.2.x)
include_dependency(SDL_image https://github.com/libsdl-org/SDL_image release-3.2.x)
include_dependency(SDL_ttf https://github.com/libsdl-org/SDL_ttf release-3.2.x)
include_dependency(u8g2 https://github.com/olikraus/u8g2 master)
add_subdirectory(components)
configure_file(
"${CMAKE_SOURCE_DIR}/Version.h.in"
"${CMAKE_SOURCE_DIR}/Version.h"
)
include_directories(
${CMAKE_INCLUDE_PATH}
${CMAKE_SOURCE_DIR}
${PROJECT_BINARY_DIR}/src
)
add_executable(${PROJECT_NAME}
WIN32 MACOSX_BUNDLE
${CMAKE_SOURCE_DIR}/main.cpp
${CMAKE_SOURCE_DIR}/Common.cpp
${CMAKE_SOURCE_DIR}/debug/debug_overlay.cpp
${CMAKE_SOURCE_DIR}/hal/u8x8_hal_sdl.cpp
${CMAKE_SOURCE_DIR}/manager/ResourceManager.cpp
${CMAKE_SOURCE_DIR}/model/AppContext.cpp
${CMAKE_SOURCE_DIR}/model/Window.cpp
${CMAKE_SOURCE_DIR}/ui/Device.cpp
${CMAKE_SOURCE_DIR}/ui/UIWidget.cpp
${CMAKE_SOURCE_DIR}/ui/widgets/Button.cpp
${CMAKE_SOURCE_DIR}/ui/widgets/D_Pad.cpp
)
if (APPLE)
# copy assets to bundle directory
set(ASSETS_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/assets)
set(ASSETS_DEST_DIR $<TARGET_BUNDLE_DIR:${PROJECT_NAME}>/Contents/Resources)
if (EXISTS ${ASSETS_SRC_DIR})
add_custom_command(
TARGET ${PROJECT_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory ${ASSETS_SRC_DIR} ${ASSETS_DEST_DIR}
COMMENT "Copying assets to bundle via custom command"
VERBATIM
)
else ()
message(WARNING "Assets source directory ${ASSETS_SRC_DIR} does not exist. Skipping custom command.")
endif ()
elseif (WINDOWS)
add_custom_command(
TARGET ${PROJECT_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
${PROJECT_SOURCE_DIR}/assets ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/assets
)
endif ()
target_compile_definitions(${PROJECT_NAME} PRIVATE SDL_MAIN_USE_CALLBACKS)
target_link_libraries(${PROJECT_NAME} PRIVATE
ImGui
insa
led-manager
persistence-manager
SDL3::SDL3
SDL3_image::SDL3_image
SDL3_ttf::SDL3_ttf
u8g2
)
endif ()
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(system_control)
return()

View File

@@ -1,10 +0,0 @@
if (NOT DEFINED ENV{IDF_PATH})
add_library(components INTERFACE)
add_subdirectory(imgui)
add_subdirectory(insa)
add_subdirectory(led-manager)
add_subdirectory(persistence-manager)
target_link_libraries(components INTERFACE ImGui)
endif ()

View File

@@ -1,10 +1,7 @@
if (DEFINED ENV{IDF_PATH})
idf_component_register(SRCS
src/ble_manager.c
INCLUDE_DIRS "include"
PRIV_REQUIRES
bt
nvs_flash
)
return()
endif ()
idf_component_register(SRCS
src/ble_manager.c
INCLUDE_DIRS "include"
PRIV_REQUIRES
bt
nvs_flash
)

View File

@@ -1,44 +1,19 @@
# Define the source files in a variable
set(SOURCE_FILES
src/common/InactivityTracker.cpp
src/common/Menu.cpp
src/common/ScrollBar.cpp
src/common/Widget.cpp
src/data/MenuItem.cpp
src/ui/LightMenu.cpp
src/ui/LightSettingsMenu.cpp
src/ui/MainMenu.cpp
src/ui/ClockScreenSaver.cpp
src/ui/ScreenSaver.cpp
src/ui/SettingsMenu.cpp
src/ui/SplashScreen.cpp
idf_component_register(SRCS
src/common/InactivityTracker.cpp
src/common/Menu.cpp
src/common/ScrollBar.cpp
src/common/Widget.cpp
src/data/MenuItem.cpp
src/ui/LightMenu.cpp
src/ui/LightSettingsMenu.cpp
src/ui/MainMenu.cpp
src/ui/ClockScreenSaver.cpp
src/ui/ScreenSaver.cpp
src/ui/SettingsMenu.cpp
src/ui/SplashScreen.cpp
INCLUDE_DIRS "include"
PRIV_REQUIRES
u8g2
led-manager
persistence-manager
)
if (DEFINED ENV{IDF_PATH})
idf_component_register(SRCS
${SOURCE_FILES}
INCLUDE_DIRS "include"
PRIV_REQUIRES
u8g2
led-manager
persistence-manager
)
return()
endif ()
cmake_minimum_required(VERSION 3.30)
project(insa)
add_library(${PROJECT_NAME} STATIC
${SOURCE_FILES}
)
include_directories(include)
target_include_directories(${PROJECT_NAME} PUBLIC include)
target_link_libraries(${PROJECT_NAME} PRIVATE
u8g2
led-manager
persistence-manager
)

View File

@@ -1,30 +1,10 @@
if (DEFINED ENV{IDF_PATH})
idf_component_register(SRCS
src/hal_esp32/led_manager.cpp
src/hal_esp32/led_status.cpp
INCLUDE_DIRS "include"
PRIV_REQUIRES
u8g2
esp_event
esp_timer
persistence-manager
)
return()
endif ()
cmake_minimum_required(VERSION 3.30)
project(led-manager)
add_library(${PROJECT_NAME} STATIC
src/hal_native/led_manager.cpp
src/hal_native/Matrix.cpp
)
include_directories(include)
target_include_directories(${PROJECT_NAME} PUBLIC include)
target_link_libraries(${PROJECT_NAME} PRIVATE
SDL3::SDL3
persistence-manager
idf_component_register(SRCS
src/hal_esp32/led_manager.cpp
src/hal_esp32/led_status.cpp
INCLUDE_DIRS "include"
PRIV_REQUIRES
u8g2
esp_event
esp_timer
persistence-manager
)

View File

@@ -20,7 +20,7 @@ uint64_t wled_init(void)
{
led_strip_config_t strip_config = {
.strip_gpio_num = CONFIG_WLED_DIN_PIN,
.max_leds = 64,
.max_leds = 500,
.led_model = LED_MODEL_WS2812,
.color_component_format = LED_STRIP_COLOR_COMPONENT_FMT_GRB,
.flags =
@@ -55,7 +55,7 @@ void event_handler(void *arg, esp_event_base_t base, int32_t id, void *event_dat
if (id == EVENT_LED_ON || id == EVENT_LED_OFF)
{
auto brightness = (id == EVENT_LED_ON) ? value : 0;
for (uint32_t i = 0; i < 64; i++)
for (uint32_t i = 0; i < 500; i++)
{
led_strip_set_pixel(led_strip, i, brightness, brightness, brightness);
}

View File

@@ -1,24 +1,6 @@
if (DEFINED ENV{IDF_PATH})
idf_component_register(SRCS
src/hal_esp32/PersistenceManager.cpp
INCLUDE_DIRS "include"
REQUIRES
nvs_flash
)
return()
endif ()
cmake_minimum_required(VERSION 3.30)
project(persistence-manager)
add_library(${PROJECT_NAME} STATIC
src/hal_native/PersistenceManager.cpp
)
include_directories(include)
target_include_directories(${PROJECT_NAME} PUBLIC include)
target_link_libraries(${PROJECT_NAME} PRIVATE
SDL3::SDL3
idf_component_register(SRCS
src/hal_esp32/PersistenceManager.cpp
INCLUDE_DIRS "include"
REQUIRES
nvs_flash
)