From 268e9d58468ae887121d501a392147da75cbae2d Mon Sep 17 00:00:00 2001 From: dongheng Date: Tue, 7 May 2019 14:46:24 +0800 Subject: [PATCH] feat(examples): Add cmake compiler script for examples --- examples/get-started/project_template/CMakeLists.txt | 6 ++++++ .../project_template/components/CMakeLists.txt | 3 +++ .../get-started/project_template/main/CMakeLists.txt | 3 +++ examples/peripherals/adc/CMakeLists.txt | 6 ++++++ examples/peripherals/adc/main/CMakeLists.txt | 3 +++ examples/peripherals/gpio/CMakeLists.txt | 6 ++++++ examples/peripherals/gpio/main/CMakeLists.txt | 3 +++ examples/peripherals/hw_timer/CMakeLists.txt | 6 ++++++ examples/peripherals/hw_timer/main/CMakeLists.txt | 3 +++ examples/peripherals/i2c/CMakeLists.txt | 6 ++++++ examples/peripherals/i2c/main/CMakeLists.txt | 3 +++ examples/peripherals/i2s/CMakeLists.txt | 6 ++++++ examples/peripherals/i2s/main/CMakeLists.txt | 3 +++ examples/peripherals/pwm/CMakeLists.txt | 6 ++++++ examples/peripherals/pwm/main/CMakeLists.txt | 3 +++ examples/peripherals/spi_master/CMakeLists.txt | 6 ++++++ examples/peripherals/spi_master/main/CMakeLists.txt | 3 +++ examples/peripherals/spi_oled/CMakeLists.txt | 6 ++++++ examples/peripherals/spi_oled/main/CMakeLists.txt | 3 +++ examples/peripherals/spi_slave/CMakeLists.txt | 6 ++++++ examples/peripherals/spi_slave/main/CMakeLists.txt | 3 +++ examples/peripherals/uart_echo/CMakeLists.txt | 6 ++++++ examples/peripherals/uart_echo/main/CMakeLists.txt | 3 +++ examples/peripherals/uart_events/CMakeLists.txt | 6 ++++++ examples/peripherals/uart_events/main/CMakeLists.txt | 3 +++ .../aws_iot/subscribe_publish/CMakeLists.txt | 6 ++++++ .../aws_iot/subscribe_publish/main/CMakeLists.txt | 11 +++++++++++ .../protocols/aws_iot/thing_shadow/CMakeLists.txt | 6 ++++++ .../aws_iot/thing_shadow/main/CMakeLists.txt | 11 +++++++++++ examples/protocols/coap_client/CMakeLists.txt | 2 -- examples/protocols/coap_client/main/CMakeLists.txt | 4 ++++ examples/protocols/coap_server/CMakeLists.txt | 2 -- examples/protocols/coap_server/main/CMakeLists.txt | 4 ++++ examples/protocols/esp-mqtt/ssl/sdkconfig.ci | 1 + examples/protocols/esp-mqtt/ssl/sdkconfig.defaults | 1 + .../esp-mqtt/ssl_mutual_auth/sdkconfig.defaults | 1 + examples/protocols/esp-mqtt/tcp/sdkconfig.ci | 1 + examples/protocols/esp-mqtt/tcp/sdkconfig.defaults | 1 + examples/protocols/esp-mqtt/ws/sdkconfig.ci | 1 + examples/protocols/esp-mqtt/ws/sdkconfig.defaults | 1 + examples/protocols/esp-mqtt/wss/sdkconfig.ci | 2 +- examples/protocols/esp-mqtt/wss/sdkconfig.defaults | 1 + examples/protocols/http_request/CMakeLists.txt | 6 ++++++ examples/protocols/http_request/main/CMakeLists.txt | 3 +++ .../protocols/http_server/advanced_tests/main/tests.c | 2 +- examples/protocols/https_mbedtls/CMakeLists.txt | 6 ++++++ examples/protocols/https_mbedtls/main/CMakeLists.txt | 8 ++++++++ examples/protocols/https_wolfssl/CMakeLists.txt | 6 ++++++ examples/protocols/https_wolfssl/main/CMakeLists.txt | 10 ++++++++++ examples/protocols/ibm-mqtt/CMakeLists.txt | 6 ++++++ examples/protocols/ibm-mqtt/main/CMakeLists.txt | 4 ++++ examples/protocols/mdns/CMakeLists.txt | 6 ++++++ examples/protocols/mdns/main/CMakeLists.txt | 3 +++ examples/protocols/openssl_client/CMakeLists.txt | 6 ++++++ examples/protocols/openssl_client/main/CMakeLists.txt | 8 ++++++++ examples/protocols/openssl_demo/Makefile | 2 +- examples/protocols/openssl_server/CMakeLists.txt | 6 ++++++ examples/protocols/openssl_server/main/CMakeLists.txt | 8 ++++++++ examples/protocols/sntp/CMakeLists.txt | 6 ++++++ examples/protocols/sntp/main/CMakeLists.txt | 3 +++ examples/system/ota/native_ota/CMakeLists.txt | 6 ++++++ examples/system/ota/native_ota/main/CMakeLists.txt | 4 ++++ examples/wifi/espnow/CMakeLists.txt | 6 ++++++ examples/wifi/espnow/main/CMakeLists.txt | 4 ++++ examples/wifi/simple_wifi/CMakeLists.txt | 6 ++++++ examples/wifi/simple_wifi/main/CMakeLists.txt | 3 +++ examples/wifi/smart_config/CMakeLists.txt | 6 ++++++ examples/wifi/smart_config/main/CMakeLists.txt | 3 +++ examples/wifi/sniffer/CMakeLists.txt | 6 ++++++ examples/wifi/sniffer/main/CMakeLists.txt | 3 +++ examples/wifi/wps/CMakeLists.txt | 6 ++++++ examples/wifi/wps/main/CMakeLists.txt | 3 +++ 72 files changed, 315 insertions(+), 7 deletions(-) create mode 100644 examples/get-started/project_template/CMakeLists.txt create mode 100644 examples/get-started/project_template/components/CMakeLists.txt create mode 100644 examples/get-started/project_template/main/CMakeLists.txt create mode 100644 examples/peripherals/adc/CMakeLists.txt create mode 100644 examples/peripherals/adc/main/CMakeLists.txt create mode 100644 examples/peripherals/gpio/CMakeLists.txt create mode 100644 examples/peripherals/gpio/main/CMakeLists.txt create mode 100644 examples/peripherals/hw_timer/CMakeLists.txt create mode 100644 examples/peripherals/hw_timer/main/CMakeLists.txt create mode 100644 examples/peripherals/i2c/CMakeLists.txt create mode 100644 examples/peripherals/i2c/main/CMakeLists.txt create mode 100644 examples/peripherals/i2s/CMakeLists.txt create mode 100644 examples/peripherals/i2s/main/CMakeLists.txt create mode 100644 examples/peripherals/pwm/CMakeLists.txt create mode 100644 examples/peripherals/pwm/main/CMakeLists.txt create mode 100644 examples/peripherals/spi_master/CMakeLists.txt create mode 100644 examples/peripherals/spi_master/main/CMakeLists.txt create mode 100644 examples/peripherals/spi_oled/CMakeLists.txt create mode 100644 examples/peripherals/spi_oled/main/CMakeLists.txt create mode 100644 examples/peripherals/spi_slave/CMakeLists.txt create mode 100644 examples/peripherals/spi_slave/main/CMakeLists.txt create mode 100644 examples/peripherals/uart_echo/CMakeLists.txt create mode 100644 examples/peripherals/uart_echo/main/CMakeLists.txt create mode 100644 examples/peripherals/uart_events/CMakeLists.txt create mode 100644 examples/peripherals/uart_events/main/CMakeLists.txt create mode 100644 examples/protocols/aws_iot/subscribe_publish/CMakeLists.txt create mode 100644 examples/protocols/aws_iot/subscribe_publish/main/CMakeLists.txt create mode 100644 examples/protocols/aws_iot/thing_shadow/CMakeLists.txt create mode 100644 examples/protocols/aws_iot/thing_shadow/main/CMakeLists.txt create mode 100644 examples/protocols/coap_client/main/CMakeLists.txt create mode 100644 examples/protocols/coap_server/main/CMakeLists.txt create mode 100644 examples/protocols/esp-mqtt/ssl/sdkconfig.defaults create mode 100644 examples/protocols/esp-mqtt/ssl_mutual_auth/sdkconfig.defaults create mode 100644 examples/protocols/esp-mqtt/tcp/sdkconfig.defaults create mode 100644 examples/protocols/esp-mqtt/ws/sdkconfig.defaults create mode 100644 examples/protocols/esp-mqtt/wss/sdkconfig.defaults create mode 100644 examples/protocols/http_request/CMakeLists.txt create mode 100644 examples/protocols/http_request/main/CMakeLists.txt create mode 100644 examples/protocols/https_mbedtls/CMakeLists.txt create mode 100644 examples/protocols/https_mbedtls/main/CMakeLists.txt create mode 100644 examples/protocols/https_wolfssl/CMakeLists.txt create mode 100644 examples/protocols/https_wolfssl/main/CMakeLists.txt create mode 100644 examples/protocols/ibm-mqtt/CMakeLists.txt create mode 100644 examples/protocols/ibm-mqtt/main/CMakeLists.txt create mode 100644 examples/protocols/mdns/CMakeLists.txt create mode 100644 examples/protocols/mdns/main/CMakeLists.txt create mode 100644 examples/protocols/openssl_client/CMakeLists.txt create mode 100644 examples/protocols/openssl_client/main/CMakeLists.txt create mode 100644 examples/protocols/openssl_server/CMakeLists.txt create mode 100644 examples/protocols/openssl_server/main/CMakeLists.txt create mode 100644 examples/protocols/sntp/CMakeLists.txt create mode 100644 examples/protocols/sntp/main/CMakeLists.txt create mode 100644 examples/system/ota/native_ota/CMakeLists.txt create mode 100644 examples/system/ota/native_ota/main/CMakeLists.txt create mode 100644 examples/wifi/espnow/CMakeLists.txt create mode 100644 examples/wifi/espnow/main/CMakeLists.txt create mode 100644 examples/wifi/simple_wifi/CMakeLists.txt create mode 100644 examples/wifi/simple_wifi/main/CMakeLists.txt create mode 100644 examples/wifi/smart_config/CMakeLists.txt create mode 100644 examples/wifi/smart_config/main/CMakeLists.txt create mode 100644 examples/wifi/sniffer/CMakeLists.txt create mode 100644 examples/wifi/sniffer/main/CMakeLists.txt create mode 100644 examples/wifi/wps/CMakeLists.txt create mode 100644 examples/wifi/wps/main/CMakeLists.txt diff --git a/examples/get-started/project_template/CMakeLists.txt b/examples/get-started/project_template/CMakeLists.txt new file mode 100644 index 00000000..cd360d1a --- /dev/null +++ b/examples/get-started/project_template/CMakeLists.txt @@ -0,0 +1,6 @@ +# 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) + +include($ENV{IDF_PATH}/tools/cmake/project.cmake) +project(project_template) diff --git a/examples/get-started/project_template/components/CMakeLists.txt b/examples/get-started/project_template/components/CMakeLists.txt new file mode 100644 index 00000000..67473b67 --- /dev/null +++ b/examples/get-started/project_template/components/CMakeLists.txt @@ -0,0 +1,3 @@ +set(COMPONENT_SRCDIRS "folder1" "folder2") + +register_component() diff --git a/examples/get-started/project_template/main/CMakeLists.txt b/examples/get-started/project_template/main/CMakeLists.txt new file mode 100644 index 00000000..31addfc4 --- /dev/null +++ b/examples/get-started/project_template/main/CMakeLists.txt @@ -0,0 +1,3 @@ +set(COMPONENT_SRCS "user_main.c") + +register_component() diff --git a/examples/peripherals/adc/CMakeLists.txt b/examples/peripherals/adc/CMakeLists.txt new file mode 100644 index 00000000..66953084 --- /dev/null +++ b/examples/peripherals/adc/CMakeLists.txt @@ -0,0 +1,6 @@ +# 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) + +include($ENV{IDF_PATH}/tools/cmake/project.cmake) +project(adc) diff --git a/examples/peripherals/adc/main/CMakeLists.txt b/examples/peripherals/adc/main/CMakeLists.txt new file mode 100644 index 00000000..030a95c3 --- /dev/null +++ b/examples/peripherals/adc/main/CMakeLists.txt @@ -0,0 +1,3 @@ +set(COMPONENT_SRCS "adc_example_main.c") + +register_component() diff --git a/examples/peripherals/gpio/CMakeLists.txt b/examples/peripherals/gpio/CMakeLists.txt new file mode 100644 index 00000000..43da7a73 --- /dev/null +++ b/examples/peripherals/gpio/CMakeLists.txt @@ -0,0 +1,6 @@ +# 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) + +include($ENV{IDF_PATH}/tools/cmake/project.cmake) +project(gpio) diff --git a/examples/peripherals/gpio/main/CMakeLists.txt b/examples/peripherals/gpio/main/CMakeLists.txt new file mode 100644 index 00000000..31addfc4 --- /dev/null +++ b/examples/peripherals/gpio/main/CMakeLists.txt @@ -0,0 +1,3 @@ +set(COMPONENT_SRCS "user_main.c") + +register_component() diff --git a/examples/peripherals/hw_timer/CMakeLists.txt b/examples/peripherals/hw_timer/CMakeLists.txt new file mode 100644 index 00000000..9a444694 --- /dev/null +++ b/examples/peripherals/hw_timer/CMakeLists.txt @@ -0,0 +1,6 @@ +# 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) + +include($ENV{IDF_PATH}/tools/cmake/project.cmake) +project(hw_timer) diff --git a/examples/peripherals/hw_timer/main/CMakeLists.txt b/examples/peripherals/hw_timer/main/CMakeLists.txt new file mode 100644 index 00000000..fb2638e5 --- /dev/null +++ b/examples/peripherals/hw_timer/main/CMakeLists.txt @@ -0,0 +1,3 @@ +set(COMPONENT_SRCS "hw_timer_example_main.c") + +register_component() diff --git a/examples/peripherals/i2c/CMakeLists.txt b/examples/peripherals/i2c/CMakeLists.txt new file mode 100644 index 00000000..7b045fb7 --- /dev/null +++ b/examples/peripherals/i2c/CMakeLists.txt @@ -0,0 +1,6 @@ +# 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) + +include($ENV{IDF_PATH}/tools/cmake/project.cmake) +project(i2c) diff --git a/examples/peripherals/i2c/main/CMakeLists.txt b/examples/peripherals/i2c/main/CMakeLists.txt new file mode 100644 index 00000000..31addfc4 --- /dev/null +++ b/examples/peripherals/i2c/main/CMakeLists.txt @@ -0,0 +1,3 @@ +set(COMPONENT_SRCS "user_main.c") + +register_component() diff --git a/examples/peripherals/i2s/CMakeLists.txt b/examples/peripherals/i2s/CMakeLists.txt new file mode 100644 index 00000000..b92c1daa --- /dev/null +++ b/examples/peripherals/i2s/CMakeLists.txt @@ -0,0 +1,6 @@ +# 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) + +include($ENV{IDF_PATH}/tools/cmake/project.cmake) +project(i2s) diff --git a/examples/peripherals/i2s/main/CMakeLists.txt b/examples/peripherals/i2s/main/CMakeLists.txt new file mode 100644 index 00000000..38ba8221 --- /dev/null +++ b/examples/peripherals/i2s/main/CMakeLists.txt @@ -0,0 +1,3 @@ +set(COMPONENT_SRCS "i2s_example_main.c") + +register_component() diff --git a/examples/peripherals/pwm/CMakeLists.txt b/examples/peripherals/pwm/CMakeLists.txt new file mode 100644 index 00000000..06c9fedd --- /dev/null +++ b/examples/peripherals/pwm/CMakeLists.txt @@ -0,0 +1,6 @@ +# 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) + +include($ENV{IDF_PATH}/tools/cmake/project.cmake) +project(pwm) diff --git a/examples/peripherals/pwm/main/CMakeLists.txt b/examples/peripherals/pwm/main/CMakeLists.txt new file mode 100644 index 00000000..5926e6bc --- /dev/null +++ b/examples/peripherals/pwm/main/CMakeLists.txt @@ -0,0 +1,3 @@ +set(COMPONENT_SRCS "pwm_example_main.c") + +register_component() diff --git a/examples/peripherals/spi_master/CMakeLists.txt b/examples/peripherals/spi_master/CMakeLists.txt new file mode 100644 index 00000000..254fb8b0 --- /dev/null +++ b/examples/peripherals/spi_master/CMakeLists.txt @@ -0,0 +1,6 @@ +# 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) + +include($ENV{IDF_PATH}/tools/cmake/project.cmake) +project(spi_master) diff --git a/examples/peripherals/spi_master/main/CMakeLists.txt b/examples/peripherals/spi_master/main/CMakeLists.txt new file mode 100644 index 00000000..d55df5d0 --- /dev/null +++ b/examples/peripherals/spi_master/main/CMakeLists.txt @@ -0,0 +1,3 @@ +set(COMPONENT_SRCS "spi_master_example_main.c") + +register_component() diff --git a/examples/peripherals/spi_oled/CMakeLists.txt b/examples/peripherals/spi_oled/CMakeLists.txt new file mode 100644 index 00000000..9e9f4d45 --- /dev/null +++ b/examples/peripherals/spi_oled/CMakeLists.txt @@ -0,0 +1,6 @@ +# 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) + +include($ENV{IDF_PATH}/tools/cmake/project.cmake) +project(spi_oled) diff --git a/examples/peripherals/spi_oled/main/CMakeLists.txt b/examples/peripherals/spi_oled/main/CMakeLists.txt new file mode 100644 index 00000000..0538f083 --- /dev/null +++ b/examples/peripherals/spi_oled/main/CMakeLists.txt @@ -0,0 +1,3 @@ +set(COMPONENT_SRCS "spi_oled_example_main.c") + +register_component() diff --git a/examples/peripherals/spi_slave/CMakeLists.txt b/examples/peripherals/spi_slave/CMakeLists.txt new file mode 100644 index 00000000..d7efcea4 --- /dev/null +++ b/examples/peripherals/spi_slave/CMakeLists.txt @@ -0,0 +1,6 @@ +# 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) + +include($ENV{IDF_PATH}/tools/cmake/project.cmake) +project(spi_slave) diff --git a/examples/peripherals/spi_slave/main/CMakeLists.txt b/examples/peripherals/spi_slave/main/CMakeLists.txt new file mode 100644 index 00000000..6ccbe341 --- /dev/null +++ b/examples/peripherals/spi_slave/main/CMakeLists.txt @@ -0,0 +1,3 @@ +set(COMPONENT_SRCS "spi_slave_example_main.c") + +register_component() diff --git a/examples/peripherals/uart_echo/CMakeLists.txt b/examples/peripherals/uart_echo/CMakeLists.txt new file mode 100644 index 00000000..ae41b42e --- /dev/null +++ b/examples/peripherals/uart_echo/CMakeLists.txt @@ -0,0 +1,6 @@ +# 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) + +include($ENV{IDF_PATH}/tools/cmake/project.cmake) +project(uart_echo) diff --git a/examples/peripherals/uart_echo/main/CMakeLists.txt b/examples/peripherals/uart_echo/main/CMakeLists.txt new file mode 100644 index 00000000..458429f4 --- /dev/null +++ b/examples/peripherals/uart_echo/main/CMakeLists.txt @@ -0,0 +1,3 @@ +set(COMPONENT_SRCS "uart_echo_example_main.c") + +register_component() diff --git a/examples/peripherals/uart_events/CMakeLists.txt b/examples/peripherals/uart_events/CMakeLists.txt new file mode 100644 index 00000000..3dc11293 --- /dev/null +++ b/examples/peripherals/uart_events/CMakeLists.txt @@ -0,0 +1,6 @@ +# 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) + +include($ENV{IDF_PATH}/tools/cmake/project.cmake) +project(uart_event) diff --git a/examples/peripherals/uart_events/main/CMakeLists.txt b/examples/peripherals/uart_events/main/CMakeLists.txt new file mode 100644 index 00000000..123f33ca --- /dev/null +++ b/examples/peripherals/uart_events/main/CMakeLists.txt @@ -0,0 +1,3 @@ +set(COMPONENT_SRCS "uart_events_example_main.c") + +register_component() diff --git a/examples/protocols/aws_iot/subscribe_publish/CMakeLists.txt b/examples/protocols/aws_iot/subscribe_publish/CMakeLists.txt new file mode 100644 index 00000000..c1a9ff1f --- /dev/null +++ b/examples/protocols/aws_iot/subscribe_publish/CMakeLists.txt @@ -0,0 +1,6 @@ +# 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) + +include($ENV{IDF_PATH}/tools/cmake/project.cmake) +project(subscribe_publish) diff --git a/examples/protocols/aws_iot/subscribe_publish/main/CMakeLists.txt b/examples/protocols/aws_iot/subscribe_publish/main/CMakeLists.txt new file mode 100644 index 00000000..bbbf02f1 --- /dev/null +++ b/examples/protocols/aws_iot/subscribe_publish/main/CMakeLists.txt @@ -0,0 +1,11 @@ +set(COMPONENT_SRCS "subscribe_publish_sample.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + + +register_component() + +if(CONFIG_EXAMPLE_EMBEDDED_CERTS) +target_add_binary_data(${COMPONENT_NAME} "certs/aws-root-ca.pem" TEXT) +target_add_binary_data(${COMPONENT_NAME} "certs/certificate.pem.crt" TEXT) +target_add_binary_data(${COMPONENT_NAME} "certs/private.pem.key" TEXT) +endif() diff --git a/examples/protocols/aws_iot/thing_shadow/CMakeLists.txt b/examples/protocols/aws_iot/thing_shadow/CMakeLists.txt new file mode 100644 index 00000000..65006bec --- /dev/null +++ b/examples/protocols/aws_iot/thing_shadow/CMakeLists.txt @@ -0,0 +1,6 @@ +# 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) + +include($ENV{IDF_PATH}/tools/cmake/project.cmake) +project(thing_shadow) diff --git a/examples/protocols/aws_iot/thing_shadow/main/CMakeLists.txt b/examples/protocols/aws_iot/thing_shadow/main/CMakeLists.txt new file mode 100644 index 00000000..0e98592f --- /dev/null +++ b/examples/protocols/aws_iot/thing_shadow/main/CMakeLists.txt @@ -0,0 +1,11 @@ +set(COMPONENT_SRCS "thing_shadow_sample.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + + +register_component() + +if(CONFIG_EXAMPLE_EMBEDDED_CERTS) +target_add_binary_data(${COMPONENT_NAME} "certs/aws-root-ca.pem" TEXT) +target_add_binary_data(${COMPONENT_NAME} "certs/certificate.pem.crt" TEXT) +target_add_binary_data(${COMPONENT_NAME} "certs/private.pem.key" TEXT) +endif() diff --git a/examples/protocols/coap_client/CMakeLists.txt b/examples/protocols/coap_client/CMakeLists.txt index 43378b8b..671988b7 100644 --- a/examples/protocols/coap_client/CMakeLists.txt +++ b/examples/protocols/coap_client/CMakeLists.txt @@ -2,7 +2,5 @@ # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/coap_client_example_main.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(coap_client) diff --git a/examples/protocols/coap_client/main/CMakeLists.txt b/examples/protocols/coap_client/main/CMakeLists.txt new file mode 100644 index 00000000..eb1a1db1 --- /dev/null +++ b/examples/protocols/coap_client/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "coap_client_example_main.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/protocols/coap_server/CMakeLists.txt b/examples/protocols/coap_server/CMakeLists.txt index 8495b857..28389253 100644 --- a/examples/protocols/coap_server/CMakeLists.txt +++ b/examples/protocols/coap_server/CMakeLists.txt @@ -2,7 +2,5 @@ # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/coap_server_example_main.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(coap_server) diff --git a/examples/protocols/coap_server/main/CMakeLists.txt b/examples/protocols/coap_server/main/CMakeLists.txt new file mode 100644 index 00000000..8650fb11 --- /dev/null +++ b/examples/protocols/coap_server/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "coap_server_example_main.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/protocols/esp-mqtt/ssl/sdkconfig.ci b/examples/protocols/esp-mqtt/ssl/sdkconfig.ci index ce328a6b..27a129be 100644 --- a/examples/protocols/esp-mqtt/ssl/sdkconfig.ci +++ b/examples/protocols/esp-mqtt/ssl/sdkconfig.ci @@ -1,2 +1,3 @@ CONFIG_BROKER_URI="mqtts://${EXAMPLE_MQTT_BROKER_SSL}" CONFIG_BROKER_CERTIFICATE_OVERRIDE="${EXAMPLE_MQTT_BROKER_CERTIFICATE}" +CONFIG_MQTT_USING_ESP=y diff --git a/examples/protocols/esp-mqtt/ssl/sdkconfig.defaults b/examples/protocols/esp-mqtt/ssl/sdkconfig.defaults new file mode 100644 index 00000000..31a9759a --- /dev/null +++ b/examples/protocols/esp-mqtt/ssl/sdkconfig.defaults @@ -0,0 +1 @@ +CONFIG_MQTT_USING_ESP=y diff --git a/examples/protocols/esp-mqtt/ssl_mutual_auth/sdkconfig.defaults b/examples/protocols/esp-mqtt/ssl_mutual_auth/sdkconfig.defaults new file mode 100644 index 00000000..31a9759a --- /dev/null +++ b/examples/protocols/esp-mqtt/ssl_mutual_auth/sdkconfig.defaults @@ -0,0 +1 @@ +CONFIG_MQTT_USING_ESP=y diff --git a/examples/protocols/esp-mqtt/tcp/sdkconfig.ci b/examples/protocols/esp-mqtt/tcp/sdkconfig.ci index 09ca8f37..f0b34b79 100644 --- a/examples/protocols/esp-mqtt/tcp/sdkconfig.ci +++ b/examples/protocols/esp-mqtt/tcp/sdkconfig.ci @@ -1,2 +1,3 @@ CONFIG_LOG_DEFAULT_LEVEL_DEBUG=y CONFIG_BROKER_URL="FROM_STDIN" +CONFIG_MQTT_USING_ESP=y diff --git a/examples/protocols/esp-mqtt/tcp/sdkconfig.defaults b/examples/protocols/esp-mqtt/tcp/sdkconfig.defaults new file mode 100644 index 00000000..31a9759a --- /dev/null +++ b/examples/protocols/esp-mqtt/tcp/sdkconfig.defaults @@ -0,0 +1 @@ +CONFIG_MQTT_USING_ESP=y diff --git a/examples/protocols/esp-mqtt/ws/sdkconfig.ci b/examples/protocols/esp-mqtt/ws/sdkconfig.ci index 4f14eef9..f024d643 100644 --- a/examples/protocols/esp-mqtt/ws/sdkconfig.ci +++ b/examples/protocols/esp-mqtt/ws/sdkconfig.ci @@ -1 +1,2 @@ CONFIG_BROKER_URI="ws://${EXAMPLE_MQTT_BROKER_WS}/ws" +CONFIG_MQTT_USING_ESP=y diff --git a/examples/protocols/esp-mqtt/ws/sdkconfig.defaults b/examples/protocols/esp-mqtt/ws/sdkconfig.defaults new file mode 100644 index 00000000..31a9759a --- /dev/null +++ b/examples/protocols/esp-mqtt/ws/sdkconfig.defaults @@ -0,0 +1 @@ +CONFIG_MQTT_USING_ESP=y diff --git a/examples/protocols/esp-mqtt/wss/sdkconfig.ci b/examples/protocols/esp-mqtt/wss/sdkconfig.ci index d0dd4929..ed4ef640 100644 --- a/examples/protocols/esp-mqtt/wss/sdkconfig.ci +++ b/examples/protocols/esp-mqtt/wss/sdkconfig.ci @@ -1,3 +1,3 @@ CONFIG_BROKER_URI="wss://${EXAMPLE_MQTT_BROKER_WSS}/ws" CONFIG_BROKER_CERTIFICATE_OVERRIDE="${EXAMPLE_MQTT_BROKER_CERTIFICATE}" - +CONFIG_MQTT_USING_ESP=y diff --git a/examples/protocols/esp-mqtt/wss/sdkconfig.defaults b/examples/protocols/esp-mqtt/wss/sdkconfig.defaults new file mode 100644 index 00000000..31a9759a --- /dev/null +++ b/examples/protocols/esp-mqtt/wss/sdkconfig.defaults @@ -0,0 +1 @@ +CONFIG_MQTT_USING_ESP=y diff --git a/examples/protocols/http_request/CMakeLists.txt b/examples/protocols/http_request/CMakeLists.txt new file mode 100644 index 00000000..173ebfa7 --- /dev/null +++ b/examples/protocols/http_request/CMakeLists.txt @@ -0,0 +1,6 @@ +# 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) + +include($ENV{IDF_PATH}/tools/cmake/project.cmake) +project(http_request) diff --git a/examples/protocols/http_request/main/CMakeLists.txt b/examples/protocols/http_request/main/CMakeLists.txt new file mode 100644 index 00000000..42279a5a --- /dev/null +++ b/examples/protocols/http_request/main/CMakeLists.txt @@ -0,0 +1,3 @@ +set(COMPONENT_SRCS "http_request_example_main.c") + +register_component() diff --git a/examples/protocols/http_server/advanced_tests/main/tests.c b/examples/protocols/http_server/advanced_tests/main/tests.c index 8845585b..1079eb08 100644 --- a/examples/protocols/http_server/advanced_tests/main/tests.c +++ b/examples/protocols/http_server/advanced_tests/main/tests.c @@ -22,7 +22,7 @@ struct async_resp_arg { esp_err_t hello_get_handler(httpd_req_t *req) { #define STR "Hello World!" - ESP_LOGI(TAG, "Free Stack for server task: '%d'", uxTaskGetStackHighWaterMark(NULL)); + ESP_LOGI(TAG, "Free Stack for server task: '%ld'", uxTaskGetStackHighWaterMark(NULL)); httpd_resp_send(req, STR, strlen(STR)); return ESP_OK; #undef STR diff --git a/examples/protocols/https_mbedtls/CMakeLists.txt b/examples/protocols/https_mbedtls/CMakeLists.txt new file mode 100644 index 00000000..1990bc1a --- /dev/null +++ b/examples/protocols/https_mbedtls/CMakeLists.txt @@ -0,0 +1,6 @@ +# 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) + +include($ENV{IDF_PATH}/tools/cmake/project.cmake) +project(https_mbedtls) diff --git a/examples/protocols/https_mbedtls/main/CMakeLists.txt b/examples/protocols/https_mbedtls/main/CMakeLists.txt new file mode 100644 index 00000000..76f9de4d --- /dev/null +++ b/examples/protocols/https_mbedtls/main/CMakeLists.txt @@ -0,0 +1,8 @@ +set(COMPONENT_SRCS "https_mbedtls_example_main.c") + +# Embed the server root certificate into the final binary +# +# (If this was a component, we would set COMPONENT_EMBED_TXTFILES here.) +set(COMPONENT_EMBED_TXTFILES server_root_cert.pem) + +register_component() diff --git a/examples/protocols/https_wolfssl/CMakeLists.txt b/examples/protocols/https_wolfssl/CMakeLists.txt new file mode 100644 index 00000000..c72e8223 --- /dev/null +++ b/examples/protocols/https_wolfssl/CMakeLists.txt @@ -0,0 +1,6 @@ +# 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) + +include($ENV{IDF_PATH}/tools/cmake/project.cmake) +project(https_wolfssl) diff --git a/examples/protocols/https_wolfssl/main/CMakeLists.txt b/examples/protocols/https_wolfssl/main/CMakeLists.txt new file mode 100644 index 00000000..33bf4ef2 --- /dev/null +++ b/examples/protocols/https_wolfssl/main/CMakeLists.txt @@ -0,0 +1,10 @@ +set(COMPONENT_SRCS "https_wolfssl_example_main.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + + +# Embed the server root certificate into the final binary +# +# (If this was a component, we would set COMPONENT_EMBED_TXTFILES here.) +set(COMPONENT_EMBED_TXTFILES server_root_cert.pem) + +register_component() diff --git a/examples/protocols/ibm-mqtt/CMakeLists.txt b/examples/protocols/ibm-mqtt/CMakeLists.txt new file mode 100644 index 00000000..4260ca18 --- /dev/null +++ b/examples/protocols/ibm-mqtt/CMakeLists.txt @@ -0,0 +1,6 @@ +# 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) + +include($ENV{IDF_PATH}/tools/cmake/project.cmake) +project(ibm-mqtt) diff --git a/examples/protocols/ibm-mqtt/main/CMakeLists.txt b/examples/protocols/ibm-mqtt/main/CMakeLists.txt new file mode 100644 index 00000000..d1ee5e2e --- /dev/null +++ b/examples/protocols/ibm-mqtt/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "MQTTEcho.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/protocols/mdns/CMakeLists.txt b/examples/protocols/mdns/CMakeLists.txt new file mode 100644 index 00000000..ced29ce4 --- /dev/null +++ b/examples/protocols/mdns/CMakeLists.txt @@ -0,0 +1,6 @@ +# 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) + +include($ENV{IDF_PATH}/tools/cmake/project.cmake) +project(mdns) diff --git a/examples/protocols/mdns/main/CMakeLists.txt b/examples/protocols/mdns/main/CMakeLists.txt new file mode 100644 index 00000000..0391d47a --- /dev/null +++ b/examples/protocols/mdns/main/CMakeLists.txt @@ -0,0 +1,3 @@ +set(COMPONENT_SRCS "mdns_example_main.c") + +register_component() diff --git a/examples/protocols/openssl_client/CMakeLists.txt b/examples/protocols/openssl_client/CMakeLists.txt new file mode 100644 index 00000000..3b366a05 --- /dev/null +++ b/examples/protocols/openssl_client/CMakeLists.txt @@ -0,0 +1,6 @@ +# 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) + +include($ENV{IDF_PATH}/tools/cmake/project.cmake) +project(openssl_client) diff --git a/examples/protocols/openssl_client/main/CMakeLists.txt b/examples/protocols/openssl_client/main/CMakeLists.txt new file mode 100644 index 00000000..c912b23d --- /dev/null +++ b/examples/protocols/openssl_client/main/CMakeLists.txt @@ -0,0 +1,8 @@ +set(COMPONENT_SRCS "openssl_client_example_main.c") + +# Embed the server root certificate into the final binary +# +# (If this was a component, we would set COMPONENT_EMBED_TXTFILES here.) +set(COMPONENT_EMBED_TXTFILES "client.pem" "client.key" "ca.pem") + +register_component() diff --git a/examples/protocols/openssl_demo/Makefile b/examples/protocols/openssl_demo/Makefile index 8987be55..d5f30fcd 100644 --- a/examples/protocols/openssl_demo/Makefile +++ b/examples/protocols/openssl_demo/Makefile @@ -3,7 +3,7 @@ # project subdirectory. # -PROJECT_NAME := openssl +PROJECT_NAME := openssl_demo include $(IDF_PATH)/make/project.mk diff --git a/examples/protocols/openssl_server/CMakeLists.txt b/examples/protocols/openssl_server/CMakeLists.txt new file mode 100644 index 00000000..d0a68b27 --- /dev/null +++ b/examples/protocols/openssl_server/CMakeLists.txt @@ -0,0 +1,6 @@ +# 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) + +include($ENV{IDF_PATH}/tools/cmake/project.cmake) +project(openssl_server) diff --git a/examples/protocols/openssl_server/main/CMakeLists.txt b/examples/protocols/openssl_server/main/CMakeLists.txt new file mode 100644 index 00000000..1f238cf3 --- /dev/null +++ b/examples/protocols/openssl_server/main/CMakeLists.txt @@ -0,0 +1,8 @@ +set(COMPONENT_SRCS "openssl_server_example_main.c") + +# Embed the server root certificate into the final binary +# +# (If this was a component, we would set COMPONENT_EMBED_TXTFILES here.) +set(COMPONENT_EMBED_TXTFILES "server.pem" "server.key" "ca.pem") + +register_component() diff --git a/examples/protocols/sntp/CMakeLists.txt b/examples/protocols/sntp/CMakeLists.txt new file mode 100644 index 00000000..872321a8 --- /dev/null +++ b/examples/protocols/sntp/CMakeLists.txt @@ -0,0 +1,6 @@ +# 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) + +include($ENV{IDF_PATH}/tools/cmake/project.cmake) +project(sntp) diff --git a/examples/protocols/sntp/main/CMakeLists.txt b/examples/protocols/sntp/main/CMakeLists.txt new file mode 100644 index 00000000..46762484 --- /dev/null +++ b/examples/protocols/sntp/main/CMakeLists.txt @@ -0,0 +1,3 @@ +set(COMPONENT_SRCS "sntp_example_main.c") + +register_component() diff --git a/examples/system/ota/native_ota/CMakeLists.txt b/examples/system/ota/native_ota/CMakeLists.txt new file mode 100644 index 00000000..f736f959 --- /dev/null +++ b/examples/system/ota/native_ota/CMakeLists.txt @@ -0,0 +1,6 @@ +# 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) + +include($ENV{IDF_PATH}/tools/cmake/project.cmake) +project(native_ota) \ No newline at end of file diff --git a/examples/system/ota/native_ota/main/CMakeLists.txt b/examples/system/ota/native_ota/main/CMakeLists.txt new file mode 100644 index 00000000..1fb77d3f --- /dev/null +++ b/examples/system/ota/native_ota/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "ota_example_main.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/wifi/espnow/CMakeLists.txt b/examples/wifi/espnow/CMakeLists.txt new file mode 100644 index 00000000..6a8822fa --- /dev/null +++ b/examples/wifi/espnow/CMakeLists.txt @@ -0,0 +1,6 @@ +# 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) + +include($ENV{IDF_PATH}/tools/cmake/project.cmake) +project(espnow) diff --git a/examples/wifi/espnow/main/CMakeLists.txt b/examples/wifi/espnow/main/CMakeLists.txt new file mode 100644 index 00000000..7e779799 --- /dev/null +++ b/examples/wifi/espnow/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_ADD_INCLUDEDIRS .) +set(COMPONENT_SRCS "espnow_example_main.c") + +register_component() diff --git a/examples/wifi/simple_wifi/CMakeLists.txt b/examples/wifi/simple_wifi/CMakeLists.txt new file mode 100644 index 00000000..1ef4ddb5 --- /dev/null +++ b/examples/wifi/simple_wifi/CMakeLists.txt @@ -0,0 +1,6 @@ +# 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) + +include($ENV{IDF_PATH}/tools/cmake/project.cmake) +project(simple_wifi) diff --git a/examples/wifi/simple_wifi/main/CMakeLists.txt b/examples/wifi/simple_wifi/main/CMakeLists.txt new file mode 100644 index 00000000..db9e8e94 --- /dev/null +++ b/examples/wifi/simple_wifi/main/CMakeLists.txt @@ -0,0 +1,3 @@ +set(COMPONENT_SRCS "simple_wifi.c") + +register_component() diff --git a/examples/wifi/smart_config/CMakeLists.txt b/examples/wifi/smart_config/CMakeLists.txt new file mode 100644 index 00000000..8e4bdff0 --- /dev/null +++ b/examples/wifi/smart_config/CMakeLists.txt @@ -0,0 +1,6 @@ +# 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) + +include($ENV{IDF_PATH}/tools/cmake/project.cmake) +project(smart_config) diff --git a/examples/wifi/smart_config/main/CMakeLists.txt b/examples/wifi/smart_config/main/CMakeLists.txt new file mode 100644 index 00000000..b54fffaa --- /dev/null +++ b/examples/wifi/smart_config/main/CMakeLists.txt @@ -0,0 +1,3 @@ +set(COMPONENT_SRCS "smartconfig_main.c") + +register_component() diff --git a/examples/wifi/sniffer/CMakeLists.txt b/examples/wifi/sniffer/CMakeLists.txt new file mode 100644 index 00000000..327327c0 --- /dev/null +++ b/examples/wifi/sniffer/CMakeLists.txt @@ -0,0 +1,6 @@ +# 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) + +include($ENV{IDF_PATH}/tools/cmake/project.cmake) +project(sniffer) diff --git a/examples/wifi/sniffer/main/CMakeLists.txt b/examples/wifi/sniffer/main/CMakeLists.txt new file mode 100644 index 00000000..e9379bd5 --- /dev/null +++ b/examples/wifi/sniffer/main/CMakeLists.txt @@ -0,0 +1,3 @@ +set(COMPONENT_SRCS "sniffer_main.c") + +register_component() diff --git a/examples/wifi/wps/CMakeLists.txt b/examples/wifi/wps/CMakeLists.txt new file mode 100644 index 00000000..797c5317 --- /dev/null +++ b/examples/wifi/wps/CMakeLists.txt @@ -0,0 +1,6 @@ +# 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) + +include($ENV{IDF_PATH}/tools/cmake/project.cmake) +project(wps) diff --git a/examples/wifi/wps/main/CMakeLists.txt b/examples/wifi/wps/main/CMakeLists.txt new file mode 100644 index 00000000..995c1359 --- /dev/null +++ b/examples/wifi/wps/main/CMakeLists.txt @@ -0,0 +1,3 @@ +set(COMPONENT_SRCS "wps.c") + +register_component()