]> granicus.if.org Git - esp-idf/commitdiff
cmake: make main a component again
authorRenz Christian Bagaporo <renz@espressif.com>
Tue, 11 Sep 2018 01:44:12 +0000 (09:44 +0800)
committerAngus Gratton <angus@espressif.com>
Tue, 11 Sep 2018 01:44:12 +0000 (09:44 +0800)
282 files changed:
components/app_trace/CMakeLists.txt
components/app_update/CMakeLists.txt
components/asio/CMakeLists.txt
components/aws_iot/CMakeLists.txt
components/bootloader/subproject/CMakeLists.txt
components/bootloader/subproject/main/CMakeLists.txt [new file with mode: 0644]
components/bootloader_support/CMakeLists.txt
components/bt/CMakeLists.txt
components/console/CMakeLists.txt
components/cxx/CMakeLists.txt
components/driver/CMakeLists.txt
components/esp-tls/CMakeLists.txt
components/esp32/CMakeLists.txt
components/esp_adc_cal/CMakeLists.txt
components/esp_http_client/CMakeLists.txt
components/esp_https_ota/CMakeLists.txt
components/ethernet/CMakeLists.txt
components/expat/CMakeLists.txt
components/fatfs/CMakeLists.txt
components/freertos/CMakeLists.txt
components/heap/CMakeLists.txt
components/http_server/CMakeLists.txt
components/jsmn/CMakeLists.txt
components/json/CMakeLists.txt
components/libsodium/CMakeLists.txt
components/log/CMakeLists.txt
components/lwip/CMakeLists.txt
components/mbedtls/CMakeLists.txt
components/mdns/CMakeLists.txt
components/micro-ecc/CMakeLists.txt
components/newlib/CMakeLists.txt
components/nghttp/CMakeLists.txt
components/nvs_flash/CMakeLists.txt
components/openssl/CMakeLists.txt
components/pthread/CMakeLists.txt
components/sdmmc/CMakeLists.txt
components/smartconfig_ack/CMakeLists.txt
components/soc/CMakeLists.txt
components/soc/esp32/sources.cmake [new file with mode: 0644]
components/spi_flash/CMakeLists.txt
components/spiffs/CMakeLists.txt
components/tcpip_adapter/CMakeLists.txt
components/ulp/CMakeLists.txt
components/vfs/CMakeLists.txt
components/wear_levelling/CMakeLists.txt
components/wpa_supplicant/CMakeLists.txt
components/xtensa-debug-module/CMakeLists.txt
docs/en/api-guides/build-system-cmake.rst
examples/bluetooth/a2dp_gatts_coex/CMakeLists.txt
examples/bluetooth/a2dp_gatts_coex/main/CMakeLists.txt [new file with mode: 0644]
examples/bluetooth/a2dp_sink/CMakeLists.txt
examples/bluetooth/a2dp_sink/main/CMakeLists.txt [new file with mode: 0644]
examples/bluetooth/a2dp_source/CMakeLists.txt
examples/bluetooth/a2dp_source/main/CMakeLists.txt [new file with mode: 0644]
examples/bluetooth/ble_adv/CMakeLists.txt
examples/bluetooth/ble_adv/main/CMakeLists.txt [new file with mode: 0644]
examples/bluetooth/ble_eddystone/CMakeLists.txt
examples/bluetooth/ble_eddystone/main/CMakeLists.txt [new file with mode: 0644]
examples/bluetooth/ble_hid_device_demo/CMakeLists.txt
examples/bluetooth/ble_hid_device_demo/main/CMakeLists.txt [new file with mode: 0644]
examples/bluetooth/ble_ibeacon/CMakeLists.txt
examples/bluetooth/ble_ibeacon/main/CMakeLists.txt [new file with mode: 0644]
examples/bluetooth/ble_spp_client/CMakeLists.txt
examples/bluetooth/ble_spp_client/main/CMakeLists.txt [new file with mode: 0644]
examples/bluetooth/ble_spp_server/CMakeLists.txt
examples/bluetooth/ble_spp_server/main/CMakeLists.txt [new file with mode: 0644]
examples/bluetooth/ble_throughput/throughput_client/CMakeLists.txt
examples/bluetooth/ble_throughput/throughput_client/main/CMakeLists.txt [new file with mode: 0644]
examples/bluetooth/ble_throughput/throughput_server/CMakeLists.txt
examples/bluetooth/ble_throughput/throughput_server/main/CMakeLists.txt [new file with mode: 0644]
examples/bluetooth/blufi/CMakeLists.txt
examples/bluetooth/blufi/main/CMakeLists.txt [new file with mode: 0644]
examples/bluetooth/bt_discovery/CMakeLists.txt
examples/bluetooth/bt_discovery/main/CMakeLists.txt [new file with mode: 0644]
examples/bluetooth/bt_spp_acceptor/CMakeLists.txt
examples/bluetooth/bt_spp_acceptor/main/CMakeLists.txt [new file with mode: 0644]
examples/bluetooth/bt_spp_initiator/CMakeLists.txt
examples/bluetooth/bt_spp_initiator/main/CMakeLists.txt [new file with mode: 0644]
examples/bluetooth/bt_spp_vfs_acceptor/CMakeLists.txt
examples/bluetooth/bt_spp_vfs_acceptor/main/CMakeLists.txt [new file with mode: 0644]
examples/bluetooth/bt_spp_vfs_initiator/CMakeLists.txt
examples/bluetooth/bt_spp_vfs_initiator/main/CMakeLists.txt [new file with mode: 0644]
examples/bluetooth/controller_hci_uart/CMakeLists.txt
examples/bluetooth/controller_hci_uart/main/CMakeLists.txt [new file with mode: 0644]
examples/bluetooth/gatt_client/CMakeLists.txt
examples/bluetooth/gatt_client/main/CMakeLists.txt [new file with mode: 0644]
examples/bluetooth/gatt_security_client/CMakeLists.txt
examples/bluetooth/gatt_security_client/main/CMakeLists.txt [new file with mode: 0644]
examples/bluetooth/gatt_security_server/CMakeLists.txt
examples/bluetooth/gatt_security_server/main/CMakeLists.txt [new file with mode: 0644]
examples/bluetooth/gatt_server/CMakeLists.txt
examples/bluetooth/gatt_server/main/CMakeLists.txt [new file with mode: 0644]
examples/bluetooth/gatt_server_service_table/CMakeLists.txt
examples/bluetooth/gatt_server_service_table/main/CMakeLists.txt [new file with mode: 0644]
examples/bluetooth/gattc_multi_connect/CMakeLists.txt
examples/bluetooth/gattc_multi_connect/main/CMakeLists.txt [new file with mode: 0644]
examples/ethernet/ethernet/CMakeLists.txt
examples/ethernet/ethernet/main/CMakeLists.txt [new file with mode: 0644]
examples/get-started/blink/CMakeLists.txt
examples/get-started/blink/main/CMakeLists.txt [new file with mode: 0644]
examples/get-started/hello_world/CMakeLists.txt
examples/get-started/hello_world/main/CMakeLists.txt [new file with mode: 0644]
examples/mesh/internal_communication/CMakeLists.txt
examples/mesh/internal_communication/main/CMakeLists.txt [new file with mode: 0644]
examples/mesh/manual_networking/CMakeLists.txt
examples/mesh/manual_networking/main/CMakeLists.txt [new file with mode: 0644]
examples/peripherals/adc/CMakeLists.txt
examples/peripherals/adc/main/CMakeLists.txt [new file with mode: 0644]
examples/peripherals/adc2/CMakeLists.txt
examples/peripherals/adc2/main/CMakeLists.txt [new file with mode: 0644]
examples/peripherals/can/can_alert_and_recovery/CMakeLists.txt
examples/peripherals/can/can_alert_and_recovery/main/CMakeLists.txt [new file with mode: 0644]
examples/peripherals/can/can_network/can_network_listen_only/CMakeLists.txt
examples/peripherals/can/can_network/can_network_listen_only/main/CMakeLists.txt [new file with mode: 0644]
examples/peripherals/can/can_network/can_network_master/CMakeLists.txt
examples/peripherals/can/can_network/can_network_master/main/CMakeLists.txt [new file with mode: 0644]
examples/peripherals/can/can_network/can_network_slave/CMakeLists.txt
examples/peripherals/can/can_network/can_network_slave/main/CMakeLists.txt [new file with mode: 0644]
examples/peripherals/can/can_self_test/CMakeLists.txt
examples/peripherals/can/can_self_test/main/CMakeLists.txt [new file with mode: 0644]
examples/peripherals/gpio/CMakeLists.txt
examples/peripherals/gpio/main/CMakeLists.txt [new file with mode: 0644]
examples/peripherals/i2c/CMakeLists.txt
examples/peripherals/i2c/main/CMakeLists.txt [new file with mode: 0644]
examples/peripherals/i2s/CMakeLists.txt
examples/peripherals/i2s/main/CMakeLists.txt [new file with mode: 0644]
examples/peripherals/i2s_adc_dac/CMakeLists.txt
examples/peripherals/i2s_adc_dac/main/CMakeLists.txt [new file with mode: 0644]
examples/peripherals/ledc/CMakeLists.txt
examples/peripherals/ledc/main/CMakeLists.txt [new file with mode: 0644]
examples/peripherals/mcpwm/mcpwm_basic_config/CMakeLists.txt
examples/peripherals/mcpwm/mcpwm_basic_config/main/CMakeLists.txt [new file with mode: 0644]
examples/peripherals/mcpwm/mcpwm_bldc_control/CMakeLists.txt
examples/peripherals/mcpwm/mcpwm_bldc_control/main/CMakeLists.txt [new file with mode: 0644]
examples/peripherals/mcpwm/mcpwm_brushed_dc_control/CMakeLists.txt
examples/peripherals/mcpwm/mcpwm_brushed_dc_control/main/CMakeLists.txt [new file with mode: 0644]
examples/peripherals/mcpwm/mcpwm_servo_control/CMakeLists.txt
examples/peripherals/mcpwm/mcpwm_servo_control/main/CMakeLists.txt [new file with mode: 0644]
examples/peripherals/pcnt/CMakeLists.txt
examples/peripherals/pcnt/main/CMakeLists.txt [new file with mode: 0644]
examples/peripherals/rmt_nec_tx_rx/CMakeLists.txt
examples/peripherals/rmt_nec_tx_rx/main/CMakeLists.txt [new file with mode: 0644]
examples/peripherals/rmt_tx/CMakeLists.txt
examples/peripherals/rmt_tx/main/CMakeLists.txt [new file with mode: 0644]
examples/peripherals/sdio/host/CMakeLists.txt
examples/peripherals/sdio/host/components/esp_slave/CMakeLists.txt
examples/peripherals/sdio/host/main/CMakeLists.txt [new file with mode: 0644]
examples/peripherals/sdio/slave/CMakeLists.txt
examples/peripherals/sdio/slave/main/CMakeLists.txt [new file with mode: 0644]
examples/peripherals/sigmadelta/CMakeLists.txt
examples/peripherals/sigmadelta/main/CMakeLists.txt [new file with mode: 0644]
examples/peripherals/spi_master/CMakeLists.txt
examples/peripherals/spi_master/main/CMakeLists.txt [new file with mode: 0644]
examples/peripherals/spi_slave/receiver/CMakeLists.txt
examples/peripherals/spi_slave/receiver/main/CMakeLists.txt [new file with mode: 0644]
examples/peripherals/spi_slave/sender/CMakeLists.txt
examples/peripherals/spi_slave/sender/main/CMakeLists.txt [new file with mode: 0644]
examples/peripherals/timer_group/CMakeLists.txt
examples/peripherals/timer_group/main/CMakeLists.txt [new file with mode: 0644]
examples/peripherals/touch_pad_interrupt/CMakeLists.txt
examples/peripherals/touch_pad_interrupt/main/CMakeLists.txt [new file with mode: 0644]
examples/peripherals/touch_pad_read/CMakeLists.txt
examples/peripherals/touch_pad_read/main/CMakeLists.txt [new file with mode: 0644]
examples/peripherals/uart_async_rxtxtasks/CMakeLists.txt
examples/peripherals/uart_async_rxtxtasks/main/CMakeLists.txt [new file with mode: 0644]
examples/peripherals/uart_echo/CMakeLists.txt
examples/peripherals/uart_echo/main/CMakeLists.txt [new file with mode: 0644]
examples/peripherals/uart_echo_rs485/CMakeLists.txt
examples/peripherals/uart_echo_rs485/main/CMakeLists.txt [new file with mode: 0644]
examples/peripherals/uart_events/CMakeLists.txt
examples/peripherals/uart_events/main/CMakeLists.txt [new file with mode: 0644]
examples/peripherals/uart_select/CMakeLists.txt
examples/peripherals/uart_select/main/CMakeLists.txt [new file with mode: 0644]
examples/protocols/asio/chat_client/CMakeLists.txt
examples/protocols/asio/chat_client/components/CMakeLists.txt
examples/protocols/asio/chat_client/main/CMakeLists.txt [new file with mode: 0644]
examples/protocols/asio/chat_server/CMakeLists.txt
examples/protocols/asio/chat_server/components/CMakeLists.txt
examples/protocols/asio/chat_server/main/CMakeLists.txt [new file with mode: 0644]
examples/protocols/asio/tcp_echo_server/CMakeLists.txt
examples/protocols/asio/tcp_echo_server/components/CMakeLists.txt
examples/protocols/asio/tcp_echo_server/main/CMakeLists.txt [new file with mode: 0644]
examples/protocols/asio/udp_echo_server/CMakeLists.txt
examples/protocols/asio/udp_echo_server/components/CMakeLists.txt
examples/protocols/asio/udp_echo_server/main/CMakeLists.txt [new file with mode: 0644]
examples/protocols/aws_iot/subscribe_publish/CMakeLists.txt
examples/protocols/aws_iot/subscribe_publish/main/CMakeLists.txt [new file with mode: 0644]
examples/protocols/aws_iot/thing_shadow/CMakeLists.txt
examples/protocols/aws_iot/thing_shadow/main/CMakeLists.txt [new file with mode: 0644]
examples/protocols/coap_client/CMakeLists.txt
examples/protocols/coap_client/main/CMakeLists.txt [new file with mode: 0644]
examples/protocols/coap_server/CMakeLists.txt
examples/protocols/coap_server/main/CMakeLists.txt [new file with mode: 0644]
examples/protocols/esp_http_client/CMakeLists.txt
examples/protocols/esp_http_client/main/CMakeLists.txt [new file with mode: 0644]
examples/protocols/http2_request/CMakeLists.txt
examples/protocols/http2_request/components/sh2lib/CMakeLists.txt
examples/protocols/http2_request/main/CMakeLists.txt [new file with mode: 0644]
examples/protocols/http_request/CMakeLists.txt
examples/protocols/http_request/main/CMakeLists.txt [new file with mode: 0644]
examples/protocols/http_server/advanced_tests/CMakeLists.txt
examples/protocols/http_server/advanced_tests/main/CMakeLists.txt [new file with mode: 0644]
examples/protocols/http_server/persistent_sockets/CMakeLists.txt
examples/protocols/http_server/persistent_sockets/main/CMakeLists.txt [new file with mode: 0644]
examples/protocols/http_server/simple/CMakeLists.txt
examples/protocols/http_server/simple/main/CMakeLists.txt [new file with mode: 0644]
examples/protocols/https_mbedtls/CMakeLists.txt
examples/protocols/https_mbedtls/main/CMakeLists.txt [new file with mode: 0644]
examples/protocols/https_request/CMakeLists.txt
examples/protocols/https_request/main/CMakeLists.txt [new file with mode: 0644]
examples/protocols/mdns/CMakeLists.txt
examples/protocols/mdns/main/CMakeLists.txt [new file with mode: 0644]
examples/protocols/openssl_client/CMakeLists.txt
examples/protocols/openssl_client/main/CMakeLists.txt [new file with mode: 0644]
examples/protocols/openssl_server/CMakeLists.txt
examples/protocols/openssl_server/main/CMakeLists.txt [new file with mode: 0644]
examples/protocols/pppos_client/CMakeLists.txt
examples/protocols/pppos_client/main/CMakeLists.txt [new file with mode: 0644]
examples/protocols/sntp/CMakeLists.txt
examples/protocols/sntp/main/CMakeLists.txt [new file with mode: 0644]
examples/protocols/udp_multicast/CMakeLists.txt
examples/protocols/udp_multicast/main/CMakeLists.txt [new file with mode: 0644]
examples/storage/nvs_rw_blob/CMakeLists.txt
examples/storage/nvs_rw_blob/main/CMakeLists.txt [new file with mode: 0644]
examples/storage/nvs_rw_value/CMakeLists.txt
examples/storage/nvs_rw_value/main/CMakeLists.txt [new file with mode: 0644]
examples/storage/sd_card/CMakeLists.txt
examples/storage/sd_card/main/CMakeLists.txt [new file with mode: 0644]
examples/storage/spiffs/CMakeLists.txt
examples/storage/spiffs/main/CMakeLists.txt [new file with mode: 0644]
examples/storage/wear_levelling/CMakeLists.txt
examples/storage/wear_levelling/main/CMakeLists.txt [new file with mode: 0644]
examples/system/app_trace_to_host/CMakeLists.txt
examples/system/app_trace_to_host/main/CMakeLists.txt [new file with mode: 0644]
examples/system/base_mac_address/CMakeLists.txt
examples/system/base_mac_address/main/CMakeLists.txt [new file with mode: 0644]
examples/system/console/CMakeLists.txt
examples/system/console/main/CMakeLists.txt [new file with mode: 0644]
examples/system/cpp_exceptions/CMakeLists.txt
examples/system/cpp_exceptions/main/CMakeLists.txt [new file with mode: 0644]
examples/system/deep_sleep/CMakeLists.txt
examples/system/deep_sleep/main/CMakeLists.txt [new file with mode: 0644]
examples/system/esp_timer/CMakeLists.txt
examples/system/esp_timer/main/CMakeLists.txt [new file with mode: 0644]
examples/system/gcov/CMakeLists.txt
examples/system/gcov/main/CMakeLists.txt [new file with mode: 0644]
examples/system/ota/native_ota_example/CMakeLists.txt
examples/system/ota/native_ota_example/main/CMakeLists.txt [new file with mode: 0644]
examples/system/ota/simple_ota_example/CMakeLists.txt
examples/system/ota/simple_ota_example/main/CMakeLists.txt [new file with mode: 0644]
examples/system/select/CMakeLists.txt
examples/system/select/main/CMakeLists.txt [new file with mode: 0644]
examples/system/task_watchdog/CMakeLists.txt
examples/system/task_watchdog/main/CMakeLists.txt [new file with mode: 0644]
examples/wifi/espnow/CMakeLists.txt
examples/wifi/espnow/main/CMakeLists.txt [new file with mode: 0644]
examples/wifi/getting_started/softAP/CMakeLists.txt
examples/wifi/getting_started/softAP/main/CMakeLists.txt [new file with mode: 0644]
examples/wifi/getting_started/station/CMakeLists.txt
examples/wifi/getting_started/station/main/CMakeLists.txt [new file with mode: 0644]
examples/wifi/iperf/CMakeLists.txt
examples/wifi/iperf/components/CMakeLists.txt
examples/wifi/iperf/main/CMakeLists.txt [new file with mode: 0644]
examples/wifi/power_save/CMakeLists.txt
examples/wifi/power_save/main/CMakeLists.txt [new file with mode: 0644]
examples/wifi/scan/CMakeLists.txt
examples/wifi/scan/main/CMakeLists.txt [new file with mode: 0644]
examples/wifi/simple_wifi/main/CMakeLists.txt [new file with mode: 0644]
examples/wifi/smart_config/CMakeLists.txt
examples/wifi/smart_config/main/CMakeLists.txt [new file with mode: 0644]
examples/wifi/wpa2_enterprise/CMakeLists.txt
examples/wifi/wpa2_enterprise/main/CMakeLists.txt [new file with mode: 0644]
examples/wifi/wps/CMakeLists.txt
examples/wifi/wps/main/CMakeLists.txt [new file with mode: 0644]
tools/ci/build_examples_cmake.sh
tools/ci/check_examples_cmake_make.sh
tools/ci/test_build_system_cmake.sh
tools/cmake/components.cmake
tools/cmake/convert_to_cmake.py
tools/cmake/idf_functions.cmake
tools/cmake/scripts/expand_requirements.cmake
tools/cmake/utilities.cmake

index 5a6f19dbbecd15b9e07b9788a888b2287950bd10..56ad263699618e0360fb0f3ede7fd941694e78c1 100644 (file)
@@ -1,4 +1,7 @@
-set(COMPONENT_SRCDIRS "." "gcov")
+set(COMPONENT_SRCS "app_trace.c"
+                   "app_trace_util.c"
+                   "gcov/gcov_rtio.c"
+                   "host_file_io.c")
 set(COMPONENT_ADD_INCLUDEDIRS "include")
 
 if(CONFIG_SYSVIEW_ENABLE)
@@ -7,11 +10,10 @@ if(CONFIG_SYSVIEW_ENABLE)
         sys_view/SEGGER
         sys_view/Sample/OS)
 
-    list(APPEND COMPONENT_SRCDIRS
-        "sys_view/SEGGER"
-        "sys_view/Sample/OS"
-        "sys_view/Sample/Config"
-        "sys_view/esp32")
+    set(COMPONENT_SRCS "SEGGER/SEGGER_SYSVIEW.c"
+                    "esp32/SEGGER_RTT_esp32.c"
+                    "Sample/Config/SEGGER_SYSVIEW_Config_FreeRTOS.c"
+                    "Sample/OS/SEGGER_SYSVIEW_FreeRTOS.c")
 endif()
 
 set(COMPONENT_REQUIRES)
index b69d109b8cb18124cd4aff3fe8514ccf4fb2f690..ef2684a2c64ed46b3455fb2aa270aff1bd465aac 100644 (file)
@@ -1,4 +1,4 @@
-set(COMPONENT_SRCDIRS ".")
+set(COMPONENT_SRCS "esp_ota_ops.c")
 set(COMPONENT_ADD_INCLUDEDIRS "include")
 
 set(COMPONENT_REQUIRES spi_flash partition_table)
index 9be66380e7001f09c0413e75a308bd9e60119d3a..43d428f8d785f39919a9da15bb253fe4f6b984cb 100644 (file)
@@ -1,7 +1,5 @@
 set(COMPONENT_ADD_INCLUDEDIRS asio/asio/include port/include)
-set(COMPONENT_SRCDIRS asio/asio/src)
-
-set(COMPONENT_SRCEXCLUDE asio/asio/src/asio_ssl.cpp)
+set(COMPONENT_SRCS "asio/asio/src/asio.cpp")
 
 set(COMPONENT_REQUIRES lwip)
 
index f7644bd7a3f15a521976ce3c86d02bdf20f9b016..79a973bca61107c23b48e5524bab501143d98b7c 100644 (file)
@@ -1,6 +1,25 @@
 if(CONFIG_AWS_IOT_SDK)
     set(COMPONENT_ADD_INCLUDEDIRS "include aws-iot-device-sdk-embedded-C/include")
