From aa1f17745fd73a3ebed91ccc12772a27ddc2eb78 Mon Sep 17 00:00:00 2001 From: Juraj Michalek Date: Mon, 19 Aug 2024 13:10:18 +0200 Subject: [PATCH] update to Component Manager 2.x --- CMakeLists.txt | 17 ++--------------- apps/calculator/CMakeLists.txt | 15 +-------------- apps/calculator/main/idf_component.yml | 11 ++++++----- apps/game_of_life/CMakeLists.txt | 15 +-------------- apps/game_of_life/main/idf_component.yml | 11 ++++++----- apps/synth_piano/CMakeLists.txt | 15 +-------------- apps/synth_piano/main/idf_component.yml | 11 ++++++----- apps/tic_tac_toe/CMakeLists.txt | 15 +-------------- apps/tic_tac_toe/main/idf_component.yml | 11 ++++++----- apps/wifi_list/main/idf_component.yml | 11 ++++++----- main/idf_component.yml | 11 ++++++----- 11 files changed, 42 insertions(+), 101 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9c3e4ba..210b3c0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,23 +6,10 @@ cmake_minimum_required(VERSION 3.5) # Select board configuration based on -DBUILD_BOARD if(NOT DEFINED BUILD_BOARD) - message(FATAL_ERROR "BUILD_BOARD CMake variable is not set") + message(FATAL_ERROR "BUILD_BOARD CMake variable is not set. Use idf.py @boards/BOARD.cfg build") endif() -set(ENV{USE_ESP_BOX} "0") -set(ENV{USE_ESP_BOX_3} "0") -set(ENV{USE_M5STACK_CORE_S3} "0") -set(ENV{USE_ESP32_P4_FUNCTION_EV_BOARD} "0") - -if (BUILD_BOARD STREQUAL "esp-box") - set(ENV{USE_ESP_BOX} "esp32s3") -elseif (BUILD_BOARD STREQUAL "esp-box-3") - set(ENV{USE_ESP_BOX_3} "esp32s3") -elseif (BUILD_BOARD STREQUAL "m5stack_core_s3") - set(ENV{USE_M5STACK_CORE_S3} "esp32s3") -elseif (BUILD_BOARD STREQUAL "esp32_p4_function_ev_board") - set(ENV{USE_ESP32_P4_FUNCTION_EV_BOARD} "esp32p4") -endif() +set(ENV{BUILD_BOARD} ${BUILD_BOARD}) set(COMPONENTS main) # "Trim" the build. Include the minimal set of components; main and anything it depends on. diff --git a/apps/calculator/CMakeLists.txt b/apps/calculator/CMakeLists.txt index bed4b61..88d471b 100644 --- a/apps/calculator/CMakeLists.txt +++ b/apps/calculator/CMakeLists.txt @@ -7,20 +7,7 @@ if(NOT DEFINED BUILD_BOARD) message(FATAL_ERROR "BUILD_BOARD CMake variable is not set") endif() -set(ENV{USE_ESP_BOX} "0") -set(ENV{USE_ESP_BOX_3} "0") -set(ENV{USE_M5STACK_CORE_S3} "0") -set(ENV{USE_ESP32_P4_FUNCTION_EV_BOARD} "0") - -if (BUILD_BOARD STREQUAL "esp-box") - set(ENV{USE_ESP_BOX} "esp32s3") -elseif (BUILD_BOARD STREQUAL "esp-box-3") - set(ENV{USE_ESP_BOX_3} "esp32s3") -elseif (BUILD_BOARD STREQUAL "m5stack_core_s3") - set(ENV{USE_M5STACK_CORE_S3} "esp32s3") -elseif (BUILD_BOARD STREQUAL "esp32_p4_function_ev_board") - set(ENV{USE_ESP32_P4_FUNCTION_EV_BOARD} "esp32p4") -endif() +set(ENV{BUILD_BOARD} ${BUILD_BOARD}) include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(calculator) diff --git a/apps/calculator/main/idf_component.yml b/apps/calculator/main/idf_component.yml index b573ec3..2daba15 100644 --- a/apps/calculator/main/idf_component.yml +++ b/apps/calculator/main/idf_component.yml @@ -1,25 +1,26 @@ ## IDF Component Manager Manifest File +# Requires IDF Component Manager 2.x dependencies: espressif/esp-box-3: version: "^1.2.0" rules: - - if: "target == ${USE_ESP_BOX_3}" + - if: "${BUILD_BOARD} == esp-box-3" espressif/esp-box: version: "3.1.0" rules: - - if: "target == ${USE_ESP_BOX}" + - if: "${BUILD_BOARD} == esp-box" espressif/m5stack_core_s3: version: "1.1.1" rules: - - if: "target == ${USE_M5STACK_CORE_S3}" + - if: "${BUILD_BOARD} == m5stack_core_s3" espressif/esp32_p4_function_ev_board: version: "2.0.0" rules: - - if: "target == ${USE_ESP32_P4_FUNCTION_EV_BOARD}" + - if: "${BUILD_BOARD} == esp32_p4_function_ev_board" # Workaround for i2c: CONFLICT! driver_ng is not allowed to be used with this old driver esp_codec_dev: public: true version: "==1.1.0" ## Required IDF version idf: - version: ">=5.0.0" \ No newline at end of file + version: ">=5.0.0" diff --git a/apps/game_of_life/CMakeLists.txt b/apps/game_of_life/CMakeLists.txt index 896f360..83ffbd0 100644 --- a/apps/game_of_life/CMakeLists.txt +++ b/apps/game_of_life/CMakeLists.txt @@ -7,20 +7,7 @@ if(NOT DEFINED BUILD_BOARD) message(FATAL_ERROR "BUILD_BOARD CMake variable is not set") endif() -set(ENV{USE_ESP_BOX} "0") -set(ENV{USE_ESP_BOX_3} "0") -set(ENV{USE_M5STACK_CORE_S3} "0") -set(ENV{USE_ESP32_P4_FUNCTION_EV_BOARD} "0") - -if (BUILD_BOARD STREQUAL "esp-box") - set(ENV{USE_ESP_BOX} "esp32s3") -elseif (BUILD_BOARD STREQUAL "esp-box-3") - set(ENV{USE_ESP_BOX_3} "esp32s3") -elseif (BUILD_BOARD STREQUAL "m5stack_core_s3") - set(ENV{USE_M5STACK_CORE_S3} "esp32s3") -elseif (BUILD_BOARD STREQUAL "esp32_p4_function_ev_board") - set(ENV{USE_ESP32_P4_FUNCTION_EV_BOARD} "esp32p4") -endif() +set(ENV{BUILD_BOARD} ${BUILD_BOARD}) include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(game_of_life) diff --git a/apps/game_of_life/main/idf_component.yml b/apps/game_of_life/main/idf_component.yml index b573ec3..2daba15 100644 --- a/apps/game_of_life/main/idf_component.yml +++ b/apps/game_of_life/main/idf_component.yml @@ -1,25 +1,26 @@ ## IDF Component Manager Manifest File +# Requires IDF Component Manager 2.x dependencies: espressif/esp-box-3: version: "^1.2.0" rules: - - if: "target == ${USE_ESP_BOX_3}" + - if: "${BUILD_BOARD} == esp-box-3" espressif/esp-box: version: "3.1.0" rules: - - if: "target == ${USE_ESP_BOX}" + - if: "${BUILD_BOARD} == esp-box" espressif/m5stack_core_s3: version: "1.1.1" rules: - - if: "target == ${USE_M5STACK_CORE_S3}" + - if: "${BUILD_BOARD} == m5stack_core_s3" espressif/esp32_p4_function_ev_board: version: "2.0.0" rules: - - if: "target == ${USE_ESP32_P4_FUNCTION_EV_BOARD}" + - if: "${BUILD_BOARD} == esp32_p4_function_ev_board" # Workaround for i2c: CONFLICT! driver_ng is not allowed to be used with this old driver esp_codec_dev: public: true version: "==1.1.0" ## Required IDF version idf: - version: ">=5.0.0" \ No newline at end of file + version: ">=5.0.0" diff --git a/apps/synth_piano/CMakeLists.txt b/apps/synth_piano/CMakeLists.txt index 4f548d7..68a7bff 100644 --- a/apps/synth_piano/CMakeLists.txt +++ b/apps/synth_piano/CMakeLists.txt @@ -7,20 +7,7 @@ if(NOT DEFINED BUILD_BOARD) message(FATAL_ERROR "BUILD_BOARD CMake variable is not set") endif() -set(ENV{USE_ESP_BOX} "0") -set(ENV{USE_ESP_BOX_3} "0") -set(ENV{USE_M5STACK_CORE_S3} "0") -set(ENV{USE_ESP32_P4_FUNCTION_EV_BOARD} "0") - -if (BUILD_BOARD STREQUAL "esp-box") - set(ENV{USE_ESP_BOX} "esp32s3") -elseif (BUILD_BOARD STREQUAL "esp-box-3") - set(ENV{USE_ESP_BOX_3} "esp32s3") -elseif (BUILD_BOARD STREQUAL "m5stack_core_s3") - set(ENV{USE_M5STACK_CORE_S3} "esp32s3") -elseif (BUILD_BOARD STREQUAL "esp32_p4_function_ev_board") - set(ENV{USE_ESP32_P4_FUNCTION_EV_BOARD} "esp32p4") -endif() +set(ENV{BUILD_BOARD} ${BUILD_BOARD}) include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(synth_piano) diff --git a/apps/synth_piano/main/idf_component.yml b/apps/synth_piano/main/idf_component.yml index b573ec3..2daba15 100644 --- a/apps/synth_piano/main/idf_component.yml +++ b/apps/synth_piano/main/idf_component.yml @@ -1,25 +1,26 @@ ## IDF Component Manager Manifest File +# Requires IDF Component Manager 2.x dependencies: espressif/esp-box-3: version: "^1.2.0" rules: - - if: "target == ${USE_ESP_BOX_3}" + - if: "${BUILD_BOARD} == esp-box-3" espressif/esp-box: version: "3.1.0" rules: - - if: "target == ${USE_ESP_BOX}" + - if: "${BUILD_BOARD} == esp-box" espressif/m5stack_core_s3: version: "1.1.1" rules: - - if: "target == ${USE_M5STACK_CORE_S3}" + - if: "${BUILD_BOARD} == m5stack_core_s3" espressif/esp32_p4_function_ev_board: version: "2.0.0" rules: - - if: "target == ${USE_ESP32_P4_FUNCTION_EV_BOARD}" + - if: "${BUILD_BOARD} == esp32_p4_function_ev_board" # Workaround for i2c: CONFLICT! driver_ng is not allowed to be used with this old driver esp_codec_dev: public: true version: "==1.1.0" ## Required IDF version idf: - version: ">=5.0.0" \ No newline at end of file + version: ">=5.0.0" diff --git a/apps/tic_tac_toe/CMakeLists.txt b/apps/tic_tac_toe/CMakeLists.txt index eb705c3..b123feb 100644 --- a/apps/tic_tac_toe/CMakeLists.txt +++ b/apps/tic_tac_toe/CMakeLists.txt @@ -7,20 +7,7 @@ if(NOT DEFINED BUILD_BOARD) message(FATAL_ERROR "BUILD_BOARD CMake variable is not set") endif() -set(ENV{USE_ESP_BOX} "0") -set(ENV{USE_ESP_BOX_3} "0") -set(ENV{USE_M5STACK_CORE_S3} "0") -set(ENV{USE_ESP32_P4_FUNCTION_EV_BOARD} "0") - -if (BUILD_BOARD STREQUAL "esp-box") - set(ENV{USE_ESP_BOX} "esp32s3") -elseif (BUILD_BOARD STREQUAL "esp-box-3") - set(ENV{USE_ESP_BOX_3} "esp32s3") -elseif (BUILD_BOARD STREQUAL "m5stack_core_s3") - set(ENV{USE_M5STACK_CORE_S3} "esp32s3") -elseif (BUILD_BOARD STREQUAL "esp32_p4_function_ev_board") - set(ENV{USE_ESP32_P4_FUNCTION_EV_BOARD} "esp32p4") -endif() +set(ENV{BUILD_BOARD} ${BUILD_BOARD}) include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(tic_tac_toe) diff --git a/apps/tic_tac_toe/main/idf_component.yml b/apps/tic_tac_toe/main/idf_component.yml index b573ec3..2daba15 100644 --- a/apps/tic_tac_toe/main/idf_component.yml +++ b/apps/tic_tac_toe/main/idf_component.yml @@ -1,25 +1,26 @@ ## IDF Component Manager Manifest File +# Requires IDF Component Manager 2.x dependencies: espressif/esp-box-3: version: "^1.2.0" rules: - - if: "target == ${USE_ESP_BOX_3}" + - if: "${BUILD_BOARD} == esp-box-3" espressif/esp-box: version: "3.1.0" rules: - - if: "target == ${USE_ESP_BOX}" + - if: "${BUILD_BOARD} == esp-box" espressif/m5stack_core_s3: version: "1.1.1" rules: - - if: "target == ${USE_M5STACK_CORE_S3}" + - if: "${BUILD_BOARD} == m5stack_core_s3" espressif/esp32_p4_function_ev_board: version: "2.0.0" rules: - - if: "target == ${USE_ESP32_P4_FUNCTION_EV_BOARD}" + - if: "${BUILD_BOARD} == esp32_p4_function_ev_board" # Workaround for i2c: CONFLICT! driver_ng is not allowed to be used with this old driver esp_codec_dev: public: true version: "==1.1.0" ## Required IDF version idf: - version: ">=5.0.0" \ No newline at end of file + version: ">=5.0.0" diff --git a/apps/wifi_list/main/idf_component.yml b/apps/wifi_list/main/idf_component.yml index b573ec3..2daba15 100644 --- a/apps/wifi_list/main/idf_component.yml +++ b/apps/wifi_list/main/idf_component.yml @@ -1,25 +1,26 @@ ## IDF Component Manager Manifest File +# Requires IDF Component Manager 2.x dependencies: espressif/esp-box-3: version: "^1.2.0" rules: - - if: "target == ${USE_ESP_BOX_3}" + - if: "${BUILD_BOARD} == esp-box-3" espressif/esp-box: version: "3.1.0" rules: - - if: "target == ${USE_ESP_BOX}" + - if: "${BUILD_BOARD} == esp-box" espressif/m5stack_core_s3: version: "1.1.1" rules: - - if: "target == ${USE_M5STACK_CORE_S3}" + - if: "${BUILD_BOARD} == m5stack_core_s3" espressif/esp32_p4_function_ev_board: version: "2.0.0" rules: - - if: "target == ${USE_ESP32_P4_FUNCTION_EV_BOARD}" + - if: "${BUILD_BOARD} == esp32_p4_function_ev_board" # Workaround for i2c: CONFLICT! driver_ng is not allowed to be used with this old driver esp_codec_dev: public: true version: "==1.1.0" ## Required IDF version idf: - version: ">=5.0.0" \ No newline at end of file + version: ">=5.0.0" diff --git a/main/idf_component.yml b/main/idf_component.yml index b573ec3..2daba15 100644 --- a/main/idf_component.yml +++ b/main/idf_component.yml @@ -1,25 +1,26 @@ ## IDF Component Manager Manifest File +# Requires IDF Component Manager 2.x dependencies: espressif/esp-box-3: version: "^1.2.0" rules: - - if: "target == ${USE_ESP_BOX_3}" + - if: "${BUILD_BOARD} == esp-box-3" espressif/esp-box: version: "3.1.0" rules: - - if: "target == ${USE_ESP_BOX}" + - if: "${BUILD_BOARD} == esp-box" espressif/m5stack_core_s3: version: "1.1.1" rules: - - if: "target == ${USE_M5STACK_CORE_S3}" + - if: "${BUILD_BOARD} == m5stack_core_s3" espressif/esp32_p4_function_ev_board: version: "2.0.0" rules: - - if: "target == ${USE_ESP32_P4_FUNCTION_EV_BOARD}" + - if: "${BUILD_BOARD} == esp32_p4_function_ev_board" # Workaround for i2c: CONFLICT! driver_ng is not allowed to be used with this old driver esp_codec_dev: public: true version: "==1.1.0" ## Required IDF version idf: - version: ">=5.0.0" \ No newline at end of file + version: ">=5.0.0"