mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
cmake: Add missing example CMakeLists.txt files, CI check all examples have both
This commit is contained in:
parent
49a910adfb
commit
5689e446dc
@ -519,6 +519,20 @@ check_permissions:
|
||||
script:
|
||||
- tools/ci/check-executable.sh
|
||||
|
||||
check_examples_cmake_make:
|
||||
stage: deploy
|
||||
image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
|
||||
tags:
|
||||
- build
|
||||
except:
|
||||
- master
|
||||
- /^release\/v/
|
||||
- /^v\d+\.\d+(\.\d+)?($|-)/
|
||||
dependencies: []
|
||||
before_script: *do_nothing_before
|
||||
script:
|
||||
- tools/ci/check_examples_cmake_make.sh
|
||||
|
||||
check_submodule_sync:
|
||||
stage: deploy
|
||||
image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
|
||||
|
12
examples/bluetooth/a2dp_gatts_coex/CMakeLists.txt
Normal file
12
examples/bluetooth/a2dp_gatts_coex/CMakeLists.txt
Normal file
@ -0,0 +1,12 @@
|
||||
# The following lines of boilerplate have to be in your project's
|
||||
# CMakeLists in this exact order for cmake to work correctly
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
set(MAIN_SRCS
|
||||
main/bt_app_av.c
|
||||
main/bt_app_core.c
|
||||
main/main.c
|
||||
)
|
||||
|
||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||
project(bt_ble_coex)
|
11
examples/bluetooth/ble_hid_device_demo/CMakeLists.txt
Normal file
11
examples/bluetooth/ble_hid_device_demo/CMakeLists.txt
Normal file
@ -0,0 +1,11 @@
|
||||
# The following four lines of boilerplate have to be in your project's CMakeLists
|
||||
# in this exact order for cmake to work correctly
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
set(MAIN_SRCS main/ble_hidd_demo_main.c
|
||||
main/hid_dev.c
|
||||
main/hid_device_le_prf.c
|
||||
main/esp_hidd_prf_api.c)
|
||||
|
||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||
project(hidd_demos)
|
5
examples/get-started/hello_world/partitions.csv
Normal file
5
examples/get-started/hello_world/partitions.csv
Normal file
@ -0,0 +1,5 @@
|
||||
# Name, Type, SubType, Offset, Size, Flags
|
||||
# Note: if you change the phy_init or app partition offset, make sure to change the offset in Kconfig.projbuild
|
||||
nvs, data, nvs, , 0x6000,
|
||||
phy_init, data, phy, , 0x1000,
|
||||
factory, app, factory, , 1M,
|
|
@ -0,0 +1,8 @@
|
||||
# The following four lines of boilerplate have to be in your project's CMakeLists
|
||||
# in this exact order for cmake to work correctly
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
set(MAIN_SRCS main/can_alert_and_recovery_example_main.c)
|
||||
|
||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||
project(can_alert_and_recovery_example)
|
@ -0,0 +1,8 @@
|
||||
# The following four lines of boilerplate have to be in your project's CMakeLists
|
||||
# in this exact order for cmake to work correctly
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
set(MAIN_SRCS main/can_network_example_listen_only_main.c)
|
||||
|
||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||
project(can_network_listen_only)
|
@ -0,0 +1,8 @@
|
||||
# The following four lines of boilerplate have to be in your project's CMakeLists
|
||||
# in this exact order for cmake to work correctly
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
set(MAIN_SRCS main/can_network_example_master_main.c)
|
||||
|
||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||
project(can_network_master)
|
@ -0,0 +1,8 @@
|
||||
# The following four lines of boilerplate have to be in your project's CMakeLists
|
||||
# in this exact order for cmake to work correctly
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
set(MAIN_SRCS main/can_network_example_slave_main.c)
|
||||
|
||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||
project(can_network_slave)
|
8
examples/peripherals/can/can_self_test/CMakeLists.txt
Normal file
8
examples/peripherals/can/can_self_test/CMakeLists.txt
Normal file
@ -0,0 +1,8 @@
|
||||
# The following four lines of boilerplate have to be in your project's CMakeLists
|
||||
# in this exact order for cmake to work correctly
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
set(MAIN_SRCS main/can_self_test_example_main.c)
|
||||
|
||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||
project(can_self_test_example)
|
@ -0,0 +1,8 @@
|
||||
# The following four lines of boilerplate have to be in your project's CMakeLists
|
||||
# in this exact order for cmake to work correctly
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
set(MAIN_SRCS main/mcpwm_basic_config_example.c)
|
||||
|
||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||
project(mcpwm_basic_config)
|
@ -0,0 +1,8 @@
|
||||
# The following four lines of boilerplate have to be in your project's CMakeLists
|
||||
# in this exact order for cmake to work correctly
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
set(MAIN_SRCS main/mcpwm_bldc_control_hall_sensor_example.c)
|
||||
|
||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||
project(mcpwm_bldc_control_hall_sensor)
|
@ -0,0 +1,8 @@
|
||||
# The following four lines of boilerplate have to be in your project's CMakeLists
|
||||
# in this exact order for cmake to work correctly
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
set(MAIN_SRCS main/mcpwm_brushed_dc_control_example.c)
|
||||
|
||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||
project(mcpwm_brushed_dc_control)
|
@ -0,0 +1,8 @@
|
||||
# The following four lines of boilerplate have to be in your project's CMakeLists
|
||||
# in this exact order for cmake to work correctly
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
set(MAIN_SRCS main/mcpwm_servo_control_example.c)
|
||||
|
||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||
project(mcpwm_servo_control)
|
@ -2,7 +2,7 @@
|
||||
# in this exact order for cmake to work correctly
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
set(MAIN_SRCS main/ota_example_main.c)
|
||||
set(MAIN_SRCS main/app_main.c)
|
||||
|
||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||
project(ota)
|
||||
project(sdio_host)
|
@ -0,0 +1,6 @@
|
||||
set(COMPONENT_SRCDIRS ".")
|
||||
set(COMPONENT_ADD_INCLUDEDIRS "include")
|
||||
|
||||
set(COMPONENT_REQUIRES driver sdmmc)
|
||||
|
||||
register_component()
|
8
examples/peripherals/sdio/slave/CMakeLists.txt
Normal file
8
examples/peripherals/sdio/slave/CMakeLists.txt
Normal file
@ -0,0 +1,8 @@
|
||||
# The following four lines of boilerplate have to be in your project's CMakeLists
|
||||
# in this exact order for cmake to work correctly
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
set(MAIN_SRCS main/app_main.c)
|
||||
|
||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||
project(sdio_slave)
|
8
examples/peripherals/spi_slave/receiver/CMakeLists.txt
Normal file
8
examples/peripherals/spi_slave/receiver/CMakeLists.txt
Normal file
@ -0,0 +1,8 @@
|
||||
# The following four lines of boilerplate have to be in your project's CMakeLists
|
||||
# in this exact order for cmake to work correctly
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
set(MAIN_SRCS main/app_main.c)
|
||||
|
||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||
project(spi-slave-receiver)
|
8
examples/peripherals/spi_slave/sender/CMakeLists.txt
Normal file
8
examples/peripherals/spi_slave/sender/CMakeLists.txt
Normal file
@ -0,0 +1,8 @@
|
||||
# The following four lines of boilerplate have to be in your project's CMakeLists
|
||||
# in this exact order for cmake to work correctly
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
set(MAIN_SRCS main/app_main.c)
|
||||
|
||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||
project(spi-slave-sender)
|
8
examples/peripherals/uart_echo_rs485/CMakeLists.txt
Normal file
8
examples/peripherals/uart_echo_rs485/CMakeLists.txt
Normal file
@ -0,0 +1,8 @@
|
||||
# The following four lines of boilerplate have to be in your project's CMakeLists
|
||||
# in this exact order for cmake to work correctly
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
set(MAIN_SRCS main/rs485_example.c)
|
||||
|
||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||
project(echo_rs485)
|
8
examples/protocols/asio/chat_client/CMakeLists.txt
Normal file
8
examples/protocols/asio/chat_client/CMakeLists.txt
Normal file
@ -0,0 +1,8 @@
|
||||
# The following four lines of boilerplate have to be in your project's CMakeLists
|
||||
# in this exact order for cmake to work correctly
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
set(MAIN_SRCS main/chat_client.cpp)
|
||||
|
||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||
project(asio_chat_client)
|
@ -0,0 +1,5 @@
|
||||
set(COMPONENT_SRCDIRS ".")
|
||||
|
||||
set(COMPONENT_PRIV_REQUIRES asio nvs_flash console)
|
||||
|
||||
register_component()
|
8
examples/protocols/asio/chat_server/CMakeLists.txt
Normal file
8
examples/protocols/asio/chat_server/CMakeLists.txt
Normal file
@ -0,0 +1,8 @@
|
||||
# The following four lines of boilerplate have to be in your project's CMakeLists
|
||||
# in this exact order for cmake to work correctly
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
set(MAIN_SRCS main/chat_server.cpp)
|
||||
|
||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||
project(asio_chat_server)
|
@ -0,0 +1,5 @@
|
||||
set(COMPONENT_SRCDIRS ".")
|
||||
|
||||
set(COMPONENT_PRIV_REQUIRES asio nvs_flash console)
|
||||
|
||||
register_component()
|
8
examples/protocols/asio/tcp_echo_server/CMakeLists.txt
Normal file
8
examples/protocols/asio/tcp_echo_server/CMakeLists.txt
Normal file
@ -0,0 +1,8 @@
|
||||
# The following four lines of boilerplate have to be in your project's CMakeLists
|
||||
# in this exact order for cmake to work correctly
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
set(MAIN_SRCS main/echo_server.cpp)
|
||||
|
||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||
project(asio_tcp_echo_server)
|
@ -0,0 +1,5 @@
|
||||
set(COMPONENT_SRCDIRS ".")
|
||||
|
||||
set(COMPONENT_PRIV_REQUIRES asio nvs_flash console)
|
||||
|
||||
register_component()
|
8
examples/protocols/asio/udp_echo_server/CMakeLists.txt
Normal file
8
examples/protocols/asio/udp_echo_server/CMakeLists.txt
Normal file
@ -0,0 +1,8 @@
|
||||
# The following four lines of boilerplate have to be in your project's CMakeLists
|
||||
# in this exact order for cmake to work correctly
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
set(MAIN_SRCS main/udp_echo_server.cpp)
|
||||
|
||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||
project(asio_udp_echo_server)
|
@ -0,0 +1,5 @@
|
||||
set(COMPONENT_SRCDIRS ".")
|
||||
|
||||
set(COMPONENT_PRIV_REQUIRES asio nvs_flash console)
|
||||
|
||||
register_component()
|
10
examples/protocols/http_server/advanced_tests/CMakeLists.txt
Normal file
10
examples/protocols/http_server/advanced_tests/CMakeLists.txt
Normal file
@ -0,0 +1,10 @@
|
||||
# The following four lines of boilerplate have to be in your project's CMakeLists
|
||||
# in this exact order for cmake to work correctly
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
set(MAIN_SRCS main/tests.c main/main.c)
|
||||
|
||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||
project(tests)
|
||||
|
||||
target_include_directories(tests.elf PRIVATE main/include)
|
@ -0,0 +1,9 @@
|
||||
# The following four lines of boilerplate have to be in your project's CMakeLists
|
||||
# in this exact order for cmake to work correctly
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
set(MAIN_SRCS main/main.c)
|
||||
|
||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||
project(persistent_sockets)
|
||||
|
10
examples/protocols/http_server/simple/CMakeLists.txt
Normal file
10
examples/protocols/http_server/simple/CMakeLists.txt
Normal file
@ -0,0 +1,10 @@
|
||||
# The following four lines of boilerplate have to be in your project's CMakeLists
|
||||
# in this exact order for cmake to work correctly
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
set(MAIN_SRCS main/main.c)
|
||||
|
||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||
project(simple)
|
||||
|
||||
|
14
examples/protocols/https_mbedtls/CMakeLists.txt
Normal file
14
examples/protocols/https_mbedtls/CMakeLists.txt
Normal file
@ -0,0 +1,14 @@
|
||||
# The following five lines of boilerplate have to be in your project's
|
||||
# CMakeLists in this exact order for cmake to work correctly
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
set(MAIN_SRCS main/https_mbedtls_example_main.c)
|
||||
|
||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||
project(https-mbedtls)
|
||||
|
||||
# Embed the server root certificate into the final binary
|
||||
#
|
||||
# (If this was a component, we would set COMPONENT_EMBED_TXTFILES here.)
|
||||
target_add_binary_data(https-mbedtls.elf
|
||||
"main/server_root_cert.pem" TEXT)
|
8
examples/system/esp_timer/CMakeLists.txt
Normal file
8
examples/system/esp_timer/CMakeLists.txt
Normal file
@ -0,0 +1,8 @@
|
||||
# The following four lines of boilerplate have to be in your project's CMakeLists
|
||||
# in this exact order for cmake to work correctly
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
set(MAIN_SRCS main/esp_timer_example_main.c)
|
||||
|
||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||
project(esp_timer_example)
|
14
examples/system/ota/native_ota_example/CMakeLists.txt
Normal file
14
examples/system/ota/native_ota_example/CMakeLists.txt
Normal file
@ -0,0 +1,14 @@
|
||||
# The following four lines of boilerplate have to be in your project's CMakeLists
|
||||
# in this exact order for cmake to work correctly
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
set(MAIN_SRCS main/native_ota_example.c)
|
||||
|
||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||
project(native_ota)
|
||||
|
||||
# Embed the server root certificate into the final binary
|
||||
#
|
||||
# (If this was a component, we would set COMPONENT_EMBED_TXTFILES here.)
|
||||
target_add_binary_data(native_ota.elf
|
||||
"../server_certs/ca_cert.pem" TEXT)
|
14
examples/system/ota/simple_ota_example/CMakeLists.txt
Normal file
14
examples/system/ota/simple_ota_example/CMakeLists.txt
Normal file
@ -0,0 +1,14 @@
|
||||
# The following four lines of boilerplate have to be in your project's CMakeLists
|
||||
# in this exact order for cmake to work correctly
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
set(MAIN_SRCS main/simple_ota_example.c)
|
||||
|
||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||
project(simple_ota)
|
||||
|
||||
# Embed the server root certificate into the final binary
|
||||
#
|
||||
# (If this was a component, we would set COMPONENT_EMBED_TXTFILES here.)
|
||||
target_add_binary_data(simple_ota.elf
|
||||
"../server_certs/ca_cert.pem" TEXT)
|
8
examples/wifi/simple_wifi/CMakeLists.txt
Normal file
8
examples/wifi/simple_wifi/CMakeLists.txt
Normal file
@ -0,0 +1,8 @@
|
||||
# The following five lines of boilerplate have to be in your project's
|
||||
# CMakeLists in this exact order for cmake to work correctly
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
set(MAIN_SRCS main/simple_wifi.c)
|
||||
|
||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||
project(simple_wifi)
|
24
tools/ci/check_examples_cmake_make.sh
Executable file
24
tools/ci/check_examples_cmake_make.sh
Executable file
@ -0,0 +1,24 @@
|
||||
#!/bin/bash
|
||||
|
||||
# While we support GNU Make & CMake together, check the same examples are present for both
|
||||
|
||||
CMAKE_EXAMPLE_PATHS=$( find ${IDF_PATH}/examples/ -type f -name CMakeLists.txt | grep -v "/components/")
|
||||
MAKE_EXAMPLE_PATHS=$( find ${IDF_PATH}/examples/ -type f -name Makefile )
|
||||
|
||||
# temporary: ignore ULP examples as no ULP toolchain support
|
||||
CMAKE_EXAMPLE_PATHS=$( echo "$CMAKE_EXAMPLE_PATHS" | grep -v "/system/ulp")
|
||||
MAKE_EXAMPLE_PATHS=$( echo "$MAKE_EXAMPLE_PATHS" | grep -v "/system/ulp")
|
||||
|
||||
CMAKE_EXAMPLE_PATHS="$(/usr/bin/dirname $CMAKE_EXAMPLE_PATHS | sort -n)"
|
||||
MAKE_EXAMPLE_PATHS="$(/usr/bin/dirname $MAKE_EXAMPLE_PATHS | sort -n)"
|
||||
|
||||
MISMATCH=$(comm -3 <(echo "$MAKE_EXAMPLE_PATHS") <(echo "$CMAKE_EXAMPLE_PATHS"))
|
||||
|
||||
if [ -n "$MISMATCH" ]; then
|
||||
echo "Some examples are not in both CMake and GNU Make:"
|
||||
echo "$MISMATCH"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Example lists match"
|
||||
exit 0
|
@ -49,6 +49,7 @@ tools/unit-test-app/unit_test.py
|
||||
tools/windows/eclipse_make.sh
|
||||
tools/ci/build_examples_cmake.sh
|
||||
tools/ci/test_build_system_cmake.sh
|
||||
tools/ci/check_examples_cmake_make.sh
|
||||
tools/cmake/convert_to_cmake.py
|
||||
tools/cmake/run_cmake_lint.sh
|
||||
tools/idf.py
|
||||
|
Loading…
Reference in New Issue
Block a user