-    set(COMPONENT_SRCDIRS "aws-iot-device-sdk-embedded-C/src port")
+    set(aws_sdk_dir aws-iot-device-sdk-embedded-C/src)
+    set(COMPONENT_SRCS "${aws_sdk_dir}/aws_iot_jobs_interface.c"
+                   "${aws_sdk_dir}/aws_iot_jobs_json.c"
+                   "${aws_sdk_dir}/aws_iot_jobs_topics.c"
+                   "${aws_sdk_dir}/aws_iot_jobs_types.c"
+                   "${aws_sdk_dir}/aws_iot_json_utils.c"
+                   "${aws_sdk_dir}/aws_iot_mqtt_client.c"
+                   "${aws_sdk_dir}/aws_iot_mqtt_client_common_internal.c"
+                   "${aws_sdk_dir}/aws_iot_mqtt_client_connect.c"
+                   "${aws_sdk_dir}/aws_iot_mqtt_client_publish.c"
+                   "${aws_sdk_dir}/aws_iot_mqtt_client_subscribe.c"
+                   "${aws_sdk_dir}/aws_iot_mqtt_client_unsubscribe.c"
+                   "${aws_sdk_dir}/aws_iot_mqtt_client_yield.c"
+                   "${aws_sdk_dir}/aws_iot_shadow.c"
+                   "${aws_sdk_dir}/aws_iot_shadow_actions.c"
+                   "${aws_sdk_dir}/aws_iot_shadow_json.c"
+                   "${aws_sdk_dir}/aws_iot_shadow_records.c"
+                   "port/network_mbedtls_wrapper.c"
+                   "port/threads_freertos.c"
+                   "port/timer.c")
 else()
     message(STATUS "Building empty aws_iot component due to configuration")
 endif()
index 7a34d8ea2267987601f81f4fe2b30f9ba7b5b388..6d3c44c44976d4a8837c09c94a4636093be5d652 100644 (file)
@@ -10,14 +10,12 @@ if(NOT IDF_PATH)
         "in by the parent build process.")
 endif()
 
-set(COMPONENTS bootloader esptool_py esp32 partition_table soc bootloader_support log spi_flash micro-ecc soc)
+set(COMPONENTS bootloader esptool_py esp32 partition_table soc bootloader_support log spi_flash micro-ecc soc main)
 set(BOOTLOADER_BUILD 1)
 add_definitions(-DBOOTLOADER_BUILD=1)
 
 set(COMPONENT_REQUIRES_COMMON log esp32 soc)
 
-set(MAIN_SRCS main/bootloader_start.c)
-
 include("${IDF_PATH}/tools/cmake/project.cmake")
 project(bootloader)
 
diff --git a/components/bootloader/subproject/main/CMakeLists.txt b/components/bootloader/subproject/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..d090e97
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "bootloader_start.c")
+set(COMPONENT_ADD_INCLUDEDIRS "")
+set(COMPONENT_REQUIRES "bootloader bootloader_support")
+register_component()
index bc610eb9606ef33b6f18feb30ccdf80a531ab74f..50aca978ce709f1f4e31a85390e7e2a02c93af5a 100644 (file)
@@ -1,4 +1,17 @@
-set(COMPONENT_SRCDIRS "src")
+set(COMPONENT_SRCS "src/bootloader_clock.c"
+                   "src/bootloader_common.c"
+                   "src/bootloader_flash.c"
+                   "src/bootloader_init.c"
+                   "src/bootloader_random.c"
+                   "src/bootloader_sha.c"
+                   "src/bootloader_utility.c"
+                   "src/efuse.c"
+                   "src/esp_image_format.c"
+                   "src/flash_encrypt.c"
+                   "src/flash_partitions.c"
+                   "src/flash_qio_mode.c"
+                   "src/secure_boot.c"
+                   "src/secure_boot_signatures.c")
 
 if(${BOOTLOADER_BUILD})
     set(COMPONENT_ADD_INCLUDEDIRS "include include_bootloader")
index f64668f9f5af6a56dff5d9bd0e08c8c8c8eb2e4e..df6fa250d46bb81f322e6af63f5de9a259d90d60 100644 (file)
@@ -1,6 +1,6 @@
 if(CONFIG_BT_ENABLED)
 
-    set(COMPONENT_SRCDIRS .)
+    set(COMPONENT_SRCS "bt.c")
     set(COMPONENT_ADD_INCLUDEDIRS include)
 
     if(CONFIG_BLUEDROID_ENABLED)
@@ -41,43 +41,234 @@ if(CONFIG_BT_ENABLED)
 
         list(APPEND COMPONENT_ADD_INCLUDEDIRS bluedroid/api/include/api)
 
-        list(APPEND COMPONENT_SRCDIRS
-            bluedroid/bta/dm
-            bluedroid/bta/gatt
-            bluedroid/bta/hh
-            bluedroid/bta/sdp
-            bluedroid/bta/av
-            bluedroid/bta/ar
-            bluedroid/bta/sys
-            bluedroid/bta/jv
-            bluedroid/device
-            bluedroid/hci
-            bluedroid/main
-            bluedroid/osi
-            bluedroid/external/sbc/decoder/srce
-            bluedroid/external/sbc/encoder/srce
-            bluedroid/btc/core
-            bluedroid/btc/profile/esp/blufi
-            bluedroid/btc/profile/std/gap
-            bluedroid/btc/profile/std/gatt
-            bluedroid/btc/profile/std/a2dp
-            bluedroid/btc/profile/std/avrc
-            bluedroid/btc/profile/std/spp
-            bluedroid/stack/btm
-            bluedroid/stack/btu
-            bluedroid/stack/gap
-            bluedroid/stack/gatt
-            bluedroid/stack/hcic
-            bluedroid/stack/l2cap
-            bluedroid/stack/sdp
-            bluedroid/stack/smp
-            bluedroid/stack/avct
-            bluedroid/stack/avrc
-            bluedroid/stack/avdt
-            bluedroid/stack/a2dp
-            bluedroid/stack/rfcomm
-            bluedroid/api
-            )
+        list(APPEND COMPONENT_SRCS "bluedroid/api/esp_a2dp_api.c"
+                   "bluedroid/api/esp_avrc_api.c"
+                   "bluedroid/api/esp_blufi_api.c"
+                   "bluedroid/api/esp_bt_device.c"
+                   "bluedroid/api/esp_bt_main.c"
+                   "bluedroid/api/esp_gap_ble_api.c"
+                   "bluedroid/api/esp_gap_bt_api.c"
+                   "bluedroid/api/esp_gatt_common_api.c"
+                   "bluedroid/api/esp_gattc_api.c"
+                   "bluedroid/api/esp_gatts_api.c"
+                   "bluedroid/api/esp_hf_client_api.c"
+                   "bluedroid/api/esp_spp_api.c"
+                   "bluedroid/bta/ar/bta_ar.c"
+                   "bluedroid/bta/av/bta_av_aact.c"
+                   "bluedroid/bta/av/bta_av_act.c"
+                   "bluedroid/bta/av/bta_av_api.c"
+                   "bluedroid/bta/av/bta_av_cfg.c"
+                   "bluedroid/bta/av/bta_av_ci.c"
+                   "bluedroid/bta/av/bta_av_main.c"
+                   "bluedroid/bta/av/bta_av_sbc.c"
+                   "bluedroid/bta/av/bta_av_ssm.c"
+                   "bluedroid/bta/dm/bta_dm_act.c"
+                   "bluedroid/bta/dm/bta_dm_api.c"
+                   "bluedroid/bta/dm/bta_dm_cfg.c"
+                   "bluedroid/bta/dm/bta_dm_ci.c"
+                   "bluedroid/bta/dm/bta_dm_co.c"
+                   "bluedroid/bta/dm/bta_dm_main.c"
+                   "bluedroid/bta/dm/bta_dm_pm.c"
+                   "bluedroid/bta/dm/bta_dm_sco.c"
+                   "bluedroid/bta/gatt/bta_gatt_common.c"
+                   "bluedroid/bta/gatt/bta_gattc_act.c"
+                   "bluedroid/bta/gatt/bta_gattc_api.c"
+                   "bluedroid/bta/gatt/bta_gattc_cache.c"
+                   "bluedroid/bta/gatt/bta_gattc_ci.c"
+                   "bluedroid/bta/gatt/bta_gattc_co.c"
+                   "bluedroid/bta/gatt/bta_gattc_main.c"
+                   "bluedroid/bta/gatt/bta_gattc_utils.c"
+                   "bluedroid/bta/gatt/bta_gatts_act.c"
+                   "bluedroid/bta/gatt/bta_gatts_api.c"
+                   "bluedroid/bta/gatt/bta_gatts_co.c"
+                   "bluedroid/bta/gatt/bta_gatts_main.c"
+                   "bluedroid/bta/gatt/bta_gatts_utils.c"
+                   "bluedroid/bta/hh/bta_hh_act.c"
+                   "bluedroid/bta/hh/bta_hh_api.c"
+                   "bluedroid/bta/hh/bta_hh_cfg.c"
+                   "bluedroid/bta/hh/bta_hh_le.c"
+                   "bluedroid/bta/hh/bta_hh_main.c"
+                   "bluedroid/bta/hh/bta_hh_utils.c"
+                   "bluedroid/bta/jv/bta_jv_act.c"
+                   "bluedroid/bta/jv/bta_jv_api.c"
+                   "bluedroid/bta/jv/bta_jv_cfg.c"
+                   "bluedroid/bta/jv/bta_jv_main.c"
+                   "bluedroid/bta/sdp/bta_sdp.c"
+                   "bluedroid/bta/sdp/bta_sdp_act.c"
+                   "bluedroid/bta/sdp/bta_sdp_api.c"
+                   "bluedroid/bta/sdp/bta_sdp_cfg.c"
+                   "bluedroid/bta/sys/bta_sys_conn.c"
+                   "bluedroid/bta/sys/bta_sys_main.c"
+                   "bluedroid/bta/sys/utl.c"
+                   "bluedroid/btc/core/btc_alarm.c"
+                   "bluedroid/btc/core/btc_ble_storage.c"
+                   "bluedroid/btc/core/btc_config.c"
+                   "bluedroid/btc/core/btc_dev.c"
+                   "bluedroid/btc/core/btc_dm.c"
+                   "bluedroid/btc/core/btc_main.c"
+                   "bluedroid/btc/core/btc_manage.c"
+                   "bluedroid/btc/core/btc_profile_queue.c"
+                   "bluedroid/btc/core/btc_sec.c"
+                   "bluedroid/btc/core/btc_sm.c"
+                   "bluedroid/btc/core/btc_storage.c"
+                   "bluedroid/btc/core/btc_task.c"
+                   "bluedroid/btc/core/btc_util.c"
+                   "bluedroid/btc/profile/esp/blufi/blufi_prf.c"
+                   "bluedroid/btc/profile/esp/blufi/blufi_protocol.c"
+                   "bluedroid/btc/profile/std/a2dp/bta_av_co.c"
+                   "bluedroid/btc/profile/std/a2dp/btc_a2dp.c"
+                   "bluedroid/btc/profile/std/a2dp/btc_a2dp_control.c"
+                   "bluedroid/btc/profile/std/a2dp/btc_a2dp_sink.c"
+                   "bluedroid/btc/profile/std/a2dp/btc_a2dp_source.c"
+                   "bluedroid/btc/profile/std/a2dp/btc_av.c"
+                   "bluedroid/btc/profile/std/avrc/btc_avrc.c"
+                   "bluedroid/btc/profile/std/gap/btc_gap_ble.c"
+                   "bluedroid/btc/profile/std/gap/btc_gap_bt.c"
+                   "bluedroid/btc/profile/std/gatt/btc_gatt_common.c"
+                   "bluedroid/btc/profile/std/gatt/btc_gatt_util.c"
+                   "bluedroid/btc/profile/std/gatt/btc_gattc.c"
+                   "bluedroid/btc/profile/std/gatt/btc_gatts.c"
+                   "bluedroid/btc/profile/std/spp/btc_spp.c"
+                   "bluedroid/device/bdaddr.c"
+                   "bluedroid/device/controller.c"
+                   "bluedroid/device/interop.c"
+                   "bluedroid/external/sbc/decoder/srce/alloc.c"
+                   "bluedroid/external/sbc/decoder/srce/bitalloc-sbc.c"
+                   "bluedroid/external/sbc/decoder/srce/bitalloc.c"
+                   "bluedroid/external/sbc/decoder/srce/bitstream-decode.c"
+                   "bluedroid/external/sbc/decoder/srce/decoder-oina.c"
+                   "bluedroid/external/sbc/decoder/srce/decoder-private.c"
+                   "bluedroid/external/sbc/decoder/srce/decoder-sbc.c"
+                   "bluedroid/external/sbc/decoder/srce/dequant.c"
+                   "bluedroid/external/sbc/decoder/srce/framing-sbc.c"
+                   "bluedroid/external/sbc/decoder/srce/framing.c"
+                   "bluedroid/external/sbc/decoder/srce/oi_codec_version.c"
+                   "bluedroid/external/sbc/decoder/srce/synthesis-8-generated.c"
+                   "bluedroid/external/sbc/decoder/srce/synthesis-dct8.c"
+                   "bluedroid/external/sbc/decoder/srce/synthesis-sbc.c"
+                   "bluedroid/external/sbc/encoder/srce/sbc_analysis.c"
+                   "bluedroid/external/sbc/encoder/srce/sbc_dct.c"
+                   "bluedroid/external/sbc/encoder/srce/sbc_dct_coeffs.c"
+                   "bluedroid/external/sbc/encoder/srce/sbc_enc_bit_alloc_mono.c"
+                   "bluedroid/external/sbc/encoder/srce/sbc_enc_bit_alloc_ste.c"
+                   "bluedroid/external/sbc/encoder/srce/sbc_enc_coeffs.c"
+                   "bluedroid/external/sbc/encoder/srce/sbc_encoder.c"
+                   "bluedroid/external/sbc/encoder/srce/sbc_packing.c"
+                   "bluedroid/hci/buffer_allocator.c"
+                   "bluedroid/hci/hci_audio.c"
+                   "bluedroid/hci/hci_hal_h4.c"
+                   "bluedroid/hci/hci_layer.c"
+                   "bluedroid/hci/hci_packet_factory.c"
+                   "bluedroid/hci/hci_packet_parser.c"
+                   "bluedroid/hci/packet_fragmenter.c"
+                   "bluedroid/main/bte_init.c"
+                   "bluedroid/main/bte_main.c"
+                   "bluedroid/osi/alarm.c"
+                   "bluedroid/osi/allocator.c"
+                   "bluedroid/osi/buffer.c"
+                   "bluedroid/osi/config.c"
+                   "bluedroid/osi/fixed_queue.c"
+                   "bluedroid/osi/future.c"
+                   "bluedroid/osi/hash_functions.c"
+                   "bluedroid/osi/hash_map.c"
+                   "bluedroid/osi/list.c"
+                   "bluedroid/osi/mutex.c"
+                   "bluedroid/osi/osi.c"
+                   "bluedroid/osi/semaphore.c"
+                   "bluedroid/stack/a2dp/a2d_api.c"
+                   "bluedroid/stack/a2dp/a2d_sbc.c"
+                   "bluedroid/stack/avct/avct_api.c"
+                   "bluedroid/stack/avct/avct_ccb.c"
+                   "bluedroid/stack/avct/avct_l2c.c"
+                   "bluedroid/stack/avct/avct_lcb.c"
+                   "bluedroid/stack/avct/avct_lcb_act.c"
+                   "bluedroid/stack/avdt/avdt_ad.c"
+                   "bluedroid/stack/avdt/avdt_api.c"
+                   "bluedroid/stack/avdt/avdt_ccb.c"
+                   "bluedroid/stack/avdt/avdt_ccb_act.c"
+                   "bluedroid/stack/avdt/avdt_l2c.c"
+                   "bluedroid/stack/avdt/avdt_msg.c"
+                   "bluedroid/stack/avdt/avdt_scb.c"
+                   "bluedroid/stack/avdt/avdt_scb_act.c"
+                   "bluedroid/stack/avrc/avrc_api.c"
+                   "bluedroid/stack/avrc/avrc_bld_ct.c"
+                   "bluedroid/stack/avrc/avrc_bld_tg.c"
+                   "bluedroid/stack/avrc/avrc_opt.c"
+                   "bluedroid/stack/avrc/avrc_pars_ct.c"
+                   "bluedroid/stack/avrc/avrc_pars_tg.c"
+                   "bluedroid/stack/avrc/avrc_sdp.c"
+                   "bluedroid/stack/avrc/avrc_utils.c"
+                   "bluedroid/stack/btm/btm_acl.c"
+                   "bluedroid/stack/btm/btm_ble.c"
+                   "bluedroid/stack/btm/btm_ble_addr.c"
+                   "bluedroid/stack/btm/btm_ble_adv_filter.c"
+                   "bluedroid/stack/btm/btm_ble_batchscan.c"
+                   "bluedroid/stack/btm/btm_ble_bgconn.c"
+                   "bluedroid/stack/btm/btm_ble_cont_energy.c"
+                   "bluedroid/stack/btm/btm_ble_gap.c"
+                   "bluedroid/stack/btm/btm_ble_multi_adv.c"
+                   "bluedroid/stack/btm/btm_ble_privacy.c"
+                   "bluedroid/stack/btm/btm_dev.c"
+                   "bluedroid/stack/btm/btm_devctl.c"
+                   "bluedroid/stack/btm/btm_inq.c"
+                   "bluedroid/stack/btm/btm_main.c"
+                   "bluedroid/stack/btm/btm_pm.c"
+                   "bluedroid/stack/btm/btm_sco.c"
+                   "bluedroid/stack/btm/btm_sec.c"
+                   "bluedroid/stack/btu/btu_hcif.c"
+                   "bluedroid/stack/btu/btu_init.c"
+                   "bluedroid/stack/btu/btu_task.c"
+                   "bluedroid/stack/gap/gap_api.c"
+                   "bluedroid/stack/gap/gap_ble.c"
+                   "bluedroid/stack/gap/gap_conn.c"
+                   "bluedroid/stack/gap/gap_utils.c"
+                   "bluedroid/stack/gatt/att_protocol.c"
+                   "bluedroid/stack/gatt/gatt_api.c"
+                   "bluedroid/stack/gatt/gatt_attr.c"
+                   "bluedroid/stack/gatt/gatt_auth.c"
+                   "bluedroid/stack/gatt/gatt_cl.c"
+                   "bluedroid/stack/gatt/gatt_db.c"
+                   "bluedroid/stack/gatt/gatt_main.c"
+                   "bluedroid/stack/gatt/gatt_sr.c"
+                   "bluedroid/stack/gatt/gatt_utils.c"
+                   "bluedroid/stack/hcic/hciblecmds.c"
+                   "bluedroid/stack/hcic/hcicmds.c"
+                   "bluedroid/stack/l2cap/l2c_api.c"
+                   "bluedroid/stack/l2cap/l2c_ble.c"
+                   "bluedroid/stack/l2cap/l2c_csm.c"
+                   "bluedroid/stack/l2cap/l2c_fcr.c"
+                   "bluedroid/stack/l2cap/l2c_link.c"
+                   "bluedroid/stack/l2cap/l2c_main.c"
+                   "bluedroid/stack/l2cap/l2c_ucd.c"
+                   "bluedroid/stack/l2cap/l2c_utils.c"
+                   "bluedroid/stack/l2cap/l2cap_client.c"
+                   "bluedroid/stack/rfcomm/port_api.c"
+                   "bluedroid/stack/rfcomm/port_rfc.c"
+                   "bluedroid/stack/rfcomm/port_utils.c"
+                   "bluedroid/stack/rfcomm/rfc_l2cap_if.c"
+                   "bluedroid/stack/rfcomm/rfc_mx_fsm.c"
+                   "bluedroid/stack/rfcomm/rfc_port_fsm.c"
+                   "bluedroid/stack/rfcomm/rfc_port_if.c"
+                   "bluedroid/stack/rfcomm/rfc_ts_frames.c"
+                   "bluedroid/stack/rfcomm/rfc_utils.c"
+                   "bluedroid/stack/sdp/sdp_api.c"
+                   "bluedroid/stack/sdp/sdp_db.c"
+                   "bluedroid/stack/sdp/sdp_discovery.c"
+                   "bluedroid/stack/sdp/sdp_main.c"
+                   "bluedroid/stack/sdp/sdp_server.c"
+                   "bluedroid/stack/sdp/sdp_utils.c"
+                   "bluedroid/stack/smp/aes.c"
+                   "bluedroid/stack/smp/p_256_curvepara.c"
+                   "bluedroid/stack/smp/p_256_ecc_pp.c"
+                   "bluedroid/stack/smp/p_256_multprecision.c"
+                   "bluedroid/stack/smp/smp_act.c"
+                   "bluedroid/stack/smp/smp_api.c"
+                   "bluedroid/stack/smp/smp_br_main.c"
+                   "bluedroid/stack/smp/smp_cmac.c"
+                   "bluedroid/stack/smp/smp_keys.c"
+                   "bluedroid/stack/smp/smp_l2c.c"
+                   "bluedroid/stack/smp/smp_main.c"
+                   "bluedroid/stack/smp/smp_utils.c")
     endif()
 endif()
 
index 0b0da5394ac981dd9742193f7bbdf65965cdaca5..1aa4ce020de78fafbfbbd621d426d6f7f280bd3d 100644 (file)
@@ -1,5 +1,8 @@
 set(COMPONENT_ADD_INCLUDEDIRS .)
-set(COMPONENT_SRCDIRS linenoise argtable3 .)
+set(COMPONENT_SRCS "argtable3/argtable3.c"
+                   "commands.c"
+                   "linenoise/linenoise.c"
+                   "split_argv.c")
 
 set(COMPONENT_REQUIRES)
 
index a797640cc01b40908bd76c9d1debb38942c0f0ce..29ee8016ef9cc785b245eaaf12a60aec13da8072 100644 (file)
@@ -1,4 +1,5 @@
-set(COMPONENT_SRCDIRS ".")
+set(COMPONENT_SRCS "cxx_exception_stubs.cpp"
+                   "cxx_guards.cpp")
 set(COMPONENT_REQUIRES)
 register_component()
 
index 0c72aecc439891c8f051e96eb87f46206e69c15a..5e396ede55167c1341f2703bb0a983d3313788c2 100644 (file)
@@ -1,4 +1,25 @@
-set(COMPONENT_SRCDIRS ".")
+set(COMPONENT_SRCS "can.c"
+                   "gpio.c"
+                   "i2c.c"
+                   "i2s.c"
+                   "ledc.c"
+                   "mcpwm.c"
+                   "pcnt.c"
+                   "periph_ctrl.c"
+                   "rmt.c"
+                   "rtc_module.c"
+                   "sdio_slave.c"
+                   "sdmmc_host.c"
+                   "sdmmc_transaction.c"
+                   "sdspi_crc.c"
+                   "sdspi_host.c"
+                   "sdspi_transaction.c"
+                   "sigmadelta.c"
+                   "spi_common.c"
+                   "spi_master.c"
+                   "spi_slave.c"
+                   "timer.c"
+                   "uart.c")
 set(COMPONENT_ADD_INCLUDEDIRS "include")
 set(COMPONENT_PRIV_INCLUDEDIRS "include/driver")
 
index 9bad428680cb31d6aadeb73e22a37fa43231e122..23f953d940a8578fc273983a9545d24e991aef64 100644 (file)
@@ -1,4 +1,4 @@
-set(COMPONENT_SRCDIRS ".")
+set(COMPONENT_SRCS "esp_tls.c")
 set(COMPONENT_ADD_INCLUDEDIRS ".")
 
 set(COMPONENT_REQUIRES mbedtls)
index b26f5efe27f1d785e4cc934f427da6e52c3ae31b..56e311c3aee90028109aa932762c8c4c2c73958c 100644 (file)
@@ -2,7 +2,7 @@ if(BOOTLOADER_BUILD)
     # For bootloader, all we need from esp32 is headers
     set(COMPONENT_ADD_INCLUDEDIRS include)
     set(COMPONENT_REQUIRES ${COMPONENTS})
-    set(COMPONENT_SRCDIRS "")
+    set(COMPONENT_SRC)
     register_component(esp32)
 
     # as cmake won't attach linker args to a header-only library, attach
@@ -17,7 +17,47 @@ if(BOOTLOADER_BUILD)
 else()
     # Regular app build
 
-    set(COMPONENT_SRCDIRS ". hwcrypto")
+    set(COMPONENT_SRCS "brownout.c"
+                   "cache_err_int.c"
+                   "clk.c"
+                   "coexist.c"
+                   "core_dump.c"
+                   "cpu_start.c"
+                   "crosscore_int.c"
+                   "dbg_stubs.c"
+                   "dport_access.c"
+                   "dport_panic_highint_hdl.S"
+                   "esp_err_to_name.c"
+                   "esp_timer.c"
+                   "esp_timer_esp32.c"
+                   "ets_timer_legacy.c"
+                   "event_default_handlers.c"
+                   "event_loop.c"
+                   "fast_crypto_ops.c"
+                   "freertos_hooks.c"
+                   "gdbstub.c"
+                   "hw_random.c"
+                   "hwcrypto/aes.c"
+                   "hwcrypto/sha.c"
+                   "int_wdt.c"
+                   "intr_alloc.c"
+                   "ipc.c"
+                   "lib_printf.c"
+                   "panic.c"
+                   "phy_init.c"
+                   "pm_esp32.c"
+                   "pm_locks.c"
+                   "pm_trace.c"
+                   "reset_reason.c"
+                   "restore.c"
+                   "sleep_modes.c"
+                   "spiram.c"
+                   "spiram_psram.c"
+                   "stack_check.c"
+                   "system_api.c"
+                   "task_wdt.c"
+                   "wifi_init.c"
+                   "wifi_os_adapter.c")
     set(COMPONENT_ADD_INCLUDEDIRS "include")
 
     set(COMPONENT_REQUIRES driver tcpip_adapter)
index fc21f1ecac84ac577c41ad875b366452f8fcf13a..8bb99092e2bf28d61abb6ddf0db1835cde370412 100644 (file)
@@ -1,4 +1,4 @@
-set(COMPONENT_SRCDIRS ".")
+set(COMPONENT_SRCS "esp_adc_cal.c")
 set(COMPONENT_ADD_INCLUDEDIRS "include")
 
 set(COMPONENT_REQUIRES)
index 31bc1185e2c1ab73ba53181b04f522b37037ac9a..7e7d29996a53a5b57a9e9b23d8cdcbcefd9b33cb 100644 (file)
@@ -1,4 +1,10 @@
-set(COMPONENT_SRCDIRS "." "lib")
+set(COMPONENT_SRCS "esp_http_client.c"
+                   "lib/http_auth.c"
+                   "lib/http_header.c"
+                   "lib/http_utils.c"
+                   "lib/transport.c"
+                   "lib/transport_ssl.c"
+                   "lib/transport_tcp.c")
 set(COMPONENT_ADD_INCLUDEDIRS "include")
 set(COMPONENT_PRIV_INCLUDEDIRS "lib/include")
 
index bfc6c12054670135a02205b44ce6c6c8b7b30ac6..6ef0a5c9e0c55d1a1f1904da8de73777e964856d 100644 (file)
@@ -1,5 +1,5 @@
 set(COMPONENT_ADD_INCLUDEDIRS include)
-set(COMPONENT_SRCDIRS "src")
+set(COMPONENT_SRCS "src/esp_https_ota.c")
 
 set(COMPONENT_REQUIRES esp_http_client)
 set(COMPONENT_PRIV_REQUIRES log app_update)
index 165d89fbe1c38b4040fee839b47acd7edb829826..ef7c9a0f9aded1236353f692e7ba241959c3804e 100644 (file)
@@ -1,4 +1,8 @@
-set(COMPONENT_SRCDIRS . eth_phy)
+set(COMPONENT_SRCS "emac_dev.c"
+                   "emac_main.c"
+                   "eth_phy/phy_common.c"
+                   "eth_phy/phy_lan8720.c"
+                   "eth_phy/phy_tlk110.c")
 set(COMPONENT_ADD_INCLUDEDIRS "include")
 
 set(COMPONENT_REQUIRES)
index e94f77512454e7da78fb00594428b93e4667df40..02037dc21a8b4e8f5491ac9164b0ea15229c17b7 100644 (file)
@@ -1,5 +1,10 @@
 set(COMPONENT_ADD_INCLUDEDIRS expat/expat/lib port/include)
-set(COMPONENT_SRCDIRS expat/expat/lib)
+set(COMPONENT_SRCS "expat/expat/lib/loadlibrary.c"
+                   "expat/expat/lib/xmlparse.c"
+                   "expat/expat/lib/xmlrole.c"
+                   "expat/expat/lib/xmltok.c"
+                   "expat/expat/lib/xmltok_impl.c"
+                   "expat/expat/lib/xmltok_ns.c")
 
 set(COMPONENT_REQUIRES)
 
index 3d24c50bf97d7f47cde1c6e4708dadd0a84cbfee..4df07d30b98d22448613b8f75707c4ee491116fb 100644 (file)
@@ -1,4 +1,13 @@
-set(COMPONENT_SRCDIRS src)
+set(COMPONENT_SRCS "src/diskio.c"
+                   "src/diskio_rawflash.c"
+                   "src/diskio_sdmmc.c"
+                   "src/diskio_wl.c"
+                   "src/ff.c"
+                   "src/ffsystem.c"
+                   "src/ffunicode.c"
+                   "src/vfs_fat.c"
+                   "src/vfs_fat_sdmmc.c"
+                   "src/vfs_fat_spiflash.c")
 set(COMPONENT_ADD_INCLUDEDIRS src)
 
 set(COMPONENT_REQUIRES wear_levelling sdmmc)
index e0618d4a94dc83df036db2ad7714d387835b16c3..bcd9b0c42ec5300ad329e5c2298637301ebcc38f 100644 (file)
@@ -1,6 +1,22 @@
 set(COMPONENT_ADD_INCLUDEDIRS include)
 set(COMPONENT_PRIV_INCLUDEDIRS include/freertos)
-set(COMPONENT_SRCDIRS ".")
+set(COMPONENT_SRCS "FreeRTOS-openocd.c"
+                   "croutine.c"
+                   "event_groups.c"
+                   "list.c"
+                   "port.c"
+                   "portasm.S"
+                   "queue.c"
+                   "ringbuf.c"
+                   "tasks.c"
+                   "timers.c"
+                   "xtensa_context.S"
+                   "xtensa_init.c"
+                   "xtensa_intr.c"
+                   "xtensa_intr_asm.S"
+                   "xtensa_overlay_os_hook.c"
+                   "xtensa_vector_defaults.S"
+                   "xtensa_vectors.S")
 set(COMPONENT_REQUIRES)
 
 register_component()
index 9c4ccf16d934ae3c3d0daf7f88cdcbe5b7b49559..f71ed9d84056b5815b5d87aef74f1ed4c3d78855 100644 (file)
@@ -1,4 +1,7 @@
-set(COMPONENT_SRCS heap_caps_init.c heap_caps.c multi_heap.c heap_trace.c)
+set(COMPONENT_SRCS "heap_caps.c"
+                   "heap_caps_init.c"
+                   "heap_trace.c"
+                   "multi_heap.c")
 
 if(NOT CONFIG_HEAP_POISONING_DISABLED)
     set(COMPONENT_SRCS ${COMPONENT_SRCS} multi_heap_poisoning.c)
index ba62bf3ace90999e370bd68a0293c701d0bca1a3..700a0b9cb1d2d85c2e5d3ca59f72eee977ead171 100644 (file)
@@ -1,6 +1,11 @@
 set(COMPONENT_ADD_INCLUDEDIRS include)
 set(COMPONENT_PRIV_INCLUDEDIRS src/port/esp32 src/util)
-set(COMPONENT_SRCDIRS src src/util)
+set(COMPONENT_SRCS "src/httpd_main.c"
+                   "src/httpd_parse.c"
+                   "src/httpd_sess.c"
+                   "src/httpd_txrx.c"
+                   "src/httpd_uri.c"
+                   "src/util/ctrl_sock.c")
 
 set(COMPONENT_REQUIRES nghttp)  # for http_parser.h
 set(COMPONENT_PRIV_REQUIRES lwip)
index 7c19d9ccba93f2600d6d6808b69365cf7e14b55d..f6776023f9469a7e3b72e75f8250e37c58c3376b 100644 (file)
@@ -1,4 +1,4 @@
-set(COMPONENT_SRCDIRS "src")
+set(COMPONENT_SRCS "src/jsmn.c")
 set(COMPONENT_ADD_INCLUDEDIRS "include")
 
 set(COMPONENT_REQUIRES "")
index 0b8ba83d66b34edfac5bfb350737bca3ee5184bb..9535315e5bdebadb47d456203aa91076fd817dcb 100644 (file)
@@ -1,4 +1,6 @@
-set(COMPONENT_SRCDIRS cJSON)
+set(COMPONENT_SRCS "cJSON/cJSON.c"
+                   "cJSON/cJSON_Utils.c"
+                   "cJSON/test.c")
 set(COMPONENT_ADD_INCLUDEDIRS cJSON)
 
 set(COMPONENT_REQUIRES "")
index 0ad301662ea75810475be1cf5699e6a42e709346..abc7d7be34ba1d07d928b24323be0b060a1fea42 100644 (file)
@@ -2,71 +2,217 @@ set(SRC libsodium/src/libsodium)
 
 set(COMPONENT_REQUIRES "mbedtls")
 
-set(COMPONENT_SRCDIRS
-    port
+set(COMPONENT_SRCS
+    "port/randombytes_esp32.c"
+    "port/crypto_hash_mbedtls/crypto_hash_sha512_mbedtls.c"
+    "port/crypto_hash_mbedtls/crypto_hash_sha256_mbedtls.c"
 
     # Derived from libsodium/src/libsodium/Makefile.am
     # (ignoring the !MINIMAL set)
-    ${SRC}/crypto_aead/chacha20poly1305/sodium
-    ${SRC}/crypto_aead/xchacha20poly1305/sodium
-    ${SRC}/crypto_auth
-    ${SRC}/crypto_auth/hmacsha256
-    ${SRC}/crypto_auth/hmacsha512
-    ${SRC}/crypto_auth/hmacsha512256
-    ${SRC}/crypto_box
-    ${SRC}/crypto_box/curve25519xsalsa20poly1305
-    ${SRC}/crypto_core/curve25519/ref10
-    ${SRC}/crypto_core/hchacha20
-    ${SRC}/crypto_core/hsalsa20/ref2
-    ${SRC}/crypto_core/hsalsa20
-    ${SRC}/crypto_core/salsa/ref
-    ${SRC}/crypto_generichash
-    ${SRC}/crypto_generichash/blake2b
-    ${SRC}/crypto_generichash/blake2b/ref
-    ${SRC}/crypto_hash
-    ${SRC}/crypto_hash/sha256
-    ${SRC}/crypto_hash/sha512
-    ${SRC}/crypto_kdf/blake2b
-    ${SRC}/crypto_kdf
-    ${SRC}/crypto_kx
-    ${SRC}/crypto_onetimeauth
-    ${SRC}/crypto_onetimeauth/poly1305
-    ${SRC}/crypto_onetimeauth/poly1305/donna
-    ${SRC}/crypto_pwhash/argon2
-    ${SRC}/crypto_pwhash
-    ${SRC}/crypto_pwhash/scryptsalsa208sha256
-    ${SRC}/crypto_pwhash/scryptsalsa208sha256/nosse
-    ${SRC}/crypto_scalarmult
-    ${SRC}/crypto_scalarmult/curve25519
-    ${SRC}/crypto_scalarmult/curve25519/ref10
-    ${SRC}/crypto_secretbox
-    ${SRC}/crypto_secretbox/xsalsa20poly1305
-    ${SRC}/crypto_shorthash
-    ${SRC}/crypto_shorthash/siphash24
-    ${SRC}/crypto_shorthash/siphash24/ref
-    ${SRC}/crypto_sign
-    ${SRC}/crypto_sign/ed25519
-    ${SRC}/crypto_sign/ed25519/ref10
-    ${SRC}/crypto_stream/chacha20
-    ${SRC}/crypto_stream/chacha20/ref
-    ${SRC}/crypto_stream
-    ${SRC}/crypto_stream/salsa20
-    ${SRC}/crypto_stream/salsa20/ref
-    ${SRC}/crypto_stream/xsalsa20
-    ${SRC}/crypto_verify/sodium
-    ${SRC}/randombytes
-    ${SRC}/sodium
+    "${SRC}/crypto_aead/chacha20poly1305/sodium/aead_chacha20poly1305.c"
+    "${SRC}/crypto_aead/xchacha20poly1305/sodium/aead_xchacha20poly1305.c"
+    "${SRC}/crypto_auth/crypto_auth.c"
+    "${SRC}/crypto_auth/hmacsha256/auth_hmacsha256.c"
+    "${SRC}/crypto_auth/hmacsha512/auth_hmacsha512.c"
+    "${SRC}/crypto_auth/hmacsha512256/auth_hmacsha512256.c"
+    "${SRC}/crypto_auth/hmacsha256/auth_hmacsha256.c"
+    "${SRC}/crypto_auth/hmacsha512/auth_hmacsha512.c"
+    "${SRC}/crypto_auth/hmacsha512256/auth_hmacsha512256.c"
+    "${SRC}/crypto_box/crypto_box.c"
+    "${SRC}/crypto_box/crypto_box_seal.c"
+    "${SRC}/crypto_box/crypto_box_easy.c"
+    "${SRC}/crypto_box/curve25519xchacha20poly1305/box_curve25519xchacha20poly1305.c"
+    "${SRC}/crypto_box/curve25519xsalsa20poly1305/box_curve25519xsalsa20poly1305.c"
+    "${SRC}/crypto_box/curve25519xsalsa20poly1305/box_curve25519xsalsa20poly1305.c"
+    "${SRC}/crypto_core/curve25519/ref10/curve25519_ref10.c"
+    "${SRC}/crypto_core/hchacha20/core_hchacha20.c"
+    "${SRC}/crypto_core/hsalsa20/ref2/core_hsalsa20_ref2.c"
+    "${SRC}/crypto_core/hsalsa20/core_hsalsa20.c"
+    "${SRC}/crypto_core/hsalsa20/ref2/core_hsalsa20_ref2.c"
+    "${SRC}/crypto_core/salsa/ref/core_salsa_ref.c"
+    "${SRC}/crypto_generichash/crypto_generichash.c"
+    "${SRC}/crypto_generichash/blake2b/generichash_blake2.c"
+    "${SRC}/crypto_generichash/blake2b/ref/blake2b-ref.c"
+    "${SRC}/crypto_generichash/blake2b/ref/blake2b-compress-sse41.c"
+    "${SRC}/crypto_generichash/blake2b/ref/generichash_blake2b.c"
+    "${SRC}/crypto_generichash/blake2b/ref/blake2b-compress-ssse3.c"
+    "${SRC}/crypto_generichash/blake2b/ref/blake2b-compress-avx2.c"
+    "${SRC}/crypto_generichash/blake2b/ref/blake2b-compress-ref.c"
+    "${SRC}/crypto_generichash/blake2b/generichash_blake2.c"
+    "${SRC}/crypto_generichash/blake2b/ref/blake2b-ref.c"
+    "${SRC}/crypto_generichash/blake2b/ref/blake2b-compress-sse41.c"
+    "${SRC}/crypto_generichash/blake2b/ref/generichash_blake2b.c"
+    "${SRC}/crypto_generichash/blake2b/ref/blake2b-compress-ssse3.c"
+    "${SRC}/crypto_generichash/blake2b/ref/blake2b-compress-avx2.c"
+    "${SRC}/crypto_generichash/blake2b/ref/blake2b-compress-ref.c"
+    "${SRC}/crypto_generichash/blake2b/ref/blake2b-ref.c"
+    "${SRC}/crypto_generichash/blake2b/ref/blake2b-compress-sse41.c"
+    "${SRC}/crypto_generichash/blake2b/ref/generichash_blake2b.c"
+    "${SRC}/crypto_generichash/blake2b/ref/blake2b-compress-ssse3.c"
+    "${SRC}/crypto_generichash/blake2b/ref/blake2b-compress-avx2.c"
+    "${SRC}/crypto_generichash/blake2b/ref/blake2b-compress-ref.c"
+    "${SRC}/crypto_hash/crypto_hash.c"
+    "${SRC}/crypto_hash/sha512/hash_sha512.c"
+    "${SRC}/crypto_hash/sha256/hash_sha256.c"
+    "${SRC}/crypto_hash/sha512/cp/hash_sha512_cp.c"
+    "${SRC}/crypto_hash/sha256/cp/hash_sha256_cp.c"
+    "${SRC}/crypto_hash/sha256/hash_sha256.c"
+    "${SRC}/crypto_hash/sha256/cp/hash_sha256_cp.c"
+    "${SRC}/crypto_hash/sha512/hash_sha512.c"
+    "${SRC}/crypto_hash/sha512/cp/hash_sha512_cp.c"
+    "${SRC}/crypto_kdf/blake2b/kdf_blake2b.c"
+    "${SRC}/crypto_kdf/crypto_kdf.c"
+    "${SRC}/crypto_kdf/blake2b/kdf_blake2b.c"
+    "${SRC}/crypto_kx/crypto_kx.c"
+    "${SRC}/crypto_onetimeauth/crypto_onetimeauth.c"
+    "${SRC}/crypto_onetimeauth/poly1305/onetimeauth_poly1305.c"
+    "${SRC}/crypto_onetimeauth/poly1305/sse2/poly1305_sse2.c"
+    "${SRC}/crypto_onetimeauth/poly1305/donna/poly1305_donna.c"
+    "${SRC}/crypto_onetimeauth/poly1305/onetimeauth_poly1305.c"
+    "${SRC}/crypto_onetimeauth/poly1305/sse2/poly1305_sse2.c"
+    "${SRC}/crypto_onetimeauth/poly1305/donna/poly1305_donna.c"
+    "${SRC}/crypto_onetimeauth/poly1305/donna/poly1305_donna.c"
+    "${SRC}/crypto_pwhash/argon2/argon2-encoding.c"
+    "${SRC}/crypto_pwhash/argon2/argon2-fill-block-ssse3.c"
+    "${SRC}/crypto_pwhash/argon2/blake2b-long.c"
+    "${SRC}/crypto_pwhash/argon2/pwhash_argon2i.c"
+    "${SRC}/crypto_pwhash/argon2/argon2.c"
+    "${SRC}/crypto_pwhash/argon2/argon2-fill-block-ref.c"
+    "${SRC}/crypto_pwhash/argon2/argon2-core.c"
+    "${SRC}/crypto_pwhash/crypto_pwhash.c"
+    "${SRC}/crypto_pwhash/scryptsalsa208sha256/pbkdf2-sha256.c"
+    "${SRC}/crypto_pwhash/scryptsalsa208sha256/scrypt_platform.c"
+    "${SRC}/crypto_pwhash/scryptsalsa208sha256/crypto_scrypt-common.c"
+    "${SRC}/crypto_pwhash/scryptsalsa208sha256/pwhash_scryptsalsa208sha256.c"
+    "${SRC}/crypto_pwhash/argon2/argon2-encoding.c"
+    "${SRC}/crypto_pwhash/argon2/argon2-fill-block-ssse3.c"
+    "${SRC}/crypto_pwhash/argon2/blake2b-long.c"
+    "${SRC}/crypto_pwhash/argon2/pwhash_argon2i.c"
+    "${SRC}/crypto_pwhash/argon2/argon2.c"
+    "${SRC}/crypto_pwhash/argon2/argon2-fill-block-ref.c"
+    "${SRC}/crypto_pwhash/argon2/argon2-core.c"
+    "${SRC}/crypto_pwhash/scryptsalsa208sha256/nosse/pwhash_scryptsalsa208sha256_nosse.c"
+    "${SRC}/crypto_pwhash/scryptsalsa208sha256/sse/pwhash_scryptsalsa208sha256_sse.c"
+    "${SRC}/crypto_pwhash/scryptsalsa208sha256/pbkdf2-sha256.c"
+    "${SRC}/crypto_pwhash/scryptsalsa208sha256/scrypt_platform.c"
+    "${SRC}/crypto_pwhash/scryptsalsa208sha256/crypto_scrypt-common.c"
+    "${SRC}/crypto_pwhash/scryptsalsa208sha256/pwhash_scryptsalsa208sha256.c"
+    "${SRC}/crypto_pwhash/scryptsalsa208sha256/nosse/pwhash_scryptsalsa208sha256_nosse.c"
+    "${SRC}/crypto_pwhash/scryptsalsa208sha256/sse/pwhash_scryptsalsa208sha256_sse.c"
+    "${SRC}/crypto_pwhash/scryptsalsa208sha256/nosse/pwhash_scryptsalsa208sha256_nosse.c"
+    "${SRC}/crypto_scalarmult/crypto_scalarmult.c"
+    "${SRC}/crypto_scalarmult/curve25519/scalarmult_curve25519.c"
+    "${SRC}/crypto_scalarmult/curve25519/sandy2x/fe_frombytes_sandy2x.c"
+    "${SRC}/crypto_scalarmult/curve25519/sandy2x/curve25519_sandy2x.c"
+    "${SRC}/crypto_scalarmult/curve25519/sandy2x/fe51_invert.c"
+    "${SRC}/crypto_scalarmult/curve25519/donna_c64/curve25519_donna_c64.c"
+    "${SRC}/crypto_scalarmult/curve25519/ref10/x25519_ref10.c"
+    "${SRC}/crypto_scalarmult/curve25519/sandy2x/fe51_pack.S"
+    "${SRC}/crypto_scalarmult/curve25519/sandy2x/fe51_mul.S"
+    "${SRC}/crypto_scalarmult/curve25519/sandy2x/ladder_base.S"
+    "${SRC}/crypto_scalarmult/curve25519/sandy2x/sandy2x.S"
+    "${SRC}/crypto_scalarmult/curve25519/sandy2x/ladder.S"
+    "${SRC}/crypto_scalarmult/curve25519/sandy2x/consts.S"
+    "${SRC}/crypto_scalarmult/curve25519/sandy2x/fe51_nsquare.S"
+    "${SRC}/crypto_scalarmult/curve25519/scalarmult_curve25519.c"
+    "${SRC}/crypto_scalarmult/curve25519/sandy2x/fe_frombytes_sandy2x.c"
+    "${SRC}/crypto_scalarmult/curve25519/sandy2x/curve25519_sandy2x.c"
+    "${SRC}/crypto_scalarmult/curve25519/sandy2x/fe51_invert.c"
+    "${SRC}/crypto_scalarmult/curve25519/donna_c64/curve25519_donna_c64.c"
+    "${SRC}/crypto_scalarmult/curve25519/ref10/x25519_ref10.c"
+    "${SRC}/crypto_scalarmult/curve25519/sandy2x/fe51_pack.S"
+    "${SRC}/crypto_scalarmult/curve25519/sandy2x/fe51_mul.S"
+    "${SRC}/crypto_scalarmult/curve25519/sandy2x/ladder_base.S"
+    "${SRC}/crypto_scalarmult/curve25519/sandy2x/sandy2x.S"
+    "${SRC}/crypto_scalarmult/curve25519/sandy2x/ladder.S"
+    "${SRC}/crypto_scalarmult/curve25519/sandy2x/consts.S"
+    "${SRC}/crypto_scalarmult/curve25519/sandy2x/fe51_nsquare.S"
+    "${SRC}/crypto_scalarmult/curve25519/ref10/x25519_ref10.c"
+    "${SRC}/crypto_secretbox/crypto_secretbox_easy.c"
+    "${SRC}/crypto_secretbox/crypto_secretbox.c"
+    "${SRC}/crypto_secretbox/xsalsa20poly1305/secretbox_xsalsa20poly1305.c"
+    "${SRC}/crypto_secretbox/xchacha20poly1305/secretbox_xchacha20poly1305.c"
+    "${SRC}/crypto_secretbox/xsalsa20poly1305/secretbox_xsalsa20poly1305.c"
+    "${SRC}/crypto_shorthash/crypto_shorthash.c"
+    "${SRC}/crypto_shorthash/siphash24/shorthash_siphashx24.c"
+    "${SRC}/crypto_shorthash/siphash24/shorthash_siphash24.c"
+    "${SRC}/crypto_shorthash/siphash24/ref/shorthash_siphashx24_ref.c"
+    "${SRC}/crypto_shorthash/siphash24/ref/shorthash_siphash24_ref.c"
+    "${SRC}/crypto_shorthash/siphash24/shorthash_siphashx24.c"
+    "${SRC}/crypto_shorthash/siphash24/shorthash_siphash24.c"
+    "${SRC}/crypto_shorthash/siphash24/ref/shorthash_siphashx24_ref.c"
+    "${SRC}/crypto_shorthash/siphash24/ref/shorthash_siphash24_ref.c"
+    "${SRC}/crypto_shorthash/siphash24/ref/shorthash_siphashx24_ref.c"
+    "${SRC}/crypto_shorthash/siphash24/ref/shorthash_siphash24_ref.c"
+    "${SRC}/crypto_sign/crypto_sign.c"
+    "${SRC}/crypto_sign/ed25519/sign_ed25519.c"
+    "${SRC}/crypto_sign/ed25519/ref10/obsolete.c"
+    "${SRC}/crypto_sign/ed25519/ref10/open.c"
+    "${SRC}/crypto_sign/ed25519/ref10/keypair.c"
+    "${SRC}/crypto_sign/ed25519/ref10/sign.c"
+    "${SRC}/crypto_sign/ed25519/sign_ed25519.c"
+    "${SRC}/crypto_sign/ed25519/ref10/obsolete.c"
+    "${SRC}/crypto_sign/ed25519/ref10/open.c"
+    "${SRC}/crypto_sign/ed25519/ref10/keypair.c"
+    "${SRC}/crypto_sign/ed25519/ref10/sign.c"
+    "${SRC}/crypto_sign/ed25519/ref10/obsolete.c"
+    "${SRC}/crypto_sign/ed25519/ref10/open.c"
+    "${SRC}/crypto_sign/ed25519/ref10/keypair.c"
+    "${SRC}/crypto_sign/ed25519/ref10/sign.c"
+    "${SRC}/crypto_stream/chacha20/stream_chacha20.c"
+    "${SRC}/crypto_stream/chacha20/ref/chacha20_ref.c"
+    "${SRC}/crypto_stream/chacha20/dolbeau/chacha20_dolbeau-ssse3.c"
+    "${SRC}/crypto_stream/chacha20/dolbeau/chacha20_dolbeau-avx2.c"
+    "${SRC}/crypto_stream/chacha20/ref/chacha20_ref.c"
+    "${SRC}/crypto_stream/crypto_stream.c"
+    "${SRC}/crypto_stream/salsa20/stream_salsa20.c"
+    "${SRC}/crypto_stream/salsa208/stream_salsa208.c"
+    "${SRC}/crypto_stream/salsa2012/stream_salsa2012.c"
+    "${SRC}/crypto_stream/chacha20/stream_chacha20.c"
+    "${SRC}/crypto_stream/aes128ctr/stream_aes128ctr.c"
+    "${SRC}/crypto_stream/xsalsa20/stream_xsalsa20.c"
+    "${SRC}/crypto_stream/xchacha20/stream_xchacha20.c"
+    "${SRC}/crypto_stream/salsa20/ref/salsa20_ref.c"
+    "${SRC}/crypto_stream/salsa20/xmm6/salsa20_xmm6.c"
+    "${SRC}/crypto_stream/salsa20/xmm6int/salsa20_xmm6int-avx2.c"
+    "${SRC}/crypto_stream/salsa20/xmm6int/salsa20_xmm6int-sse2.c"
+    "${SRC}/crypto_stream/salsa208/ref/stream_salsa208_ref.c"
+    "${SRC}/crypto_stream/salsa2012/ref/stream_salsa2012_ref.c"
+    "${SRC}/crypto_stream/chacha20/ref/chacha20_ref.c"
+    "${SRC}/crypto_stream/chacha20/dolbeau/chacha20_dolbeau-ssse3.c"
+    "${SRC}/crypto_stream/chacha20/dolbeau/chacha20_dolbeau-avx2.c"
+    "${SRC}/crypto_stream/aes128ctr/nacl/consts_aes128ctr.c"
+    "${SRC}/crypto_stream/aes128ctr/nacl/stream_aes128ctr_nacl.c"
+    "${SRC}/crypto_stream/aes128ctr/nacl/beforenm_aes128ctr.c"
+    "${SRC}/crypto_stream/aes128ctr/nacl/afternm_aes128ctr.c"
+    "${SRC}/crypto_stream/aes128ctr/nacl/xor_afternm_aes128ctr.c"
+    "${SRC}/crypto_stream/aes128ctr/nacl/int128_aes128ctr.c"
+    "${SRC}/crypto_stream/salsa20/xmm6/salsa20_xmm6-asm.S"
+    "${SRC}/crypto_stream/salsa20/stream_salsa20.c"
+    "${SRC}/crypto_stream/salsa20/ref/salsa20_ref.c"
+    "${SRC}/crypto_stream/salsa20/xmm6/salsa20_xmm6.c"
+    "${SRC}/crypto_stream/salsa20/xmm6int/salsa20_xmm6int-avx2.c"
+    "${SRC}/crypto_stream/salsa20/xmm6int/salsa20_xmm6int-sse2.c"
+    "${SRC}/crypto_stream/salsa20/xmm6/salsa20_xmm6-asm.S"
+    "${SRC}/crypto_stream/salsa20/ref/salsa20_ref.c"
+    "${SRC}/crypto_stream/xsalsa20/stream_xsalsa20.c"
+    "${SRC}/crypto_verify/sodium/verify.c"
+    "${SRC}/randombytes/randombytes.c"
+    "${SRC}/randombytes/sysrandom/randombytes_sysrandom.c"
+    "${SRC}/randombytes/salsa20/randombytes_salsa20_random.c"
+    "${SRC}/randombytes/nativeclient/randombytes_nativeclient.c"
+    "${SRC}/sodium/runtime.c"
+    "${SRC}/sodium/utils.c"
+    "${SRC}/sodium/core.c"
+    "${SRC}/sodium/version.c"
     )
 
 if(CONFIG_LIBSODIUM_USE_MBEDTLS_SHA)
-    set(COMPONENT_SRCDIRS ${COMPONENT_SRCDIRS}
-        port/crypto_hash_mbedtls
-        )
+    set(COMPONENT_SRCS "port/crypto_hash_mbedtls/crypto_hash_sha256_mbedtls.c"
+                   "port/crypto_hash_mbedtls/crypto_hash_sha512_mbedtls.c")
 else()
-    set(COMPONENT_SRCDIRS ${COMPONENT_SRCDIRS}
-        ${SRC}/crypto_hash/sha256/cp
-        ${SRC}/crypto_hash/sha512/cp
-        )
+    set(COMPONENT_SRCS "port/crypto_hash_mbedtls/crypto_hash_sha256_mbedtls.c"
+                   "port/crypto_hash_mbedtls/crypto_hash_sha512_mbedtls.c")
 endif()
 
 set(COMPONENT_ADD_INCLUDEDIRS ${SRC}/include port_include)
index ad162fe1e1c2529624178672769534783d694e44..84b6cf460798922e2e95462b2a30e9902e5672e0 100644 (file)
@@ -1,4 +1,4 @@
-set(COMPONENT_SRCDIRS ".")
+set(COMPONENT_SRCS "log.c")
 set(COMPONENT_ADD_INCLUDEDIRS "include")
 set(COMPONENT_REQUIRES)
 register_component()
index 45126db6550d011d4a8346275cefc44a38f1d04a..63930f6fe095962514d701a7af40151ea115fc3d 100644 (file)
@@ -5,27 +5,118 @@ set(COMPONENT_ADD_INCLUDEDIRS
     port/esp32/include/arch
     )
 
-set(COMPONENT_SRCDIRS
-    apps/dhcpserver
-       apps/ping
-       lwip/src/api
-       lwip/src/apps/sntp
-       lwip/src/core
-       lwip/src/core/ipv4
-       lwip/src/core/ipv6
-       lwip/src/netif
-       lwip/src/netif/ppp
-       port/esp32
-       port/esp32/freertos
-       port/esp32/netif
-       port/esp32/debug
-    )
+set(COMPONENT_SRCS "apps/dhcpserver/dhcpserver.c"
+                   "apps/ping/esp_ping.c"
+                   "apps/ping/ping.c"
+                   "lwip/src/api/api_lib.c"
+                   "lwip/src/api/api_msg.c"
+                   "lwip/src/api/err.c"
+                   "lwip/src/api/netbuf.c"
+                   "lwip/src/api/netdb.c"
+                   "lwip/src/api/netifapi.c"
+                   "lwip/src/api/sockets.c"
+                   "lwip/src/api/tcpip.c"
+                   "lwip/src/apps/sntp/sntp.c"
+                   "lwip/src/core/def.c"
+                   "lwip/src/core/dns.c"
+                   "lwip/src/core/inet_chksum.c"
+                   "lwip/src/core/init.c"
+                   "lwip/src/core/ip.c"
+                   "lwip/src/core/ipv4/autoip.c"
+                   "lwip/src/core/ipv4/dhcp.c"
+                   "lwip/src/core/ipv4/etharp.c"
+                   "lwip/src/core/ipv4/icmp.c"
+                   "lwip/src/core/ipv4/igmp.c"
+                   "lwip/src/core/ipv4/ip4.c"
+                   "lwip/src/core/ipv4/ip4_addr.c"
+                   "lwip/src/core/ipv4/ip4_frag.c"
+                   "lwip/src/core/ipv6/dhcp6.c"
+                   "lwip/src/core/ipv6/ethip6.c"
+                   "lwip/src/core/ipv6/icmp6.c"
+                   "lwip/src/core/ipv6/inet6.c"
+                   "lwip/src/core/ipv6/ip6.c"
+                   "lwip/src/core/ipv6/ip6_addr.c"
+                   "lwip/src/core/ipv6/ip6_frag.c"
+                   "lwip/src/core/ipv6/mld6.c"
+                   "lwip/src/core/ipv6/nd6.c"
+                   "lwip/src/core/mem.c"
+                   "lwip/src/core/memp.c"
+                   "lwip/src/core/netif.c"
+                   "lwip/src/core/pbuf.c"
+                   "lwip/src/core/raw.c"
+                   "lwip/src/core/stats.c"
+                   "lwip/src/core/sys.c"
+                   "lwip/src/core/tcp.c"
+                   "lwip/src/core/tcp_in.c"
+                   "lwip/src/core/tcp_out.c"
+                   "lwip/src/core/timeouts.c"
+                   "lwip/src/core/udp.c"
+                   "lwip/src/netif/ethernet.c"
+                   "lwip/src/netif/ethernetif.c"
+                   "lwip/src/netif/lowpan6.c"
+                   "lwip/src/netif/ppp/auth.c"
+                   "lwip/src/netif/ppp/ccp.c"
+                   "lwip/src/netif/ppp/chap-md5.c"
+                   "lwip/src/netif/ppp/chap-new.c"
+                   "lwip/src/netif/ppp/chap_ms.c"
+                   "lwip/src/netif/ppp/demand.c"
+                   "lwip/src/netif/ppp/eap.c"
+                   "lwip/src/netif/ppp/ecp.c"
+                   "lwip/src/netif/ppp/eui64.c"
+                   "lwip/src/netif/ppp/fsm.c"
+                   "lwip/src/netif/ppp/ipcp.c"
+                   "lwip/src/netif/ppp/ipv6cp.c"
+                   "lwip/src/netif/ppp/lcp.c"
+                   "lwip/src/netif/ppp/magic.c"
+                   "lwip/src/netif/ppp/mppe.c"
+                   "lwip/src/netif/ppp/multilink.c"
+                   "lwip/src/netif/ppp/ppp.c"
+                   "lwip/src/netif/ppp/pppapi.c"
+                   "lwip/src/netif/ppp/pppcrypt.c"
+                   "lwip/src/netif/ppp/pppoe.c"
+                   "lwip/src/netif/ppp/pppol2tp.c"
+                   "lwip/src/netif/ppp/pppos.c"
+                   "lwip/src/netif/ppp/upap.c"
+                   "lwip/src/netif/ppp/utils.c"
+                   "lwip/src/netif/ppp/vj.c"
+                   "lwip/src/netif/slipif.c"
+                   "port/esp32/debug/lwip_debug.c"
+                   "port/esp32/freertos/sys_arch.c"
+                   "port/esp32/netif/ethernetif.c"
+                   "port/esp32/netif/wlanif.c"
+                   "port/esp32/vfs_lwip.c")
 
 if(CONFIG_PPP_SUPPORT)
-    list(APPEND COMPONENT_SRCDIRS
-        lwip/src/netif/ppp
-        lwip/src/netif/ppp/polarssl
-        )
+    list(APPEND COMPONENT_SRCS "lwip/src/netif/ppp/auth.c"
+                   "lwip/src/netif/ppp/ccp.c"
+                   "lwip/src/netif/ppp/chap-md5.c"
+                   "lwip/src/netif/ppp/chap-new.c"
+                   "lwip/src/netif/ppp/chap_ms.c"
+                   "lwip/src/netif/ppp/demand.c"
+                   "lwip/src/netif/ppp/eap.c"
+                   "lwip/src/netif/ppp/ecp.c"
+                   "lwip/src/netif/ppp/eui64.c"
+                   "lwip/src/netif/ppp/fsm.c"
+                   "lwip/src/netif/ppp/ipcp.c"
+                   "lwip/src/netif/ppp/ipv6cp.c"
+                   "lwip/src/netif/ppp/lcp.c"
+                   "lwip/src/netif/ppp/magic.c"
+                   "lwip/src/netif/ppp/mppe.c"
+                   "lwip/src/netif/ppp/multilink.c"
+                   "lwip/src/netif/ppp/polarssl/arc4.c"
+                   "lwip/src/netif/ppp/polarssl/des.c"
+                   "lwip/src/netif/ppp/polarssl/md4.c"
+                   "lwip/src/netif/ppp/polarssl/md5.c"
+                   "lwip/src/netif/ppp/polarssl/sha1.c"
+                   "lwip/src/netif/ppp/ppp.c"
+                   "lwip/src/netif/ppp/pppapi.c"
+                   "lwip/src/netif/ppp/pppcrypt.c"
+                   "lwip/src/netif/ppp/pppoe.c"
+                   "lwip/src/netif/ppp/pppol2tp.c"
+                   "lwip/src/netif/ppp/pppos.c"
+                   "lwip/src/netif/ppp/upap.c"
+                   "lwip/src/netif/ppp/utils.c"
+                   "lwip/src/netif/ppp/vj.c")
 endif()
 
 set(COMPONENT_REQUIRES vfs)
index ffac9fea8e8ca957aef683592ff16b2032f966e6..aca00dddb7210a9a1d9b5dcaeae3256b7d12e94e 100644 (file)
@@ -1,7 +1,90 @@
 set(COMPONENT_ADD_INCLUDEDIRS port/include mbedtls/include)
-set(COMPONENT_SRCDIRS mbedtls/library port)
-
-set(COMPONENT_SRCEXCLUDE mbedtls/library/net_sockets.c)
+set(COMPONENT_SRCS "mbedtls/library/aes.c"
+                   "mbedtls/library/aesni.c"
+                   "mbedtls/library/arc4.c"
+                   "mbedtls/library/aria.c"
+                   "mbedtls/library/asn1parse.c"
+                   "mbedtls/library/asn1write.c"
+                   "mbedtls/library/base64.c"
+                   "mbedtls/library/bignum.c"
+                   "mbedtls/library/blowfish.c"
+                   "mbedtls/library/camellia.c"
+                   "mbedtls/library/ccm.c"
+                   "mbedtls/library/certs.c"
+                   "mbedtls/library/chacha20.c"
+                   "mbedtls/library/chachapoly.c"
+                   "mbedtls/library/cipher.c"
+                   "mbedtls/library/cipher_wrap.c"
+                   "mbedtls/library/cmac.c"
+                   "mbedtls/library/ctr_drbg.c"
+                   "mbedtls/library/debug.c"
+                   "mbedtls/library/des.c"
+                   "mbedtls/library/dhm.c"
+                   "mbedtls/library/ecdh.c"
+                   "mbedtls/library/ecdsa.c"
+                   "mbedtls/library/ecjpake.c"
+                   "mbedtls/library/ecp.c"
+                   "mbedtls/library/ecp_curves.c"
+                   "mbedtls/library/entropy.c"
+                   "mbedtls/library/entropy_poll.c"
+                   "mbedtls/library/error.c"
+                   "mbedtls/library/gcm.c"
+                   "mbedtls/library/havege.c"
+                   "mbedtls/library/hkdf.c"
+                   "mbedtls/library/hmac_drbg.c"
+                   "mbedtls/library/md.c"
+                   "mbedtls/library/md2.c"
+                   "mbedtls/library/md4.c"
+                   "mbedtls/library/md5.c"
+                   "mbedtls/library/md_wrap.c"
+                   "mbedtls/library/memory_buffer_alloc.c"
+                   "mbedtls/library/net_sockets.c"
+                   "mbedtls/library/nist_kw.c"
+                   "mbedtls/library/oid.c"
+                   "mbedtls/library/padlock.c"
+                   "mbedtls/library/pem.c"
+                   "mbedtls/library/pk.c"
+                   "mbedtls/library/pk_wrap.c"
+                   "mbedtls/library/pkcs11.c"
+                   "mbedtls/library/pkcs12.c"
+                   "mbedtls/library/pkcs5.c"
+                   "mbedtls/library/pkparse.c"
+                   "mbedtls/library/pkwrite.c"
+                   "mbedtls/library/platform.c"
+                   "mbedtls/library/platform_util.c"
+                   "mbedtls/library/poly1305.c"
+                   "mbedtls/library/ripemd160.c"
+                   "mbedtls/library/rsa.c"
+                   "mbedtls/library/rsa_internal.c"
+                   "mbedtls/library/sha1.c"
+                   "mbedtls/library/sha256.c"
+                   "mbedtls/library/sha512.c"
+                   "mbedtls/library/ssl_cache.c"
+                   "mbedtls/library/ssl_ciphersuites.c"
+                   "mbedtls/library/ssl_cli.c"
+                   "mbedtls/library/ssl_cookie.c"
+                   "mbedtls/library/ssl_srv.c"
+                   "mbedtls/library/ssl_ticket.c"
+                   "mbedtls/library/ssl_tls.c"
+                   "mbedtls/library/threading.c"
+                   "mbedtls/library/timing.c"
+                   "mbedtls/library/version.c"
+                   "mbedtls/library/version_features.c"
+                   "mbedtls/library/x509.c"
+                   "mbedtls/library/x509_create.c"
+                   "mbedtls/library/x509_crl.c"
+                   "mbedtls/library/x509_crt.c"
+                   "mbedtls/library/x509_csr.c"
+                   "mbedtls/library/x509write_crt.c"
+                   "mbedtls/library/x509write_csr.c"
+                   "mbedtls/library/xtea.c"
+                   "port/esp_bignum.c"
+                   "port/esp_hardware.c"
+                   "port/esp_sha1.c"
+                   "port/esp_sha256.c"
+                   "port/esp_sha512.c"
+                   "port/mbedtls_debug.c"
+                   "port/net_sockets.c")
 
 set(COMPONENT_REQUIRES lwip)
 
index 4ab664110912d53d0ce12acbefa8716ecdb71de6..0933e30059178eaaf9542dc3ffe0bac2481708b2 100644 (file)
@@ -1,4 +1,6 @@
-set(COMPONENT_SRCDIRS ".")
+set(COMPONENT_SRCS "mdns.c"
+                   "mdns_console.c"
+                   "mdns_networking.c")
 set(COMPONENT_ADD_INCLUDEDIRS "include")
 set(COMPONENT_PRIV_INCLUDEDIRS "private_include")
 set(COMPONENT_REQUIRES lwip mbedtls console tcpip_adapter)
index 24e0a9e6f6dadbbc769fcd6b22a16fcc60ed4c9b..a0e1693b116c1ea1274c33c30f404121a52958d8 100644 (file)
@@ -1,5 +1,5 @@
-# only compile the micro-ecc/uECC.c source file
-set(COMPONENT_SRCS micro-ecc/uECC.c)
+# only compile the "micro-ecc/uECC.c" source file
+set(COMPONENT_SRCS "micro-ecc/uECC.c")
 
 set(COMPONENT_ADD_INCLUDEDIRS micro-ecc)
 
index 4bc0db3f903cab9535ad119bdb94609c6761d664..a1d6d33676117c1824e9075bb31e679850f646a3 100644 (file)
@@ -1,4 +1,11 @@
-set(COMPONENT_SRCDIRS ".")
+set(COMPONENT_SRCS "locks.c"
+                   "pthread.c"
+                   "random.c"
+                   "reent_init.c"
+                   "select.c"
+                   "syscall_table.c"
+                   "syscalls.c"
+                   "time.c")
 set(COMPONENT_ADD_INCLUDEDIRS platform_include include)
 
 if(CONFIG_SPIRAM_CACHE_WORKAROUND)
index c7e4b754b87f7f89795a9868e6e10c51fb4884f4..b1a4b1642111265c2f34204ac08c4465886bacfb 100644 (file)
@@ -1,4 +1,26 @@
 set(COMPONENT_ADD_INCLUDEDIRS port/include nghttp2/lib/includes)
-set(COMPONENT_SRCDIRS nghttp2/lib port)
+set(COMPONENT_SRCS "nghttp2/lib/nghttp2_buf.c"
+                   "nghttp2/lib/nghttp2_callbacks.c"
+                   "nghttp2/lib/nghttp2_debug.c"
+                   "nghttp2/lib/nghttp2_frame.c"
+                   "nghttp2/lib/nghttp2_hd.c"
+                   "nghttp2/lib/nghttp2_hd_huffman.c"
+                   "nghttp2/lib/nghttp2_hd_huffman_data.c"
+                   "nghttp2/lib/nghttp2_helper.c"
+                   "nghttp2/lib/nghttp2_http.c"
+                   "nghttp2/lib/nghttp2_map.c"
+                   "nghttp2/lib/nghttp2_mem.c"
+                   "nghttp2/lib/nghttp2_npn.c"
+                   "nghttp2/lib/nghttp2_option.c"
+                   "nghttp2/lib/nghttp2_outbound_item.c"
+                   "nghttp2/lib/nghttp2_pq.c"
+                   "nghttp2/lib/nghttp2_priority_spec.c"
+                   "nghttp2/lib/nghttp2_queue.c"
+                   "nghttp2/lib/nghttp2_rcbuf.c"
+                   "nghttp2/lib/nghttp2_session.c"
+                   "nghttp2/lib/nghttp2_stream.c"
+                   "nghttp2/lib/nghttp2_submit.c"
+                   "nghttp2/lib/nghttp2_version.c"
+                   "port/http_parser.c")
 
 register_component()
index 1fe5ecf26e12175f2168ca61d4809ffea46f07c8..ce7efbb14b2b07dad49c1749e75abd890637b390 100644 (file)
@@ -1,4 +1,9 @@
-set(COMPONENT_SRCDIRS src)
+set(COMPONENT_SRCS "src/nvs_api.cpp"
+                   "src/nvs_item_hash_list.cpp"
+                   "src/nvs_page.cpp"
+                   "src/nvs_pagemanager.cpp"
+                   "src/nvs_storage.cpp"
+                   "src/nvs_types.cpp")
 set(COMPONENT_ADD_INCLUDEDIRS include)
 
 set(COMPONENT_REQUIRES spi_flash)
index 84d02ffe8807ddbba96f573642a1f0fe7ca3fa93..3a96598f01e8b904c34734f22c419e09be783238 100644 (file)
@@ -1,6 +1,13 @@
 set(COMPONENT_ADD_INCLUDEDIRS include)
 set(COMPONENT_PRIV_INCLUDEDIRS include/internal include/platform include/openssl)
-set(COMPONENT_SRCDIRS library platform)
+set(COMPONENT_SRCS "library/ssl_cert.c"
+                   "library/ssl_lib.c"
+                   "library/ssl_methods.c"
+                   "library/ssl_pkey.c"
+                   "library/ssl_stack.c"
+                   "library/ssl_x509.c"
+                   "platform/ssl_pm.c"
+                   "platform/ssl_port.c")
 
 set(COMPONENT_REQUIRES mbedtls)
 
index 0b93e09ed49b09b38d934929d12d6bd60c679c3d..157793707ffa709ef897b1808b15afceded1aa3d 100644 (file)
@@ -1,4 +1,6 @@
-set(COMPONENT_SRCDIRS ".")
+set(COMPONENT_SRCS "pthread.c"
+                   "pthread_cond_var.c"
+                   "pthread_local_storage.c")
 set(COMPONENT_ADD_INCLUDEDIRS "include")
 set(COMPONENT_REQUIRES)
 register_component()
index 58b9aeb6797c2f806c2d71f23b7ee3d3a2635e16..41defd5e9e7e26d3b62d64cc9f234ec2645b9d72 100644 (file)
@@ -1,4 +1,9 @@
-set(COMPONENT_SRCDIRS ".")
+set(COMPONENT_SRCS "sdmmc_cmd.c"
+                   "sdmmc_common.c"
+                   "sdmmc_init.c"
+                   "sdmmc_io.c"
+                   "sdmmc_mmc.c"
+                   "sdmmc_sd.c")
 set(COMPONENT_ADD_INCLUDEDIRS "include")
 set(COMPONENT_REQUIRES driver)
 register_component()
index 8b18007dea201fb976e6ebc2a7066dc43e539b80..1518776ce9c9f8a4f5353257c3be540941442d52 100644 (file)
@@ -1,4 +1,4 @@
-set(COMPONENT_SRCDIRS ".")
+set(COMPONENT_SRCS "smartconfig_ack.c")
 set(COMPONENT_ADD_INCLUDEDIRS "include")
 
 set(COMPONENT_PRIV_REQUIRES lwip tcpip_adapter)
index a6a916b6417f8b34b6dfbdbff2b0b6e684fb0dad..b46bde85041856ae1543b83ec359a719a7c2d243 100644 (file)
@@ -1,9 +1,12 @@
 set(SOC_NAME esp32)
 
-set(COMPONENT_SRCDIRS ${SOC_NAME} src)
-set(COMPONENT_ADD_INCLUDEDIRS ${SOC_NAME}/include include)
+include(${IDF_PATH}/components/soc/${SOC_NAME}/sources.cmake)
 
-set(COMPONENT_REQUIRES)
+spaces2list(SOC_SRCS)
+add_prefix(COMPONENT_SRCS "${SOC_NAME}/" ${SOC_SRCS})
+list(APPEND COMPONENT_SRCS "src/memory_layout_utils.c")
 
+set(COMPONENT_ADD_INCLUDEDIRS ${SOC_NAME}/include include)
 
-register_component()
+set(COMPONENT_REQUIRES)
+register_component()
\ No newline at end of file
diff --git a/components/soc/esp32/sources.cmake b/components/soc/esp32/sources.cmake
new file mode 100644 (file)
index 0000000..25e2061
--- /dev/null
@@ -0,0 +1,14 @@
+set(SOC_SRCS "cpu_util.c"
+    "gpio_periph.c"
+    "rtc_clk.c"
+    "rtc_clk_init.c"
+    "rtc_init.c"
+    "rtc_periph.c"
+    "rtc_pm.c"
+    "rtc_sleep.c"
+    "rtc_time.c"
+    "rtc_wdt.c"
+    "sdio_slave_periph.c"
+    "sdmmc_periph.c"
+    "soc_memory_layout.c"
+    "spi_periph.c")
\ No newline at end of file
index 1eafba54d4ecd3c32e530a71041440841dc63f5d..0445b53347aa32553b53b6b32d4bd04ff72558b6 100644 (file)
@@ -1,10 +1,14 @@
 if(BOOTLOADER_BUILD)
     # Bootloader needs SPIUnlock from this file, but doesn't
     # need other parts of this component
-    set(COMPONENT_SRCS spi_flash_rom_patch.c)
+    set(COMPONENT_SRCS "spi_flash_rom_patch.c")
     set(COMPONENT_PRIV_REQUIRES bootloader_support)
 else()
-    set(COMPONENT_SRCDIRS .)
+    set(COMPONENT_SRCS "cache_utils.c"
+                   "flash_mmap.c"
+                   "flash_ops.c"
+                   "partition.c"
+                   "spi_flash_rom_patch.c")
     set(COMPONENT_PRIV_REQUIRES bootloader_support app_update)
 endif()
 
index 54356cb0d6571f2f3abc1162e1399e9f394c05e7..c0903655d89e2ea70c0c8cc6a64028337f2b0aee 100644 (file)
@@ -1,6 +1,12 @@
 set(COMPONENT_ADD_INCLUDEDIRS "include")
 set(COMPONENT_PRIV_INCLUDEDIRS "." "spiffs/src")
-set(COMPONENT_SRCDIRS "." "spiffs/src")
+set(COMPONENT_SRCS "esp_spiffs.c"
+                   "spiffs/src/spiffs_cache.c"
+                   "spiffs/src/spiffs_check.c"
+                   "spiffs/src/spiffs_gc.c"
+                   "spiffs/src/spiffs_hydrogen.c"
+                   "spiffs/src/spiffs_nucleus.c"
+                   "spiffs_api.c")
 
 set(COMPONENT_REQUIRES spi_flash)
 set(COMPONENT_PRIV_REQUIRES bootloader_support)
index 24deb2f24796c5f05a1bf87caa34bc59937fdce7..2868696ac76a2506c83102c0bf07de982cba635a 100644 (file)
@@ -1,4 +1,4 @@
-set(COMPONENT_SRCDIRS ".")
+set(COMPONENT_SRCS "tcpip_adapter_lwip.c")
 set(COMPONENT_ADD_INCLUDEDIRS "include")
 
 set(COMPONENT_REQUIRES lwip)
index fc21f1ecac84ac577c41ad875b366452f8fcf13a..9c71467b3977bd0737df0170e135ee20e23af866 100644 (file)
@@ -1,4 +1,5 @@
-set(COMPONENT_SRCDIRS ".")
+set(COMPONENT_SRCS "ulp.c"
+                   "ulp_macro.c")
 set(COMPONENT_ADD_INCLUDEDIRS "include")
 
 set(COMPONENT_REQUIRES)
index fc21f1ecac84ac577c41ad875b366452f8fcf13a..77083dc202c2aa7d5ec282d6ea61473c537107dc 100644 (file)
@@ -1,4 +1,5 @@
-set(COMPONENT_SRCDIRS ".")
+set(COMPONENT_SRCS "vfs.c"
+                   "vfs_uart.c")
 set(COMPONENT_ADD_INCLUDEDIRS "include")
 
 set(COMPONENT_REQUIRES)
index 8b5db6231dea4cc5828816733ec14f6a4aa03554..59b81ccfaac80925210cfe3fcd13cd44f40614d9 100644 (file)
@@ -1,4 +1,10 @@
-set(COMPONENT_SRCDIRS ".")
+set(COMPONENT_SRCS "Partition.cpp"
+                   "SPI_Flash.cpp"
+                   "WL_Ext_Perf.cpp"
+                   "WL_Ext_Safe.cpp"
+                   "WL_Flash.cpp"
+                   "crc32.cpp"
+                   "wear_levelling.cpp")
 set(COMPONENT_ADD_INCLUDEDIRS "include")
 set(COMPONENT_PRIV_INCLUDEDIRS private_include)
 set(COMPONENT_REQUIRES spi_flash)
index 2f63ff398fc9a8cadea237f617091aa0e0fe6a1e..8564f1ba0289e3ac09eb93924cf97cb5ac74ca1a 100644 (file)
@@ -1,4 +1,76 @@
-set(COMPONENT_SRCDIRS src/crypto port src/fast_crypto src/wpa2/eap_peer src/wpa2/tls src/wpa2/utils src/wps)
+set(COMPONENT_SRCS "port/os_xtensa.c"
+                   "src/crypto/aes-cbc.c"
+                   "src/crypto/aes-internal-dec.c"
+                   "src/crypto/aes-internal-enc.c"
+                   "src/crypto/aes-internal.c"
+                   "src/crypto/aes-unwrap.c"
+                   "src/crypto/aes-wrap.c"
+                   "src/crypto/bignum.c"
+                   "src/crypto/crypto_internal-cipher.c"
+                   "src/crypto/crypto_internal-modexp.c"
+                   "src/crypto/crypto_internal-rsa.c"
+                   "src/crypto/crypto_internal.c"
+                   "src/crypto/des-internal.c"
+                   "src/crypto/dh_group5.c"
+                   "src/crypto/dh_groups.c"
+                   "src/crypto/md4-internal.c"
+                   "src/crypto/md5-internal.c"
+                   "src/crypto/md5.c"
+                   "src/crypto/ms_funcs.c"
+                   "src/crypto/rc4.c"
+                   "src/crypto/sha1-internal.c"
+                   "src/crypto/sha1-pbkdf2.c"
+                   "src/crypto/sha1.c"
+                   "src/crypto/sha256-internal.c"
+                   "src/crypto/sha256.c"
+                   "src/fast_crypto/fast_aes-cbc.c"
+                   "src/fast_crypto/fast_aes-unwrap.c"
+                   "src/fast_crypto/fast_aes-wrap.c"
+                   "src/fast_crypto/fast_crypto_internal-cipher.c"
+                   "src/fast_crypto/fast_crypto_internal-modexp.c"
+                   "src/fast_crypto/fast_crypto_internal.c"
+                   "src/fast_crypto/fast_sha256-internal.c"
+                   "src/fast_crypto/fast_sha256.c"
+                   "src/wpa2/eap_peer/chap.c"
+                   "src/wpa2/eap_peer/eap.c"
+                   "src/wpa2/eap_peer/eap_common.c"
+                   "src/wpa2/eap_peer/eap_mschapv2.c"
+                   "src/wpa2/eap_peer/eap_peap.c"
+                   "src/wpa2/eap_peer/eap_peap_common.c"
+                   "src/wpa2/eap_peer/eap_tls.c"
+                   "src/wpa2/eap_peer/eap_tls_common.c"
+                   "src/wpa2/eap_peer/eap_ttls.c"
+                   "src/wpa2/eap_peer/mschapv2.c"
+                   "src/wpa2/tls/asn1.c"
+                   "src/wpa2/tls/bignum.c"
+                   "src/wpa2/tls/pkcs1.c"
+                   "src/wpa2/tls/pkcs5.c"
+                   "src/wpa2/tls/pkcs8.c"
+                   "src/wpa2/tls/rsa.c"
+                   "src/wpa2/tls/tls_internal.c"
+                   "src/wpa2/tls/tlsv1_client.c"
+                   "src/wpa2/tls/tlsv1_client_read.c"
+                   "src/wpa2/tls/tlsv1_client_write.c"
+                   "src/wpa2/tls/tlsv1_common.c"
+                   "src/wpa2/tls/tlsv1_cred.c"
+                   "src/wpa2/tls/tlsv1_record.c"
+                   "src/wpa2/tls/tlsv1_server.c"
+                   "src/wpa2/tls/tlsv1_server_read.c"
+                   "src/wpa2/tls/tlsv1_server_write.c"
+                   "src/wpa2/tls/x509v3.c"
+                   "src/wpa2/utils/base64.c"
+                   "src/wpa2/utils/ext_password.c"
+                   "src/wps/eap_common.c"
+                   "src/wps/uuid.c"
+                   "src/wps/wps.c"
+                   "src/wps/wps_attr_build.c"
+                   "src/wps/wps_attr_parse.c"
+                   "src/wps/wps_attr_process.c"
+                   "src/wps/wps_common.c"
+                   "src/wps/wps_dev_attr.c"
+                   "src/wps/wps_enrollee.c"
+                   "src/wps/wps_registrar.c"
+                   "src/wps/wps_validate.c")
 set(COMPONENT_ADD_INCLUDEDIRS include port/include)
 
 set(COMPONENT_REQUIRES "")
index 810d299d134e418f94661ec05e283d37da5c8abc..465690d822da83b5a2d0b531580bc45602eb3a43 100644 (file)
@@ -1,4 +1,5 @@
-set(COMPONENT_SRCDIRS ".")
+set(COMPONENT_SRCS "eri.c"
+                   "trax.c")
 set(COMPONENT_ADD_INCLUDEDIRS "include")
 
 set(COMPONENT_REQUIRES "")
index d0423c01e46e8697d6cd1051a80a0ecd9f8951e9..dfa679c2f8366b427340058eca2e637daa8c1c7e 100644 (file)
@@ -170,14 +170,14 @@ An example project directory tree might look like this::
 
 This example "myProject" contains the following elements:
 
-- A top-level project CMakeLists.txt file. This is the primary file which CMake uses to learn how to build the project. The project CMakeLists.txt file sets the ``MAIN_SRCS`` variable which lists all of the source files in the "main" directory (part of this project's executable). It may set other project-wide CMake variables, as well. Then it includes the file :idf_file:`/tools/cmake/project.cmake` which
+- A top-level project CMakeLists.txt file. This is the primary file which CMake uses to learn how to build the project; and may set project-wide CMake variables. It includes the file :idf_file:`/tools/cmake/project.cmake` which
   implements the rest of the build system. Finally, it sets the project name and defines the project.
 
 - "sdkconfig" project configuration file. This file is created/updated when ``idf.py menuconfig`` runs, and holds configuration for all of the components in the project (including ESP-IDF itself). The "sdkconfig" file may or may not be added to the source control system of the project.
 
 - Optional "components" directory contains components that are part of the project. A project does not have to contain custom components of this kind, but it can be useful for structuring reusable code or including third party components that aren't part of ESP-IDF.
 
-- "main" directory is a special "by convention" directory that contains source code for the project executable itself. These source files are listed in the project's CMakeLists file. You don't need to name this directory "main", but we recommend you follow this convention. If you have a lot of source files in your project, we recommend grouping most into components instead of putting them all in "main".
+- "main" directory is a special "pseudo-component" that contains source code for the project itself. "main" is a default name, the CMake variable ``COMPONENT_DIRS`` includes this component but you can modify this variable (or set ``EXTRA_COMPONENT_DIRS`` in the top-level CMakeLists.txt) to look for components in other places. If you have a lot of source files in your project, we recommend grouping most into components instead of putting them all in "main".
 
 - "build" directory is where build output is created. This directory is created by ``idf.py`` if it doesn't already exist. CMake configures the project and generates interim build files in this directory. Then, after the main build process is run, this directory will also contain interim object files and libraries as well as final binary output files. This directory is usually not added to source control or distributed with the project source code.
 
@@ -200,8 +200,6 @@ Minimal project::
 
       cmake_minimum_required(VERSION 3.5)
 
-      set(MAIN_SRCS main/src1.c main/src2.c)
-
       include($ENV{IDF_PATH}/tools/cmake/project.cmake)
       project(myProject)
 
@@ -214,11 +212,6 @@ Mandatory Parts
 The inclusion of these four lines, in the order shown above, is necessary for every project:
 
 - ``cmake_minimum_required(VERSION 3.5)`` tells CMake what version is required to build the project. ESP-IDF is designed to work with CMake 3.5 or newer. This line must be the first line in the CMakeLists.txt file.
-- ``set(MAIN_SRCS xxx)`` sets a variable - ``MAIN_SRCS`` to be a list of the "main" source files in the project. Paths are relative to the CMakeLists. They don't specifically need to be under the "main" sub-directory, but this structure is encouraged.
-
-  It is *strongly recommended not to add a lot of files to the MAIN_SRCS list*. If you have a lot of source files then it recommended to organise them functionally into individual components under the project "components" directory. This will make your project more maintainable, reusable, and easier to configure. Components are further explained below.
-
-  ``MAIN_SRCS`` must name at least one source file (although that file doesn't need to necessarily include an ``app_main()`` function or anything else).
 - ``include($ENV{IDF_PATH}/tools/cmake/project.cmake)`` pulls in the rest of the CMake functionality to configure the project, discover all the components, etc.
 - ``project(myProject)`` creates the project itself, and specifies the project name. The project name is used for the final binary output files of the app - ie ``myProject.elf``, ``myProject.bin``. Only one project can be defined per CMakeLists file.
 
@@ -268,11 +261,11 @@ Minimal Component CMakeLists
 
 The minimal component ``CMakeLists.txt`` file is as follows::
 
-  set(COMPONENT_SRCDIRS ".")
+  set(COMPONENT_SRCS "foo.c")
   set(COMPONENT_ADD_INCLUDEDIRS "include")
   register_component()
 
-- ``COMPONENT_SRCDIRS`` is a (space-separated) list of directories to search for source files. Source files (``*.c``, ``*.cpp``, ``*.cc``, ``*.S``) in these directories will be compiled into the component library.
+- ``COMPONENT_SRCS`` is a (space-separated) list of source files (``*.c``, ``*.cpp``, ``*.cc``, ``*.S``). These source files will be compiled into the component library.
 - ``COMPONENT_ADD_INCLUDEDIRS`` is a (space-separated) list of directories to add to the global include search path for any component which requires this component, and also the main source files.
 - ``register_component()`` is required to add the component (using the variables set above) to the build. A library with the name of the component will be built and linked into the final app. If this step is skipped (perhaps due to use of a CMake `if function <cmake if_>`_ or similar), this component will not be part of the build.
 
@@ -320,12 +313,17 @@ The following variables can be set inside ``component.mk`` to control the build
   the component directory, which will be added to the include search
   path for this component's source files only.
 - ``COMPONENT_PRIV_REQUIRES`` is a (space-separated) list of components that are required to either compile or link this component's source files. These components' header paths do not propagate to other components which require it, they are only used to compile this component's sources. See `Component Requirements`_ for more details.
+- ``COMPONENT_SRCS``: Paths to individual source files to compile as part of the component. This is the recommended way of adding source files to the build.
 - ``COMPONENT_SRCDIRS``: Directory paths, must be relative to the component directory, which will be searched for source files (``*.cpp``,
-  ``*.c``, ``*.S``). Set this to specify a list of directories which contain source files.
-- ``COMPONENT_SRCS``: Paths to individual source files to compile. Setting this causes ``COMPONENT_SRCDIRS`` to be ignored. Setting this variable instead gives you finer grained control over which files are compiled.
-  If you don't set ``COMPONENT_SRCDIRS`` or ``COMPONENT_SRCS``, your component won't compile a library but it may still add include paths for use when compiling other components or the source files listed in ``MAIN_SRCS``.
+  ``*.c``, ``*.S``). Source files are globbed from the listed directories and compiled as part of the component in place of ``COMPONENT_SRCS``, i.e. setting this will cause ``COMPONENT_SRCS`` to be ignored.
+  This can be a convenient way of including source files to the components en masse, but is generally not recommended due to caveats attached to CMake globbing (see `File Globbing & Incremental Builds`).
 - ``COMPONENT_SRCEXCLUDE``: Paths to source files to exclude from component. Can be set in conjunction with ``COMPONENT_SRCDIRS`` if there is a directory with a large number of source files to include in the component but one or more source files which should not be. Paths can be specified relative to the component directory or absolute.
 
+.. note::
+
+  If you don't set ``COMPONENT_SRCDIRS`` or ``COMPONENT_SRCS``, your component won't compile a library but it may still add include paths for use when compiling other components.
+
+
 Controlling Component Compilation
 ---------------------------------
 
@@ -399,7 +397,6 @@ When creating a project
   - Those components' requirements (evaluated recursively).
   - The "common" components that every component depends on.
 - Setting ``COMPONENTS`` to the minimal list of required components can significantly reduce compile times.
-- When compiling the project's source files (``MAIN_SRCS``), the public header directories (``COMPONENT_ADD_INCLUDEDIRS`` list) of all components included in the build are available.
 
 .. _component-requirements-implementation:
 
@@ -777,22 +774,20 @@ File Globbing & Incremental Builds
 
 .. highlight:: cmake
 
-The preferred way to include source files in an ESP-IDF component is to set ``COMPONENT_SRC_DIRS``::
+The preferred way to include source files in an ESP-IDF component is to list them manually in COMPONENT_SRCS::
 
-  set(COMPONENT_SRCDIRS library platform)
+  set(COMPONENT_SRCS library/a.c library/b.c platform/platform.c)
 
-The build system will automatically find (via "file globbing") all source files in this directory. Alternatively, files can be specified individually::
+This preference reflects the `CMake best practice <https://gist.github.com/mbinna/c61dbb39bca0e4fb7d1f73b0d66a4fd1/>`_ of manually listing source files. This could, however, be inconvenient when there are lots of source files to add to the build. The ESP-IDF build system provides an alternative way for specifying source files using ``COMPONENT_SRCDIRS``::
 
-  set(COMPONENT_SRCS library/a.c library/b.c platform/platform.c)
+  set(COMPONENT_SRCDIRS library platform)
 
-CMake_ recommends always to name all files individually (ie ``COMPONENT_SRCS``). This is because CMake is automatically re-run whenever a CMakeLists file changes. If a new source file is added and file globbing is used, then CMake won't know to automatically re-run and this file won't be added to the build.
+This uses globbing behind the scenes to find source files in the specified directories. Be aware, however, that if a new source file is added and this method is used, then CMake won't know to automatically re-run and this file won't be added to the build. 
 
 The trade-off is acceptable when you're adding the file yourself, because you can trigger a clean build or run ``idf.py reconfigure`` to manually re-run CMake_. However, the problem gets harder when you share your project with others who may check out a new version using a source control tool like Git...
 
 For components which are part of ESP-IDF, we use a third party Git CMake integration module (:idf_file:`/tools/cmake/third_party/GetGitRevisionDescription.cmake`) which automatically re-runs CMake any time the repository commit changes. This means if you check out a new ESP-IDF version, CMake will automatically rerun.
 
-For project CMakeLists files, ``MAIN_SRCS`` is a list of source files. Therefore if a new file is added, CMakeLists will change and this triggers a re-run of CMake. (This is the approach which CMake_ recommends.)
-
 For project components (not part of ESP-IDF), there are a few different options:
 
 - If keeping your project file in Git, ESP-IDF will automatically track the Git revision and re-run CMake if the revision changes.
@@ -889,15 +884,6 @@ It does so by running ``make`` to expand the ESP-IDF build system variables whic
 
 The conversion tool is not capable of dealing with complex Makefile logic or unusual targets. These will need to be converted by hand.
 
-'main' is no longer a component
--------------------------------
-
-In the GNU Make build system ``main`` is a component with a ``component.mk`` file like other components.
-
-Due to CMake requirements for building executables, ``main`` source files are now linked directly into the final binary. The source files in ``main`` must be listed in the ``MAIN_SRCS`` variable (see :ref:`project mandatory variables <project-mandatory-parts>` for more details). At least one source file has to be listed here (although it doesn't need to contain anything in particular).
-
-In general, it's better not to have too many source files in ``MAIN_SRCS``. If you find that you are adding many source files here, see if you can reorganize and group some into project components (see the :ref:`example project structure <example-project-structure>`, above).
-
 No Longer Available in CMake
 ----------------------------
 
@@ -930,8 +916,7 @@ The following variables no longer have default values:
 No Longer Necessary
 -------------------
 
-It is no longer necessary to set ``COMPONENT_SRCDIRS`` if setting ``COMPONENT_SRCS`` (in fact, in the CMake-based system ``COMPONENT_SRCDIRS`` is ignored if ``COMPONENT_SRCS`` is set).
-
+It is no longer necessary to set ``COMPONENT_SRCDIRS`` if setting ``COMPONENT_SRCS`` (in fact, in the CMake-based system ``COMPONENT_SRCS`` is ignored if ``COMPONENT_SRCDIRS`` is set).
 
 .. _esp-idf-template: https://github.com/espressif/esp-idf-template
 .. _cmake: https://cmake.org
index 3243515f39f2e653bc079c43a674332966b167c8..3c9fa474c11bfe9e8a2de23b2b488605e033173b 100644 (file)
@@ -2,11 +2,5 @@
 # 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)
diff --git a/examples/bluetooth/a2dp_gatts_coex/main/CMakeLists.txt b/examples/bluetooth/a2dp_gatts_coex/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..a55538b
--- /dev/null
@@ -0,0 +1,6 @@
+set(COMPONENT_SRCS "bt_app_av.c"
+                   "bt_app_core.c"
+                   "main.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index 4d14857a023b0cf4b21d2877ee2d6460096fad0b..cc8e45027dda334b9daec460429b32dab3e56063 100644 (file)
@@ -2,11 +2,5 @@
 # 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(a2dp_sink)
diff --git a/examples/bluetooth/a2dp_sink/main/CMakeLists.txt b/examples/bluetooth/a2dp_sink/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..a55538b
--- /dev/null
@@ -0,0 +1,6 @@
+set(COMPONENT_SRCS "bt_app_av.c"
+                   "bt_app_core.c"
+                   "main.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index 1b4c447998b88f2ddb1ed45cff513c6364a2e6b9..7c4e2152888a3091515e4ea035f96d283d48b931 100644 (file)
@@ -2,10 +2,5 @@
 # CMakeLists in this exact order for cmake to work correctly
 cmake_minimum_required(VERSION 3.5)
 
-set(MAIN_SRCS
-    main/bt_app_core.c
-    main/main.c
-    )
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(a2dp_source)
diff --git a/examples/bluetooth/a2dp_source/main/CMakeLists.txt b/examples/bluetooth/a2dp_source/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..98b05a1
--- /dev/null
@@ -0,0 +1,5 @@
+set(COMPONENT_SRCS "bt_app_core.c"
+                   "main.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index 04715a8583aec2b6b1c68be043a1f850791e1be5..22b94847f6ef7248461eb6014b4f314a81e8d71f 100644 (file)
@@ -2,9 +2,5 @@
 # CMakeLists in this exact order for cmake to work correctly
 cmake_minimum_required(VERSION 3.5)
 
-set(MAIN_SRCS
-    main/app_bt.c
-    )
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(ble_adv)
diff --git a/examples/bluetooth/ble_adv/main/CMakeLists.txt b/examples/bluetooth/ble_adv/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..d005e60
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "app_bt.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index 05d77c7c6f2f7fba0c26246210ddb1dbcb4dc2d5..9c5943ef06e4151ef1b4096e421cd422fae9d6b2 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/esp_eddystone_api.c main/esp_eddystone_demo.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(ble_eddystone_demo)
diff --git a/examples/bluetooth/ble_eddystone/main/CMakeLists.txt b/examples/bluetooth/ble_eddystone/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..66a4e1a
--- /dev/null
@@ -0,0 +1,5 @@
+set(COMPONENT_SRCS "esp_eddystone_api.c"
+                   "esp_eddystone_demo.c")
+set(COMPONENT_ADD_INCLUDEDIRS "")
+
+register_component()
index 9cacc348988d4afc81e9fa3297a92078733ce561..f8c948007c0a07c1507a31ebc6897405489882c3 100644 (file)
@@ -1,11 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/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)
diff --git a/examples/bluetooth/ble_hid_device_demo/main/CMakeLists.txt b/examples/bluetooth/ble_hid_device_demo/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..cada4eb
--- /dev/null
@@ -0,0 +1,7 @@
+set(COMPONENT_SRCS "ble_hidd_demo_main.c"
+                   "esp_hidd_prf_api.c"
+                   "hid_dev.c"
+                   "hid_device_le_prf.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index 5eb1d7363ea9c6f88e0f1d84d69ac0f8307009dd..dce22425d5e26f9c1c4e15168fde5abf79324f5b 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/ibeacon_demo.c main/esp_ibeacon_api.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(ble_ibeacon_demo)
diff --git a/examples/bluetooth/ble_ibeacon/main/CMakeLists.txt b/examples/bluetooth/ble_ibeacon/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..1ae1a02
--- /dev/null
@@ -0,0 +1,5 @@
+set(COMPONENT_SRCS "esp_ibeacon_api.c"
+                   "ibeacon_demo.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index 93abbbfb3aae4b17f4a55b903a25fc47462d133c..301d8408e78130cdd7a92d94e59466d2f1cb3392 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/spp_client_demo.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(spp_client_demo)
diff --git a/examples/bluetooth/ble_spp_client/main/CMakeLists.txt b/examples/bluetooth/ble_spp_client/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..de584f3
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "spp_client_demo.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index c0508f8018cbdbab67d6785037c755d1edb563a5..b4dcebe6afecbd9c0c1eecf56615e6ac4f59cbe4 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/ble_spp_server_demo.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(ble_spp_server_demo)
diff --git a/examples/bluetooth/ble_spp_server/main/CMakeLists.txt b/examples/bluetooth/ble_spp_server/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..99f35ee
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "ble_spp_server_demo.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index c557a916ef71a2baa543e8cd503418eec5dc14ee..3a592ef4f0b117332dd0d7afdeef3b5e8d03cce1 100644 (file)
@@ -2,9 +2,5 @@
 # CMakeLists in this exact order for cmake to work correctly
 cmake_minimum_required(VERSION 3.5)
 
-set(MAIN_SRCS
-    main/example_ble_client_throughput.c
-    )
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(throughput_client_demo)
diff --git a/examples/bluetooth/ble_throughput/throughput_client/main/CMakeLists.txt b/examples/bluetooth/ble_throughput/throughput_client/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..1fe2755
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "example_ble_client_throughput.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index 8d3bd0cbb180b2a75c093fe90a8073386e79692b..adcc12d731f153b3f5642a6c6936fef094f804b3 100644 (file)
@@ -2,9 +2,5 @@
 # CMakeLists in this exact order for cmake to work correctly
 cmake_minimum_required(VERSION 3.5)
 
-set(MAIN_SRCS
-    main/example_ble_server_throughput.c
-    )
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(throughput_server_demo)
diff --git a/examples/bluetooth/ble_throughput/throughput_server/main/CMakeLists.txt b/examples/bluetooth/ble_throughput/throughput_server/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..3c1f62a
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "example_ble_server_throughput.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index e016e161a375259b1aaefa293941cced7e5451aa..b85d34bbbfc2a07bf5f375e6a9976a36d8bcdbbc 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/blufi_security.c main/blufi_example_main.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(blufi_demo)
diff --git a/examples/bluetooth/blufi/main/CMakeLists.txt b/examples/bluetooth/blufi/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..cbb9b24
--- /dev/null
@@ -0,0 +1,5 @@
+set(COMPONENT_SRCS "blufi_example_main.c"
+                   "blufi_security.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index b79d221bdd1918ab4fa010c06bbf2a764d6b0beb..6b73adc360d4cd0f73c44f4ba5e4cfcbaaaf1e46 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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_discovery.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(bt_discovery)
diff --git a/examples/bluetooth/bt_discovery/main/CMakeLists.txt b/examples/bluetooth/bt_discovery/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..68ddbfb
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "bt_discovery.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index 5ed97b3876ea1ad61748c0634070c1203afe4942..8b26ee3f56b888e6e660f69b43d5f9b42acf2aad 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/example_spp_acceptor_demo.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(bt_spp_acceptor_demo)
diff --git a/examples/bluetooth/bt_spp_acceptor/main/CMakeLists.txt b/examples/bluetooth/bt_spp_acceptor/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..0694503
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "example_spp_acceptor_demo.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index fc8eb551bb0511812da67c5404d435f409139c33..4ee5f07788e0554090ba306eda076f5bd9384e35 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/example_spp_initiator_demo.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(bt_spp_initiator_demo)
diff --git a/examples/bluetooth/bt_spp_initiator/main/CMakeLists.txt b/examples/bluetooth/bt_spp_initiator/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..1eae1b7
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "example_spp_initiator_demo.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index b37ab5f68315eb1de19549dafb7f75c73cf9c590..46030210a0045d7a3b8c6b739141333352062d77 100644 (file)
@@ -1,10 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/example_spp_vfs_acceptor_demo.c
-    main/spp_task.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(bt_spp_vfs_acceptor_demo)
diff --git a/examples/bluetooth/bt_spp_vfs_acceptor/main/CMakeLists.txt b/examples/bluetooth/bt_spp_vfs_acceptor/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..b224db8
--- /dev/null
@@ -0,0 +1,5 @@
+set(COMPONENT_SRCS "example_spp_vfs_acceptor_demo.c"
+                   "spp_task.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index 94c7b230def724a40332105b4d4778cbc70806f2..a133903920e5540f272934d0db2ea750ee5ba6bd 100644 (file)
@@ -1,10 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/example_spp_vfs_initiator_demo.c
-    main/spp_task.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(bt_spp_vfs_initiator_demo)
diff --git a/examples/bluetooth/bt_spp_vfs_initiator/main/CMakeLists.txt b/examples/bluetooth/bt_spp_vfs_initiator/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..f3b9111
--- /dev/null
@@ -0,0 +1,5 @@
+set(COMPONENT_SRCS "example_spp_vfs_initiator_demo.c"
+                   "spp_task.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index 0c7fcbdd947b6507eaf6e8bdccbe25cf3802e61c..49c95f4da401e668c8124933d3e6c2cd2461c64a 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/controller_hci_uart_demo.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(controller_hci_uart)
diff --git a/examples/bluetooth/controller_hci_uart/main/CMakeLists.txt b/examples/bluetooth/controller_hci_uart/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..2f40a64
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "controller_hci_uart_demo.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index 5e41444abb3aaa426d040eaf152c830ca188575e..d32eb6bee14567c099ca325f47f2d9246c0c1d7c 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/gattc_demo.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(gatt_client_demo)
diff --git a/examples/bluetooth/gatt_client/main/CMakeLists.txt b/examples/bluetooth/gatt_client/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..7c79edc
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "gattc_demo.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index 787f0b763022d57bbd87fd576df502047060f93a..8f468d76448938dfe194c482623a8777bd7d71f1 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/example_ble_sec_gattc_demo.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(sec_gattc_demo)
diff --git a/examples/bluetooth/gatt_security_client/main/CMakeLists.txt b/examples/bluetooth/gatt_security_client/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..32cea7e
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "example_ble_sec_gattc_demo.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index d232d02b3198e5e41b5f72b16e3bbadfbd67716a..8e9d61ff9fa7df449d9a43ca3d6cbb1e1bb2a326 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/example_ble_sec_gatts_demo.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(sec_gatts_demo)
diff --git a/examples/bluetooth/gatt_security_server/main/CMakeLists.txt b/examples/bluetooth/gatt_security_server/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..87df03c
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "example_ble_sec_gatts_demo.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index 74a0560be50087d3cad44adfd73d299336c4b588..fb1760c1efba278a6bfdccc2fa937a8d45b1e18d 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/gatts_demo.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(gatt_server_demos)
diff --git a/examples/bluetooth/gatt_server/main/CMakeLists.txt b/examples/bluetooth/gatt_server/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..d23e5ff
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "gatts_demo.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index 2f5653065d42e898903c1d1f35ec19dedc519970..d6dc6a416be22aedaabe04886cf9a3a4492b0065 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/gatts_table_creat_demo.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(gatt_server_service_table_demo)
diff --git a/examples/bluetooth/gatt_server_service_table/main/CMakeLists.txt b/examples/bluetooth/gatt_server_service_table/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..7588b5a
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "gatts_table_creat_demo.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index 73566a731c41af5f2037800ff4675ae0c75016a3..6a7a6b3b8d0a71a23d700e0e574dab05f9ac36f9 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/gattc_multi_connect.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(gatt_multi_connect)
diff --git a/examples/bluetooth/gattc_multi_connect/main/CMakeLists.txt b/examples/bluetooth/gattc_multi_connect/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..19dcf60
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "gattc_multi_connect.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index 0b4d20f08847647cd3459f243e79335e0eecf8ac..ccd3c7cbe8b07737bf9709c954d521f86b4a8d15 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/ethernet_example_main.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(ethernet_demo)
diff --git a/examples/ethernet/ethernet/main/CMakeLists.txt b/examples/ethernet/ethernet/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..8c0c9fa
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "ethernet_example_main.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index 56450928b6d79d178180d8126ba4a93c52086aa3..33a52a5d5dacb72569be6e5a4325d33b2d0dfc2f 100644 (file)
@@ -2,7 +2,5 @@
 # CMakeLists in this exact order for cmake to work correctly
 cmake_minimum_required(VERSION 3.5)
 
-set(MAIN_SRCS main/blink.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(blink)
diff --git a/examples/get-started/blink/main/CMakeLists.txt b/examples/get-started/blink/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..69f12a3
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "blink.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index 1d4853e774bf7df2ad8a54ddf3ea7b316c459adc..8a022b8486b73a856a8a6b4a505a3e64894afbb1 100644 (file)
@@ -2,7 +2,5 @@
 # CMakeLists in this exact order for cmake to work correctly
 cmake_minimum_required(VERSION 3.5)
 
-set(MAIN_SRCS main/hello_world_main.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(hello-world)
diff --git a/examples/get-started/hello_world/main/CMakeLists.txt b/examples/get-started/hello_world/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..b79b831
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "hello_world_main.c")
+set(COMPONENT_ADD_INCLUDEDIRS "")
+
+register_component()
\ No newline at end of file
index 485f63621a7e1fe830968e538ed2b373cdb979a2..d0cf18781a32941a343a19151a0067501a0bcc77 100644 (file)
@@ -2,10 +2,5 @@
 # CMakeLists in this exact order for cmake to work correctly
 cmake_minimum_required(VERSION 3.5)
 
-set(MAIN_SRCS main/mesh_light.c main/mesh_main.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(internal_transceiver)
-
-include_directories(main/include)
-
diff --git a/examples/mesh/internal_communication/main/CMakeLists.txt b/examples/mesh/internal_communication/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..451eece
--- /dev/null
@@ -0,0 +1,5 @@
+set(COMPONENT_SRCS "mesh_light.c"
+                   "mesh_main.c")
+set(COMPONENT_ADD_INCLUDEDIRS ". include")
+
+register_component()
index 485f63621a7e1fe830968e538ed2b373cdb979a2..d0cf18781a32941a343a19151a0067501a0bcc77 100644 (file)
@@ -2,10 +2,5 @@
 # CMakeLists in this exact order for cmake to work correctly
 cmake_minimum_required(VERSION 3.5)
 
-set(MAIN_SRCS main/mesh_light.c main/mesh_main.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(internal_transceiver)
-
-include_directories(main/include)
-
diff --git a/examples/mesh/manual_networking/main/CMakeLists.txt b/examples/mesh/manual_networking/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..451eece
--- /dev/null
@@ -0,0 +1,5 @@
+set(COMPONENT_SRCS "mesh_light.c"
+                   "mesh_main.c")
+set(COMPONENT_ADD_INCLUDEDIRS ". include")
+
+register_component()
index 2232b277cd3390fccddab57aadaf8da47d285b60..b01d635218538c98c7c9ca229a270b47f18bbcd3 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/adc1_example_main.c)
-
 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 (file)
index 0000000..9b5d48f
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "adc1_example_main.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index 650e3100aebbe0081a443ac0afa026fa5746699b..7ea7329c1e3e747580d8f4c2804ff3cf082a15c6 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/adc2_example_main.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(adc2)
diff --git a/examples/peripherals/adc2/main/CMakeLists.txt b/examples/peripherals/adc2/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..1d7776e
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "adc2_example_main.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index c5e43497cbf5212c9596a19b1ca166c627edd48b..4d4838176f3a0f25410b5a470b5599e8140505e5 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/can_alert_and_recovery_example_main.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(can_alert_and_recovery_example)
diff --git a/examples/peripherals/can/can_alert_and_recovery/main/CMakeLists.txt b/examples/peripherals/can/can_alert_and_recovery/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..cf9bf40
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "can_alert_and_recovery_example_main.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index 3f0f7a1c0c5b97b67bc79e7084d786373d5c08d8..42617e10ffa87fcdf445967c88233a68f0b411a5 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/can_network_example_listen_only_main.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(can_network_listen_only)
diff --git a/examples/peripherals/can/can_network/can_network_listen_only/main/CMakeLists.txt b/examples/peripherals/can/can_network/can_network_listen_only/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..5eab299
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "can_network_example_listen_only_main.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index f64b5e4459fe5d149caefeb2c19c82a28670b813..33ac7b660be287b9d7074bf91a8af3ae74c4c67f 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/can_network_example_master_main.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(can_network_master)
diff --git a/examples/peripherals/can/can_network/can_network_master/main/CMakeLists.txt b/examples/peripherals/can/can_network/can_network_master/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..f0dc1d6
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "can_network_example_master_main.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index 4c7f9c933ff80274b0a5be33d4ff52ab85f06cae..1550db1564800f742ed3612f9ca741cdcf328a26 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/can_network_example_slave_main.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(can_network_slave)
diff --git a/examples/peripherals/can/can_network/can_network_slave/main/CMakeLists.txt b/examples/peripherals/can/can_network/can_network_slave/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..4a002fb
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "can_network_example_slave_main.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index c6ab8e9248a51d81d915c8d50a204f2fae915b3c..027060e221d568d6d5d714db5c1646b0fe990493 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/can_self_test_example_main.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(can_self_test_example)
diff --git a/examples/peripherals/can/can_self_test/main/CMakeLists.txt b/examples/peripherals/can/can_self_test/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..21db765
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "can_self_test_example_main.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index 82873edc4a9266aff209f91a6e555b8014f7f952..6ac490d38a0219c5af03a062928c44d9ef0df062 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/gpio_example_main.c)
-
 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 (file)
index 0000000..d768cb8
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "gpio_example_main.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index 048d75fb3693198f79ded76b497665b33277d615..1db34db2207d8f8fbc6a1f1e10cd531db526239f 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/i2c_example_main.c)
-
 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 (file)
index 0000000..02386f7
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "i2c_example_main.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index 6520061d4e66bab688edba986eeea9216d2bb786..19c5f883081139ac5a6433c1d44c4a024414f54f 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/i2s_example_main.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(esp32-i2s-driver-example)
diff --git a/examples/peripherals/i2s/main/CMakeLists.txt b/examples/peripherals/i2s/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..dbb7b17
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "i2s_example_main.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index 8e7fe3c07325f73c8aff15755ba5474103d59121..4b27d7cd687a6e7c8eed302aeeb703237f39ac9f 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/app_main.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(i2s-adc-dac)
diff --git a/examples/peripherals/i2s_adc_dac/main/CMakeLists.txt b/examples/peripherals/i2s_adc_dac/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..6b03500
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "app_main.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index c0c15b6f9d767fd24c28b71c41b7603ac132ae35..0ce275c8e01910d9e912fba11b305e5f27239b74 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/ledc_example_main.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(ledc)
diff --git a/examples/peripherals/ledc/main/CMakeLists.txt b/examples/peripherals/ledc/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..6405eb9
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "ledc_example_main.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index a3ee8315fbccf58a3e7c76923f81921f4d92b7bb..53eb976ea44641517df423b27df5add4638a15e3 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/mcpwm_basic_config_example.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(mcpwm_basic_config)
diff --git a/examples/peripherals/mcpwm/mcpwm_basic_config/main/CMakeLists.txt b/examples/peripherals/mcpwm/mcpwm_basic_config/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..d5fdbf5
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "mcpwm_basic_config_example.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index ed09e85b2c212c0731cde47bba8df198d0f7bf7d..10ed869e1b9ba812bb54946bc13cc3b327250ae2 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/mcpwm_bldc_control_hall_sensor_example.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(mcpwm_bldc_control_hall_sensor)
diff --git a/examples/peripherals/mcpwm/mcpwm_bldc_control/main/CMakeLists.txt b/examples/peripherals/mcpwm/mcpwm_bldc_control/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..a52ad94
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "mcpwm_bldc_control_hall_sensor_example.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index 4076c283947c68e65bf74862b18cba885cb6d129..a4baf8b40cadb70e0aebc6f05c11c6bbf1ddeef1 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/mcpwm_brushed_dc_control_example.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(mcpwm_brushed_dc_control)
diff --git a/examples/peripherals/mcpwm/mcpwm_brushed_dc_control/main/CMakeLists.txt b/examples/peripherals/mcpwm/mcpwm_brushed_dc_control/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..1259035
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "mcpwm_brushed_dc_control_example.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index fc3fab8093f18534b1f662c1cffb24a25e669514..524c0ec97ced498a348992f6d8c81b08ad2e26e4 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/mcpwm_servo_control_example.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(mcpwm_servo_control)
diff --git a/examples/peripherals/mcpwm/mcpwm_servo_control/main/CMakeLists.txt b/examples/peripherals/mcpwm/mcpwm_servo_control/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..c8fa3d9
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "mcpwm_servo_control_example.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index 2a7c8f40e8a580aa1df292e79783c2d284f09000..8f9d35a794b2ef993d2190cd0565202d773d6608 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/pcnt_example_main.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(pcnt)
diff --git a/examples/peripherals/pcnt/main/CMakeLists.txt b/examples/peripherals/pcnt/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..2bd2779
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "pcnt_example_main.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index 468032294ca701516bc8ea62d2c3a79186b74ee9..5e3f6b3658f4632b65fffe7c21e9d5ed9af1a2c9 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/infrared_nec_main.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(infrared_nec)
diff --git a/examples/peripherals/rmt_nec_tx_rx/main/CMakeLists.txt b/examples/peripherals/rmt_nec_tx_rx/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..80c75b2
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "infrared_nec_main.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index 7aa64fedb8f6ef7dc7e4814d4913954ab38f8eb0..cf5f789fdc318f32e9384f8e29cea24d56762dc7 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/rmt_tx_main.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(rmt_tx)
diff --git a/examples/peripherals/rmt_tx/main/CMakeLists.txt b/examples/peripherals/rmt_tx/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..a0a9147
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "rmt_tx_main.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index 507af55e7d6389c947c700697171fbf3bbf5de3f..fb1d9a33efe8410531d748159d80cdb68682eecf 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/app_main.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(sdio_host)
index c864bbba23157d72423ff1c90f02bcb8e89c2f57..1cda8805cb706e588607fa1d08eff9f62d9a8174 100644 (file)
@@ -1,4 +1,4 @@
-set(COMPONENT_SRCDIRS ".")
+set(COMPONENT_SRCS "esp_slave.c")
 set(COMPONENT_ADD_INCLUDEDIRS "include")
 
 set(COMPONENT_REQUIRES driver sdmmc)
diff --git a/examples/peripherals/sdio/host/main/CMakeLists.txt b/examples/peripherals/sdio/host/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..6b03500
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "app_main.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index f5d89e6d0220460366447d35ff80f1e6205a43f3..c9944539775d0e098577d7281cb12997a61c4565 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/app_main.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(sdio_slave)
diff --git a/examples/peripherals/sdio/slave/main/CMakeLists.txt b/examples/peripherals/sdio/slave/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..6b03500
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "app_main.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index 3f4df2cfc7f9b15162e648815301e598a5688687..3a7098cb25e614d61f5e64c1451eda3f465121ab 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/sigmadelta_example_main.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(sigmadelta)
diff --git a/examples/peripherals/sigmadelta/main/CMakeLists.txt b/examples/peripherals/sigmadelta/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..1b0f229
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "sigmadelta_example_main.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index d27864187f8c8b38f366e92d66e1ac6ce85bee1a..6494ac1fda62bc579bbf5246fdf73e81570c0369 100644 (file)
@@ -1,17 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/spi_master_example_main.c
-    main/pretty_effect.c
-    main/decode_image.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(spi_master)
-
-# Embed the image into the final binary
-#
-# (If this was a component, we would set COMPONENT_EMBED_TXTFILES here.)
-target_add_binary_data(spi_master.elf
-    "main/image.jpg" BINARY)
diff --git a/examples/peripherals/spi_master/main/CMakeLists.txt b/examples/peripherals/spi_master/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..806ccae
--- /dev/null
@@ -0,0 +1,9 @@
+set(COMPONENT_SRCS "decode_image.c"
+                   "pretty_effect.c"
+                   "spi_master_example_main.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+
+set(COMPONENT_EMBED_FILES image.jpg)
+
+register_component()
index 21c05d9e67643dea3ad6d08816fff6163e941608..a55b703ab5d0a1f89662744a5f5b5aa9d5b25f01 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/app_main.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(spi-slave-receiver)
diff --git a/examples/peripherals/spi_slave/receiver/main/CMakeLists.txt b/examples/peripherals/spi_slave/receiver/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..6b03500
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "app_main.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index 0c95698e962601fc35c9e69ce70bba2a473cc727..f9144aa84236e3d7938c00b231017352ce9cbf81 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/app_main.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(spi-slave-sender)
diff --git a/examples/peripherals/spi_slave/sender/main/CMakeLists.txt b/examples/peripherals/spi_slave/sender/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..6b03500
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "app_main.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index 7f851e16495c07d928eca613aa792064483aaaf6..247819ef30b5802420f0ef7c9dc8ad55439b102f 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/timer_group_example_main.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(timer_group)
diff --git a/examples/peripherals/timer_group/main/CMakeLists.txt b/examples/peripherals/timer_group/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..9a96ce9
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "timer_group_example_main.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index efdecaba1dbca9c700f2824d967e53c18057d88d..9ab076f8e900ebe37c981077738e77f76e17ed86 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/tp_interrupt_main.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(touch_pad_interrupt)
diff --git a/examples/peripherals/touch_pad_interrupt/main/CMakeLists.txt b/examples/peripherals/touch_pad_interrupt/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..b77bf9c
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "tp_interrupt_main.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index f246a1ad533dcdcd4575d3b66cf525ffb7d3508c..828816fe4db7e52d19fe7f10a2cbe563d227036f 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/tp_read_main.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(touch_pad_read)
diff --git a/examples/peripherals/touch_pad_read/main/CMakeLists.txt b/examples/peripherals/touch_pad_read/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..b556e8c
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "tp_read_main.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index 4ab23a834d6d60e77d5d5dbf1a56d1da7d1c3359..ea67b8aa6252b41a9d2d7c4e6530248e3224893f 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/uart_async_rxtxtasks_main.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(uart_async_rxtxtasks)
diff --git a/examples/peripherals/uart_async_rxtxtasks/main/CMakeLists.txt b/examples/peripherals/uart_async_rxtxtasks/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..b572323
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "uart_async_rxtxtasks_main.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index b7ab8a5824c77ce3e6ab13f71a02d619d762de3a..0dc35072c2e69d7d07e7bd0694a022dd4dda1f61 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/uart_echo_example_main.c)
-
 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 (file)
index 0000000..1ca803f
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "uart_echo_example_main.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index 7df24511898cea042010d72d3904b0b83637b320..dba97cb4f7223889228706c90940f3d0443948e6 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/rs485_example.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(echo_rs485)
diff --git a/examples/peripherals/uart_echo_rs485/main/CMakeLists.txt b/examples/peripherals/uart_echo_rs485/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..8b33930
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "rs485_example.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index 464886f254406dbdde7dc0c76a202cb0df619ccd..d89fe7267f19c3cd64b652cdf69f3f18711e5c9d 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/uart_events_example_main.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(uart_events)
diff --git a/examples/peripherals/uart_events/main/CMakeLists.txt b/examples/peripherals/uart_events/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..5a408ef
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "uart_events_example_main.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index c761f9d60509a9c2e3b8f3ccb28396c9ea459837..8cf5a7bd194218a15b279fe9e9fc888ee019a2be 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/uart_select_example_main.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(uart_select)
diff --git a/examples/peripherals/uart_select/main/CMakeLists.txt b/examples/peripherals/uart_select/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..4e3ae00
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "uart_select_example_main.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index 78d29f0bde8919a348a21d24bc7241a5f6f00d51..e0480c277aa950c6c575ef0948413da67bf1b3f4 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/chat_client.cpp)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(asio_chat_client)
index 4bb51e6a5fbe4914711cf1ac99a3d5822867eeb4..e51766724723640dba9ca995a934a61d961b3259 100644 (file)
@@ -1,4 +1,4 @@
-set(COMPONENT_SRCDIRS ".")
+set(COMPONENT_SRCS "wifi_asio.cpp")
 
 set(COMPONENT_PRIV_REQUIRES asio nvs_flash console)
 
diff --git a/examples/protocols/asio/chat_client/main/CMakeLists.txt b/examples/protocols/asio/chat_client/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..25419de
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "chat_client.cpp")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index 91331df14b3af404b119305dbdfd0bda2f2e0636..c8c629856d8ecb2f32ca161f26f1f2bdaa1aef97 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/chat_server.cpp)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(asio_chat_server)
index 4bb51e6a5fbe4914711cf1ac99a3d5822867eeb4..e51766724723640dba9ca995a934a61d961b3259 100644 (file)
@@ -1,4 +1,4 @@
-set(COMPONENT_SRCDIRS ".")
+set(COMPONENT_SRCS "wifi_asio.cpp")
 
 set(COMPONENT_PRIV_REQUIRES asio nvs_flash console)
 
diff --git a/examples/protocols/asio/chat_server/main/CMakeLists.txt b/examples/protocols/asio/chat_server/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..7e44a90
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "chat_server.cpp")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index 76bf9bcb6b432c773a54d0c9a01134d28f39a51f..b8d5638f7a8c83e3f5b7a38bbcd853c9a91ecc11 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/echo_server.cpp)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(asio_tcp_echo_server)
index 4bb51e6a5fbe4914711cf1ac99a3d5822867eeb4..e51766724723640dba9ca995a934a61d961b3259 100644 (file)
@@ -1,4 +1,4 @@
-set(COMPONENT_SRCDIRS ".")
+set(COMPONENT_SRCS "wifi_asio.cpp")
 
 set(COMPONENT_PRIV_REQUIRES asio nvs_flash console)
 
diff --git a/examples/protocols/asio/tcp_echo_server/main/CMakeLists.txt b/examples/protocols/asio/tcp_echo_server/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..04c3c94
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "echo_server.cpp")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index 143a364e44efb58b320e2a3cf7f90d5b8bd6a59e..8d5c3a6927386af4cf3e8cb4a5560ac84fecf4c0 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/udp_echo_server.cpp)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(asio_udp_echo_server)
index 4bb51e6a5fbe4914711cf1ac99a3d5822867eeb4..e51766724723640dba9ca995a934a61d961b3259 100644 (file)
@@ -1,4 +1,4 @@
-set(COMPONENT_SRCDIRS ".")
+set(COMPONENT_SRCS "wifi_asio.cpp")
 
 set(COMPONENT_PRIV_REQUIRES asio nvs_flash console)
 
diff --git a/examples/protocols/asio/udp_echo_server/main/CMakeLists.txt b/examples/protocols/asio/udp_echo_server/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..cd24937
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "udp_echo_server.cpp")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index c7cfd88f4d6cf5f5065dfab4a30bba131098c405..9058298059987a640ce403a6722597d84cbb78b0 100644 (file)
@@ -1,13 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/subscribe_publish_sample.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
-project(subscribe_publish)
-
-# Embed the certificate data directly in the built binary
-target_add_binary_data(subscribe_publish.elf main/certs/aws-root-ca.pem TEXT)
-target_add_binary_data(subscribe_publish.elf main/certs/certificate.pem.crt TEXT)
-target_add_binary_data(subscribe_publish.elf main/certs/private.pem.key TEXT)
+project(subscribe_publish)
\ No newline at end of file
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 (file)
index 0000000..d5fc090
--- /dev/null
@@ -0,0 +1,28 @@
+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)
+
+if(NOT IDF_CI_BUILD)
+    add_custom_command(OUTPUT certs/certificate.pem.crt certs/private.pem.key
+                        COMMAND echo "Dummy certificate data for continuous integration" >
+                                certs/certificate.pem.crt
+                        COMMAND echo "Dummy certificate data for continuous integration" >
+                                certs/private.pem.key
+                        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+                        VERBATIM)
+    add_custom_target(example_certificates DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/certs/certificate.pem.crt ${CMAKE_CURRENT_BINARY_DIR}/certs/private.pem.key)
+    
+    add_dependencies(${COMPONENT_NAME} example_certificates)
+    
+    target_add_binary_data(${COMPONENT_NAME} "${CMAKE_CURRENT_BINARY_DIR}/certs/certificate.pem.crt" TEXT)
+    target_add_binary_data(${COMPONENT_NAME} "${CMAKE_CURRENT_BINARY_DIR}/certs/private.pem.key" TEXT)
+else()
+    target_add_binary_data(${COMPONENT_NAME} "certs/certificate.pem.crt" TEXT)
+    target_add_binary_data(${COMPONENT_NAME} "certs/private.pem.key" TEXT) 
+endif()
+endif()
\ No newline at end of file
index 37d5d9a9cf1859fde169d36b14753a8c438baa18..fe87b29cc38891828296ba3d5cfe42ece1fd9866 100644 (file)
@@ -1,13 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/thing_shadow_sample.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(thing_shadow)
-
-# Embed the certificate data directly in the built binary
-target_add_binary_data(thing_shadow.elf main/certs/aws-root-ca.pem TEXT)
-target_add_binary_data(thing_shadow.elf main/certs/certificate.pem.crt TEXT)
-target_add_binary_data(thing_shadow.elf main/certs/private.pem.key TEXT)
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 (file)
index 0000000..ee14baf
--- /dev/null
@@ -0,0 +1,28 @@
+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)
+
+if(NOT IDF_CI_BUILD)
+    add_custom_command(OUTPUT certs/certificate.pem.crt certs/private.pem.key
+                        COMMAND echo "Dummy certificate data for continuous integration" >
+                                certs/certificate.pem.crt
+                        COMMAND echo "Dummy certificate data for continuous integration" >
+                                certs/private.pem.key
+                        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+                        VERBATIM)
+    add_custom_target(example_certificates DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/certs/certificate.pem.crt ${CMAKE_CURRENT_BINARY_DIR}/certs/private.pem.key)
+    
+    add_dependencies(${COMPONENT_NAME} example_certificates)
+    
+    target_add_binary_data(${COMPONENT_NAME} "${CMAKE_CURRENT_BINARY_DIR}/certs/certificate.pem.crt" TEXT)
+    target_add_binary_data(${COMPONENT_NAME} "${CMAKE_CURRENT_BINARY_DIR}/certs/private.pem.key" TEXT)
+else()
+    target_add_binary_data(${COMPONENT_NAME} "certs/certificate.pem.crt" TEXT)
+    target_add_binary_data(${COMPONENT_NAME} "certs/private.pem.key" TEXT) 
+endif()
+endif()
\ No newline at end of file
index 43378b8b64a17e4ca00ac264d8f50c12cee670df..495538d3df77682de99de04b72885c113e8b5f93 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/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 (file)
index 0000000..eb1a1db
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "coap_client_example_main.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index 8495b85782fd1c1d30796f1ba97a64b468018faa..16689d2e3bc1248e595870369e22f7599aa32b99 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/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 (file)
index 0000000..8650fb1
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "coap_server_example_main.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index 5241b97bd22be35454a218e3eec0e7016b89c293..6896d5acd9bbcd704a7e34bfaae8c881739b71a5 100644 (file)
@@ -2,13 +2,5 @@
 # CMakeLists in this exact order for cmake to work correctly
 cmake_minimum_required(VERSION 3.5)
 
-set(MAIN_SRCS main/esp_http_client_example.c main/app_wifi.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(esp-http-client-example)
-
-# 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(esp-http-client-example.elf
-    "main/howsmyssl_com_root_cert.pem" TEXT)
diff --git a/examples/protocols/esp_http_client/main/CMakeLists.txt b/examples/protocols/esp_http_client/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..093811e
--- /dev/null
@@ -0,0 +1,11 @@
+set(COMPONENT_SRCS "app_wifi.c"
+                   "esp_http_client_example.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 howsmyssl_com_root_cert.pem)
+
+register_component()
index b49128d5e4d56a33c5cc08072d9f6197863e1207..edda2c42f697e8580077424a8d291c37ee8659a1 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/http2_request_example_main.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(http2-request)
index 6d19bf48b69f235c2990c8df1fb569b53d9240dc..ec1b5a1e124b65b72a8343da445f534c8023f287 100644 (file)
@@ -1,6 +1,6 @@
 set(COMPONENT_ADD_INCLUDEDIRS .)
 
-set(COMPONENT_SRCDIRS .)
+set(COMPONENT_SRCS "sh2lib.c")
 
 set(COMPONENT_REQUIRES nghttp)
 set(COMPONENT_PRIV_REQUIRES lwip esp-tls)
diff --git a/examples/protocols/http2_request/main/CMakeLists.txt b/examples/protocols/http2_request/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..6139002
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "http2_request_example_main.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index a8f1470b9e299074e51ff7c2b1e90d2c55c6cef1..1c818eb23efdf36909b216eee701db506beeb151 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/http_request_example_main.c)
-
 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 (file)
index 0000000..8e346e8
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "http_request_example_main.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index 6edb47bda999acfc05acd39035181fe79efcf62a..b6f65f8f0f7b73a26d6920b40552642f0c2d64fa 100644 (file)
@@ -1,9 +1,7 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/tests.c main/main.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(tests)
 
diff --git a/examples/protocols/http_server/advanced_tests/main/CMakeLists.txt b/examples/protocols/http_server/advanced_tests/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..9fd69b1
--- /dev/null
@@ -0,0 +1,5 @@
+set(COMPONENT_SRCS "main.c"
+                   "tests.c")
+set(COMPONENT_ADD_INCLUDEDIRS ". include")
+
+register_component()
index b3587a5ef080c68dcd6c0532111e4c651d50330f..2d453b679ab490461ee736c6ec2e052c810045bf 100644 (file)
@@ -1,9 +1,7 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/main.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(persistent_sockets)
 
diff --git a/examples/protocols/http_server/persistent_sockets/main/CMakeLists.txt b/examples/protocols/http_server/persistent_sockets/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..8597076
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "main.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index 0b6dc948c1a00bc0d60688e8ae05b30cad9cce8b..cc9d4fd83300115bfcfc7cf621ba6d00b32aca6e 100644 (file)
@@ -1,10 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/main.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(simple)
-
-
diff --git a/examples/protocols/http_server/simple/main/CMakeLists.txt b/examples/protocols/http_server/simple/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..8597076
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "main.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index b564db2fa37ae73fdad838ffd88430412a853a4b..a1f41ff8759f3628e287d57e53289022e65c4fce 100644 (file)
@@ -2,13 +2,5 @@
 # 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)
+project(https-mbedtls)
\ No newline at end of file
diff --git a/examples/protocols/https_mbedtls/main/CMakeLists.txt b/examples/protocols/https_mbedtls/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..c9b097c
--- /dev/null
@@ -0,0 +1,10 @@
+set(COMPONENT_SRCS "https_mbedtls_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()
index 22118c45cb6b30121c3c5d70541eba1da45400a9..f77bc6610150a6b61099516c5eaf9795fe290f1e 100644 (file)
@@ -2,13 +2,5 @@
 # CMakeLists in this exact order for cmake to work correctly
 cmake_minimum_required(VERSION 3.5)
 
-set(MAIN_SRCS main/https_request_example_main.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(https_request)
-
-# 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_request.elf
-    "main/server_root_cert.pem" TEXT)
diff --git a/examples/protocols/https_request/main/CMakeLists.txt b/examples/protocols/https_request/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..60a1a06
--- /dev/null
@@ -0,0 +1,10 @@
+set(COMPONENT_SRCS "https_request_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()
index 57c5e9a2e6e0f1af15fafe94ff1a72f730888688..88b7c1e3f1499c1359e24eb0e5db07e5fa5ac7b3 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/mdns_example_main.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(mdns-test)
diff --git a/examples/protocols/mdns/main/CMakeLists.txt b/examples/protocols/mdns/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..814837e
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "mdns_example_main.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index 0fc241ddf29e622d19e115a620818d0568d125b7..5449461ce7aa70a91b9d6a22247d0511a62c406c 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/openssl_client_example_main.c)
-
 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 (file)
index 0000000..d8e15c9
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "openssl_client_example_main.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index dba98fc6854eb134262ec4a19b5ee009c5e7314a..d3e5c5ccbea810abbe508cae48ec6e55db8b855b 100644 (file)
@@ -1,12 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/openssl_server_example_main.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(openssl_server)
-
-# Embed the certificate & key data directly in the built binary
-target_add_binary_data(openssl_server.elf main/cacert.pem TEXT)
-target_add_binary_data(openssl_server.elf main/prvtkey.pem TEXT)
diff --git a/examples/protocols/openssl_server/main/CMakeLists.txt b/examples/protocols/openssl_server/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..07b57ef
--- /dev/null
@@ -0,0 +1,8 @@
+set(COMPONENT_SRCS "openssl_server_example_main.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+
+# Embed the certificate & key data directly in the built binary
+set(COMPONENT_EMBED_TXTFILES cacert.pem prvtkey.pem)
+
+register_component()
index c9378d72fa6068d390b20245e3f6808c916d2c8c..96095257827c0702446162a94e5b8ace6c23e601 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/pppos_client_main.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(pppos_client)
diff --git a/examples/protocols/pppos_client/main/CMakeLists.txt b/examples/protocols/pppos_client/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..e4ef137
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "pppos_client_main.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index d083f8fe1aee46f85b834127e14e0072d43ceb23..dd46b088b1c898750162522229db9eb6eb4fabb8 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/sntp_example_main.c)
-
 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 (file)
index 0000000..c7c035c
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "sntp_example_main.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index 998524292a56f7ab398bab674265f771542f348c..fe4b8fe8efce08db7005fdb4f44db31a9b23267e 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/udp_multicast_example_main.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(udp-multicast)
diff --git a/examples/protocols/udp_multicast/main/CMakeLists.txt b/examples/protocols/udp_multicast/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..d3caeb6
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "udp_multicast_example_main.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index 1dd6023f3029ca8f323713aa868366f308d1be40..a4c9141fd001ffa946d1da4d64cef41b28873703 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/nvs_blob_example_main.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(nvs-rw-blob)
diff --git a/examples/storage/nvs_rw_blob/main/CMakeLists.txt b/examples/storage/nvs_rw_blob/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..675c11a
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "nvs_blob_example_main.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index 971a306efe9ce09c8567e784a27b725d21e2e5f7..d0e9215d30055dd4c7ad621e349935bb42385d35 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/nvs_value_example_main.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(nvs-rw-value)
diff --git a/examples/storage/nvs_rw_value/main/CMakeLists.txt b/examples/storage/nvs_rw_value/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..1383460
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "nvs_value_example_main.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index ab4bcf2fa44144455c8a58af54ed33b05fd15552..00153c74c97583b78316e6215d617c0b74141979 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/sd_card_example_main.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(sd_card)
diff --git a/examples/storage/sd_card/main/CMakeLists.txt b/examples/storage/sd_card/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..d0a4b53
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "sd_card_example_main.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index 0356e25bf76bced0f3d8bd3ed90afead8b19c982..1894b31ca393cbf6c50f6f85fda3dfdea499908b 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/spiffs_example_main.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(spiffs)
diff --git a/examples/storage/spiffs/main/CMakeLists.txt b/examples/storage/spiffs/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..8d041d5
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "spiffs_example_main.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index bd35e0843c39c3ed72ce9a3aee10e3430e050596..d404d3c24326c860fd0745c0ba86c19ba7bc2c53 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/wear_levelling_example_main.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(wear_levelling_example)
diff --git a/examples/storage/wear_levelling/main/CMakeLists.txt b/examples/storage/wear_levelling/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..e344e9a
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "wear_levelling_example_main.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index f26a0fdb6f294efa66913da8c8c954a5c48aec94..7182f8cca56ab3f7f3a0d7929d4e1047cd92ed8d 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/app_trace_to_host_test.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(app_trace_to_host_test)
diff --git a/examples/system/app_trace_to_host/main/CMakeLists.txt b/examples/system/app_trace_to_host/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..05e91af
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "app_trace_to_host_test.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index 984dbb978d786be31d78a5f736e0f53876195c2b..986095de5a63623d00a7152d3230e5f48e3a9e55 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/base_mac_address_example_main.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(base_mac_address)
diff --git a/examples/system/base_mac_address/main/CMakeLists.txt b/examples/system/base_mac_address/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..364317d
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "base_mac_address_example_main.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index 416fc704a097f667439d94098cc9845ce4699c3d..d3f354f7fc993d3925b5a763501aaf30e4c3e8a7 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/cmd_wifi.c main/console_example_main.c main/cmd_system.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(console)
diff --git a/examples/system/console/main/CMakeLists.txt b/examples/system/console/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..5f8bc46
--- /dev/null
@@ -0,0 +1,6 @@
+set(COMPONENT_SRCS "cmd_system.c"
+                   "cmd_wifi.c"
+                   "console_example_main.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index 9fca8875073938ee2546116a6127dcb32b6acfbf..d3f354f7fc993d3925b5a763501aaf30e4c3e8a7 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/exception_example_main.cpp)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
-project(cpp_exceptions_example)
+project(console)
diff --git a/examples/system/cpp_exceptions/main/CMakeLists.txt b/examples/system/cpp_exceptions/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..f735cc5
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "exception_example_main.cpp")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index cf3d195aa96ef227e0c94b8162c5a7590ccfb9b6..38e606ff25a40111d94302cb4a18f06a501a6e8d 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/deep_sleep_example_main.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(deep_sleep)
diff --git a/examples/system/deep_sleep/main/CMakeLists.txt b/examples/system/deep_sleep/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..e99ca4d
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "deep_sleep_example_main.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index 5165f3d2a0100891082264b479506bbbf15b1430..4222f063cb166bb88b33947cc0a5f14930f783a4 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/esp_timer_example_main.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(esp_timer_example)
diff --git a/examples/system/esp_timer/main/CMakeLists.txt b/examples/system/esp_timer/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..09db9ec
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "esp_timer_example_main.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index b1cb9fd775e02248b805e249b6cef187b3e61734..8a1f715683f63ff045e907455495be118e5d3109 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/gcov_example_func.c main/gcov_example.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(gcov_example)
diff --git a/examples/system/gcov/main/CMakeLists.txt b/examples/system/gcov/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..170d5c5
--- /dev/null
@@ -0,0 +1,5 @@
+set(COMPONENT_SRCS "gcov_example.c"
+                   "gcov_example_func.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index c4aa4d0d4870255bb384072e344a9b1eabc82354..9e1828169e376ff2e32bc79160d8b4a39b258f1d 100644 (file)
@@ -1,14 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/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)
diff --git a/examples/system/ota/native_ota_example/main/CMakeLists.txt b/examples/system/ota/native_ota_example/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..f7e58ac
--- /dev/null
@@ -0,0 +1,10 @@
+set(COMPONENT_SRCS "native_ota_example.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_certs/ca_cert.pem)
+
+register_component()
index f15e70874199722b6ac2d1c26fc4c98cbde3ff02..ae979292deda92793dd7adf324135e16831d3e13 100644 (file)
@@ -1,14 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/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)
+project(simple_ota)
\ No newline at end of file
diff --git a/examples/system/ota/simple_ota_example/main/CMakeLists.txt b/examples/system/ota/simple_ota_example/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..6d7b303
--- /dev/null
@@ -0,0 +1,11 @@
+set(COMPONENT_SRCS "simple_ota_example.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_certs/ca_cert.pem)
+
+
+register_component()
index 3175ceeb0ae468918a5067ae4e5a8858d0369a72..2e8180b5d3ddbcbe1f4c0d86d9cd7498116d92f9 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/select_example.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(select)
diff --git a/examples/system/select/main/CMakeLists.txt b/examples/system/select/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..bf59f84
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "select_example.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index e0f24b03f6f0dc4c6e737c4ef45ce56b1c7c2bc8..4d3e6f98c990923e8d0b8543285129f3df4aeaf1 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/task_watchdog_example_main.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(task_watchdog)
diff --git a/examples/system/task_watchdog/main/CMakeLists.txt b/examples/system/task_watchdog/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..ef06f3c
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "task_watchdog_example_main.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index 446cf5ccf1d476b3a399774caf7a77dc36953ee0..73c190ccbd10e4abc6d2d74cb904d6f1924718e3 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/espnow_example_main.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(espnow_example)
diff --git a/examples/wifi/espnow/main/CMakeLists.txt b/examples/wifi/espnow/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..151eab7
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "espnow_example_main.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index 57158b16b847d63cf60eadd5cb6021257a7ee074..83a0f1dbc4de4e889b4548d44501090d267dfc34 100644 (file)
@@ -2,7 +2,5 @@
 # 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)
diff --git a/examples/wifi/getting_started/softAP/main/CMakeLists.txt b/examples/wifi/getting_started/softAP/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..6724060
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "softap_example_main.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index 4825821365889c45ce85fe2b4061432bda774543..05a40120b1a8cc3e33f4a1e63b0a7b4761e924b9 100644 (file)
@@ -2,7 +2,5 @@
 # CMakeLists in this exact order for cmake to work correctly
 cmake_minimum_required(VERSION 3.5)
 
-set(MAIN_SRCS main/station_example_main.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(wifi_station)
diff --git a/examples/wifi/getting_started/station/main/CMakeLists.txt b/examples/wifi/getting_started/station/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..3cd1031
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "station_example_main.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index 7463023e9e4b255cd6276859edaad0dbc7f935d1..069eeae866a9dd7f73f30db399443bff7ced5fda 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/cmd_wifi.c main/main.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(iperf)
index 352403c414669c47cd61b2811f16a420d11cfa65..d51a810196474d6822061056a75a02fe78071329 100644 (file)
@@ -1,6 +1,6 @@
 set(COMPONENT_ADD_INCLUDEDIRS .)
 
-set(COMPONENT_SRCDIRS .)
+set(COMPONENT_SRCS "iperf.c")
 
 set(COMPONENT_PRIV_REQUIRES lwip)
 
diff --git a/examples/wifi/iperf/main/CMakeLists.txt b/examples/wifi/iperf/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..2487dec
--- /dev/null
@@ -0,0 +1,5 @@
+set(COMPONENT_SRCS "cmd_wifi.c"
+                   "main.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index 65cc2011dfba62d1439a5c527f8671398fde8a3d..a9a182fe6f1332094617eb1ac26484b9e1fe8144 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/power_save.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(power_save)
diff --git a/examples/wifi/power_save/main/CMakeLists.txt b/examples/wifi/power_save/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..f7fc34d
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "power_save.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index 9de12341a3656a378a61ed54190004cbcfcda78a..0b74ad3db748e2727936a4cbd299c7458c109e27 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/scan.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(scan)
diff --git a/examples/wifi/scan/main/CMakeLists.txt b/examples/wifi/scan/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..0b78986
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "scan.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
diff --git a/examples/wifi/simple_wifi/main/CMakeLists.txt b/examples/wifi/simple_wifi/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..e7c00ec
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "simple_wifi.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index ae0b88ee6d7dd4025f329519eacdb63b0d82652d..71bda67e5b0f48691bba27a3e2492c9f8d81fd9c 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/smartconfig_main.c)
-
 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 (file)
index 0000000..a716681
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "smartconfig_main.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index a489894e3896c93eeb71424974e9cefdb2195973..d50e6df219daea9abdc357f876bc4e5eeadeb93c 100644 (file)
@@ -1,17 +1,9 @@
 
 # (Automatically converted from project Makefile by convert_to_cmake.py.)
 
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/wpa2_enterprise_main.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(wpa2-enterprise)
-
-# Embed CA, certificate & key directly into binary
-target_add_binary_data(wpa2-enterprise.elf main/wpa2_ca.pem TEXT)
-target_add_binary_data(wpa2-enterprise.elf main/wpa2_client.crt TEXT)
-target_add_binary_data(wpa2-enterprise.elf main/wpa2_client.key TEXT)
-
diff --git a/examples/wifi/wpa2_enterprise/main/CMakeLists.txt b/examples/wifi/wpa2_enterprise/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..10640a3
--- /dev/null
@@ -0,0 +1,8 @@
+set(COMPONENT_SRCS "wpa2_enterprise_main.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+
+# Embed CA, certificate & key directly into binary
+set(COMPONENT_EMBED_TXTFILES wpa2_ca.pem wpa2_client.crt wpa2_client.key)
+
+register_component()
index fd23de9aa42a49a9cee567cd9c984fdbffc5f180..8bf9b9a8d2f86c676ae16b29414fde0424214dea 100644 (file)
@@ -1,8 +1,6 @@
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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/wps.c)
-
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 project(wps_example)
diff --git a/examples/wifi/wps/main/CMakeLists.txt b/examples/wifi/wps/main/CMakeLists.txt
new file mode 100644 (file)
index 0000000..c0a1063
--- /dev/null
@@ -0,0 +1,4 @@
+set(COMPONENT_SRCS "wps.c")
+set(COMPONENT_ADD_INCLUDEDIRS ".")
+
+register_component()
index e4f728cbde938240e14c4241915392adb496f1b4..d86d30fbd97d4c66c2fcbe3c32d17db385438246 100755 (executable)
@@ -65,7 +65,7 @@ RESULT_ISSUES=22  # magic number result code for issues found
 LOG_SUSPECTED=${LOG_PATH}/common_log.txt
 touch ${LOG_SUSPECTED}
 
-EXAMPLE_PATHS=$( find ${IDF_PATH}/examples/ -type f -name CMakeLists.txt | grep -v "/components/" | sort )
+EXAMPLE_PATHS=$( find ${IDF_PATH}/examples/ -type f -name CMakeLists.txt | grep -v "/components/" | grep -v "/main/" | sort )
 
 if [ $# -eq 0 ]
 then
index 2f2d84413289eab79893646b4455c562222ce7d9..079d1854312f3ec90de99a27f8a0f1ac44c55751 100755 (executable)
@@ -2,7 +2,7 @@
 
 # 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/")
+CMAKE_EXAMPLE_PATHS=$( find ${IDF_PATH}/examples/ -type f -name CMakeLists.txt | grep -v "/components/" | grep -v "/main/")
 MAKE_EXAMPLE_PATHS=$( find ${IDF_PATH}/examples/ -type f -name Makefile )
 
 # temporary: ignore ULP examples as no ULP toolchain support
index de400fcb7df709129a107d8792150f445ef0024c..bb57375d1e0f579c411c3daa1d6083a0a1702c8a 100755 (executable)
@@ -78,7 +78,7 @@ function run_tests()
     take_build_snapshot
     touch ${IDF_PATH}/components/bootloader/subproject/main/bootloader_start.c
     idf.py build || failure "Failed to partial build bootloader"
-    assert_rebuilt ${BOOTLOADER_BINS} bootloader/CMakeFiles/bootloader.elf.dir/main/bootloader_start.c.obj
+    assert_rebuilt ${BOOTLOADER_BINS} bootloader/main/CMakeFiles/main.dir/bootloader_start.c.obj
     assert_not_rebuilt ${APP_BINS} ${PARTITION_BIN}
 
     print_status "Partition CSV file rebuilds partitions"
index 0056a3b4a03f70ccf94c8f00e6b32b8793a50a9c..bb4be0c862fc3ad0921ca161b59392c453c002f7 100644 (file)
@@ -22,8 +22,14 @@ function(register_component)
     spaces2list(COMPONENT_ADD_INCLUDEDIRS)
     spaces2list(COMPONENT_SRCEXCLUDE)
 
-    # Add to COMPONENT_SRCS by globbing in COMPONENT_SRCDIRS
-    if(NOT COMPONENT_SRCS)
+    if(COMPONENT_SRCDIRS)
+        # Warn user if both COMPONENT_SRCDIRS and COMPONENT_SRCS are set
+        if(COMPONENT_SRCS)
+            message(WARNING "COMPONENT_SRCDIRS and COMPONENT_SRCS are both set, COMPONENT_SRCS will be ignored")
+        endif()
+
+        set(COMPONENT_SRCS "")
+
         foreach(dir ${COMPONENT_SRCDIRS})
             get_filename_component(abs_dir ${dir} ABSOLUTE BASE_DIR ${component_dir})
             if(NOT IS_DIRECTORY ${abs_dir})
index 82e69717159257690c115e8a2486dbb79993ec08..be0b42510e02199b6d8567c86d9d97abb37890cf 100755 (executable)
@@ -82,10 +82,20 @@ def get_component_variables(project_path, component_path):
             if src is not None:
                 srcs.append(src)
         make_vars["COMPONENT_SRCS"] = " ".join(srcs)
-    else:  # Use COMPONENT_SRCDIRS
-        make_vars["COMPONENT_SRCDIRS"] = make_vars.get("COMPONENT_SRCDIRS", ".")
+    else:
+        component_srcs = list()
+        for component_srcdir in make_vars.get("COMPONENT_SRCDIRS", ".").split(" "):
+            component_srcdir_path = os.path.abspath(os.path.join(component_path, component_srcdir))
+            
+            srcs = list()
+            srcs += glob.glob(os.path.join(component_srcdir_path, "*.[cS]"))
+            srcs += glob.glob(os.path.join(component_srcdir_path, "*.cpp"))
+            srcs = [('"%s"' % str(os.path.relpath(s, component_path))) for s in srcs]
 
     make_vars["COMPONENT_ADD_INCLUDEDIRS"] = make_vars.get("COMPONENT_ADD_INCLUDEDIRS", "include")
+            component_srcs += srcs
+        make_vars["COMPONENT_SRCS"] = " ".join(component_srcs)
+
 
     return make_vars
 
@@ -106,32 +116,10 @@ def convert_project(project_path):
 
     component_paths = project_vars["COMPONENT_PATHS"].split(" ")
 
-    # "main" component is made special in cmake, so extract it from the component_paths list
-    try:
-        main_component_path = [ p for p in component_paths if os.path.basename(p) == "main" ][0]
-        if debug:
-            print("Found main component %s"  % main_component_path)
-        main_vars = get_component_variables(project_path, main_component_path)
-    except IndexError:
-        print("WARNING: Project has no 'main' component, but CMake-based system requires at least one file in MAIN_SRCS...")
-        main_vars = { "COMPONENT_SRCS" : ""} # dummy for MAIN_SRCS
-
-    # Remove main component from list of components we're converting to cmake
-    component_paths = [ p for p in component_paths if os.path.basename(p) != "main" ]
-
     # Convert components as needed
     for p in component_paths:
         convert_component(project_path, p)
 
-    # Look up project variables before we start writing the file, so nothing
-    # is created if there is an error
-
-    main_srcs = main_vars["COMPONENT_SRCS"].split(" ")
-    # convert from component-relative to absolute paths
-    main_srcs = [ os.path.normpath(os.path.join(main_component_path, m)) for m in main_srcs ]
-    # convert to make relative to the project directory
-    main_srcs = [ os.path.relpath(m, project_path) for m in main_srcs ]
-
     project_name = project_vars["PROJECT_NAME"]
 
     # Generate the project CMakeLists.txt file
@@ -139,12 +127,11 @@ def convert_project(project_path):
         f.write("""
 # (Automatically converted from project Makefile by convert_to_cmake.py.)
 
-# The following four lines of boilerplate have to be in your project's CMakeLists
+# 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)
 
 """)
-        f.write("set(MAIN_SRCS %s)\n" % " ".join(main_srcs))
         f.write("""
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 """)
@@ -164,16 +151,6 @@ def convert_component(project_path, component_path):
     # Look up all the variables before we start writing the file, so it's not
     # created if there's an erro
     component_srcs = v.get("COMPONENT_SRCS", None)
-    component_srcdirs = None
-    if component_srcs is not None:
-        # see if we should be using COMPONENT_SRCS or COMPONENT_SRCDIRS, if COMPONENT_SRCS is everything in SRCDIRS
-        component_allsrcs = []
-        for d in v.get("COMPONENT_SRCDIRS", "").split(" "):
-            component_allsrcs += glob.glob(os.path.normpath(os.path.join(component_path, d, "*.[cS]")))
-            component_allsrcs += glob.glob(os.path.normpath(os.path.join(component_path, d, "*.cpp")))
-        abs_component_srcs = [os.path.normpath(os.path.join(component_path, p)) for p in component_srcs.split(" ")]
-        if set(component_allsrcs) == set(abs_component_srcs):
-            component_srcdirs = v.get("COMPONENT_SRCDIRS")
 
     component_add_includedirs = v["COMPONENT_ADD_INCLUDEDIRS"]
     cflags = v.get("CFLAGS", None)
@@ -185,10 +162,7 @@ def convert_component(project_path, component_path):
         f.write("set(COMPONENT_REQUIRES "")\n")
         f.write("set(COMPONENT_PRIV_REQUIRES "")\n\n")
 
-        if component_srcdirs is not None:
-            f.write("set(COMPONENT_SRCDIRS %s)\n\n" % component_srcdirs)
-            f.write("register_component()\n")
-        elif component_srcs is not None:
+        if component_srcs is not None:
             f.write("set(COMPONENT_SRCS %s)\n\n" % component_srcs)
             f.write("register_component()\n")
         else:
index b8c0f221d188326aeed890d894aa817884a2ba65..9f6474ca1d30ce7126ffac23c35edd1ac4ad7d23 100644 (file)
@@ -22,8 +22,15 @@ macro(idf_set_global_variables)
     # (cmake calls this CMAKE_SOURCE_DIR, keeping old name for compatibility.)
     set(PROJECT_PATH "${CMAKE_SOURCE_DIR}")
 
-    # Note: Unlike older build system, "main" is no longer a component. See build docs for details.
-    set_default(COMPONENT_DIRS "${PROJECT_PATH}/components ${EXTRA_COMPONENT_DIRS} ${IDF_PATH}/components")
+    if(MAIN_SRCS)
+        message(WARNING "main is now a component, use of MAIN_SRCS is deprecated")
+        set_default(COMPONENT_DIRS "${PROJECT_PATH}/components ${EXTRA_COMPONENT_DIRS} \
+                                    ${IDF_PATH}/components")
+    else()
+        set_default(COMPONENT_DIRS "${PROJECT_PATH}/components ${EXTRA_COMPONENT_DIRS} \
+                                    ${IDF_PATH}/components ${PROJECT_PATH}/main")
+    endif()
+
     spaces2list(COMPONENT_DIRS)
 
     spaces2list(COMPONENTS)
@@ -140,8 +147,22 @@ endfunction()
 function(idf_add_executable)
     set(exe_target ${PROJECT_NAME}.elf)
 
-    spaces2list(MAIN_SRCS)
-    add_executable(${exe_target} "${MAIN_SRCS}")
+    if(MAIN_SRCS)
+        spaces2list(MAIN_SRCS)
+        add_executable(${exe_target} ${MAIN_SRCS})
+    else()
+        # Create a dummy file to work around CMake requirement of having a source
+        # file while adding an executable
+        add_executable(${exe_target} "${CMAKE_CURRENT_BINARY_DIR}/dummy_main_src.c")
+        add_custom_command(OUTPUT dummy_main_src.c
+                        COMMAND echo "" > dummy_main_src.c
+                        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+                        VERBATIM)
+
+        add_custom_target(dummy_main_src DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/dummy_main_src.c)
+
+        add_dependencies(${exe_target} dummy_main_src)
+    endif()
 
     add_map_file(${exe_target})
 endfunction()
index 673357da1852a4f44472688064fe4b77ec69345b..29feda8b3248d02184fdf2bc7d071264745acf9f 100644 (file)
@@ -54,8 +54,16 @@ endfunction()
 # (expand_component_requirements() includes the component CMakeLists.txt, which then sets its component variables,
 # calls this dummy macro, and immediately exits again.)
 macro(register_component)
-    spaces2list(COMPONENT_REQUIRES)
-    set_property(GLOBAL PROPERTY "${COMPONENT}_REQUIRES" "${COMPONENT_REQUIRES}")
+    if(COMPONENT STREQUAL main AND NOT COMPONENT_REQUIRES)
+        set(main_component_requires ${COMPONENTS})
+        list(REMOVE_ITEM main_component_requires "main")
+
+        set_property(GLOBAL PROPERTY "${COMPONENT}_REQUIRES" "${main_component_requires}")
+    else()
+        spaces2list(COMPONENT_REQUIRES)
+        set_property(GLOBAL PROPERTY "${COMPONENT}_REQUIRES" "${COMPONENT_REQUIRES}")
+    endif()
+
     spaces2list(COMPONENT_PRIV_REQUIRES)
     set_property(GLOBAL PROPERTY "${COMPONENT}_PRIV_REQUIRES" "${COMPONENT_PRIV_REQUIRES}")
 
index e1c682c8984999b8580649c36a411edf7cec89cc..74d90d317d98cbba02e5744bb6fa839356d17230 100644 (file)
@@ -179,3 +179,14 @@ function(make_json_list list variable)
     string(REPLACE ";" "\", \"" result "[ \"${list}\" ]")
     set("${variable}" "${result}" PARENT_SCOPE)
 endfunction()
+
+# add_prefix
+#
+# Adds a prefix to each item in the specified list.
+#
+function(add_prefix var prefix)
+    foreach(elm ${ARGN})
+        list(APPEND newlist "${prefix}${elm}")
+    endforeach()
+    set(${var} "${newlist}" PARENT_SCOPE)
+endfunction()
\ No newline at end of file