diff --git a/components/app_trace/CMakeLists.txt b/components/app_trace/CMakeLists.txt index dc6e8baa7a..b9bcdddccc 100644 --- a/components/app_trace/CMakeLists.txt +++ b/components/app_trace/CMakeLists.txt @@ -1,32 +1,34 @@ -set(COMPONENT_SRCS "app_trace.c" - "app_trace_util.c" - "host_file_io.c" - "gcov/gcov_rtio.c") -set(COMPONENT_ADD_INCLUDEDIRS "include") +set(srcs + "app_trace.c" + "app_trace_util.c" + "host_file_io.c" + "gcov/gcov_rtio.c") + +set(include_dirs "include") if(CONFIG_SYSVIEW_ENABLE) - list(APPEND COMPONENT_ADD_INCLUDEDIRS + list(APPEND include_dirs sys_view/Config sys_view/SEGGER sys_view/Sample/OS) - list(APPEND COMPONENT_SRCS "sys_view/SEGGER/SEGGER_SYSVIEW.c" - "sys_view/Sample/Config/SEGGER_SYSVIEW_Config_FreeRTOS.c" - "sys_view/Sample/OS/SEGGER_SYSVIEW_FreeRTOS.c" - "sys_view/esp32/SEGGER_RTT_esp32.c" - "sys_view/ext/heap_trace_module.c" - "sys_view/ext/logging.c") + list(APPEND srcs + "sys_view/SEGGER/SEGGER_SYSVIEW.c" + "sys_view/Sample/Config/SEGGER_SYSVIEW_Config_FreeRTOS.c" + "sys_view/Sample/OS/SEGGER_SYSVIEW_FreeRTOS.c" + "sys_view/esp32/SEGGER_RTT_esp32.c" + "sys_view/ext/heap_trace_module.c" + "sys_view/ext/logging.c") endif() if(CONFIG_HEAP_TRACING_TOHOST) - list(APPEND COMPONENT_SRCS "heap_trace_tohost.c") + list(APPEND srcs "heap_trace_tohost.c") endif() -set(COMPONENT_REQUIRES) -set(COMPONENT_PRIV_REQUIRES heap soc) -set(COMPONENT_ADD_LDFRAGMENTS linker.lf) - -register_component() +idf_component_register(SRCS "${srcs}" + INCLUDE_DIRS "${include_dirs}" + PRIV_REQUIRES soc + LDFRAGMENTS linker.lf) # disable --coverage for this component, as it is used as transport # for gcov diff --git a/components/app_trace/test/CMakeLists.txt b/components/app_trace/test/CMakeLists.txt index 884ca8b6da..16aca87790 100644 --- a/components/app_trace/test/CMakeLists.txt +++ b/components/app_trace/test/CMakeLists.txt @@ -1,6 +1,3 @@ -set(COMPONENT_SRCDIRS ".") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -set(COMPONENT_REQUIRES unity) - -register_component() \ No newline at end of file +idf_component_register(SRC_DIRS "." + INCLUDE_DIRS "." + REQUIRES unity) \ No newline at end of file diff --git a/components/app_update/CMakeLists.txt b/components/app_update/CMakeLists.txt index 68ab01c4f9..af07c24042 100644 --- a/components/app_update/CMakeLists.txt +++ b/components/app_update/CMakeLists.txt @@ -1,10 +1,7 @@ -set(COMPONENT_SRCS "esp_ota_ops.c" - "esp_app_desc.c") -set(COMPONENT_ADD_INCLUDEDIRS "include") - -set(COMPONENT_REQUIRES spi_flash partition_table bootloader_support) - -register_component() +idf_component_register(SRCS "esp_ota_ops.c" + "esp_app_desc.c" + INCLUDE_DIRS "include" + REQUIRES spi_flash partition_table bootloader_support) # esp_app_desc structure is added as an undefined symbol because otherwise the # linker will ignore this structure as it has no other files depending on it. diff --git a/components/app_update/test/CMakeLists.txt b/components/app_update/test/CMakeLists.txt index e42488e75e..e56fd72838 100644 --- a/components/app_update/test/CMakeLists.txt +++ b/components/app_update/test/CMakeLists.txt @@ -1,6 +1,3 @@ -set(COMPONENT_SRCDIRS ".") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -set(COMPONENT_REQUIRES unity test_utils app_update bootloader_support nvs_flash) - -register_component() \ No newline at end of file +idf_component_register(SRC_DIRS "." + INCLUDE_DIRS "." + REQUIRES unity test_utils app_update bootloader_support nvs_flash) \ No newline at end of file diff --git a/components/asio/CMakeLists.txt b/components/asio/CMakeLists.txt index 43d428f8d7..f2038278de 100644 --- a/components/asio/CMakeLists.txt +++ b/components/asio/CMakeLists.txt @@ -1,6 +1,3 @@ -set(COMPONENT_ADD_INCLUDEDIRS asio/asio/include port/include) -set(COMPONENT_SRCS "asio/asio/src/asio.cpp") - -set(COMPONENT_REQUIRES lwip) - -register_component() +idf_component_register(SRCS "asio/asio/src/asio.cpp" + INCLUDE_DIRS "asio/asio/include" "port/include" + REQUIRES lwip) diff --git a/components/bootloader/CMakeLists.txt b/components/bootloader/CMakeLists.txt index a9dbf01afe..6d50ca58f5 100644 --- a/components/bootloader/CMakeLists.txt +++ b/components/bootloader/CMakeLists.txt @@ -1,4 +1,4 @@ -register_component() +idf_component_register() # Do not generate flash file when building bootloader or is in early expansion of the build if(BOOTLOADER_BUILD) @@ -7,8 +7,7 @@ endif() # Set values used in flash_bootloader_args.in and generate flash file # for bootloader -set(BOOTLOADER_OFFSET 0x1000) -esptool_py_flash_project_args(bootloader ${BOOTLOADER_OFFSET} +esptool_py_flash_project_args(bootloader 0x1000 ${BOOTLOADER_BUILD_DIR}/bootloader.bin FLASH_IN_PROJECT FLASH_FILE_TEMPLATE flash_bootloader_args.in) \ No newline at end of file diff --git a/components/bootloader/flash_bootloader_args.in b/components/bootloader/flash_bootloader_args.in index 610ba7626b..2867c5aafd 100644 --- a/components/bootloader/flash_bootloader_args.in +++ b/components/bootloader/flash_bootloader_args.in @@ -1,4 +1,4 @@ --flash_mode ${ESPFLASHMODE} --flash_size ${ESPFLASHSIZE} --flash_freq ${ESPFLASHFREQ} -${BOOTLOADER_OFFSET} bootloader/bootloader.bin +${OFFSET} ${IMAGE} diff --git a/components/bootloader/subproject/components/micro-ecc/CMakeLists.txt b/components/bootloader/subproject/components/micro-ecc/CMakeLists.txt index d609b61e70..7d4bfc4d19 100644 --- a/components/bootloader/subproject/components/micro-ecc/CMakeLists.txt +++ b/components/bootloader/subproject/components/micro-ecc/CMakeLists.txt @@ -1,4 +1,3 @@ # only compile the "micro-ecc/uECC.c" source file -set(COMPONENT_SRCS "micro-ecc/uECC.c") -set(COMPONENT_ADD_INCLUDEDIRS micro-ecc) -register_component() +idf_component_register(SRCS "micro-ecc/uECC.c" + INCLUDE_DIRS micro-ecc) diff --git a/components/bootloader/subproject/main/CMakeLists.txt b/components/bootloader/subproject/main/CMakeLists.txt index ab3ed94fd0..d73d46debc 100644 --- a/components/bootloader/subproject/main/CMakeLists.txt +++ b/components/bootloader/subproject/main/CMakeLists.txt @@ -1,7 +1,5 @@ -set(COMPONENT_SRCS "bootloader_start.c") -set(COMPONENT_ADD_INCLUDEDIRS "") -set(COMPONENT_REQUIRES bootloader bootloader_support) -register_component() +idf_component_register(SRCS "bootloader_start.c" + REQUIRES bootloader bootloader_support) idf_build_get_property(target IDF_TARGET) set(scripts "${target}.bootloader.ld" diff --git a/components/bootloader_support/CMakeLists.txt b/components/bootloader_support/CMakeLists.txt index 2437829d54..d40b8d1866 100644 --- a/components/bootloader_support/CMakeLists.txt +++ b/components/bootloader_support/CMakeLists.txt @@ -1,21 +1,23 @@ -set(COMPONENT_SRCS "src/bootloader_clock.c" - "src/bootloader_common.c" - "src/bootloader_flash.c" - "src/bootloader_random.c" - "src/bootloader_utility.c" - "src/esp_image_format.c" - "src/flash_partitions.c" - "src/flash_qio_mode.c") +set(srcs + "src/bootloader_clock.c" + "src/bootloader_common.c" + "src/bootloader_flash.c" + "src/bootloader_random.c" + "src/bootloader_utility.c" + "src/esp_image_format.c" + "src/flash_partitions.c" + "src/flash_qio_mode.c") if(BOOTLOADER_BUILD) - set(COMPONENT_ADD_INCLUDEDIRS "include include_bootloader") - set(COMPONENT_REQUIRES soc) #unfortunately the header directly uses SOC registers - set(COMPONENT_PRIV_REQUIRES micro-ecc spi_flash efuse) - list(APPEND COMPONENT_SRCS "src/bootloader_init.c" - "src/${IDF_TARGET}/bootloader_sha.c" - "src/${IDF_TARGET}/flash_encrypt.c" - "src/${IDF_TARGET}/secure_boot_signatures.c" - "src/${IDF_TARGET}/secure_boot.c") + set(include_dirs "include" "include_bootloader") + set(requires soc) #unfortunately the header directly uses SOC registers + set(priv_requires micro-ecc spi_flash efuse) + list(APPEND srcs + "src/bootloader_init.c" + "src/${IDF_TARGET}/bootloader_sha.c" + "src/${IDF_TARGET}/flash_encrypt.c" + "src/${IDF_TARGET}/secure_boot_signatures.c" + "src/${IDF_TARGET}/secure_boot.c") if(CONFIG_SECURE_SIGNED_APPS) get_filename_component(secure_boot_verification_key @@ -45,18 +47,24 @@ if(BOOTLOADER_BUILD) DEPENDS "${orig_secure_boot_verification_key}" VERBATIM) endif() - set(COMPONENT_EMBED_FILES "${secure_boot_verification_key}") + set(embed_files "${secure_boot_verification_key}") set_property(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES "${secure_boot_verification_key}") endif() else() - list(APPEND COMPONENT_SRCS "src/idf/bootloader_sha.c" - "src/idf/secure_boot_signatures.c") - set(COMPONENT_ADD_INCLUDEDIRS "include") - set(COMPONENT_PRIV_INCLUDEDIRS "include_bootloader") - set(COMPONENT_REQUIRES soc) #unfortunately the header directly uses SOC registers - set(COMPONENT_PRIV_REQUIRES spi_flash mbedtls efuse) + list(APPEND srcs + "src/idf/bootloader_sha.c" + "src/idf/secure_boot_signatures.c") + set(include_dirs "include") + set(priv_include_dirs "include_bootloader") + set(requires soc) #unfortunately the header directly uses SOC registers + set(priv_requires spi_flash mbedtls efuse) endif() -register_component() \ No newline at end of file +idf_component_register(SRCS "${srcs}" + INCLUDE_DIRS "${include_dirs}" + PRIV_INCLUDE_DIRS "${priv_include_dirs}" + REQUIRES "${requires}" + PRIV_REQUIRES "${priv_requires}" + EMBED_FILES "${embed_files}") \ No newline at end of file diff --git a/components/bootloader_support/test/CMakeLists.txt b/components/bootloader_support/test/CMakeLists.txt index 587c81609c..a31c179345 100644 --- a/components/bootloader_support/test/CMakeLists.txt +++ b/components/bootloader_support/test/CMakeLists.txt @@ -1,6 +1,3 @@ -set(COMPONENT_SRCDIRS ".") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -set(COMPONENT_REQUIRES unity bootloader_support app_update) - -register_component() \ No newline at end of file +idf_component_register(SRC_DIRS "." + INCLUDE_DIRS "." + REQUIRES unity bootloader_support app_update) diff --git a/components/bt/CMakeLists.txt b/components/bt/CMakeLists.txt index 58ccb27a82..bae50179d9 100644 --- a/components/bt/CMakeLists.txt +++ b/components/bt/CMakeLists.txt @@ -1,11 +1,11 @@ if(CONFIG_BT_ENABLED) - set(COMPONENT_SRCS "bt.c") - set(COMPONENT_ADD_INCLUDEDIRS include) + set(srcs "bt.c") + set(include_dirs include) if(CONFIG_BT_BLUEDROID_ENABLED) - list(APPEND COMPONENT_PRIV_INCLUDEDIRS + list(APPEND priv_include_dirs bluedroid/bta/include bluedroid/bta/ar/include bluedroid/bta/av/include @@ -41,9 +41,9 @@ if(CONFIG_BT_ENABLED) bluedroid/stack/include bluedroid/common/include) - list(APPEND COMPONENT_ADD_INCLUDEDIRS bluedroid/api/include/api) + list(APPEND include_dirs bluedroid/api/include/api) - list(APPEND COMPONENT_SRCS "bluedroid/api/esp_a2dp_api.c" + list(APPEND 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" @@ -357,9 +357,10 @@ if (CONFIG_BLE_MESH) endif() # requirements can't depend on config -set(COMPONENT_PRIV_REQUIRES nvs_flash soc) - -register_component() +idf_component_register(SRCS "${srcs}" + INCLUDE_DIRS "${include_dirs}" + PRIV_INCLUDE_DIRS "${priv_include_dirs}" + REQUIRES nvs_flash soc) if(CONFIG_BT_ENABLED) if(GCC_NOT_5_2_0) diff --git a/components/bt/test/CMakeLists.txt b/components/bt/test/CMakeLists.txt index e59c45744a..0012e8bd17 100644 --- a/components/bt/test/CMakeLists.txt +++ b/components/bt/test/CMakeLists.txt @@ -1,7 +1,5 @@ if(CONFIG_BT_ENABLED OR CMAKE_BUILD_EARLY_EXPANSION) - set(COMPONENT_SRCDIRS ".") - set(COMPONENT_ADD_INCLUDEDIRS ".") - set(COMPONENT_REQUIRES unity nvs_flash bt) - - register_component() -endif() + idf_component_register(SRC_DIRS "." + INCLUDE_DIRS "." + REQUIRES unity nvs_flash bt) +endif() \ No newline at end of file diff --git a/components/coap/CMakeLists.txt b/components/coap/CMakeLists.txt index 246a0e28e4..aef9d31682 100644 --- a/components/coap/CMakeLists.txt +++ b/components/coap/CMakeLists.txt @@ -1,28 +1,31 @@ -set(COMPONENT_ADD_INCLUDEDIRS port/include port/include/coap libcoap/include libcoap/include/coap2) +set(include_dirs port/include port/include/coap libcoap/include libcoap/include/coap2) -set(COMPONENT_SRCS "libcoap/src/address.c" - "libcoap/src/async.c" - "libcoap/src/block.c" - "libcoap/src/coap_event.c" - "libcoap/src/coap_hashkey.c" - "libcoap/src/coap_session.c" - "libcoap/src/coap_time.c" - "libcoap/src/coap_debug.c" - "libcoap/src/encode.c" - "libcoap/src/mem.c" - "libcoap/src/net.c" - "libcoap/src/option.c" - "libcoap/src/pdu.c" - "libcoap/src/resource.c" - "libcoap/src/str.c" - "libcoap/src/subscribe.c" - "libcoap/src/uri.c" - "libcoap/src/coap_notls.c" - "port/coap_io.c") +set(srcs + "libcoap/src/address.c" + "libcoap/src/async.c" + "libcoap/src/block.c" + "libcoap/src/coap_event.c" + "libcoap/src/coap_hashkey.c" + "libcoap/src/coap_session.c" + "libcoap/src/coap_time.c" + "libcoap/src/coap_debug.c" + "libcoap/src/encode.c" + "libcoap/src/mem.c" + "libcoap/src/net.c" + "libcoap/src/option.c" + "libcoap/src/pdu.c" + "libcoap/src/resource.c" + "libcoap/src/str.c" + "libcoap/src/subscribe.c" + "libcoap/src/uri.c" + "libcoap/src/coap_notls.c" + "port/coap_io.c") set(COMPONENT_REQUIRES lwip) -register_component() +idf_component_register(SRCS "${srcs}" + INCLUDE_DIRS "${include_dirs}" + REQUIRES lwip) # Silence format truncation warning, until it is fixed upstream set_source_files_properties(libcoap/src/coap_debug.c PROPERTIES COMPILE_FLAGS -Wno-format-truncation) diff --git a/components/console/CMakeLists.txt b/components/console/CMakeLists.txt index 33dddc81a9..cb20200cd6 100644 --- a/components/console/CMakeLists.txt +++ b/components/console/CMakeLists.txt @@ -1,7 +1,6 @@ -set(COMPONENT_ADD_INCLUDEDIRS .) -set(COMPONENT_SRCS "commands.c" - "split_argv.c" - "argtable3/argtable3.c" - "linenoise/linenoise.c") -register_component() - +idf_component_register(SRCS "commands.c" + "split_argv.c" + "argtable3/argtable3.c" + "linenoise/linenoise.c" + INCLUDE_DIRS "." + REQUIRES vfs) diff --git a/components/cxx/CMakeLists.txt b/components/cxx/CMakeLists.txt index dbfe20dd32..4e81992ad0 100644 --- a/components/cxx/CMakeLists.txt +++ b/components/cxx/CMakeLists.txt @@ -1,6 +1,5 @@ -set(COMPONENT_SRCS "cxx_exception_stubs.cpp" - "cxx_guards.cpp") -register_component() +idf_component_register(SRCS "cxx_exception_stubs.cpp" + "cxx_guards.cpp") target_link_libraries(${COMPONENT_LIB} PUBLIC stdc++ gcc) target_link_libraries(${COMPONENT_LIB} INTERFACE "-u __cxa_guard_dummy") diff --git a/components/cxx/test/CMakeLists.txt b/components/cxx/test/CMakeLists.txt index 884ca8b6da..16aca87790 100644 --- a/components/cxx/test/CMakeLists.txt +++ b/components/cxx/test/CMakeLists.txt @@ -1,6 +1,3 @@ -set(COMPONENT_SRCDIRS ".") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -set(COMPONENT_REQUIRES unity) - -register_component() \ No newline at end of file +idf_component_register(SRC_DIRS "." + INCLUDE_DIRS "." + REQUIRES unity) \ No newline at end of file diff --git a/components/driver/CMakeLists.txt b/components/driver/CMakeLists.txt index 9b36ca854b..f0509fcf19 100644 --- a/components/driver/CMakeLists.txt +++ b/components/driver/CMakeLists.txt @@ -1,33 +1,33 @@ -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") -set(COMPONENT_REQUIRES esp_ringbuf soc) #cannot totally hide soc headers, since there are a lot arguments in the driver are chip-dependent - -register_component() +set(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") +idf_component_register(SRCS "${srcs}" + INCLUDE_DIRS "include" + PRIV_INCLUDE_DIRS "include/driver" + REQUIRES esp_ringbuf soc) #cannot totally hide soc headers, since there are a lot arguments in the driver are chip-dependent if(GCC_NOT_5_2_0) # uses C11 atomic feature set_source_files_properties(spi_master.c PROPERTIES COMPILE_FLAGS -std=gnu11) -endif() +endif() \ No newline at end of file diff --git a/components/driver/test/CMakeLists.txt b/components/driver/test/CMakeLists.txt index b48610adcd..7102bae72e 100644 --- a/components/driver/test/CMakeLists.txt +++ b/components/driver/test/CMakeLists.txt @@ -1,6 +1,3 @@ -set(COMPONENT_SRCDIRS ". param_test") -set(COMPONENT_ADD_INCLUDEDIRS "include param_test/include") - -set(COMPONENT_REQUIRES unity test_utils driver nvs_flash) - -register_component() \ No newline at end of file +idf_component_register(SRC_DIRS "." "param_test" + INCLUDE_DIRS "include" "param_test/include" + REQUIRES unity test_utils driver nvs_flash) \ No newline at end of file diff --git a/components/efuse/CMakeLists.txt b/components/efuse/CMakeLists.txt index f649a242f4..9a05e7cc14 100644 --- a/components/efuse/CMakeLists.txt +++ b/components/efuse/CMakeLists.txt @@ -3,16 +3,18 @@ idf_build_get_property(soc_name IDF_TARGET) if(EXISTS "${COMPONENT_DIR}/${soc_name}") include(${COMPONENT_DIR}/${soc_name}/sources.cmake) spaces2list(EFUSE_SOC_SRCS) - add_prefix(COMPONENT_SRCS "${soc_name}/" ${EFUSE_SOC_SRCS}) - set(COMPONENT_ADD_INCLUDEDIRS include ${soc_name}/include) + add_prefix(srcs "${soc_name}/" ${EFUSE_SOC_SRCS}) + set(include_dirs include ${soc_name}/include) endif() -list(APPEND COMPONENT_SRCS "src/esp_efuse_api.c" - "src/esp_efuse_fields.c" - "src/esp_efuse_utility.c") +list(APPEND srcs + "src/esp_efuse_api.c" + "src/esp_efuse_fields.c" + "src/esp_efuse_utility.c") -set(COMPONENT_PRIV_REQUIRES bootloader_support soc) -register_component() +idf_component_register(SRCS "${srcs}" + PRIV_REQUIRES bootloader_support soc + INCLUDE_DIRS "${include_dirs}") set(GEN_EFUSE_TABLE_ARG --max_blk_len ${CONFIG_EFUSE_MAX_BLK_LEN}) diff --git a/components/efuse/test/CMakeLists.txt b/components/efuse/test/CMakeLists.txt index 28d0b2e7aa..e239bfe5ce 100644 --- a/components/efuse/test/CMakeLists.txt +++ b/components/efuse/test/CMakeLists.txt @@ -1,6 +1,3 @@ -set(COMPONENT_SRCDIRS ".") -set(COMPONENT_ADD_INCLUDEDIRS "." "include") - -set(COMPONENT_REQUIRES unity test_utils efuse bootloader_support) - -register_component() \ No newline at end of file +idf_component_register(SRC_DIRS "." + INCLUDE_DIRS "." "include" + REQUIRES unity test_utils efuse bootloader_support) \ No newline at end of file diff --git a/components/esp-tls/CMakeLists.txt b/components/esp-tls/CMakeLists.txt index 23f953d940..e08418e5a1 100644 --- a/components/esp-tls/CMakeLists.txt +++ b/components/esp-tls/CMakeLists.txt @@ -1,7 +1,4 @@ -set(COMPONENT_SRCS "esp_tls.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -set(COMPONENT_REQUIRES mbedtls) -set(COMPONENT_PRIV_REQUIRES lwip nghttp) - -register_component() +idf_component_register(SRCS "esp_tls.c" + INCLUDE_DIRS "." + REQUIRES mbedtls + PRIV_REQUIRES lwip nghttp) diff --git a/components/esp32/CMakeLists.txt b/components/esp32/CMakeLists.txt index 9d763b41b9..916113b533 100644 --- a/components/esp32/CMakeLists.txt +++ b/components/esp32/CMakeLists.txt @@ -1,50 +1,50 @@ -require_idf_targets(esp32) - if(BOOTLOADER_BUILD) # For bootloader, all we need from esp32 is headers - set(COMPONENT_ADD_INCLUDEDIRS include) - register_component() + idf_component_register(INCLUDE_DIRS include) target_linker_script(${COMPONENT_LIB} INTERFACE "ld/esp32.peripherals.ld") else() # Regular app build + set(srcs + "brownout.c" + "cache_err_int.c" + "cache_sram_mmu.c" + "clk.c" + "cpu_start.c" + "crosscore_int.c" + "dport_access.c" + "dport_panic_highint_hdl.S" + "esp_adapter.c" + "esp_timer_esp32.c" + "esp_himem.c" + "gdbstub.c" + "hw_random.c" + "int_wdt.c" + "intr_alloc.c" + "panic.c" + "pm_esp32.c" + "pm_trace.c" + "reset_reason.c" + "sleep_modes.c" + "spiram.c" + "spiram_psram.c" + "system_api.c" + "task_wdt.c") + set(include_dirs "include") - set(COMPONENT_SRCS "brownout.c" - "cache_err_int.c" - "cache_sram_mmu.c" - "clk.c" - "cpu_start.c" - "crosscore_int.c" - "dport_access.c" - "dport_panic_highint_hdl.S" - "esp_adapter.c" - "esp_timer_esp32.c" - "esp_himem.c" - "gdbstub.c" - "hw_random.c" - "int_wdt.c" - "intr_alloc.c" - "panic.c" - "pm_esp32.c" - "pm_trace.c" - "reset_reason.c" - "sleep_modes.c" - "spiram.c" - "spiram_psram.c" - "system_api.c" - "task_wdt.c") - set(COMPONENT_ADD_INCLUDEDIRS "include") - - set(COMPONENT_REQUIRES driver esp_event efuse soc) #unfortunately rom/uart uses SOC registers directly + set(requires driver esp_event efuse soc) #unfortunately rom/uart uses SOC registers directly # driver is a public requirement because esp_sleep.h uses gpio_num_t & touch_pad_t # app_update is added here because cpu_start.c uses esp_ota_get_app_description() function. - set(COMPONENT_PRIV_REQUIRES - app_trace app_update bootloader_support log mbedtls nvs_flash pthread + set(priv_requires app_trace app_update bootloader_support log mbedtls nvs_flash pthread smartconfig_ack spi_flash vfs wpa_supplicant espcoredump esp_common esp_wifi) + set(fragments linker.lf ld/esp32_fragments.lf) - set(COMPONENT_ADD_LDFRAGMENTS linker.lf ld/esp32_fragments.lf) - - register_component() + idf_component_register(SRCS "${srcs}" + INCLUDE_DIRS "${include_dirs}" + LDFRAGMENTS "${fragments}" + REQUIRES "${requires}" + PRIV_REQUIRES "${priv_requires}" + REQUIRED_IDF_TARGETS esp32) target_linker_script(${COMPONENT_LIB} INTERFACE "${CMAKE_CURRENT_BINARY_DIR}/esp32_out.ld") diff --git a/components/esp32/test/CMakeLists.txt b/components/esp32/test/CMakeLists.txt index 1ced21ed8a..b36af1bd1d 100644 --- a/components/esp32/test/CMakeLists.txt +++ b/components/esp32/test/CMakeLists.txt @@ -1,9 +1,6 @@ -set(COMPONENT_SRCDIRS ".") -set(COMPONENT_ADD_INCLUDEDIRS ". ${CMAKE_CURRENT_BINARY_DIR}") - -set(COMPONENT_REQUIRES unity test_utils nvs_flash ulp esp_common) - -register_component() +idf_component_register(SRC_DIRS "." + INCLUDE_DIRS "." "${CMAKE_CURRENT_BINARY_DIR}" + REQUIRES unity test_utils nvs_flash ulp esp_common) add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/test_tjpgd_logo.h" COMMAND xxd -i "logo.jpg" "${CMAKE_CURRENT_BINARY_DIR}/test_tjpgd_logo.h" diff --git a/components/esp_adc_cal/CMakeLists.txt b/components/esp_adc_cal/CMakeLists.txt index 8bb99092e2..baef0b690e 100644 --- a/components/esp_adc_cal/CMakeLists.txt +++ b/components/esp_adc_cal/CMakeLists.txt @@ -1,6 +1,3 @@ -set(COMPONENT_SRCS "esp_adc_cal.c") -set(COMPONENT_ADD_INCLUDEDIRS "include") - -set(COMPONENT_REQUIRES) - -register_component() +idf_component_register(SRCS "esp_adc_cal.c" + INCLUDE_DIRS "include" + REQUIRES driver) diff --git a/components/esp_common/CMakeLists.txt b/components/esp_common/CMakeLists.txt index 18ffe93678..bb9bd8a7a4 100644 --- a/components/esp_common/CMakeLists.txt +++ b/components/esp_common/CMakeLists.txt @@ -1,27 +1,19 @@ if(BOOTLOADER_BUILD) # For bootloader, all we need from esp_common is headers - set(COMPONENT_ADD_INCLUDEDIRS include) - set(COMPONENT_REQUIRES ${IDF_COMPONENTS}) - set(COMPONENT_SRCS ) - register_component() + idf_component_register(INCLUDE_DIRS include) set_property(TARGET ${COMPONENT_LIB} APPEND PROPERTY INTERFACE_LINK_LIBRARIES "-Wl,--gc-sections") else() # Regular app build - set(COMPONENT_SRCS - "src/dbg_stubs.c" - "src/esp_err_to_name.c" - "src/esp_timer.c" - "src/ets_timer_legacy.c" - "src/freertos_hooks.c" - "src/ipc.c" - "src/pm_locks.c" - "src/stack_check.c") - set(COMPONENT_ADD_INCLUDEDIRS "include") - set(COMPONENT_PRIV_INCLUDEDIRS) - set(COMPONENT_REQUIRES) - set(COMPONENT_PRIV_REQUIRES soc) - - register_component() + idf_component_register(SRCS "src/dbg_stubs.c" + "src/esp_err_to_name.c" + "src/esp_timer.c" + "src/ets_timer_legacy.c" + "src/freertos_hooks.c" + "src/ipc.c" + "src/pm_locks.c" + "src/stack_check.c" + INCLUDE_DIRS include + PRIV_REQUIRES soc) set_source_files_properties( "src/stack_check.c" diff --git a/components/esp_event/CMakeLists.txt b/components/esp_event/CMakeLists.txt index 53aff6b0a2..becd3ba7f6 100644 --- a/components/esp_event/CMakeLists.txt +++ b/components/esp_event/CMakeLists.txt @@ -1,19 +1,13 @@ -set(COMPONENT_SRCS "default_event_loop.c" - "esp_event.c" - "esp_event_private.c" - "event_loop_legacy.c" - "event_send.c") - -set(COMPONENT_ADD_INCLUDEDIRS "include") -set(COMPONENT_PRIV_INCLUDEDIRS "private_include") - -set(COMPONENT_REQUIRES log tcpip_adapter) -set(COMPONENT_PRIV_REQUIRES ethernet) -set(COMPONENT_REQUIRES log tcpip_adapter ethernet) - -set(COMPONENT_ADD_LDFRAGMENTS linker.lf) - -register_component() +idf_component_register(SRCS "default_event_loop.c" + "esp_event.c" + "esp_event_private.c" + "event_loop_legacy.c" + "event_send.c" + INCLUDE_DIRS "include" + PRIV_INCLUDE_DIRS "private_include" + REQUIRES log tcpip_adapter + PRIV_REQUIRES ethernet + LDFRAGMENTS linker.lf) if(GCC_NOT_5_2_0 AND CONFIG_ESP_EVENT_LOOP_PROFILING) # uses C11 atomic feature diff --git a/components/esp_event/test/CMakeLists.txt b/components/esp_event/test/CMakeLists.txt index 287a2ba928..8264f10dda 100644 --- a/components/esp_event/test/CMakeLists.txt +++ b/components/esp_event/test/CMakeLists.txt @@ -1,5 +1,3 @@ -set(COMPONENT_SRCDIRS ".") -set(COMPONENT_PRIV_INCLUDEDIRS "../private_include" ".") -set(COMPONENT_PRIV_REQUIRES unity test_utils esp_event driver) - -register_component() \ No newline at end of file +idf_component_register(SRC_DIRS "." + PRIV_INCLUDE_DIRS "../private_include" "." + REQUIRES unity test_utils esp_event driver) diff --git a/components/esp_http_client/CMakeLists.txt b/components/esp_http_client/CMakeLists.txt index 2bea7ce022..327e90778a 100644 --- a/components/esp_http_client/CMakeLists.txt +++ b/components/esp_http_client/CMakeLists.txt @@ -1,11 +1,8 @@ -set(COMPONENT_SRCS "esp_http_client.c" - "lib/http_auth.c" - "lib/http_header.c" - "lib/http_utils.c") -set(COMPONENT_ADD_INCLUDEDIRS "include") -set(COMPONENT_PRIV_INCLUDEDIRS "lib/include") - -set(COMPONENT_REQUIRES "nghttp") -set(COMPONENT_PRIV_REQUIRES "mbedtls" "lwip" "esp-tls" "tcp_transport") - -register_component() +idf_component_register(SRCS "esp_http_client.c" + "lib/http_auth.c" + "lib/http_header.c" + "lib/http_utils.c" + INCLUDE_DIRS "include" + PRIV_INCLUDE_DIRS "lib/include" + REQUIRES nghttp + PRIV_REQUIRES mbedtls lwip esp-tls tcp_transport) diff --git a/components/esp_http_client/test/CMakeLists.txt b/components/esp_http_client/test/CMakeLists.txt index 6b99d7546a..70fc98dcad 100644 --- a/components/esp_http_client/test/CMakeLists.txt +++ b/components/esp_http_client/test/CMakeLists.txt @@ -1,6 +1,3 @@ -set(COMPONENT_SRCDIRS ".") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -set(COMPONENT_REQUIRES unity test_utils esp_http_client) - -register_component() +idf_component_register(SRC_DIRS "." + INCLUDE_DIRS "." + REQUIRES unity test_utils esp_http_client) \ No newline at end of file diff --git a/components/esp_http_server/CMakeLists.txt b/components/esp_http_server/CMakeLists.txt index 700a0b9cb1..744e6b207f 100644 --- a/components/esp_http_server/CMakeLists.txt +++ b/components/esp_http_server/CMakeLists.txt @@ -1,13 +1,10 @@ -set(COMPONENT_ADD_INCLUDEDIRS include) -set(COMPONENT_PRIV_INCLUDEDIRS src/port/esp32 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) - -register_component() +idf_component_register(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" + INCLUDE_DIRS "include" + PRIV_INCLUDE_DIRS "src/port/esp32" "src/util" + REQUIRES nghttp # for http_parser.h + PRIV_REQUIRES lwip) diff --git a/components/esp_http_server/test/CMakeLists.txt b/components/esp_http_server/test/CMakeLists.txt index de20de38f5..e2ceeb2986 100644 --- a/components/esp_http_server/test/CMakeLists.txt +++ b/components/esp_http_server/test/CMakeLists.txt @@ -1,6 +1,3 @@ -set(COMPONENT_SRCDIRS ".") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -set(COMPONENT_REQUIRES unity test_utils esp_http_server) - -register_component() +idf_component_register(SRC_DIRS "." + INCLUDE_DIRS "." + REQUIRES unity test_utils esp_http_server) \ No newline at end of file diff --git a/components/esp_https_ota/CMakeLists.txt b/components/esp_https_ota/CMakeLists.txt index 6ef0a5c9e0..8608666fde 100644 --- a/components/esp_https_ota/CMakeLists.txt +++ b/components/esp_https_ota/CMakeLists.txt @@ -1,7 +1,4 @@ -set(COMPONENT_ADD_INCLUDEDIRS include) -set(COMPONENT_SRCS "src/esp_https_ota.c") - -set(COMPONENT_REQUIRES esp_http_client) -set(COMPONENT_PRIV_REQUIRES log app_update) - -register_component() +idf_component_register(SRCS "src/esp_https_ota.c" + INCLUDE_DIRS "include" + REQUIRES esp_http_client + PRIV_REQUIRES log app_update) diff --git a/components/esp_https_server/CMakeLists.txt b/components/esp_https_server/CMakeLists.txt index dfdaa11ecc..c63549b0e2 100644 --- a/components/esp_https_server/CMakeLists.txt +++ b/components/esp_https_server/CMakeLists.txt @@ -1,7 +1,4 @@ -set(COMPONENT_ADD_INCLUDEDIRS include) -set(COMPONENT_SRCS "src/https_server.c") - -set(COMPONENT_REQUIRES esp_http_server openssl) -set(COMPONENT_PRIV_REQUIRES lwip) - -register_component() +idf_component_register(SRCS "src/https_server.c" + INCLUDE_DIRS "include" + REQUIRES esp_http_server openssl + PRIV_REQUIRES lwip) diff --git a/components/esp_ringbuf/CMakeLists.txt b/components/esp_ringbuf/CMakeLists.txt index bba1dfd6d8..4c4b114af9 100644 --- a/components/esp_ringbuf/CMakeLists.txt +++ b/components/esp_ringbuf/CMakeLists.txt @@ -1,7 +1,3 @@ -set(COMPONENT_ADD_INCLUDEDIRS "include") -set(COMPONENT_SRCS "ringbuf.c") -set(COMPONENT_ADD_LDFRAGMENTS linker.lf) - -set(COMPONENT_REQUIRES) - -register_component() +idf_component_register(SRCS "ringbuf.c" + INCLUDE_DIRS "include" + LDFRAGMENTS linker.lf) diff --git a/components/esp_ringbuf/test/CMakeLists.txt b/components/esp_ringbuf/test/CMakeLists.txt index 236536c476..b531a14504 100644 --- a/components/esp_ringbuf/test/CMakeLists.txt +++ b/components/esp_ringbuf/test/CMakeLists.txt @@ -1,6 +1,3 @@ -set(COMPONENT_SRCDIRS ".") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -set(COMPONENT_REQUIRES unity test_utils) - -register_component() +idf_component_register(SRC_DIRS "." + INCLUDE_DIRS "." + REQUIRES unity test_utils) \ No newline at end of file diff --git a/components/esp_rom/CMakeLists.txt b/components/esp_rom/CMakeLists.txt index 188f511eac..2c903a5100 100644 --- a/components/esp_rom/CMakeLists.txt +++ b/components/esp_rom/CMakeLists.txt @@ -1,9 +1,6 @@ if(BOOTLOADER_BUILD) # For bootloader, all we need is headers - set(COMPONENT_ADD_INCLUDEDIRS "include") - set(COMPONENT_REQUIRES ${IDF_COMPONENTS}) - set(COMPONENT_SRCS) - register_component() + idf_component_register(INCLUDE_DIRS include) set(scripts "esp32/ld/esp32.rom.ld" "esp32/ld/esp32.rom.newlib-funcs.ld" @@ -12,10 +9,8 @@ if(BOOTLOADER_BUILD) target_linker_script(${COMPONENT_LIB} INTERFACE "${scripts}") else() # Regular app build - set(COMPONENT_SRCS "esp_rom.c") - set(COMPONENT_ADD_INCLUDEDIRS "include") - - register_component() + idf_component_register(SRCS "esp_rom.c" + INCLUDE_DIRS include) set(scripts "esp32/ld/esp32.rom.ld" diff --git a/components/esp_websocket_client/CMakeLists.txt b/components/esp_websocket_client/CMakeLists.txt index 723199ce0f..f366a278d3 100644 --- a/components/esp_websocket_client/CMakeLists.txt +++ b/components/esp_websocket_client/CMakeLists.txt @@ -1,4 +1,3 @@ -set(COMPONENT_SRCS "esp_websocket_client.c") -set(COMPONENT_ADD_INCLUDEDIRS "include") -set(COMPONENT_REQUIRES lwip esp-tls tcp_transport nghttp) -register_component() +idf_component_register(SRCS "esp_websocket_client.c" + INCLUDE_DIRS "include" + REQUIRES lwip esp-tls tcp_transport nghttp) diff --git a/components/esp_wifi/CMakeLists.txt b/components/esp_wifi/CMakeLists.txt index 5349e905ac..9c7f29759b 100644 --- a/components/esp_wifi/CMakeLists.txt +++ b/components/esp_wifi/CMakeLists.txt @@ -1,23 +1,21 @@ idf_build_get_property(idf_target IDF_TARGET) -idf_build_get_property(build_dir BUILD_DIR) - -set(COMPONENT_SRCS - "src/coexist.c" - "src/fast_crypto_ops.c" - "src/lib_printf.c" - "src/mesh_event.c" - "src/phy_init.c" - "src/restore.c" - "src/wifi_init.c") -set(COMPONENT_ADD_INCLUDEDIRS "include" "${idf_target}/include") -set(COMPONENT_PRIV_INCLUDEDIRS) -set(COMPONENT_PRIV_REQUIRES wpa_supplicant nvs_flash) if(NOT CONFIG_ESP32_NO_BLOBS) - set(COMPONENT_ADD_LDFRAGMENTS "linker.lf") + set(ldfragments "linker.lf") endif() -register_component() +idf_component_register(SRCS "src/coexist.c" + "src/fast_crypto_ops.c" + "src/lib_printf.c" + "src/mesh_event.c" + "src/phy_init.c" + "src/restore.c" + "src/wifi_init.c" + INCLUDE_DIRS "include" "${idf_target}/include" + PRIV_REQUIRES wpa_supplicant nvs_flash + LDFRAGMENTS "${ldfragments}") + +idf_build_get_property(build_dir BUILD_DIR) target_link_libraries(${COMPONENT_LIB} PUBLIC "-L ${CMAKE_CURRENT_SOURCE_DIR}/lib_${idf_target}") if(NOT CONFIG_ESP32_NO_BLOBS) diff --git a/components/esp_wifi/test/CMakeLists.txt b/components/esp_wifi/test/CMakeLists.txt index 6f9211dcc6..cf98dd8137 100644 --- a/components/esp_wifi/test/CMakeLists.txt +++ b/components/esp_wifi/test/CMakeLists.txt @@ -1,9 +1,6 @@ -set(COMPONENT_SRCDIRS ".") -set(COMPONENT_ADD_INCLUDEDIRS ". ${CMAKE_CURRENT_BINARY_DIR}") - -set(COMPONENT_REQUIRES unity test_utils nvs_flash ulp esp_common) - -register_component() +idf_component_register(SRC_DIRS "." + INCLUDE_DIRS "." "${CMAKE_CURRENT_BINARY_DIR}" + REQUIRES unity test_utils nvs_flash ulp esp_common) idf_component_get_property(esp_wifi_dir esp_wifi COMPONENT_DIR) diff --git a/components/espcoredump/CMakeLists.txt b/components/espcoredump/CMakeLists.txt index 8ef4c1ce70..aa3b32eeac 100644 --- a/components/espcoredump/CMakeLists.txt +++ b/components/espcoredump/CMakeLists.txt @@ -1,10 +1,8 @@ -set(COMPONENT_PRIV_INCLUDEDIRS "include_core_dump") -set(COMPONENT_ADD_INCLUDEDIRS "include") -set(COMPONENT_PRIV_REQUIRES spi_flash soc) -set(COMPONENT_ADD_LDFRAGMENTS linker.lf) -set(COMPONENT_SRCS "src/core_dump_common.c" - "src/core_dump_flash.c" - "src/core_dump_port.c" - "src/core_dump_uart.c") - -register_component() +idf_component_register(SRCS "src/core_dump_common.c" + "src/core_dump_flash.c" + "src/core_dump_port.c" + "src/core_dump_uart.c" + INCLUDE_DIRS "include" + PRIV_INCLUDE_DIRS "include_core_dump" + LDFRAGMENTS linker.lf + PRIV_REQUIRES spi_flash soc) diff --git a/components/espcoredump/test/CMakeLists.txt b/components/espcoredump/test/CMakeLists.txt index 6704c238b9..c000ba4e57 100644 --- a/components/espcoredump/test/CMakeLists.txt +++ b/components/espcoredump/test/CMakeLists.txt @@ -1,8 +1,7 @@ if(TESTS_ALL EQUAL 1) message("not linking coredump test from CI.") else() - set(COMPONENT_SRCDIRS ".") - set(COMPONENT_ADD_INCLUDEDIRS ".") - set(COMPONENT_REQUIRES unity nvs_flash) - register_component() + idf_component_register(SRC_DIRS "." + INCLUDE_DIRS "." + REQUIRES unity nvs_flash) endif() \ No newline at end of file diff --git a/components/esptool_py/CMakeLists.txt b/components/esptool_py/CMakeLists.txt index 09764ccf05..10a0f3457d 100644 --- a/components/esptool_py/CMakeLists.txt +++ b/components/esptool_py/CMakeLists.txt @@ -1,5 +1,4 @@ -set(COMPONENT_PRIV_REQUIRES bootloader) -register_component() +idf_component_register(REQUIRES bootloader) string(REPLACE ";" " " ESPTOOLPY_FLASH_PROJECT_OPTIONS "${ESPTOOLPY_ELF2IMAGE_FLASH_OPTIONS}") set(ESPTOOLPY_FLASH_PROJECT_OPTIONS diff --git a/components/esptool_py/project_include.cmake b/components/esptool_py/project_include.cmake index b847680c88..544888f054 100644 --- a/components/esptool_py/project_include.cmake +++ b/components/esptool_py/project_include.cmake @@ -148,7 +148,10 @@ add_custom_target(flash_project_args_target) # esptool_py_flash_project_args # -# Add file to the flasher args list, to be flashed at a particular offset +# Add file to the flasher args list, to be flashed at a particular offset. +# +# When a template FLASH_FILE_TEMPLATE is given, the variables OFFSET and IMAGE +# hold the value of arguments offset and image, respectively. function(esptool_py_flash_project_args entry offset image) set(options FLASH_IN_PROJECT) # flash the image when flashing the project set(single_value FLASH_FILE_TEMPLATE) # template file to use to be able to @@ -172,8 +175,16 @@ function(esptool_py_flash_project_args entry offset image) if(NOT __FLASH_FILE_TEMPLATE) file(GENERATE OUTPUT ${entry_flash_args} CONTENT "${offset} ${image}") else() + set(OFFSET ${offset}) + set(IMAGE ${image}) get_filename_component(template "${__FLASH_FILE_TEMPLATE}" ABSOLUTE) - file(GENERATE OUTPUT ${entry_flash_args} INPUT ${template}) + configure_file(${template} ${CMAKE_CURRENT_BINARY_DIR}/${template}.in2) + file(GENERATE OUTPUT ${entry_flash_args} INPUT ${CMAKE_CURRENT_BINARY_DIR}/${template}.in2) + set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + APPEND PROPERTY + ADDITIONAL_MAKE_CLEAN_FILES ${CMAKE_CURRENT_BINARY_DIR}/${template}.in2}) + unset(OFFSET) + unset(IMAGE) endif() set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} diff --git a/components/ethernet/CMakeLists.txt b/components/ethernet/CMakeLists.txt index 704d21a7d7..3951c97c22 100644 --- a/components/ethernet/CMakeLists.txt +++ b/components/ethernet/CMakeLists.txt @@ -1,12 +1,8 @@ -set(COMPONENT_SRCS "emac_dev.c" - "emac_main.c" - "eth_phy/phy_common.c" - "eth_phy/phy_lan8720.c" - "eth_phy/phy_tlk110.c" - "eth_phy/phy_ip101.c") -set(COMPONENT_ADD_INCLUDEDIRS "include") - -set(COMPONENT_REQUIRES) -set(COMPONENT_PRIV_REQUIRES tcpip_adapter esp_event soc) - -register_component() +idf_component_register(SRCS "emac_dev.c" + "emac_main.c" + "eth_phy/phy_common.c" + "eth_phy/phy_lan8720.c" + "eth_phy/phy_tlk110.c" + "eth_phy/phy_ip101.c" + INCLUDE_DIRS "include" + PRIV_REQUIRES tcpip_adapter esp_event soc) diff --git a/components/ethernet/test/CMakeLists.txt b/components/ethernet/test/CMakeLists.txt index d5d44577ae..ae46c13bfd 100644 --- a/components/ethernet/test/CMakeLists.txt +++ b/components/ethernet/test/CMakeLists.txt @@ -1,5 +1,3 @@ -set(COMPONENT_SRCDIRS ".") -set(COMPONENT_ADD_INCLUDEDIRS ".") -set(COMPONENT_REQUIRES unity ethernet) - -register_component() \ No newline at end of file +idf_component_register(SRC_DIRS "." + INCLUDE_DIRS "." + REQUIRES unity ethernet) \ No newline at end of file diff --git a/components/expat/CMakeLists.txt b/components/expat/CMakeLists.txt index 596aee917c..a6c5882c79 100644 --- a/components/expat/CMakeLists.txt +++ b/components/expat/CMakeLists.txt @@ -1,11 +1,10 @@ -set(COMPONENT_ADD_INCLUDEDIRS expat/expat/lib port/include) -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") -register_component() +idf_component_register(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" + INCLUDE_DIRS expat/expat/lib port/include) target_compile_definitions(${COMPONENT_LIB} PRIVATE HAVE_EXPAT_CONFIG_H) target_compile_definitions(${COMPONENT_LIB} PRIVATE HAVE_GETRANDOM) diff --git a/components/expat/test/CMakeLists.txt b/components/expat/test/CMakeLists.txt index be2a822177..28d0afb413 100644 --- a/components/expat/test/CMakeLists.txt +++ b/components/expat/test/CMakeLists.txt @@ -1,5 +1,3 @@ -set(COMPONENT_SRCDIRS ".") -set(COMPONENT_ADD_INCLUDEDIRS ".") -set(COMPONENT_REQUIRES unity expat) - -register_component() +idf_component_register(SRC_DIRS "." + INCLUDE_DIRS "." + REQUIRES unity expat) \ No newline at end of file diff --git a/components/fatfs/CMakeLists.txt b/components/fatfs/CMakeLists.txt index 4df07d30b9..d12bd175d2 100644 --- a/components/fatfs/CMakeLists.txt +++ b/components/fatfs/CMakeLists.txt @@ -1,15 +1,12 @@ -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) - -register_component() +idf_component_register(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" + INCLUDE_DIRS src + REQUIRES wear_levelling sdmmc) diff --git a/components/fatfs/test/CMakeLists.txt b/components/fatfs/test/CMakeLists.txt index 5e0431c469..2796e95eb4 100644 --- a/components/fatfs/test/CMakeLists.txt +++ b/components/fatfs/test/CMakeLists.txt @@ -1,8 +1,4 @@ -set(COMPONENT_SRCDIRS ".") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -set(COMPONENT_REQUIRES unity test_utils vfs fatfs) - -set(COMPONENT_EMBED_TXTFILES fatfs.img) - -register_component() \ No newline at end of file +idf_component_register(SRC_DIRS "." + INCLUDE_DIRS "." + REQUIRES unity test_utils vfs fatfs + EMBED_TXTFILES fatfs.img) \ No newline at end of file diff --git a/components/freemodbus/CMakeLists.txt b/components/freemodbus/CMakeLists.txt index 4b57c16619..97112a53be 100644 --- a/components/freemodbus/CMakeLists.txt +++ b/components/freemodbus/CMakeLists.txt @@ -1,41 +1,44 @@ # The following five lines of boilerplate have to be in your project's # CMakeLists in this exact order for cmake to work correctly -set(COMPONENT_SRCS "common/esp_modbus_master.c" - "common/esp_modbus_slave.c" - "modbus/mb.c" - "modbus/mb_m.c" - "modbus/ascii/mbascii.c" - "modbus/rtu/mbrtu_m.c" - "modbus/rtu/mbrtu.c" - "modbus/rtu/mbcrc.c" - "modbus/tcp/mbtcp.c" - "port/port.c" - "port/portevent.c" - "port/portevent_m.c" - "port/portother.c" - "port/portother_m.c" - "port/portserial.c" - "port/portserial_m.c" - "port/porttimer.c" - "port/porttimer_m.c" - "modbus/functions/mbfunccoils.c" - "modbus/functions/mbfunccoils_m.c" - "modbus/functions/mbfuncdiag.c" - "modbus/functions/mbfuncdisc.c" - "modbus/functions/mbfuncdisc_m.c" - "modbus/functions/mbfuncholding.c" - "modbus/functions/mbfuncholding_m.c" - "modbus/functions/mbfuncinput.c" - "modbus/functions/mbfuncinput_m.c" - "modbus/functions/mbfuncother.c" - "modbus/functions/mbutils.c" - "serial_slave/modbus_controller/mbc_serial_slave.c" - "serial_master/modbus_controller/mbc_serial_master.c") -set(COMPONENT_ADD_INCLUDEDIRS common/include) -set(COMPONENT_PRIV_INCLUDEDIRS common port modbus modbus/ascii modbus/functions +set(srcs + "common/esp_modbus_master.c" + "common/esp_modbus_slave.c" + "modbus/mb.c" + "modbus/mb_m.c" + "modbus/ascii/mbascii.c" + "modbus/rtu/mbrtu_m.c" + "modbus/rtu/mbrtu.c" + "modbus/rtu/mbcrc.c" + "modbus/tcp/mbtcp.c" + "port/port.c" + "port/portevent.c" + "port/portevent_m.c" + "port/portother.c" + "port/portother_m.c" + "port/portserial.c" + "port/portserial_m.c" + "port/porttimer.c" + "port/porttimer_m.c" + "modbus/functions/mbfunccoils.c" + "modbus/functions/mbfunccoils_m.c" + "modbus/functions/mbfuncdiag.c" + "modbus/functions/mbfuncdisc.c" + "modbus/functions/mbfuncdisc_m.c" + "modbus/functions/mbfuncholding.c" + "modbus/functions/mbfuncholding_m.c" + "modbus/functions/mbfuncinput.c" + "modbus/functions/mbfuncinput_m.c" + "modbus/functions/mbfuncother.c" + "modbus/functions/mbutils.c" + "serial_slave/modbus_controller/mbc_serial_slave.c" + "serial_master/modbus_controller/mbc_serial_master.c") +set(include_dirs common/include) +set(priv_include_dirs common port modbus modbus/ascii modbus/functions modbus/rtu modbus/tcp modbus/include) -list(APPEND COMPONENT_PRIV_INCLUDEDIRS serial_slave/port serial_slave/modbus_controller +list(APPEND priv_include_dirs serial_slave/port serial_slave/modbus_controller serial_master/port serial_master/modbus_controller) -set(COMPONENT_REQUIRES "driver") -register_component() +idf_component_register(SRCS "${srcs}" + INCLUDE_DIRS "${include_dirs}" + PRIV_INCLUDE_DIRS "${priv_include_dirs}" + REQUIRES driver) diff --git a/components/freertos/CMakeLists.txt b/components/freertos/CMakeLists.txt index a7a83bbebc..ee6b560392 100644 --- a/components/freertos/CMakeLists.txt +++ b/components/freertos/CMakeLists.txt @@ -1,29 +1,29 @@ -set(COMPONENT_ADD_INCLUDEDIRS include) -set(COMPONENT_PRIV_INCLUDEDIRS include/freertos .) -set(COMPONENT_SRCS "croutine.c" - "event_groups.c" - "FreeRTOS-openocd.c" - "list.c" - "port.c" - "portasm.S" - "queue.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(srcs + "croutine.c" + "event_groups.c" + "FreeRTOS-openocd.c" + "list.c" + "port.c" + "portasm.S" + "queue.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") # app_trace is required by FreeRTOS headers only when CONFIG_SYSVIEW_ENABLE=y, # but requirements can't depend on config options, so always require it. -set(COMPONENT_REQUIRES app_trace) -set(COMPONENT_PRIV_REQUIRES esp_common soc) -set(COMPONENT_ADD_LDFRAGMENTS linker.lf) - -register_component() +idf_component_register(SRCS "${srcs}" + INCLUDE_DIRS include + PRIV_INCLUDE_DIRS include/freertos . + LDFRAGMENTS linker.lf + REQUIRES app_trace + PRIV_REQUIRES soc) target_link_libraries(${COMPONENT_LIB} INTERFACE "-Wl,--undefined=uxTopUsedPriority") diff --git a/components/freertos/test/CMakeLists.txt b/components/freertos/test/CMakeLists.txt index 66a8c82315..b531a14504 100644 --- a/components/freertos/test/CMakeLists.txt +++ b/components/freertos/test/CMakeLists.txt @@ -1,6 +1,3 @@ -set(COMPONENT_SRCDIRS ".") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -set(COMPONENT_REQUIRES unity test_utils) - -register_component() \ No newline at end of file +idf_component_register(SRC_DIRS "." + INCLUDE_DIRS "." + REQUIRES unity test_utils) \ No newline at end of file diff --git a/components/heap/CMakeLists.txt b/components/heap/CMakeLists.txt index 8ed72d2f2f..0bacaf74f9 100644 --- a/components/heap/CMakeLists.txt +++ b/components/heap/CMakeLists.txt @@ -1,23 +1,24 @@ -set(COMPONENT_SRCS "heap_caps.c" - "heap_caps_init.c" - "multi_heap.c") +set(srcs + "heap_caps.c" + "heap_caps_init.c" + "multi_heap.c") if(NOT CONFIG_HEAP_POISONING_DISABLED) - list(APPEND COMPONENT_SRCS "multi_heap_poisoning.c") + list(APPEND srcs "multi_heap_poisoning.c") endif() if(CONFIG_HEAP_TASK_TRACKING) - list(APPEND COMPONENT_SRCS "heap_task_info.c") + list(APPEND srcs "heap_task_info.c") endif() if(CONFIG_HEAP_TRACING_STANDALONE) - list(APPEND COMPONENT_SRCS "heap_trace_standalone.c") + list(APPEND srcs "heap_trace_standalone.c") endif() -set(COMPONENT_ADD_INCLUDEDIRS "include") -set(COMPONENT_ADD_LDFRAGMENTS linker.lf) -set(COMPONENT_PRIV_REQUIRES soc) -register_component() +idf_component_register(SRCS "${srcs}" + INCLUDE_DIRS include + LDFRAGMENTS linker.lf + PRIV_REQUIRES soc) if(CONFIG_HEAP_TRACING) set(WRAP_FUNCTIONS diff --git a/components/heap/test/CMakeLists.txt b/components/heap/test/CMakeLists.txt index aed6c9743e..b70637f263 100644 --- a/components/heap/test/CMakeLists.txt +++ b/components/heap/test/CMakeLists.txt @@ -1,6 +1,3 @@ -set(COMPONENT_SRCDIRS ".") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -set(COMPONENT_REQUIRES unity test_utils heap) - -register_component() \ No newline at end of file +idf_component_register(SRC_DIRS "." + INCLUDE_DIRS "." + REQUIRES unity test_utils heap) \ No newline at end of file diff --git a/components/idf_test/CMakeLists.txt b/components/idf_test/CMakeLists.txt index e307838a8b..eafb7ac220 100644 --- a/components/idf_test/CMakeLists.txt +++ b/components/idf_test/CMakeLists.txt @@ -1,2 +1 @@ -set(COMPONENT_ADD_INCLUDEDIRS "include") -register_component() +idf_component_register(INCLUDE_DIRS include) diff --git a/components/jsmn/CMakeLists.txt b/components/jsmn/CMakeLists.txt index 562a2cadcb..0c7a0ab99e 100644 --- a/components/jsmn/CMakeLists.txt +++ b/components/jsmn/CMakeLists.txt @@ -1,3 +1,2 @@ -set(COMPONENT_SRCS "src/jsmn.c") -set(COMPONENT_ADD_INCLUDEDIRS "include") -register_component() +idf_component_register(SRCS "src/jsmn.c" + INCLUDE_DIRS "include") diff --git a/components/json/CMakeLists.txt b/components/json/CMakeLists.txt index 4a85a0b3d1..1ecadb3858 100644 --- a/components/json/CMakeLists.txt +++ b/components/json/CMakeLists.txt @@ -1,5 +1,4 @@ -set(COMPONENT_SRCS "cJSON/cJSON.c" - "cJSON/cJSON_Utils.c" - "cJSON/test.c") -set(COMPONENT_ADD_INCLUDEDIRS cJSON) -register_component() +idf_component_register(SRCS "cJSON/cJSON.c" + "cJSON/cJSON_Utils.c" + "cJSON/test.c" + INCLUDE_DIRS cJSON) diff --git a/components/libsodium/CMakeLists.txt b/components/libsodium/CMakeLists.txt index caef522233..103e296612 100644 --- a/components/libsodium/CMakeLists.txt +++ b/components/libsodium/CMakeLists.txt @@ -1,133 +1,137 @@ set(SRC libsodium/src/libsodium) # Derived from libsodium/src/libsodium/Makefile.am # (ignoring the !MINIMAL set) -set(COMPONENT_SRCS "${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_box/crypto_box.c" - "${SRC}/crypto_box/crypto_box_easy.c" - "${SRC}/crypto_box/crypto_box_seal.c" - "${SRC}/crypto_box/curve25519xchacha20poly1305/box_curve25519xchacha20poly1305.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/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-compress-avx2.c" - "${SRC}/crypto_generichash/blake2b/ref/blake2b-compress-ref.c" - "${SRC}/crypto_generichash/blake2b/ref/blake2b-compress-sse41.c" - "${SRC}/crypto_generichash/blake2b/ref/blake2b-compress-ssse3.c" - "${SRC}/crypto_generichash/blake2b/ref/blake2b-ref.c" - "${SRC}/crypto_generichash/blake2b/ref/generichash_blake2b.c" - "${SRC}/crypto_hash/crypto_hash.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/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/donna/poly1305_donna.c" - "${SRC}/crypto_onetimeauth/poly1305/sse2/poly1305_sse2.c" - "${SRC}/crypto_pwhash/crypto_pwhash.c" - "${SRC}/crypto_pwhash/argon2/argon2-core.c" - "${SRC}/crypto_pwhash/argon2/argon2-encoding.c" - "${SRC}/crypto_pwhash/argon2/argon2-fill-block-ref.c" - "${SRC}/crypto_pwhash/argon2/argon2-fill-block-ssse3.c" - "${SRC}/crypto_pwhash/argon2/argon2.c" - "${SRC}/crypto_pwhash/argon2/blake2b-long.c" - "${SRC}/crypto_pwhash/argon2/pwhash_argon2i.c" - "${SRC}/crypto_pwhash/scryptsalsa208sha256/crypto_scrypt-common.c" - "${SRC}/crypto_pwhash/scryptsalsa208sha256/pbkdf2-sha256.c" - "${SRC}/crypto_pwhash/scryptsalsa208sha256/pwhash_scryptsalsa208sha256.c" - "${SRC}/crypto_pwhash/scryptsalsa208sha256/scrypt_platform.c" - "${SRC}/crypto_pwhash/scryptsalsa208sha256/nosse/pwhash_scryptsalsa208sha256_nosse.c" - "${SRC}/crypto_pwhash/scryptsalsa208sha256/sse/pwhash_scryptsalsa208sha256_sse.c" - "${SRC}/crypto_scalarmult/crypto_scalarmult.c" - "${SRC}/crypto_scalarmult/curve25519/scalarmult_curve25519.c" - "${SRC}/crypto_scalarmult/curve25519/donna_c64/curve25519_donna_c64.c" - "${SRC}/crypto_scalarmult/curve25519/ref10/x25519_ref10.c" - "${SRC}/crypto_scalarmult/curve25519/sandy2x/consts.S" - "${SRC}/crypto_scalarmult/curve25519/sandy2x/curve25519_sandy2x.c" - "${SRC}/crypto_scalarmult/curve25519/sandy2x/fe51_invert.c" - "${SRC}/crypto_scalarmult/curve25519/sandy2x/fe51_mul.S" - "${SRC}/crypto_scalarmult/curve25519/sandy2x/fe51_nsquare.S" - "${SRC}/crypto_scalarmult/curve25519/sandy2x/fe51_pack.S" - "${SRC}/crypto_scalarmult/curve25519/sandy2x/fe_frombytes_sandy2x.c" - "${SRC}/crypto_scalarmult/curve25519/sandy2x/ladder.S" - "${SRC}/crypto_scalarmult/curve25519/sandy2x/ladder_base.S" - "${SRC}/crypto_scalarmult/curve25519/sandy2x/sandy2x.S" - "${SRC}/crypto_secretbox/crypto_secretbox.c" - "${SRC}/crypto_secretbox/crypto_secretbox_easy.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_siphash24.c" - "${SRC}/crypto_shorthash/siphash24/shorthash_siphashx24.c" - "${SRC}/crypto_shorthash/siphash24/ref/shorthash_siphash24_ref.c" - "${SRC}/crypto_shorthash/siphash24/ref/shorthash_siphashx24_ref.c" - "${SRC}/crypto_sign/crypto_sign.c" - "${SRC}/crypto_sign/ed25519/sign_ed25519.c" - "${SRC}/crypto_sign/ed25519/ref10/keypair.c" - "${SRC}/crypto_sign/ed25519/ref10/obsolete.c" - "${SRC}/crypto_sign/ed25519/ref10/open.c" - "${SRC}/crypto_sign/ed25519/ref10/sign.c" - "${SRC}/crypto_stream/crypto_stream.c" - "${SRC}/crypto_stream/aes128ctr/stream_aes128ctr.c" - "${SRC}/crypto_stream/aes128ctr/nacl/afternm_aes128ctr.c" - "${SRC}/crypto_stream/aes128ctr/nacl/beforenm_aes128ctr.c" - "${SRC}/crypto_stream/aes128ctr/nacl/consts_aes128ctr.c" - "${SRC}/crypto_stream/aes128ctr/nacl/int128_aes128ctr.c" - "${SRC}/crypto_stream/aes128ctr/nacl/stream_aes128ctr_nacl.c" - "${SRC}/crypto_stream/aes128ctr/nacl/xor_afternm_aes128ctr.c" - "${SRC}/crypto_stream/chacha20/stream_chacha20.c" - "${SRC}/crypto_stream/chacha20/dolbeau/chacha20_dolbeau-avx2.c" - "${SRC}/crypto_stream/chacha20/dolbeau/chacha20_dolbeau-ssse3.c" - "${SRC}/crypto_stream/chacha20/ref/chacha20_ref.c" - "${SRC}/crypto_stream/salsa20/stream_salsa20.c" - "${SRC}/crypto_stream/salsa20/ref/salsa20_ref.c" - "${SRC}/crypto_stream/salsa20/xmm6/salsa20_xmm6-asm.S" - "${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/salsa2012/stream_salsa2012.c" - "${SRC}/crypto_stream/salsa2012/ref/stream_salsa2012_ref.c" - "${SRC}/crypto_stream/salsa208/stream_salsa208.c" - "${SRC}/crypto_stream/salsa208/ref/stream_salsa208_ref.c" - "${SRC}/crypto_stream/xchacha20/stream_xchacha20.c" - "${SRC}/crypto_stream/xsalsa20/stream_xsalsa20.c" - "${SRC}/crypto_verify/sodium/verify.c" - "${SRC}/randombytes/randombytes.c" - "${SRC}/randombytes/nativeclient/randombytes_nativeclient.c" - "${SRC}/randombytes/salsa20/randombytes_salsa20_random.c" - "${SRC}/randombytes/sysrandom/randombytes_sysrandom.c" - "${SRC}/sodium/core.c" - "${SRC}/sodium/runtime.c" - "${SRC}/sodium/utils.c" - "${SRC}/sodium/version.c" - "port/randombytes_esp32.c") +set(srcs + "${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_box/crypto_box.c" + "${SRC}/crypto_box/crypto_box_easy.c" + "${SRC}/crypto_box/crypto_box_seal.c" + "${SRC}/crypto_box/curve25519xchacha20poly1305/box_curve25519xchacha20poly1305.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/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-compress-avx2.c" + "${SRC}/crypto_generichash/blake2b/ref/blake2b-compress-ref.c" + "${SRC}/crypto_generichash/blake2b/ref/blake2b-compress-sse41.c" + "${SRC}/crypto_generichash/blake2b/ref/blake2b-compress-ssse3.c" + "${SRC}/crypto_generichash/blake2b/ref/blake2b-ref.c" + "${SRC}/crypto_generichash/blake2b/ref/generichash_blake2b.c" + "${SRC}/crypto_hash/crypto_hash.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/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/donna/poly1305_donna.c" + "${SRC}/crypto_onetimeauth/poly1305/sse2/poly1305_sse2.c" + "${SRC}/crypto_pwhash/crypto_pwhash.c" + "${SRC}/crypto_pwhash/argon2/argon2-core.c" + "${SRC}/crypto_pwhash/argon2/argon2-encoding.c" + "${SRC}/crypto_pwhash/argon2/argon2-fill-block-ref.c" + "${SRC}/crypto_pwhash/argon2/argon2-fill-block-ssse3.c" + "${SRC}/crypto_pwhash/argon2/argon2.c" + "${SRC}/crypto_pwhash/argon2/blake2b-long.c" + "${SRC}/crypto_pwhash/argon2/pwhash_argon2i.c" + "${SRC}/crypto_pwhash/scryptsalsa208sha256/crypto_scrypt-common.c" + "${SRC}/crypto_pwhash/scryptsalsa208sha256/pbkdf2-sha256.c" + "${SRC}/crypto_pwhash/scryptsalsa208sha256/pwhash_scryptsalsa208sha256.c" + "${SRC}/crypto_pwhash/scryptsalsa208sha256/scrypt_platform.c" + "${SRC}/crypto_pwhash/scryptsalsa208sha256/nosse/pwhash_scryptsalsa208sha256_nosse.c" + "${SRC}/crypto_pwhash/scryptsalsa208sha256/sse/pwhash_scryptsalsa208sha256_sse.c" + "${SRC}/crypto_scalarmult/crypto_scalarmult.c" + "${SRC}/crypto_scalarmult/curve25519/scalarmult_curve25519.c" + "${SRC}/crypto_scalarmult/curve25519/donna_c64/curve25519_donna_c64.c" + "${SRC}/crypto_scalarmult/curve25519/ref10/x25519_ref10.c" + "${SRC}/crypto_scalarmult/curve25519/sandy2x/consts.S" + "${SRC}/crypto_scalarmult/curve25519/sandy2x/curve25519_sandy2x.c" + "${SRC}/crypto_scalarmult/curve25519/sandy2x/fe51_invert.c" + "${SRC}/crypto_scalarmult/curve25519/sandy2x/fe51_mul.S" + "${SRC}/crypto_scalarmult/curve25519/sandy2x/fe51_nsquare.S" + "${SRC}/crypto_scalarmult/curve25519/sandy2x/fe51_pack.S" + "${SRC}/crypto_scalarmult/curve25519/sandy2x/fe_frombytes_sandy2x.c" + "${SRC}/crypto_scalarmult/curve25519/sandy2x/ladder.S" + "${SRC}/crypto_scalarmult/curve25519/sandy2x/ladder_base.S" + "${SRC}/crypto_scalarmult/curve25519/sandy2x/sandy2x.S" + "${SRC}/crypto_secretbox/crypto_secretbox.c" + "${SRC}/crypto_secretbox/crypto_secretbox_easy.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_siphash24.c" + "${SRC}/crypto_shorthash/siphash24/shorthash_siphashx24.c" + "${SRC}/crypto_shorthash/siphash24/ref/shorthash_siphash24_ref.c" + "${SRC}/crypto_shorthash/siphash24/ref/shorthash_siphashx24_ref.c" + "${SRC}/crypto_sign/crypto_sign.c" + "${SRC}/crypto_sign/ed25519/sign_ed25519.c" + "${SRC}/crypto_sign/ed25519/ref10/keypair.c" + "${SRC}/crypto_sign/ed25519/ref10/obsolete.c" + "${SRC}/crypto_sign/ed25519/ref10/open.c" + "${SRC}/crypto_sign/ed25519/ref10/sign.c" + "${SRC}/crypto_stream/crypto_stream.c" + "${SRC}/crypto_stream/aes128ctr/stream_aes128ctr.c" + "${SRC}/crypto_stream/aes128ctr/nacl/afternm_aes128ctr.c" + "${SRC}/crypto_stream/aes128ctr/nacl/beforenm_aes128ctr.c" + "${SRC}/crypto_stream/aes128ctr/nacl/consts_aes128ctr.c" + "${SRC}/crypto_stream/aes128ctr/nacl/int128_aes128ctr.c" + "${SRC}/crypto_stream/aes128ctr/nacl/stream_aes128ctr_nacl.c" + "${SRC}/crypto_stream/aes128ctr/nacl/xor_afternm_aes128ctr.c" + "${SRC}/crypto_stream/chacha20/stream_chacha20.c" + "${SRC}/crypto_stream/chacha20/dolbeau/chacha20_dolbeau-avx2.c" + "${SRC}/crypto_stream/chacha20/dolbeau/chacha20_dolbeau-ssse3.c" + "${SRC}/crypto_stream/chacha20/ref/chacha20_ref.c" + "${SRC}/crypto_stream/salsa20/stream_salsa20.c" + "${SRC}/crypto_stream/salsa20/ref/salsa20_ref.c" + "${SRC}/crypto_stream/salsa20/xmm6/salsa20_xmm6-asm.S" + "${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/salsa2012/stream_salsa2012.c" + "${SRC}/crypto_stream/salsa2012/ref/stream_salsa2012_ref.c" + "${SRC}/crypto_stream/salsa208/stream_salsa208.c" + "${SRC}/crypto_stream/salsa208/ref/stream_salsa208_ref.c" + "${SRC}/crypto_stream/xchacha20/stream_xchacha20.c" + "${SRC}/crypto_stream/xsalsa20/stream_xsalsa20.c" + "${SRC}/crypto_verify/sodium/verify.c" + "${SRC}/randombytes/randombytes.c" + "${SRC}/randombytes/nativeclient/randombytes_nativeclient.c" + "${SRC}/randombytes/salsa20/randombytes_salsa20_random.c" + "${SRC}/randombytes/sysrandom/randombytes_sysrandom.c" + "${SRC}/sodium/core.c" + "${SRC}/sodium/runtime.c" + "${SRC}/sodium/utils.c" + "${SRC}/sodium/version.c" + "port/randombytes_esp32.c") if(CONFIG_LIBSODIUM_USE_MBEDTLS_SHA) - list(APPEND COMPONENT_SRCS "port/crypto_hash_mbedtls/crypto_hash_sha256_mbedtls.c" - "port/crypto_hash_mbedtls/crypto_hash_sha512_mbedtls.c") + list(APPEND srcs + "port/crypto_hash_mbedtls/crypto_hash_sha256_mbedtls.c" + "port/crypto_hash_mbedtls/crypto_hash_sha512_mbedtls.c") else() - list(APPEND COMPONENT_SRCS "${SRC}/crypto_hash/sha256/cp/hash_sha256_cp.c" - "${SRC}/crypto_hash/sha512/cp/hash_sha512_cp.c") + list(APPEND srcs + "${SRC}/crypto_hash/sha256/cp/hash_sha256_cp.c" + "${SRC}/crypto_hash/sha512/cp/hash_sha512_cp.c") endif() -set(COMPONENT_ADD_INCLUDEDIRS ${SRC}/include port_include) -set(COMPONENT_PRIV_INCLUDEDIRS ${SRC}/include/sodium port_include/sodium port) - -set(COMPONENT_REQUIRES mbedtls) -register_component() +set(include_dirs ${SRC}/include port_include) +set(priv_include_dirs ${SRC}/include/sodium port_include/sodium port) +idf_component_register(SRCS "${srcs}" + INCLUDE_DIRS "${include_dirs}" + PRIV_INCLUDE_DIRS "${priv_include_dirs}" + REQUIRES mbedtls) target_compile_definitions(${COMPONENT_LIB} PRIVATE CONFIGURED diff --git a/components/libsodium/test/CMakeLists.txt b/components/libsodium/test/CMakeLists.txt index 76ac24d2fc..2e3a43bad6 100644 --- a/components/libsodium/test/CMakeLists.txt +++ b/components/libsodium/test/CMakeLists.txt @@ -2,11 +2,7 @@ if(TESTS_ALL EQUAL 1) message("not linking libsodium tests, use '-T libsodium' to test it") else() get_filename_component(LS_TESTDIR "${CMAKE_CURRENT_LIST_DIR}/../libsodium/test/default" ABSOLUTE) - - set(COMPONENT_ADD_INCLUDEDIRS "." "${LS_TESTDIR}/../quirks") - - set(COMPONENT_REQUIRES unity libsodium) - + set(TEST_CASES "chacha20;aead_chacha20poly1305;box;box2;ed25519_convert;sign;hash") foreach(test_case ${TEST_CASES}) @@ -14,9 +10,9 @@ else() list(APPEND TEST_CASES_FILES ${test_case_file}) endforeach() - set(COMPONENT_SRCS "${TEST_CASES_FILES};test_sodium.c") - - register_component() + idf_component_register(SRCS "${TEST_CASES_FILES}" "test_sodium.c" + INCLUDE_DIRS "." "${LS_TESTDIR}/../quirks" + REQUIRES unity libsodium) # The libsodium test suite is designed to be run each test case as an executable on a desktop computer and uses # filesytem to write & then compare contents of each file. diff --git a/components/log/CMakeLists.txt b/components/log/CMakeLists.txt index 505dc93186..4ca3c1a544 100644 --- a/components/log/CMakeLists.txt +++ b/components/log/CMakeLists.txt @@ -1,4 +1,3 @@ -set(COMPONENT_SRCS "log.c") -set(COMPONENT_ADD_INCLUDEDIRS "include") -set(COMPONENT_PRIV_REQUIRES soc) -register_component() +idf_component_register(SRCS "log.c" + INCLUDE_DIRS "include" + PRIV_REQUIRES soc) diff --git a/components/lwip/CMakeLists.txt b/components/lwip/CMakeLists.txt index 6a15d6f5c8..cb6a659530 100644 --- a/components/lwip/CMakeLists.txt +++ b/components/lwip/CMakeLists.txt @@ -1,4 +1,4 @@ -set(COMPONENT_ADD_INCLUDEDIRS +set(include_dirs include/apps include/apps/sntp lwip/src/include @@ -6,129 +6,130 @@ set(COMPONENT_ADD_INCLUDEDIRS port/esp32/include/arch ) -set(COMPONENT_SRCS "apps/dhcpserver/dhcpserver.c" - "apps/ping/esp_ping.c" - "apps/ping/ping.c" - "apps/sntp/sntp.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/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/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/netif/ethernet.c" - "lwip/src/netif/ethernetif.c" - "lwip/src/netif/lowpan6.c" - "lwip/src/netif/slipif.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" - "port/esp32/vfs_lwip.c" - "port/esp32/debug/lwip_debug.c" - "port/esp32/freertos/sys_arch.c" - "port/esp32/netif/dhcp_state.c" - "port/esp32/netif/ethernetif.c" - "port/esp32/netif/nettestif.c" - "port/esp32/netif/wlanif.c") +set(srcs + "apps/dhcpserver/dhcpserver.c" + "apps/ping/esp_ping.c" + "apps/ping/ping.c" + "apps/sntp/sntp.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/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/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/netif/ethernet.c" + "lwip/src/netif/ethernetif.c" + "lwip/src/netif/lowpan6.c" + "lwip/src/netif/slipif.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" + "port/esp32/vfs_lwip.c" + "port/esp32/debug/lwip_debug.c" + "port/esp32/freertos/sys_arch.c" + "port/esp32/netif/dhcp_state.c" + "port/esp32/netif/ethernetif.c" + "port/esp32/netif/nettestif.c" + "port/esp32/netif/wlanif.c") if(CONFIG_LWIP_PPP_SUPPORT) - 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/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/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") + list(APPEND 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/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/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") endif() -set(COMPONENT_REQUIRES vfs esp_wifi) -set(COMPONENT_PRIV_REQUIRES ethernet tcpip_adapter nvs_flash) - -set(COMPONENT_ADD_LDFRAGMENTS linker.lf) - -register_component() +idf_component_register(SRCS "${srcs}" + INCLUDE_DIRS "${include_dirs}" + LDFRAGMENTS linker.lf + REQUIRES vfs esp_wifi + PRIV_REQUIRES ethernet tcpip_adapter nvs_flash) # lots of LWIP source files evaluate macros that check address of stack variables target_compile_options(${COMPONENT_LIB} PRIVATE -Wno-address) diff --git a/components/mbedtls/CMakeLists.txt b/components/mbedtls/CMakeLists.txt index eaa420ef2e..91ef70234a 100644 --- a/components/mbedtls/CMakeLists.txt +++ b/components/mbedtls/CMakeLists.txt @@ -1,8 +1,6 @@ -set(COMPONENT_ADD_INCLUDEDIRS "port/include" "mbedtls/include") -set(COMPONENT_SRCS "mbedtls.c") -set(COMPONENT_REQUIRES lwip) - -register_component() +idf_component_register(SRCS "mbedtls.c" + INCLUDE_DIRS "port/include" "mbedtls/include" + REQUIRES lwip) # Only build mbedtls libraries set(ENABLE_TESTING CACHE BOOL OFF) diff --git a/components/mbedtls/test/CMakeLists.txt b/components/mbedtls/test/CMakeLists.txt index 5a8cfd8d33..8a083482a6 100644 --- a/components/mbedtls/test/CMakeLists.txt +++ b/components/mbedtls/test/CMakeLists.txt @@ -1,9 +1,6 @@ -set(COMPONENT_SRCDIRS ".") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -set(COMPONENT_REQUIRES unity test_utils mbedtls) - -register_component() +idf_component_register(SRC_DIRS "." + INCLUDE_DIRS "." + REQUIRES unity test_utils mbedtls) idf_component_get_property(mbedtls mbedtls COMPONENT_LIB) target_compile_definitions(${mbedtls} PUBLIC "-DMBEDTLS_DEPRECATED_WARNING") diff --git a/components/mdns/CMakeLists.txt b/components/mdns/CMakeLists.txt index 0933e30059..7b744dde56 100644 --- a/components/mdns/CMakeLists.txt +++ b/components/mdns/CMakeLists.txt @@ -1,9 +1,7 @@ -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) - -register_component() +idf_component_register(SRCS "mdns.c" + "mdns_console.c" + "mdns_networking.c" + INCLUDE_DIRS "include" + PRIV_INCLUDE_DIRS "private_include" + REQUIRES lwip mbedtls console tcpip_adapter) diff --git a/components/mdns/test/CMakeLists.txt b/components/mdns/test/CMakeLists.txt index 7e694470f6..516ee0097b 100644 --- a/components/mdns/test/CMakeLists.txt +++ b/components/mdns/test/CMakeLists.txt @@ -1,3 +1,2 @@ -set(COMPONENT_SRCDIRS ".") -set(COMPONENT_PRIV_REQUIRES unity test_utils mdns) -register_component() \ No newline at end of file +idf_component_register(SRC_DIRS "." + PRIV_REQUIRES unity test_utils mdns) \ No newline at end of file diff --git a/components/mqtt/CMakeLists.txt b/components/mqtt/CMakeLists.txt index 85f63cc9a8..1c30e3a913 100644 --- a/components/mqtt/CMakeLists.txt +++ b/components/mqtt/CMakeLists.txt @@ -1,10 +1,7 @@ -set(COMPONENT_ADD_INCLUDEDIRS esp-mqtt/include) -set(COMPONENT_PRIV_INCLUDEDIRS "esp-mqtt/lib/include") -set(COMPONENT_SRCS "esp-mqtt/mqtt_client.c" - "esp-mqtt/lib/mqtt_msg.c" - "esp-mqtt/lib/mqtt_outbox.c" - "esp-mqtt/lib/platform_esp32_idf.c") - -set(COMPONENT_REQUIRES lwip nghttp mbedtls tcp_transport) - -register_component() +idf_component_register(SRCS "esp-mqtt/mqtt_client.c" + "esp-mqtt/lib/mqtt_msg.c" + "esp-mqtt/lib/mqtt_outbox.c" + "esp-mqtt/lib/platform_esp32_idf.c" + INCLUDE_DIRS esp-mqtt/include + PRIV_INCLUDE_DIRS "esp-mqtt/lib/include" + REQUIRES lwip nghttp mbedtls tcp_transport) diff --git a/components/newlib/CMakeLists.txt b/components/newlib/CMakeLists.txt index 920842a73e..47b7c368b3 100644 --- a/components/newlib/CMakeLists.txt +++ b/components/newlib/CMakeLists.txt @@ -1,20 +1,21 @@ -set(COMPONENT_SRCS "heap.c" - "locks.c" - "poll.c" - "pthread.c" - "random.c" - "reent_init.c" - "select.c" - "syscall_table.c" - "syscalls.c" - "termios.c" - "time.c" - "utime.c") -set(COMPONENT_ADD_INCLUDEDIRS platform_include) +set(srcs + "heap.c" + "locks.c" + "poll.c" + "pthread.c" + "random.c" + "reent_init.c" + "select.c" + "syscall_table.c" + "syscalls.c" + "termios.c" + "time.c" + "utime.c") +set(include_dirs platform_include) if(GCC_NOT_5_2_0) if(CONFIG_SPIRAM_CACHE_WORKAROUND) - set(COMPONENT_ADD_LDFRAGMENTS esp32-spiram-rom-functions-c.lf) + set(ldfragments esp32-spiram-rom-functions-c.lf) endif() # Forces the linker to include locks, heap, and syscalls from this component, @@ -27,20 +28,21 @@ else() # Remove this section when GCC 5.2.0 is no longer supported # 'include' and 'lib' directories should also be removed. # An if statement about LIB_PATH below should also be removed. - list(APPEND COMPONENT_ADD_INCLUDEDIRS include) + list(APPEND include_dirs include) set(LIB_PATH ${CMAKE_CURRENT_SOURCE_DIR}/lib) if(CONFIG_SPIRAM_CACHE_WORKAROUND) - set(COMPONENT_ADD_LDFRAGMENTS esp32-spiram-rom-functions-psram-workaround.lf) + set(ldfragments esp32-spiram-rom-functions-psram-workaround.lf) endif() endif() -set(COMPONENT_REQUIRES vfs) # for sys/ioctl.h -set(COMPONENT_PRIV_REQUIRES soc) +list(APPEND ldfragments newlib.lf) -list(APPEND COMPONENT_ADD_LDFRAGMENTS newlib.lf) - -register_component() +idf_component_register(SRCS "${srcs}" + INCLUDE_DIRS "${include_dirs}" + REQUIRES vfs + PRIV_REQUIRES soc + LDFRAGMENTS "${ldfragments}") if(LIB_PATH) target_link_libraries(${COMPONENT_LIB} INTERFACE "-L ${LIB_PATH}") diff --git a/components/newlib/test/CMakeLists.txt b/components/newlib/test/CMakeLists.txt index 66a8c82315..b531a14504 100644 --- a/components/newlib/test/CMakeLists.txt +++ b/components/newlib/test/CMakeLists.txt @@ -1,6 +1,3 @@ -set(COMPONENT_SRCDIRS ".") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -set(COMPONENT_REQUIRES unity test_utils) - -register_component() \ No newline at end of file +idf_component_register(SRC_DIRS "." + INCLUDE_DIRS "." + REQUIRES unity test_utils) \ No newline at end of file diff --git a/components/nghttp/CMakeLists.txt b/components/nghttp/CMakeLists.txt index c1c4d80942..1c9ba17a23 100644 --- a/components/nghttp/CMakeLists.txt +++ b/components/nghttp/CMakeLists.txt @@ -1,28 +1,29 @@ -set(COMPONENT_ADD_INCLUDEDIRS port/include nghttp2/lib/includes) -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") +set(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() +idf_component_register(SRCS "${srcs}" + INCLUDE_DIRS port/include nghttp2/lib/includes) target_compile_definitions(${COMPONENT_LIB} PUBLIC "-DHAVE_CONFIG_H") diff --git a/components/nvs_flash/CMakeLists.txt b/components/nvs_flash/CMakeLists.txt index 2c815b31ca..1d7e5862dd 100644 --- a/components/nvs_flash/CMakeLists.txt +++ b/components/nvs_flash/CMakeLists.txt @@ -1,13 +1,10 @@ -set(COMPONENT_SRCS "src/nvs_api.cpp" - "src/nvs_encr.cpp" - "src/nvs_item_hash_list.cpp" - "src/nvs_ops.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 mbedtls) - -register_component() +idf_component_register(SRCS "src/nvs_api.cpp" + "src/nvs_encr.cpp" + "src/nvs_item_hash_list.cpp" + "src/nvs_ops.cpp" + "src/nvs_page.cpp" + "src/nvs_pagemanager.cpp" + "src/nvs_storage.cpp" + "src/nvs_types.cpp" + REQUIRES spi_flash mbedtls + INCLUDE_DIRS include) diff --git a/components/nvs_flash/test/CMakeLists.txt b/components/nvs_flash/test/CMakeLists.txt index f473de05af..ede2a57bae 100644 --- a/components/nvs_flash/test/CMakeLists.txt +++ b/components/nvs_flash/test/CMakeLists.txt @@ -1,6 +1,3 @@ -set(COMPONENT_SRCDIRS ".") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -set(COMPONENT_REQUIRES unity test_utils nvs_flash bootloader_support) - -register_component() +idf_component_register(SRCS "." + INCLUDE_DIRS "." + REQUIRES unity test_utils nvs_flash bootloader_support) \ No newline at end of file diff --git a/components/openssl/CMakeLists.txt b/components/openssl/CMakeLists.txt index 3a96598f01..bba4006f1a 100644 --- a/components/openssl/CMakeLists.txt +++ b/components/openssl/CMakeLists.txt @@ -1,14 +1,11 @@ -set(COMPONENT_ADD_INCLUDEDIRS include) -set(COMPONENT_PRIV_INCLUDEDIRS include/internal include/platform include/openssl) -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) - -register_component() +idf_component_register(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" + REQUIRES mbedtls + INCLUDE_DIRS include + PRIV_INCLUDE_DIRS include/internal include/platform include/openssl) diff --git a/components/partition_table/CMakeLists.txt b/components/partition_table/CMakeLists.txt index d94e3e162f..4fe76cc93e 100644 --- a/components/partition_table/CMakeLists.txt +++ b/components/partition_table/CMakeLists.txt @@ -1,4 +1,4 @@ -register_config_only_component() +idf_component_register() if(BOOTLOADER_BUILD) return() diff --git a/components/partition_table/test/CMakeLists.txt b/components/partition_table/test/CMakeLists.txt index 66a8c82315..b531a14504 100644 --- a/components/partition_table/test/CMakeLists.txt +++ b/components/partition_table/test/CMakeLists.txt @@ -1,6 +1,3 @@ -set(COMPONENT_SRCDIRS ".") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -set(COMPONENT_REQUIRES unity test_utils) - -register_component() \ No newline at end of file +idf_component_register(SRC_DIRS "." + INCLUDE_DIRS "." + REQUIRES unity test_utils) \ No newline at end of file diff --git a/components/protobuf-c/CMakeLists.txt b/components/protobuf-c/CMakeLists.txt index 1c9a3ffc3f..1801093194 100644 --- a/components/protobuf-c/CMakeLists.txt +++ b/components/protobuf-c/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_ADD_INCLUDEDIRS protobuf-c) -set(COMPONENT_SRCS "protobuf-c/protobuf-c/protobuf-c.c") - -register_component() +idf_component_register(SRCS "protobuf-c/protobuf-c/protobuf-c.c" + INCLUDE_DIRS protobuf-c) diff --git a/components/protocomm/CMakeLists.txt b/components/protocomm/CMakeLists.txt index 9f9343815f..334e279145 100644 --- a/components/protocomm/CMakeLists.txt +++ b/components/protocomm/CMakeLists.txt @@ -1,25 +1,27 @@ -set(COMPONENT_ADD_INCLUDEDIRS include/common - include/security - include/transports) -set(COMPONENT_PRIV_INCLUDEDIRS proto-c src/common src/simple_ble) -set(COMPONENT_SRCS "src/common/protocomm.c" - "src/security/security0.c" - "src/security/security1.c" - "proto-c/constants.pb-c.c" - "proto-c/sec0.pb-c.c" - "proto-c/sec1.pb-c.c" - "proto-c/session.pb-c.c" - "src/transports/protocomm_console.c" - "src/transports/protocomm_httpd.c") - -set(COMPONENT_PRIV_REQUIRES protobuf-c mbedtls console esp_http_server bt) +set(include_dirs include/common + include/security + include/transports) +set(priv_include_dirs proto-c src/common src/simple_ble) +set(srcs + "src/common/protocomm.c" + "src/security/security0.c" + "src/security/security1.c" + "proto-c/constants.pb-c.c" + "proto-c/sec0.pb-c.c" + "proto-c/sec1.pb-c.c" + "proto-c/session.pb-c.c" + "src/transports/protocomm_console.c" + "src/transports/protocomm_httpd.c") if(CONFIG_BT_ENABLED) if(CONFIG_BT_BLUEDROID_ENABLED) - list(APPEND COMPONENT_SRCS + list(APPEND srcs "src/simple_ble/simple_ble.c" "src/transports/protocomm_ble.c") endif() endif() -register_component() +idf_component_register(SRCS "${srcs}" + INCLUDE_DIRS "${include_dirs}" + PRIV_INCLUDE_DIRS "${priv_include_dirs}" + PRIV_REQUIRES protobuf-c mbedtls console esp_http_server bt) diff --git a/components/protocomm/test/CMakeLists.txt b/components/protocomm/test/CMakeLists.txt index f25cb01a18..6e04b5332e 100644 --- a/components/protocomm/test/CMakeLists.txt +++ b/components/protocomm/test/CMakeLists.txt @@ -1,7 +1,4 @@ -set(COMPONENT_SRCDIRS ".") -set(COMPONENT_ADD_INCLUDEDIRS ".") -set(COMPONENT_PRIV_INCLUDEDIRS "../proto-c/") - -set(COMPONENT_REQUIRES unity mbedtls protocomm protobuf-c) - -register_component() +idf_component_register(SRC_DIRS "." + INCLUDE_DIRS "." + PRIV_INCLUDE_DIRS "../proto-c/" + REQUIRES unity mbedtls protocomm protobuf-c) \ No newline at end of file diff --git a/components/pthread/CMakeLists.txt b/components/pthread/CMakeLists.txt index 5c8bc04a04..d488c92a9d 100644 --- a/components/pthread/CMakeLists.txt +++ b/components/pthread/CMakeLists.txt @@ -1,8 +1,7 @@ -set(COMPONENT_SRCS "pthread.c" - "pthread_cond_var.c" - "pthread_local_storage.c") -set(COMPONENT_ADD_INCLUDEDIRS "include") -register_component() +idf_component_register(SRCS "pthread.c" + "pthread_cond_var.c" + "pthread_local_storage.c" + INCLUDE_DIRS include) if(CONFIG_FREERTOS_ENABLE_STATIC_TASK_CLEAN_UP) target_link_libraries(${COMPONENT_LIB} "-Wl,--wrap=vPortCleanUpTCB") diff --git a/components/pthread/test/CMakeLists.txt b/components/pthread/test/CMakeLists.txt index f57f843b1b..bb02dc7d41 100644 --- a/components/pthread/test/CMakeLists.txt +++ b/components/pthread/test/CMakeLists.txt @@ -1,6 +1,3 @@ -set(COMPONENT_SRCDIRS ".") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -set(COMPONENT_REQUIRES unity test_utils pthread) - -register_component() \ No newline at end of file +idf_component_register(SRC_DIRS "." + INCLUDE_DIRS "." + REQUIRES unity test_utils pthread) \ No newline at end of file diff --git a/components/sdmmc/CMakeLists.txt b/components/sdmmc/CMakeLists.txt index fdba0cf790..cb7de0e805 100644 --- a/components/sdmmc/CMakeLists.txt +++ b/components/sdmmc/CMakeLists.txt @@ -1,10 +1,9 @@ -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) -set(COMPONENT_PRIV_REQUIRES soc) -register_component() +idf_component_register(SRCS "sdmmc_cmd.c" + "sdmmc_common.c" + "sdmmc_init.c" + "sdmmc_io.c" + "sdmmc_mmc.c" + "sdmmc_sd.c" + INCLUDE_DIRS include + REQUIRES driver + PRIV_REQUIRES soc) \ No newline at end of file diff --git a/components/sdmmc/test/CMakeLists.txt b/components/sdmmc/test/CMakeLists.txt index 885cda77a6..c7c2d52a9b 100644 --- a/components/sdmmc/test/CMakeLists.txt +++ b/components/sdmmc/test/CMakeLists.txt @@ -1,6 +1,3 @@ -set(COMPONENT_SRCDIRS ".") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -set(COMPONENT_REQUIRES unity sdmmc) - -register_component() \ No newline at end of file +idf_component_register(SRC_DIRS "." + INCLUDE_DIRS "." + REQUIRES unity sdmmc) \ No newline at end of file diff --git a/components/smartconfig_ack/CMakeLists.txt b/components/smartconfig_ack/CMakeLists.txt index 1518776ce9..eb34b0713c 100644 --- a/components/smartconfig_ack/CMakeLists.txt +++ b/components/smartconfig_ack/CMakeLists.txt @@ -1,6 +1,3 @@ -set(COMPONENT_SRCS "smartconfig_ack.c") -set(COMPONENT_ADD_INCLUDEDIRS "include") - -set(COMPONENT_PRIV_REQUIRES lwip tcpip_adapter) - -register_component() +idf_component_register(SRCS "smartconfig_ack.c" + INCLUDE_DIRS include + PRIV_REQUIRES lwip tcpip_adapter) \ No newline at end of file diff --git a/components/soc/CMakeLists.txt b/components/soc/CMakeLists.txt index 572fb38f68..11bbbd0d4c 100644 --- a/components/soc/CMakeLists.txt +++ b/components/soc/CMakeLists.txt @@ -4,24 +4,23 @@ if(EXISTS "${COMPONENT_DIR}/${soc_name}") include(${COMPONENT_DIR}/${soc_name}/sources.cmake) spaces2list(SOC_SRCS) - add_prefix(COMPONENT_SRCS "${soc_name}/" ${SOC_SRCS}) - set(COMPONENT_ADD_INCLUDEDIRS ${soc_name}/include) + add_prefix(srcs "${soc_name}/" ${SOC_SRCS}) + set(include_dirs ${soc_name}/include) endif() -list(APPEND COMPONENT_ADD_INCLUDEDIRS include) -list(APPEND COMPONENT_SRCS "src/memory_layout_utils.c" - "src/lldesc.c" - "src/hal/spi_hal.c" - "src/hal/spi_hal_iram.c" - "src/hal/spi_slave_hal.c" - "src/hal/spi_slave_hal_iram.c" - "src/soc_include_legacy_warn.c" - "src/hal/spi_flash_hal.c" - "src/hal/spi_flash_hal_iram.c" +list(APPEND include_dirs include) +list(APPEND srcs + "src/memory_layout_utils.c" + "src/lldesc.c" + "src/hal/spi_hal.c" + "src/hal/spi_hal_iram.c" + "src/hal/spi_slave_hal.c" + "src/hal/spi_slave_hal_iram.c" + "src/soc_include_legacy_warn.c" + "src/hal/spi_flash_hal.c" + "src/hal/spi_flash_hal_iram.c" ) -set(COMPONENT_ADD_LDFRAGMENTS linker.lf) - -set(COMPONENT_REQUIRES) - -register_component() +idf_component_register(SRCS "${srcs}" + INCLUDE_DIRS "${include_dirs}" + LDFRAGMENTS linker.lf) diff --git a/components/soc/test/CMakeLists.txt b/components/soc/test/CMakeLists.txt index 276f56651a..619190b156 100644 --- a/components/soc/test/CMakeLists.txt +++ b/components/soc/test/CMakeLists.txt @@ -1,10 +1,11 @@ idf_build_get_property(soc_name IDF_TARGET) + get_filename_component(soc_test "${CMAKE_CURRENT_SOURCE_DIR}/../${soc_name}/test" ABSOLUTE) if(EXISTS "${soc_test}") - set(COMPONENT_SRCS "${soc_test}") - set(COMPONENT_ADD_INCLUDEDIRS "${soc_test}") + set(srcs "${soc_test}") + set(include_dirs "${soc_test}") endif() -set(COMPONENT_REQUIRES unity test_utils) - -register_component() +idf_component_register(SRC_DIRS "${src_dirs}" + INCLUDE_DIRS "${include_dirs}" + REQUIRES unity test_utils) diff --git a/components/spi_flash/CMakeLists.txt b/components/spi_flash/CMakeLists.txt index eb17b31eef..51bec183a7 100644 --- a/components/spi_flash/CMakeLists.txt +++ b/components/spi_flash/CMakeLists.txt @@ -1,29 +1,29 @@ +set(priv_requires bootloader_support soc) 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_PRIV_REQUIRES bootloader_support soc) + set(srcs "spi_flash_rom_patch.c") else() - set(COMPONENT_SRCS "cache_utils.c" - "flash_mmap.c" - "flash_ops.c" - "partition.c" - "spi_flash_rom_patch.c" - "spi_flash_chip_drivers.c" - "spi_flash_chip_generic.c" - "spi_flash_chip_issi.c" - "spi_flash_os_func_app.c" - "spi_flash_os_func_noos.c" - "memspi_host_driver.c" - ) + set(srcs + "cache_utils.c" + "flash_mmap.c" + "flash_ops.c" + "partition.c" + "spi_flash_rom_patch.c" + "spi_flash_chip_drivers.c" + "spi_flash_chip_generic.c" + "spi_flash_chip_issi.c" + "spi_flash_os_func_app.c" + "spi_flash_os_func_noos.c" + "memspi_host_driver.c") if(NOT CONFIG_SPI_FLASH_USE_LEGACY_IMPL) - list(APPEND COMPONENT_SRCS "esp_flash_api.c") + list(APPEND srcs "esp_flash_api.c") endif() - set(COMPONENT_PRIV_REQUIRES bootloader_support app_update soc) + set(priv_requires bootloader_support app_update soc) endif() -set(COMPONENT_ADD_INCLUDEDIRS include) -set(COMPONENT_PRIV_INCLUDEDIRS private_include) -set(COMPONENT_ADD_LDFRAGMENTS linker.lf) - -register_component() +idf_component_register(SRCS "${srcs}" + PRIV_REQUIRES "${priv_requires}" + INCLUDE_DIRS include + PRIV_INCLUDE_DIRS private_include + LDFRAGMENTS linker.lf) diff --git a/components/spi_flash/test/CMakeLists.txt b/components/spi_flash/test/CMakeLists.txt index 559473b821..ae23154f2f 100644 --- a/components/spi_flash/test/CMakeLists.txt +++ b/components/spi_flash/test/CMakeLists.txt @@ -1,6 +1,3 @@ -set(COMPONENT_SRCDIRS ".") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -set(COMPONENT_REQUIRES unity test_utils spi_flash bootloader_support app_update) - -register_component() \ No newline at end of file +idf_component_register(SRC_DIRS "." + INCLUDE_DIRS "." + REQUIRES unity test_utils spi_flash bootloader_support app_update) \ No newline at end of file diff --git a/components/spiffs/CMakeLists.txt b/components/spiffs/CMakeLists.txt index 17e5a5587b..dfe4643c0f 100644 --- a/components/spiffs/CMakeLists.txt +++ b/components/spiffs/CMakeLists.txt @@ -1,15 +1,12 @@ -set(COMPONENT_ADD_INCLUDEDIRS "include") -set(COMPONENT_PRIV_INCLUDEDIRS "." "spiffs/src") -set(COMPONENT_SRCS "esp_spiffs.c" - "spiffs_api.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") - -set(COMPONENT_REQUIRES spi_flash) -set(COMPONENT_PRIV_REQUIRES bootloader_support) - -register_component() +idf_component_register(SRCS "esp_spiffs.c" + "spiffs_api.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" + INCLUDE_DIRS "include" + PRIV_INCLUDE_DIRS "." "spiffs/src" + REQUIRES spi_flash + PRIV_REQUIRES bootloader_support) diff --git a/components/spiffs/test/CMakeLists.txt b/components/spiffs/test/CMakeLists.txt index dc004f479b..20bfd7a7d4 100644 --- a/components/spiffs/test/CMakeLists.txt +++ b/components/spiffs/test/CMakeLists.txt @@ -1,6 +1,3 @@ -set(COMPONENT_SRCDIRS ".") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -set(COMPONENT_REQUIRES unity test_utils spiffs) - -register_component() \ No newline at end of file +idf_component_register(SRC_DIRS "." + INCLUDE_DIRS "." + REQUIRES unity test_utils spiffs) \ No newline at end of file diff --git a/components/tcp_transport/CMakeLists.txt b/components/tcp_transport/CMakeLists.txt index 9c2ef846b8..f1821db60f 100644 --- a/components/tcp_transport/CMakeLists.txt +++ b/components/tcp_transport/CMakeLists.txt @@ -1,12 +1,8 @@ -set(COMPONENT_SRCS "transport.c" - "transport_ssl.c" - "transport_tcp.c" - "transport_ws.c" - "transport_utils.c" - "transport_strcasestr.c") - -set(COMPONENT_ADD_INCLUDEDIRS "include") - -set(COMPONENT_REQUIRES lwip esp-tls) - -register_component() +idf_component_register(SRCS "transport.c" + "transport_ssl.c" + "transport_tcp.c" + "transport_ws.c" + "transport_utils.c" + "transport_strcasestr.c" + INCLUDE_DIRS include + REQUIRES lwip esp-tls) \ No newline at end of file diff --git a/components/tcpip_adapter/CMakeLists.txt b/components/tcpip_adapter/CMakeLists.txt index b728811ef2..8d35ca61df 100644 --- a/components/tcpip_adapter/CMakeLists.txt +++ b/components/tcpip_adapter/CMakeLists.txt @@ -1,7 +1,3 @@ -set(COMPONENT_SRCS "event_handlers.c" - "tcpip_adapter_lwip.c") -set(COMPONENT_ADD_INCLUDEDIRS "include") - -set(COMPONENT_REQUIRES lwip) - -register_component() +idf_component_register(SRCS "event_handlers.c" "tcpip_adapter_lwip.c" + INCLUDE_DIRS include + REQUIRES lwip ethernet) diff --git a/components/ulp/CMakeLists.txt b/components/ulp/CMakeLists.txt index ca8d115c39..6d47331208 100644 --- a/components/ulp/CMakeLists.txt +++ b/components/ulp/CMakeLists.txt @@ -1,4 +1,3 @@ -set(COMPONENT_SRCS "ulp.c" - "ulp_macro.c") -set(COMPONENT_ADD_INCLUDEDIRS "include") -register_component() +idf_component_register(SRCS "ulp.c" + "ulp_macro.c" + INCLUDE_DIRS include) \ No newline at end of file diff --git a/components/ulp/test/CMakeLists.txt b/components/ulp/test/CMakeLists.txt index 296fda0148..27311f9530 100644 --- a/components/ulp/test/CMakeLists.txt +++ b/components/ulp/test/CMakeLists.txt @@ -1,9 +1,6 @@ -set(COMPONENT_SRCDIRS ".") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -set(COMPONENT_REQUIRES unity ulp soc esp_common) - -register_component() +idf_component_register(SRC_DIRS "." + INCLUDE_DIRS "." + REQUIRES unity ulp soc esp_common) set(ulp_app_name ulp_test_app) set(ulp_s_sources "ulp/test_jumps.S") diff --git a/components/unity/CMakeLists.txt b/components/unity/CMakeLists.txt index 53494ae0f0..d98b05d8df 100644 --- a/components/unity/CMakeLists.txt +++ b/components/unity/CMakeLists.txt @@ -1,22 +1,21 @@ -set(COMPONENT_SRCS "unity/src/unity.c" - "unity_port_esp32.c") - -set(COMPONENT_ADD_INCLUDEDIRS "include" - "unity/src") +set(srcs + "unity/src/unity.c" + "unity_port_esp32.c") if(CONFIG_UNITY_ENABLE_BACKTRACE_ON_FAIL) list(APPEND COMPONENT_PRIV_INCLUDEDIRS "include/priv") endif() if(CONFIG_UNITY_ENABLE_IDF_TEST_RUNNER) - list(APPEND COMPONENT_SRCS "unity_runner.c") + list(APPEND srcs "unity_runner.c") endif() if(CONFIG_UNITY_ENABLE_FIXTURE) - list(APPEND COMPONENT_SRCS "unity/extras/fixture/src/unity_fixture.c") + list(APPEND srcs "unity/extras/fixture/src/unity_fixture.c") endif() -register_component() +idf_component_register(SRCS "${srcs}" + INCLUDE_DIRS "include" "unity/src") target_compile_definitions(${COMPONENT_LIB} PUBLIC -DUNITY_INCLUDE_CONFIG_H diff --git a/components/vfs/CMakeLists.txt b/components/vfs/CMakeLists.txt index 0b2f640ca6..d62c9e0393 100644 --- a/components/vfs/CMakeLists.txt +++ b/components/vfs/CMakeLists.txt @@ -1,8 +1,7 @@ -set(COMPONENT_SRCS "vfs.c" - "vfs_uart.c" - "vfs_semihost.c") -set(COMPONENT_ADD_INCLUDEDIRS "include") -register_component() +idf_component_register(SRCS "vfs.c" + "vfs_uart.c" + "vfs_semihost.c" + INCLUDE_DIRS include) # Some newlib syscalls are implemented in vfs.c, make sure these are always # seen by the linker diff --git a/components/vfs/test/CMakeLists.txt b/components/vfs/test/CMakeLists.txt index e67c253d0f..f0a24edd9f 100644 --- a/components/vfs/test/CMakeLists.txt +++ b/components/vfs/test/CMakeLists.txt @@ -1,8 +1,4 @@ -set(COMPONENT_SRCDIRS ".") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -set(COMPONENT_REQUIRES unity test_utils vfs fatfs spiffs) - -set(COMPONENT_ADD_LDFRAGMENTS linker.lf) - -register_component() +idf_component_register(SRC_DIRS "." + INCLUDE_DIRS "." + REQUIRES unity test_utils vfs fatfs spiffs + LDFRAGMENTS linker.lf) \ No newline at end of file diff --git a/components/wear_levelling/CMakeLists.txt b/components/wear_levelling/CMakeLists.txt index 59b81ccfaa..1a0d775975 100644 --- a/components/wear_levelling/CMakeLists.txt +++ b/components/wear_levelling/CMakeLists.txt @@ -1,11 +1,10 @@ -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) -register_component() +idf_component_register(SRCS "Partition.cpp" + "SPI_Flash.cpp" + "WL_Ext_Perf.cpp" + "WL_Ext_Safe.cpp" + "WL_Flash.cpp" + "crc32.cpp" + "wear_levelling.cpp" + INCLUDE_DIRS include + PRIV_INCLUDE_DIRS private_include + REQUIRES spi_flash) \ No newline at end of file diff --git a/components/wear_levelling/test/CMakeLists.txt b/components/wear_levelling/test/CMakeLists.txt index 133be91080..a81bf5a8e5 100644 --- a/components/wear_levelling/test/CMakeLists.txt +++ b/components/wear_levelling/test/CMakeLists.txt @@ -1,8 +1,4 @@ -set(COMPONENT_SRCDIRS ".") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -set(COMPONENT_REQUIRES unity test_utils wear_levelling) - -set(COMPONENT_EMBED_FILES test_partition_v1.bin) - -register_component() \ No newline at end of file +idf_component_register(SRC_DIRS "." + INCLUDE_DIRS "." + REQUIRES unity test_utils wear_levelling + EMBED_FILES test_partition_v1.bin) \ No newline at end of file diff --git a/components/wifi_provisioning/CMakeLists.txt b/components/wifi_provisioning/CMakeLists.txt index ec129bce3b..58ddab84f6 100644 --- a/components/wifi_provisioning/CMakeLists.txt +++ b/components/wifi_provisioning/CMakeLists.txt @@ -1,21 +1,20 @@ -set(COMPONENT_ADD_INCLUDEDIRS include) -set(COMPONENT_PRIV_INCLUDEDIRS src proto-c ../protocomm/proto-c) -set(COMPONENT_SRCS "src/wifi_config.c" - "src/manager.c" - "src/handlers.c" - "src/scheme_softap.c" - "src/scheme_console.c" - "proto-c/wifi_config.pb-c.c" - "proto-c/wifi_constants.pb-c.c") - -set(COMPONENT_REQUIRES lwip protocomm) -set(COMPONENT_PRIV_REQUIRES protobuf-c bt mdns json) +set(srcs "src/wifi_config.c" + "src/manager.c" + "src/handlers.c" + "src/scheme_softap.c" + "src/scheme_console.c" + "proto-c/wifi_config.pb-c.c" + "proto-c/wifi_constants.pb-c.c") if(CONFIG_BT_ENABLED) if(CONFIG_BT_BLUEDROID_ENABLED) - list(APPEND COMPONENT_SRCS + list(APPEND srcs "src/scheme_ble.c") endif() endif() -register_component() +idf_component_register(SRCS "${srcs}" + INCLUDE_DIRS include + PRIV_INCLUDE_DIRS src proto-c ../protocomm/proto-c + REQUIRES lwip protocomm + PRIV_REQUIRES protobuf-c bt mdns json) diff --git a/components/wpa_supplicant/CMakeLists.txt b/components/wpa_supplicant/CMakeLists.txt index 35bf0bbdb3..7389e1da6c 100644 --- a/components/wpa_supplicant/CMakeLists.txt +++ b/components/wpa_supplicant/CMakeLists.txt @@ -1,83 +1,82 @@ -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_mbedtls.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(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_mbedtls.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_REQUIRES "") -set(COMPONENT_PRIV_REQUIRES mbedtls) - -register_component() +idf_component_register(SRCS "${srcs}" + INCLUDE_DIRS include port/include + PRIV_REQUIRES mbedtls) target_compile_options(${COMPONENT_LIB} PRIVATE -Wno-strict-aliasing) target_compile_definitions(${COMPONENT_LIB} PRIVATE diff --git a/components/wpa_supplicant/test/CMakeLists.txt b/components/wpa_supplicant/test/CMakeLists.txt index 28ca784c09..1be503f44f 100644 --- a/components/wpa_supplicant/test/CMakeLists.txt +++ b/components/wpa_supplicant/test/CMakeLists.txt @@ -1,6 +1,3 @@ -set(COMPONENT_SRCDIRS ".") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -set(COMPONENT_REQUIRES unity wpa_supplicant mbedtls) - -register_component() +idf_component_register(SRC_DIRS "." + INCLUDE_DIRS "." + REQUIRES unity wpa_supplicant mbedtls) \ No newline at end of file diff --git a/components/xtensa/CMakeLists.txt b/components/xtensa/CMakeLists.txt index 1bb997d673..0ab1dd018d 100644 --- a/components/xtensa/CMakeLists.txt +++ b/components/xtensa/CMakeLists.txt @@ -1,10 +1,10 @@ -set(COMPONENT_SRCS "eri.c" "trax.c" "debug_helpers.c" "debug_helpers_asm.S") +idf_build_get_property(target IDF_TARGET) +idf_component_register(SRCS "debug_helpers.c" + "debug_helpers_asm.S" + "eri.c" + "trax.c" + INCLUDE_DIRS include ${target}/include + LDFRAGMENTS linker.lf + PRIV_REQUIRES soc) -set(COMPONENT_ADD_INCLUDEDIRS "include" "${IDF_TARGET}/include") - -set(COMPONENT_ADD_LDFRAGMENTS linker.lf) -set(COMPONENT_PRIV_REQUIRES soc) - -register_component() - -target_link_libraries(${COMPONENT_LIB} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/${IDF_TARGET}/libhal.a") +target_link_libraries(${COMPONENT_LIB} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/${target}/libhal.a") diff --git a/examples/bluetooth/a2dp_gatts_coex/main/CMakeLists.txt b/examples/bluetooth/a2dp_gatts_coex/main/CMakeLists.txt index a55538b5fb..55f2d445aa 100644 --- a/examples/bluetooth/a2dp_gatts_coex/main/CMakeLists.txt +++ b/examples/bluetooth/a2dp_gatts_coex/main/CMakeLists.txt @@ -1,6 +1,4 @@ -set(COMPONENT_SRCS "bt_app_av.c" - "bt_app_core.c" - "main.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "bt_app_av.c" + "bt_app_core.c" + "main.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/bluetooth/a2dp_sink/main/CMakeLists.txt b/examples/bluetooth/a2dp_sink/main/CMakeLists.txt index a55538b5fb..d1d916efbd 100644 --- a/examples/bluetooth/a2dp_sink/main/CMakeLists.txt +++ b/examples/bluetooth/a2dp_sink/main/CMakeLists.txt @@ -1,6 +1,5 @@ -set(COMPONENT_SRCS "bt_app_av.c" - "bt_app_core.c" - "main.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") +idf_component_register(SRCS "bt_app_av.c" + "bt_app_core.c" + "main.c" + INCLUDE_DIRS ".") -register_component() diff --git a/examples/bluetooth/a2dp_source/main/CMakeLists.txt b/examples/bluetooth/a2dp_source/main/CMakeLists.txt index 98b05a101b..d0a3885ddb 100644 --- a/examples/bluetooth/a2dp_source/main/CMakeLists.txt +++ b/examples/bluetooth/a2dp_source/main/CMakeLists.txt @@ -1,5 +1,3 @@ -set(COMPONENT_SRCS "bt_app_core.c" - "main.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "bt_app_core.c" + "main.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/bluetooth/ble_adv/main/CMakeLists.txt b/examples/bluetooth/ble_adv/main/CMakeLists.txt index d005e60123..494d32308b 100644 --- a/examples/bluetooth/ble_adv/main/CMakeLists.txt +++ b/examples/bluetooth/ble_adv/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "app_bt.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "app_bt.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/bluetooth/ble_compatibility_test/main/CMakeLists.txt b/examples/bluetooth/ble_compatibility_test/main/CMakeLists.txt index 3435b4c563..99553fec31 100644 --- a/examples/bluetooth/ble_compatibility_test/main/CMakeLists.txt +++ b/examples/bluetooth/ble_compatibility_test/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "ble_compatibility_test.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "ble_compatibility_test.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/bluetooth/ble_eddystone/main/CMakeLists.txt b/examples/bluetooth/ble_eddystone/main/CMakeLists.txt index 66a4e1aa6c..cdd852c570 100644 --- a/examples/bluetooth/ble_eddystone/main/CMakeLists.txt +++ b/examples/bluetooth/ble_eddystone/main/CMakeLists.txt @@ -1,5 +1,3 @@ -set(COMPONENT_SRCS "esp_eddystone_api.c" - "esp_eddystone_demo.c") -set(COMPONENT_ADD_INCLUDEDIRS "") - -register_component() +idf_component_register(SRCS "esp_eddystone_api.c" + "esp_eddystone_demo.c" + INCLUDE_DIRS "") \ No newline at end of file diff --git a/examples/bluetooth/ble_hid_device_demo/main/CMakeLists.txt b/examples/bluetooth/ble_hid_device_demo/main/CMakeLists.txt index 6445d3c5ef..efba49f6b7 100644 --- a/examples/bluetooth/ble_hid_device_demo/main/CMakeLists.txt +++ b/examples/bluetooth/ble_hid_device_demo/main/CMakeLists.txt @@ -1,10 +1,8 @@ -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() +idf_component_register(SRCS "ble_hidd_demo_main.c" + "esp_hidd_prf_api.c" + "hid_dev.c" + "hid_device_le_prf.c" + INCLUDE_DIRS ".") if(GCC_NOT_5_2_0) target_compile_options(${COMPONENT_LIB} PRIVATE -Wno-unused-const-variable) diff --git a/examples/bluetooth/ble_ibeacon/main/CMakeLists.txt b/examples/bluetooth/ble_ibeacon/main/CMakeLists.txt index 1ae1a02e64..50293e2a7b 100644 --- a/examples/bluetooth/ble_ibeacon/main/CMakeLists.txt +++ b/examples/bluetooth/ble_ibeacon/main/CMakeLists.txt @@ -1,5 +1,3 @@ -set(COMPONENT_SRCS "esp_ibeacon_api.c" - "ibeacon_demo.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "esp_ibeacon_api.c" + "ibeacon_demo.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/bluetooth/ble_spp_client/main/CMakeLists.txt b/examples/bluetooth/ble_spp_client/main/CMakeLists.txt index de584f3977..1b83a293fa 100644 --- a/examples/bluetooth/ble_spp_client/main/CMakeLists.txt +++ b/examples/bluetooth/ble_spp_client/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "spp_client_demo.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "spp_client_demo.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/bluetooth/ble_spp_server/main/CMakeLists.txt b/examples/bluetooth/ble_spp_server/main/CMakeLists.txt index 99f35ee072..be4f67ba8d 100644 --- a/examples/bluetooth/ble_spp_server/main/CMakeLists.txt +++ b/examples/bluetooth/ble_spp_server/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "ble_spp_server_demo.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "ble_spp_server_demo.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/bluetooth/ble_throughput/throughput_client/main/CMakeLists.txt b/examples/bluetooth/ble_throughput/throughput_client/main/CMakeLists.txt index 1fe275526d..e4c37ee280 100644 --- a/examples/bluetooth/ble_throughput/throughput_client/main/CMakeLists.txt +++ b/examples/bluetooth/ble_throughput/throughput_client/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "example_ble_client_throughput.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "example_ble_client_throughput.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/bluetooth/ble_throughput/throughput_server/main/CMakeLists.txt b/examples/bluetooth/ble_throughput/throughput_server/main/CMakeLists.txt index 3c1f62ac89..c54e45c928 100644 --- a/examples/bluetooth/ble_throughput/throughput_server/main/CMakeLists.txt +++ b/examples/bluetooth/ble_throughput/throughput_server/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "example_ble_server_throughput.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "example_ble_server_throughput.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/bluetooth/blufi/main/CMakeLists.txt b/examples/bluetooth/blufi/main/CMakeLists.txt index cbb9b24c36..8e40bfbf2f 100644 --- a/examples/bluetooth/blufi/main/CMakeLists.txt +++ b/examples/bluetooth/blufi/main/CMakeLists.txt @@ -1,5 +1,3 @@ -set(COMPONENT_SRCS "blufi_example_main.c" - "blufi_security.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "blufi_example_main.c" + "blufi_security.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/bluetooth/bt_discovery/main/CMakeLists.txt b/examples/bluetooth/bt_discovery/main/CMakeLists.txt index 68ddbfb4c8..4bc23a96f4 100644 --- a/examples/bluetooth/bt_discovery/main/CMakeLists.txt +++ b/examples/bluetooth/bt_discovery/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "bt_discovery.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "bt_discovery.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/bluetooth/bt_spp_acceptor/main/CMakeLists.txt b/examples/bluetooth/bt_spp_acceptor/main/CMakeLists.txt index 0694503f92..a71f85ba7c 100644 --- a/examples/bluetooth/bt_spp_acceptor/main/CMakeLists.txt +++ b/examples/bluetooth/bt_spp_acceptor/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "example_spp_acceptor_demo.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "example_spp_acceptor_demo.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/bluetooth/bt_spp_initiator/main/CMakeLists.txt b/examples/bluetooth/bt_spp_initiator/main/CMakeLists.txt index 1eae1b74c9..09a976ad1c 100644 --- a/examples/bluetooth/bt_spp_initiator/main/CMakeLists.txt +++ b/examples/bluetooth/bt_spp_initiator/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "example_spp_initiator_demo.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "example_spp_initiator_demo.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/bluetooth/bt_spp_vfs_acceptor/main/CMakeLists.txt b/examples/bluetooth/bt_spp_vfs_acceptor/main/CMakeLists.txt index b224db80b6..369e404a15 100644 --- a/examples/bluetooth/bt_spp_vfs_acceptor/main/CMakeLists.txt +++ b/examples/bluetooth/bt_spp_vfs_acceptor/main/CMakeLists.txt @@ -1,5 +1,3 @@ -set(COMPONENT_SRCS "example_spp_vfs_acceptor_demo.c" - "spp_task.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "example_spp_vfs_acceptor_demo.c" + "spp_task.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/bluetooth/bt_spp_vfs_initiator/main/CMakeLists.txt b/examples/bluetooth/bt_spp_vfs_initiator/main/CMakeLists.txt index f3b9111353..03781e4786 100644 --- a/examples/bluetooth/bt_spp_vfs_initiator/main/CMakeLists.txt +++ b/examples/bluetooth/bt_spp_vfs_initiator/main/CMakeLists.txt @@ -1,5 +1,3 @@ -set(COMPONENT_SRCS "example_spp_vfs_initiator_demo.c" - "spp_task.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "example_spp_vfs_initiator_demo.c" + "spp_task.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/bluetooth/controller_hci_uart/main/CMakeLists.txt b/examples/bluetooth/controller_hci_uart/main/CMakeLists.txt index 2f40a64c69..b4eacc768a 100644 --- a/examples/bluetooth/controller_hci_uart/main/CMakeLists.txt +++ b/examples/bluetooth/controller_hci_uart/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "controller_hci_uart_demo.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "controller_hci_uart_demo.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/bluetooth/gatt_client/main/CMakeLists.txt b/examples/bluetooth/gatt_client/main/CMakeLists.txt index 7c79edceaa..82a30b2f71 100644 --- a/examples/bluetooth/gatt_client/main/CMakeLists.txt +++ b/examples/bluetooth/gatt_client/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "gattc_demo.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "gattc_demo.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/bluetooth/gatt_security_client/main/CMakeLists.txt b/examples/bluetooth/gatt_security_client/main/CMakeLists.txt index 32cea7e2e3..691e1edd29 100644 --- a/examples/bluetooth/gatt_security_client/main/CMakeLists.txt +++ b/examples/bluetooth/gatt_security_client/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "example_ble_sec_gattc_demo.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "example_ble_sec_gattc_demo.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/bluetooth/gatt_security_server/main/CMakeLists.txt b/examples/bluetooth/gatt_security_server/main/CMakeLists.txt index 87df03c692..6514591112 100644 --- a/examples/bluetooth/gatt_security_server/main/CMakeLists.txt +++ b/examples/bluetooth/gatt_security_server/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "example_ble_sec_gatts_demo.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "example_ble_sec_gatts_demo.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/bluetooth/gatt_server/main/CMakeLists.txt b/examples/bluetooth/gatt_server/main/CMakeLists.txt index d23e5ffc7d..e950c9ecd0 100644 --- a/examples/bluetooth/gatt_server/main/CMakeLists.txt +++ b/examples/bluetooth/gatt_server/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "gatts_demo.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "gatts_demo.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/bluetooth/gatt_server_service_table/main/CMakeLists.txt b/examples/bluetooth/gatt_server_service_table/main/CMakeLists.txt index 7588b5a7a1..fbe553576b 100644 --- a/examples/bluetooth/gatt_server_service_table/main/CMakeLists.txt +++ b/examples/bluetooth/gatt_server_service_table/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "gatts_table_creat_demo.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "gatts_table_creat_demo.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/bluetooth/gattc_multi_connect/main/CMakeLists.txt b/examples/bluetooth/gattc_multi_connect/main/CMakeLists.txt index 19dcf60d3a..826febe746 100644 --- a/examples/bluetooth/gattc_multi_connect/main/CMakeLists.txt +++ b/examples/bluetooth/gattc_multi_connect/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "gattc_multi_connect.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "gattc_multi_connect.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/build_system/cmake/import_lib/main/CMakeLists.txt b/examples/build_system/cmake/import_lib/main/CMakeLists.txt index fb136b8b97..6c60c8f980 100644 --- a/examples/build_system/cmake/import_lib/main/CMakeLists.txt +++ b/examples/build_system/cmake/import_lib/main/CMakeLists.txt @@ -1,9 +1,6 @@ -set(COMPONENT_SRCS "main.cpp") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -set(COMPONENT_EMBED_TXTFILES "sample.xml") - -register_component() +idf_component_register(SRCS "main.cpp" + INCLUDE_DIRS "." + EMBED_TXTFILES "sample.xml") # Build static library, do not build test executables option(BUILD_SHARED_LIBS OFF) diff --git a/examples/common_components/protocol_examples_common/CMakeLists.txt b/examples/common_components/protocol_examples_common/CMakeLists.txt index 784909da03..0ccb219b4a 100644 --- a/examples/common_components/protocol_examples_common/CMakeLists.txt +++ b/examples/common_components/protocol_examples_common/CMakeLists.txt @@ -1,5 +1,2 @@ -set(COMPONENT_SRCS "connect.c" - "stdin_out.c") -set(COMPONENT_ADD_INCLUDEDIRS "include") - -register_component() +idf_component_register(SRCS "connect.c" "stdin_out.c" + INCLUDE_DIRS "include") diff --git a/examples/ethernet/eth2ap/main/CMakeLists.txt b/examples/ethernet/eth2ap/main/CMakeLists.txt index aaf55bea54..5dbbb14c2d 100644 --- a/examples/ethernet/eth2ap/main/CMakeLists.txt +++ b/examples/ethernet/eth2ap/main/CMakeLists.txt @@ -1,6 +1,2 @@ - -set(COMPONENT_SRCS "eth2ap_example_main.c") - -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "eth2ap_example_main.c" + INCLUDE_DIRS ".") diff --git a/examples/ethernet/ethernet/main/CMakeLists.txt b/examples/ethernet/ethernet/main/CMakeLists.txt index 8c0c9fa0fc..8bc01f1bb4 100644 --- a/examples/ethernet/ethernet/main/CMakeLists.txt +++ b/examples/ethernet/ethernet/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "ethernet_example_main.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "ethernet_example_main.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/ethernet/iperf/main/CMakeLists.txt b/examples/ethernet/iperf/main/CMakeLists.txt index 16ecc3272c..aa66030901 100644 --- a/examples/ethernet/iperf/main/CMakeLists.txt +++ b/examples/ethernet/iperf/main/CMakeLists.txt @@ -1,5 +1,3 @@ -set(COMPONENT_SRCS "cmd_ethernet.c" - "iperf_example_main.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "cmd_ethernet.c" + "iperf_example_main.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/get-started/blink/main/CMakeLists.txt b/examples/get-started/blink/main/CMakeLists.txt index 69f12a3847..413c3b5141 100644 --- a/examples/get-started/blink/main/CMakeLists.txt +++ b/examples/get-started/blink/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "blink.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "blink.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/get-started/hello_world/main/CMakeLists.txt b/examples/get-started/hello_world/main/CMakeLists.txt index b79b831950..c299e03782 100644 --- a/examples/get-started/hello_world/main/CMakeLists.txt +++ b/examples/get-started/hello_world/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "hello_world_main.c") -set(COMPONENT_ADD_INCLUDEDIRS "") - -register_component() \ No newline at end of file +idf_component_register(SRCS "hello_world_main.c" + INCLUDE_DIRS "") \ No newline at end of file diff --git a/examples/mesh/internal_communication/main/CMakeLists.txt b/examples/mesh/internal_communication/main/CMakeLists.txt index 451eeceed6..686ab05acf 100644 --- a/examples/mesh/internal_communication/main/CMakeLists.txt +++ b/examples/mesh/internal_communication/main/CMakeLists.txt @@ -1,5 +1,3 @@ -set(COMPONENT_SRCS "mesh_light.c" - "mesh_main.c") -set(COMPONENT_ADD_INCLUDEDIRS ". include") - -register_component() +idf_component_register(SRCS "mesh_light.c" + "mesh_main.c" + INCLUDE_DIRS "." "include") diff --git a/examples/mesh/manual_networking/main/CMakeLists.txt b/examples/mesh/manual_networking/main/CMakeLists.txt index 1ae57b28ac..686ab05acf 100644 --- a/examples/mesh/manual_networking/main/CMakeLists.txt +++ b/examples/mesh/manual_networking/main/CMakeLists.txt @@ -1,5 +1,3 @@ -set(COMPONENT_SRCS "mesh_light.c" - "mesh_main.c") -set(COMPONENT_ADD_INCLUDEDIRS "." "include") - -register_component() +idf_component_register(SRCS "mesh_light.c" + "mesh_main.c" + INCLUDE_DIRS "." "include") diff --git a/examples/peripherals/adc/main/CMakeLists.txt b/examples/peripherals/adc/main/CMakeLists.txt index 9b5d48fc60..035e5bd270 100644 --- a/examples/peripherals/adc/main/CMakeLists.txt +++ b/examples/peripherals/adc/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "adc1_example_main.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "adc1_example_main.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/peripherals/adc2/main/CMakeLists.txt b/examples/peripherals/adc2/main/CMakeLists.txt index 1d7776ecf0..5a6c87d577 100644 --- a/examples/peripherals/adc2/main/CMakeLists.txt +++ b/examples/peripherals/adc2/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "adc2_example_main.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "adc2_example_main.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/peripherals/can/can_alert_and_recovery/main/CMakeLists.txt b/examples/peripherals/can/can_alert_and_recovery/main/CMakeLists.txt index cf9bf40a99..ab23bf60fb 100644 --- a/examples/peripherals/can/can_alert_and_recovery/main/CMakeLists.txt +++ b/examples/peripherals/can/can_alert_and_recovery/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "can_alert_and_recovery_example_main.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "can_alert_and_recovery_example_main.c" + INCLUDE_DIRS ".") \ No newline at end of file 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 index 5eab299b00..191642e1d1 100644 --- 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 @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "can_network_example_listen_only_main.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "can_network_example_listen_only_main.c" + INCLUDE_DIRS ".") \ No newline at end of file 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 index f0dc1d6a79..31a67ddcb9 100644 --- a/examples/peripherals/can/can_network/can_network_master/main/CMakeLists.txt +++ b/examples/peripherals/can/can_network/can_network_master/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "can_network_example_master_main.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "can_network_example_master_main.c" + INCLUDE_DIRS ".") \ No newline at end of file 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 index 4a002fbfc3..5ade11d5b5 100644 --- a/examples/peripherals/can/can_network/can_network_slave/main/CMakeLists.txt +++ b/examples/peripherals/can/can_network/can_network_slave/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "can_network_example_slave_main.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "can_network_example_slave_main.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/peripherals/can/can_self_test/main/CMakeLists.txt b/examples/peripherals/can/can_self_test/main/CMakeLists.txt index 21db765a8f..5c3f85e0a5 100644 --- a/examples/peripherals/can/can_self_test/main/CMakeLists.txt +++ b/examples/peripherals/can/can_self_test/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "can_self_test_example_main.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "can_self_test_example_main.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/peripherals/gpio/main/CMakeLists.txt b/examples/peripherals/gpio/main/CMakeLists.txt index d768cb8252..d33d5e1716 100644 --- a/examples/peripherals/gpio/main/CMakeLists.txt +++ b/examples/peripherals/gpio/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "gpio_example_main.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "gpio_example_main.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/peripherals/i2c/i2c_self_test/main/CMakeLists.txt b/examples/peripherals/i2c/i2c_self_test/main/CMakeLists.txt index 02386f7197..4dc828aacc 100644 --- a/examples/peripherals/i2c/i2c_self_test/main/CMakeLists.txt +++ b/examples/peripherals/i2c/i2c_self_test/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "i2c_example_main.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "i2c_example_main.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/peripherals/i2c/i2c_tools/main/CMakeLists.txt b/examples/peripherals/i2c/i2c_tools/main/CMakeLists.txt index 50cdc09826..fed3a94434 100644 --- a/examples/peripherals/i2c/i2c_tools/main/CMakeLists.txt +++ b/examples/peripherals/i2c/i2c_tools/main/CMakeLists.txt @@ -1,5 +1,3 @@ -set(COMPONENT_SRCS "i2ctools_example_main.c" - "cmd_i2ctools.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "i2ctools_example_main.c" + "cmd_i2ctools.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/peripherals/i2s/main/CMakeLists.txt b/examples/peripherals/i2s/main/CMakeLists.txt index dbb7b172a3..5233689fb2 100644 --- a/examples/peripherals/i2s/main/CMakeLists.txt +++ b/examples/peripherals/i2s/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "i2s_example_main.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "i2s_example_main.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/peripherals/i2s_adc_dac/main/CMakeLists.txt b/examples/peripherals/i2s_adc_dac/main/CMakeLists.txt index 6b03500639..e7392559ee 100644 --- a/examples/peripherals/i2s_adc_dac/main/CMakeLists.txt +++ b/examples/peripherals/i2s_adc_dac/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "app_main.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "app_main.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/peripherals/ledc/main/CMakeLists.txt b/examples/peripherals/ledc/main/CMakeLists.txt index 6405eb95ff..f6064011cc 100644 --- a/examples/peripherals/ledc/main/CMakeLists.txt +++ b/examples/peripherals/ledc/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "ledc_example_main.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "ledc_example_main.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/peripherals/mcpwm/mcpwm_basic_config/main/CMakeLists.txt b/examples/peripherals/mcpwm/mcpwm_basic_config/main/CMakeLists.txt index d5fdbf5600..ec236fe844 100644 --- a/examples/peripherals/mcpwm/mcpwm_basic_config/main/CMakeLists.txt +++ b/examples/peripherals/mcpwm/mcpwm_basic_config/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "mcpwm_basic_config_example.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "mcpwm_basic_config_example.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/peripherals/mcpwm/mcpwm_bldc_control/main/CMakeLists.txt b/examples/peripherals/mcpwm/mcpwm_bldc_control/main/CMakeLists.txt index a52ad94513..3f7cedf8d2 100644 --- a/examples/peripherals/mcpwm/mcpwm_bldc_control/main/CMakeLists.txt +++ b/examples/peripherals/mcpwm/mcpwm_bldc_control/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "mcpwm_bldc_control_hall_sensor_example.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "mcpwm_bldc_control_hall_sensor_example.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/peripherals/mcpwm/mcpwm_brushed_dc_control/main/CMakeLists.txt b/examples/peripherals/mcpwm/mcpwm_brushed_dc_control/main/CMakeLists.txt index 1259035cbf..81ecd07a8f 100644 --- a/examples/peripherals/mcpwm/mcpwm_brushed_dc_control/main/CMakeLists.txt +++ b/examples/peripherals/mcpwm/mcpwm_brushed_dc_control/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "mcpwm_brushed_dc_control_example.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "mcpwm_brushed_dc_control_example.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/peripherals/mcpwm/mcpwm_servo_control/main/CMakeLists.txt b/examples/peripherals/mcpwm/mcpwm_servo_control/main/CMakeLists.txt index c8fa3d96b9..7a6efda90a 100644 --- a/examples/peripherals/mcpwm/mcpwm_servo_control/main/CMakeLists.txt +++ b/examples/peripherals/mcpwm/mcpwm_servo_control/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "mcpwm_servo_control_example.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "mcpwm_servo_control_example.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/peripherals/pcnt/main/CMakeLists.txt b/examples/peripherals/pcnt/main/CMakeLists.txt index 2bd2779553..11ace9793f 100644 --- a/examples/peripherals/pcnt/main/CMakeLists.txt +++ b/examples/peripherals/pcnt/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "pcnt_example_main.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "pcnt_example_main.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/peripherals/rmt_nec_tx_rx/main/CMakeLists.txt b/examples/peripherals/rmt_nec_tx_rx/main/CMakeLists.txt index 80c75b2285..907a16c057 100644 --- a/examples/peripherals/rmt_nec_tx_rx/main/CMakeLists.txt +++ b/examples/peripherals/rmt_nec_tx_rx/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "infrared_nec_main.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "infrared_nec_main.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/peripherals/rmt_tx/main/CMakeLists.txt b/examples/peripherals/rmt_tx/main/CMakeLists.txt index a0a9147a2a..ad48214028 100644 --- a/examples/peripherals/rmt_tx/main/CMakeLists.txt +++ b/examples/peripherals/rmt_tx/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "rmt_tx_main.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "rmt_tx_main.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/peripherals/sdio/host/components/esp_slave/CMakeLists.txt b/examples/peripherals/sdio/host/components/esp_slave/CMakeLists.txt index 1cda8805cb..9f5c38bbaf 100644 --- a/examples/peripherals/sdio/host/components/esp_slave/CMakeLists.txt +++ b/examples/peripherals/sdio/host/components/esp_slave/CMakeLists.txt @@ -1,6 +1,3 @@ -set(COMPONENT_SRCS "esp_slave.c") -set(COMPONENT_ADD_INCLUDEDIRS "include") - -set(COMPONENT_REQUIRES driver sdmmc) - -register_component() +idf_component_register(SRCS "esp_slave.c" + INCLUDE_DIRS "include" + REQUIRES driver sdmmc) \ No newline at end of file diff --git a/examples/peripherals/sdio/host/main/CMakeLists.txt b/examples/peripherals/sdio/host/main/CMakeLists.txt index 6b03500639..e7392559ee 100644 --- a/examples/peripherals/sdio/host/main/CMakeLists.txt +++ b/examples/peripherals/sdio/host/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "app_main.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "app_main.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/peripherals/sdio/slave/main/CMakeLists.txt b/examples/peripherals/sdio/slave/main/CMakeLists.txt index 6b03500639..e7392559ee 100644 --- a/examples/peripherals/sdio/slave/main/CMakeLists.txt +++ b/examples/peripherals/sdio/slave/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "app_main.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "app_main.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/peripherals/sigmadelta/main/CMakeLists.txt b/examples/peripherals/sigmadelta/main/CMakeLists.txt index 1b0f2299f0..52abe2822d 100644 --- a/examples/peripherals/sigmadelta/main/CMakeLists.txt +++ b/examples/peripherals/sigmadelta/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "sigmadelta_example_main.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "sigmadelta_example_main.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/peripherals/spi_master/main/CMakeLists.txt b/examples/peripherals/spi_master/main/CMakeLists.txt index 806ccae2b6..6d1a795b48 100644 --- a/examples/peripherals/spi_master/main/CMakeLists.txt +++ b/examples/peripherals/spi_master/main/CMakeLists.txt @@ -1,9 +1,5 @@ -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() +idf_component_register(SRCS "decode_image.c" + "pretty_effect.c" + "spi_master_example_main.c" + INCLUDE_DIRS "." + EMBED_FILES image.jpg) \ No newline at end of file diff --git a/examples/peripherals/spi_slave/receiver/main/CMakeLists.txt b/examples/peripherals/spi_slave/receiver/main/CMakeLists.txt index 6b03500639..e7392559ee 100644 --- a/examples/peripherals/spi_slave/receiver/main/CMakeLists.txt +++ b/examples/peripherals/spi_slave/receiver/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "app_main.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "app_main.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/peripherals/spi_slave/sender/main/CMakeLists.txt b/examples/peripherals/spi_slave/sender/main/CMakeLists.txt index 6b03500639..e7392559ee 100644 --- a/examples/peripherals/spi_slave/sender/main/CMakeLists.txt +++ b/examples/peripherals/spi_slave/sender/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "app_main.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "app_main.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/peripherals/timer_group/main/CMakeLists.txt b/examples/peripherals/timer_group/main/CMakeLists.txt index 9a96ce9068..9a07f9eb72 100644 --- a/examples/peripherals/timer_group/main/CMakeLists.txt +++ b/examples/peripherals/timer_group/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "timer_group_example_main.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "timer_group_example_main.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/peripherals/touch_pad_interrupt/main/CMakeLists.txt b/examples/peripherals/touch_pad_interrupt/main/CMakeLists.txt index b77bf9c7be..df4240c344 100644 --- a/examples/peripherals/touch_pad_interrupt/main/CMakeLists.txt +++ b/examples/peripherals/touch_pad_interrupt/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "tp_interrupt_main.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "tp_interrupt_main.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/peripherals/touch_pad_read/main/CMakeLists.txt b/examples/peripherals/touch_pad_read/main/CMakeLists.txt index b556e8c0ee..dad0c4905c 100644 --- a/examples/peripherals/touch_pad_read/main/CMakeLists.txt +++ b/examples/peripherals/touch_pad_read/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "tp_read_main.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "tp_read_main.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/peripherals/uart/nmea0183_parser/main/CMakeLists.txt b/examples/peripherals/uart/nmea0183_parser/main/CMakeLists.txt index a8c42b8a71..b06050f468 100644 --- a/examples/peripherals/uart/nmea0183_parser/main/CMakeLists.txt +++ b/examples/peripherals/uart/nmea0183_parser/main/CMakeLists.txt @@ -1,5 +1,3 @@ -set(COMPONENT_SRCS "nmea_parser_example_main.c" - "nmea_parser.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "nmea_parser_example_main.c" + "nmea_parser.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/peripherals/uart/uart_async_rxtxtasks/main/CMakeLists.txt b/examples/peripherals/uart/uart_async_rxtxtasks/main/CMakeLists.txt index b572323523..7cfd9876ee 100644 --- a/examples/peripherals/uart/uart_async_rxtxtasks/main/CMakeLists.txt +++ b/examples/peripherals/uart/uart_async_rxtxtasks/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "uart_async_rxtxtasks_main.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "uart_async_rxtxtasks_main.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/peripherals/uart/uart_echo/main/CMakeLists.txt b/examples/peripherals/uart/uart_echo/main/CMakeLists.txt index 1ca803f131..b3eac5eff9 100644 --- a/examples/peripherals/uart/uart_echo/main/CMakeLists.txt +++ b/examples/peripherals/uart/uart_echo/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "uart_echo_example_main.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "uart_echo_example_main.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/peripherals/uart/uart_echo_rs485/main/CMakeLists.txt b/examples/peripherals/uart/uart_echo_rs485/main/CMakeLists.txt index 8b3393049e..ef96bc63f1 100644 --- a/examples/peripherals/uart/uart_echo_rs485/main/CMakeLists.txt +++ b/examples/peripherals/uart/uart_echo_rs485/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "rs485_example.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "rs485_example.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/peripherals/uart/uart_events/main/CMakeLists.txt b/examples/peripherals/uart/uart_events/main/CMakeLists.txt index 5a408ef1ef..44d8838503 100644 --- a/examples/peripherals/uart/uart_events/main/CMakeLists.txt +++ b/examples/peripherals/uart/uart_events/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "uart_events_example_main.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "uart_events_example_main.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/peripherals/uart/uart_select/main/CMakeLists.txt b/examples/peripherals/uart/uart_select/main/CMakeLists.txt index 4e3ae00def..8f1897f23f 100644 --- a/examples/peripherals/uart/uart_select/main/CMakeLists.txt +++ b/examples/peripherals/uart/uart_select/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "uart_select_example_main.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "uart_select_example_main.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/protocols/asio/chat_client/main/CMakeLists.txt b/examples/protocols/asio/chat_client/main/CMakeLists.txt index 25419de4a8..d92c9a8ae9 100644 --- a/examples/protocols/asio/chat_client/main/CMakeLists.txt +++ b/examples/protocols/asio/chat_client/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "chat_client.cpp") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "chat_client.cpp" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/protocols/asio/chat_server/main/CMakeLists.txt b/examples/protocols/asio/chat_server/main/CMakeLists.txt index 7e44a9039f..9042b223a6 100644 --- a/examples/protocols/asio/chat_server/main/CMakeLists.txt +++ b/examples/protocols/asio/chat_server/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "chat_server.cpp") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "chat_server.cpp" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/protocols/asio/tcp_echo_server/main/CMakeLists.txt b/examples/protocols/asio/tcp_echo_server/main/CMakeLists.txt index 04c3c94d9a..ef518dc723 100644 --- a/examples/protocols/asio/tcp_echo_server/main/CMakeLists.txt +++ b/examples/protocols/asio/tcp_echo_server/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "echo_server.cpp") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "echo_server.cpp" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/protocols/asio/udp_echo_server/main/CMakeLists.txt b/examples/protocols/asio/udp_echo_server/main/CMakeLists.txt index cd24937bef..c7a9e3575a 100644 --- a/examples/protocols/asio/udp_echo_server/main/CMakeLists.txt +++ b/examples/protocols/asio/udp_echo_server/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "udp_echo_server.cpp") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "udp_echo_server.cpp" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/protocols/coap_client/main/CMakeLists.txt b/examples/protocols/coap_client/main/CMakeLists.txt index eb1a1db15d..90a88c9d3b 100644 --- a/examples/protocols/coap_client/main/CMakeLists.txt +++ b/examples/protocols/coap_client/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "coap_client_example_main.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "coap_client_example_main.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/protocols/coap_server/main/CMakeLists.txt b/examples/protocols/coap_server/main/CMakeLists.txt index 8650fb1147..c28a7be75e 100644 --- a/examples/protocols/coap_server/main/CMakeLists.txt +++ b/examples/protocols/coap_server/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "coap_server_example_main.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "coap_server_example_main.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/protocols/esp_http_client/main/CMakeLists.txt b/examples/protocols/esp_http_client/main/CMakeLists.txt index 77a52e233a..8cc92e71e8 100644 --- a/examples/protocols/esp_http_client/main/CMakeLists.txt +++ b/examples/protocols/esp_http_client/main/CMakeLists.txt @@ -1,10 +1,6 @@ -set(COMPONENT_SRCS "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() +idf_component_register(SRCS "esp_http_client_example.c" + INCLUDE_DIRS "." + EMBED_TXTFILES howsmyssl_com_root_cert.pem) \ No newline at end of file diff --git a/examples/protocols/http2_request/components/sh2lib/CMakeLists.txt b/examples/protocols/http2_request/components/sh2lib/CMakeLists.txt index ec1b5a1e12..030f3f14c2 100644 --- a/examples/protocols/http2_request/components/sh2lib/CMakeLists.txt +++ b/examples/protocols/http2_request/components/sh2lib/CMakeLists.txt @@ -1,8 +1,4 @@ -set(COMPONENT_ADD_INCLUDEDIRS .) - -set(COMPONENT_SRCS "sh2lib.c") - -set(COMPONENT_REQUIRES nghttp) -set(COMPONENT_PRIV_REQUIRES lwip esp-tls) - -register_component() +idf_component_register(SRCS "sh2lib.c" + INCLUDE_DIRS . + REQUIRES nghttp + PRIV_REQUIRES lwip esp-tls) diff --git a/examples/protocols/http2_request/main/CMakeLists.txt b/examples/protocols/http2_request/main/CMakeLists.txt index 6139002258..defbb29583 100644 --- a/examples/protocols/http2_request/main/CMakeLists.txt +++ b/examples/protocols/http2_request/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "http2_request_example_main.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "http2_request_example_main.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/protocols/http_request/main/CMakeLists.txt b/examples/protocols/http_request/main/CMakeLists.txt index 8e346e8bb3..b4b91e9b87 100644 --- a/examples/protocols/http_request/main/CMakeLists.txt +++ b/examples/protocols/http_request/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "http_request_example_main.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "http_request_example_main.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/protocols/http_server/advanced_tests/main/CMakeLists.txt b/examples/protocols/http_server/advanced_tests/main/CMakeLists.txt index 9fd69b1d35..53a3e4d8b9 100644 --- a/examples/protocols/http_server/advanced_tests/main/CMakeLists.txt +++ b/examples/protocols/http_server/advanced_tests/main/CMakeLists.txt @@ -1,5 +1,3 @@ -set(COMPONENT_SRCS "main.c" - "tests.c") -set(COMPONENT_ADD_INCLUDEDIRS ". include") - -register_component() +idf_component_register(SRCS "main.c" + "tests.c" + INCLUDE_DIRS "." "include") \ No newline at end of file diff --git a/examples/protocols/http_server/file_serving/main/CMakeLists.txt b/examples/protocols/http_server/file_serving/main/CMakeLists.txt index a9493f54a8..2354c4b1be 100644 --- a/examples/protocols/http_server/file_serving/main/CMakeLists.txt +++ b/examples/protocols/http_server/file_serving/main/CMakeLists.txt @@ -1,6 +1,3 @@ -set(COMPONENT_SRCS "main.c" "file_server.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -set(COMPONENT_EMBED_FILES "favicon.ico" "upload_script.html") - -register_component() +idf_component_register(SRCS "main.c" "file_server.c" + INCLUDE_DIRS "." + EMBED_FILES "favicon.ico" "upload_script.html") \ No newline at end of file diff --git a/examples/protocols/http_server/persistent_sockets/main/CMakeLists.txt b/examples/protocols/http_server/persistent_sockets/main/CMakeLists.txt index 85970762ab..e0287b7b9e 100644 --- a/examples/protocols/http_server/persistent_sockets/main/CMakeLists.txt +++ b/examples/protocols/http_server/persistent_sockets/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "main.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "main.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/protocols/http_server/restful_server/main/CMakeLists.txt b/examples/protocols/http_server/restful_server/main/CMakeLists.txt index 6df9c7c4da..4e35a40f23 100644 --- a/examples/protocols/http_server/restful_server/main/CMakeLists.txt +++ b/examples/protocols/http_server/restful_server/main/CMakeLists.txt @@ -1,7 +1,6 @@ -set(COMPONENT_SRCS "esp_rest_main.c" "rest_server.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "esp_rest_main.c" + "rest_server.c" + INCLUDE_DIRS ".") if(CONFIG_EXAMPLE_WEB_DEPLOY_SF) set(WEB_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../front/web-demo") diff --git a/examples/protocols/http_server/simple/main/CMakeLists.txt b/examples/protocols/http_server/simple/main/CMakeLists.txt index 85970762ab..e0287b7b9e 100644 --- a/examples/protocols/http_server/simple/main/CMakeLists.txt +++ b/examples/protocols/http_server/simple/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "main.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "main.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/protocols/https_mbedtls/main/CMakeLists.txt b/examples/protocols/https_mbedtls/main/CMakeLists.txt index c9b097c6b9..99d46aba00 100644 --- a/examples/protocols/https_mbedtls/main/CMakeLists.txt +++ b/examples/protocols/https_mbedtls/main/CMakeLists.txt @@ -1,10 +1,6 @@ -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() +idf_component_register(SRCS "https_mbedtls_example_main.c" + INCLUDE_DIRS "." + EMBED_TXTFILES server_root_cert.pem) \ No newline at end of file diff --git a/examples/protocols/https_request/main/CMakeLists.txt b/examples/protocols/https_request/main/CMakeLists.txt index 60a1a0664c..5501a68205 100644 --- a/examples/protocols/https_request/main/CMakeLists.txt +++ b/examples/protocols/https_request/main/CMakeLists.txt @@ -1,10 +1,6 @@ -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() +idf_component_register(SRCS "https_request_example_main.c" + INCLUDE_DIRS "." + EMBED_TXTFILES server_root_cert.pem) \ No newline at end of file diff --git a/examples/protocols/https_server/main/CMakeLists.txt b/examples/protocols/https_server/main/CMakeLists.txt index 9e08fb4d71..feca398b8e 100644 --- a/examples/protocols/https_server/main/CMakeLists.txt +++ b/examples/protocols/https_server/main/CMakeLists.txt @@ -1,8 +1,4 @@ -set(COMPONENT_SRCS "main.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -set(COMPONENT_EMBED_TXTFILES - "certs/cacert.pem" - "certs/prvtkey.pem") - -register_component() +idf_component_register(SRCS "main.c" + INCLUDE_DIRS "." + EMBED_TXTFILES "certs/cacert.pem" + "certs/prvtkey.pem") \ No newline at end of file diff --git a/examples/protocols/mdns/main/CMakeLists.txt b/examples/protocols/mdns/main/CMakeLists.txt index 814837ea97..141d1e30dc 100644 --- a/examples/protocols/mdns/main/CMakeLists.txt +++ b/examples/protocols/mdns/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "mdns_example_main.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "mdns_example_main.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/protocols/modbus_master/main/CMakeLists.txt b/examples/protocols/modbus_master/main/CMakeLists.txt index 6db1f90987..2555f99e43 100644 --- a/examples/protocols/modbus_master/main/CMakeLists.txt +++ b/examples/protocols/modbus_master/main/CMakeLists.txt @@ -1,6 +1,4 @@ -set(COMPONENT_SRCS "sense_main.c" - "sense_modbus.c" - "device_params.c") -set(COMPONENT_ADD_INCLUDEDIRS "." "include") - -register_component() \ No newline at end of file +idf_component_register(SRCS "sense_main.c" + "sense_modbus.c" + "device_params.c" + INCLUDE_DIRS "." "include") diff --git a/examples/protocols/modbus_slave/main/CMakeLists.txt b/examples/protocols/modbus_slave/main/CMakeLists.txt index 96b08bdc5b..19967e3169 100644 --- a/examples/protocols/modbus_slave/main/CMakeLists.txt +++ b/examples/protocols/modbus_slave/main/CMakeLists.txt @@ -1,5 +1,3 @@ -set(COMPONENT_SRCS "freemodbus.c" - "deviceparams.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() \ No newline at end of file +idf_component_register(SRCS "freemodbus.c" + "deviceparams.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/protocols/mqtt/publish_test/main/CMakeLists.txt b/examples/protocols/mqtt/publish_test/main/CMakeLists.txt index c3074a7067..67c4c7b5ad 100644 --- a/examples/protocols/mqtt/publish_test/main/CMakeLists.txt +++ b/examples/protocols/mqtt/publish_test/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "publish_test.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "publish_test.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/protocols/mqtt/ssl/main/CMakeLists.txt b/examples/protocols/mqtt/ssl/main/CMakeLists.txt index 6b03500639..e7392559ee 100644 --- a/examples/protocols/mqtt/ssl/main/CMakeLists.txt +++ b/examples/protocols/mqtt/ssl/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "app_main.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "app_main.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/protocols/mqtt/ssl_mutual_auth/main/CMakeLists.txt b/examples/protocols/mqtt/ssl_mutual_auth/main/CMakeLists.txt index 6b03500639..e7392559ee 100644 --- a/examples/protocols/mqtt/ssl_mutual_auth/main/CMakeLists.txt +++ b/examples/protocols/mqtt/ssl_mutual_auth/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "app_main.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "app_main.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/protocols/mqtt/tcp/main/CMakeLists.txt b/examples/protocols/mqtt/tcp/main/CMakeLists.txt index 6b03500639..e7392559ee 100644 --- a/examples/protocols/mqtt/tcp/main/CMakeLists.txt +++ b/examples/protocols/mqtt/tcp/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "app_main.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "app_main.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/protocols/mqtt/ws/main/CMakeLists.txt b/examples/protocols/mqtt/ws/main/CMakeLists.txt index 6b03500639..e7392559ee 100644 --- a/examples/protocols/mqtt/ws/main/CMakeLists.txt +++ b/examples/protocols/mqtt/ws/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "app_main.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "app_main.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/protocols/mqtt/wss/main/CMakeLists.txt b/examples/protocols/mqtt/wss/main/CMakeLists.txt index 6b03500639..e7392559ee 100644 --- a/examples/protocols/mqtt/wss/main/CMakeLists.txt +++ b/examples/protocols/mqtt/wss/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "app_main.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "app_main.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/protocols/openssl_client/main/CMakeLists.txt b/examples/protocols/openssl_client/main/CMakeLists.txt index d8e15c98cd..c7a8b33d91 100644 --- a/examples/protocols/openssl_client/main/CMakeLists.txt +++ b/examples/protocols/openssl_client/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "openssl_client_example_main.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "openssl_client_example_main.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/protocols/openssl_server/main/CMakeLists.txt b/examples/protocols/openssl_server/main/CMakeLists.txt index 07b57ef293..713b0cddf2 100644 --- a/examples/protocols/openssl_server/main/CMakeLists.txt +++ b/examples/protocols/openssl_server/main/CMakeLists.txt @@ -1,8 +1,4 @@ -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() +idf_component_register(SRCS "openssl_server_example_main.c" + INCLUDE_DIRS "." + EMBED_TXTFILES cacert.pem prvtkey.pem) \ No newline at end of file diff --git a/examples/protocols/pppos_client/components/modem/CMakeLists.txt b/examples/protocols/pppos_client/components/modem/CMakeLists.txt index 1b1272ec2f..e1bc2c0a97 100644 --- a/examples/protocols/pppos_client/components/modem/CMakeLists.txt +++ b/examples/protocols/pppos_client/components/modem/CMakeLists.txt @@ -1,12 +1,8 @@ -set(COMPONENT_ADD_INCLUDEDIRS .) +set(srcs "src/esp_modem.c" + "src/esp_modem_dce_service" + "src/sim800.c" + "src/bg96.c") -set(COMPONENT_SRCS "src/esp_modem.c" - "src/esp_modem_dce_service" - "src/sim800.c" - "src/bg96.c") - -set(COMPONENT_ADD_INCLUDEDIRS "include") - -set(COMPONENT_REQUIRES driver) - -register_component() +idf_component_register(SRCS "${srcs}" + INCLUDE_DIRS include + REQUIRES driver) \ No newline at end of file diff --git a/examples/protocols/pppos_client/main/CMakeLists.txt b/examples/protocols/pppos_client/main/CMakeLists.txt index e4ef1373fa..048a7246cd 100644 --- a/examples/protocols/pppos_client/main/CMakeLists.txt +++ b/examples/protocols/pppos_client/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "pppos_client_main.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "pppos_client_main.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/protocols/sntp/main/CMakeLists.txt b/examples/protocols/sntp/main/CMakeLists.txt index c7c035ca03..e06a3359f6 100644 --- a/examples/protocols/sntp/main/CMakeLists.txt +++ b/examples/protocols/sntp/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "sntp_example_main.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "sntp_example_main.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/protocols/sockets/tcp_client/main/CMakeLists.txt b/examples/protocols/sockets/tcp_client/main/CMakeLists.txt index be11f2950f..f1688dcb46 100644 --- a/examples/protocols/sockets/tcp_client/main/CMakeLists.txt +++ b/examples/protocols/sockets/tcp_client/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "tcp_client.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "tcp_client.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/protocols/sockets/tcp_server/main/CMakeLists.txt b/examples/protocols/sockets/tcp_server/main/CMakeLists.txt index 844a71574c..1565c7bc30 100644 --- a/examples/protocols/sockets/tcp_server/main/CMakeLists.txt +++ b/examples/protocols/sockets/tcp_server/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "tcp_server.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "tcp_server.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/protocols/sockets/udp_client/main/CMakeLists.txt b/examples/protocols/sockets/udp_client/main/CMakeLists.txt index aadad8c208..adc109a104 100644 --- a/examples/protocols/sockets/udp_client/main/CMakeLists.txt +++ b/examples/protocols/sockets/udp_client/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "udp_client.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "udp_client.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/protocols/sockets/udp_multicast/main/CMakeLists.txt b/examples/protocols/sockets/udp_multicast/main/CMakeLists.txt index d3caeb6ed7..a8b478a68f 100644 --- a/examples/protocols/sockets/udp_multicast/main/CMakeLists.txt +++ b/examples/protocols/sockets/udp_multicast/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "udp_multicast_example_main.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "udp_multicast_example_main.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/protocols/sockets/udp_server/main/CMakeLists.txt b/examples/protocols/sockets/udp_server/main/CMakeLists.txt index 55a6bebdc2..ceb9d65fa5 100644 --- a/examples/protocols/sockets/udp_server/main/CMakeLists.txt +++ b/examples/protocols/sockets/udp_server/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "udp_server.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "udp_server.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/protocols/websocket/main/CMakeLists.txt b/examples/protocols/websocket/main/CMakeLists.txt index caf642155c..bff26f1088 100644 --- a/examples/protocols/websocket/main/CMakeLists.txt +++ b/examples/protocols/websocket/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "websocket_example.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "websocket_example.c" + INCLUDE_DIRS ".") diff --git a/examples/provisioning/ble_prov/main/CMakeLists.txt b/examples/provisioning/ble_prov/main/CMakeLists.txt index 3c44a1a36a..a483b3871f 100644 --- a/examples/provisioning/ble_prov/main/CMakeLists.txt +++ b/examples/provisioning/ble_prov/main/CMakeLists.txt @@ -1,6 +1,4 @@ -set(COMPONENT_SRCS "app_main.c" - "app_prov.c" - "app_prov_handlers.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "app_main.c" + "app_prov.c" + "app_prov_handlers.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/provisioning/console_prov/main/CMakeLists.txt b/examples/provisioning/console_prov/main/CMakeLists.txt index 3c44a1a36a..a483b3871f 100644 --- a/examples/provisioning/console_prov/main/CMakeLists.txt +++ b/examples/provisioning/console_prov/main/CMakeLists.txt @@ -1,6 +1,4 @@ -set(COMPONENT_SRCS "app_main.c" - "app_prov.c" - "app_prov_handlers.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "app_main.c" + "app_prov.c" + "app_prov_handlers.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/provisioning/custom_config/components/custom_provisioning/CMakeLists.txt b/examples/provisioning/custom_config/components/custom_provisioning/CMakeLists.txt index 4e0f61c125..bcffb88bc6 100644 --- a/examples/provisioning/custom_config/components/custom_provisioning/CMakeLists.txt +++ b/examples/provisioning/custom_config/components/custom_provisioning/CMakeLists.txt @@ -1,8 +1,5 @@ -set(COMPONENT_ADD_INCLUDEDIRS include) -set(COMPONENT_PRIV_INCLUDEDIRS proto-c) -set(COMPONENT_SRCS "src/custom_config.c" - "proto-c/custom_config.pb-c.c") - -set(COMPONENT_PRIV_REQUIRES protobuf-c) - -register_component() +idf_component_register(SRCS "src/custom_config.c" + "proto-c/custom_config.pb-c.c" + INCLUDE_DIRS include + PRIV_INCLUDE_DIRS proto-c + PRIV_REQUIRES protobuf-c) \ No newline at end of file diff --git a/examples/provisioning/custom_config/main/CMakeLists.txt b/examples/provisioning/custom_config/main/CMakeLists.txt index 3c44a1a36a..a483b3871f 100644 --- a/examples/provisioning/custom_config/main/CMakeLists.txt +++ b/examples/provisioning/custom_config/main/CMakeLists.txt @@ -1,6 +1,4 @@ -set(COMPONENT_SRCS "app_main.c" - "app_prov.c" - "app_prov_handlers.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "app_main.c" + "app_prov.c" + "app_prov_handlers.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/provisioning/manager/main/CMakeLists.txt b/examples/provisioning/manager/main/CMakeLists.txt index 6b03500639..61fac40e63 100644 --- a/examples/provisioning/manager/main/CMakeLists.txt +++ b/examples/provisioning/manager/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "app_main.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "app_main.c" + INCLUDE_DIRS ".") diff --git a/examples/provisioning/softap_prov/main/CMakeLists.txt b/examples/provisioning/softap_prov/main/CMakeLists.txt index 3c44a1a36a..a483b3871f 100644 --- a/examples/provisioning/softap_prov/main/CMakeLists.txt +++ b/examples/provisioning/softap_prov/main/CMakeLists.txt @@ -1,6 +1,4 @@ -set(COMPONENT_SRCS "app_main.c" - "app_prov.c" - "app_prov_handlers.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "app_main.c" + "app_prov.c" + "app_prov_handlers.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/storage/nvs_rw_blob/main/CMakeLists.txt b/examples/storage/nvs_rw_blob/main/CMakeLists.txt index 675c11a0e9..a267ebda53 100644 --- a/examples/storage/nvs_rw_blob/main/CMakeLists.txt +++ b/examples/storage/nvs_rw_blob/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "nvs_blob_example_main.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "nvs_blob_example_main.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/storage/nvs_rw_value/main/CMakeLists.txt b/examples/storage/nvs_rw_value/main/CMakeLists.txt index 1383460018..6690649ca0 100644 --- a/examples/storage/nvs_rw_value/main/CMakeLists.txt +++ b/examples/storage/nvs_rw_value/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "nvs_value_example_main.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "nvs_value_example_main.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/storage/partition_api/partition_find/main/CMakeLists.txt b/examples/storage/partition_api/partition_find/main/CMakeLists.txt index 695e65e746..b2d392b5d4 100644 --- a/examples/storage/partition_api/partition_find/main/CMakeLists.txt +++ b/examples/storage/partition_api/partition_find/main/CMakeLists.txt @@ -1,6 +1,3 @@ -set(COMPONENT_SRCS "main.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -set(COMPONENT_EMBED_TXTFILES ../partitions_example.csv) - -register_component() +idf_component_register(SRCS "main.c" + INCLUDE_DIRS "." + EMBED_TXTFILES ../partitions_example.csv) \ No newline at end of file diff --git a/examples/storage/partition_api/partition_mmap/main/CMakeLists.txt b/examples/storage/partition_api/partition_mmap/main/CMakeLists.txt index 85970762ab..e0287b7b9e 100644 --- a/examples/storage/partition_api/partition_mmap/main/CMakeLists.txt +++ b/examples/storage/partition_api/partition_mmap/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "main.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "main.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/storage/partition_api/partition_ops/main/CMakeLists.txt b/examples/storage/partition_api/partition_ops/main/CMakeLists.txt index 85970762ab..e0287b7b9e 100644 --- a/examples/storage/partition_api/partition_ops/main/CMakeLists.txt +++ b/examples/storage/partition_api/partition_ops/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "main.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "main.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/storage/parttool/main/CMakeLists.txt b/examples/storage/parttool/main/CMakeLists.txt index a574d5ffe6..6056a42f9f 100644 --- a/examples/storage/parttool/main/CMakeLists.txt +++ b/examples/storage/parttool/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "parttool_main.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() \ No newline at end of file +idf_component_register(SRCS "parttool_main.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/storage/sd_card/main/CMakeLists.txt b/examples/storage/sd_card/main/CMakeLists.txt index d0a4b53d93..439aa90025 100644 --- a/examples/storage/sd_card/main/CMakeLists.txt +++ b/examples/storage/sd_card/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "sd_card_example_main.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "sd_card_example_main.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/storage/semihost_vfs/main/CMakeLists.txt b/examples/storage/semihost_vfs/main/CMakeLists.txt index 34d60ad45e..aabc5a454f 100644 --- a/examples/storage/semihost_vfs/main/CMakeLists.txt +++ b/examples/storage/semihost_vfs/main/CMakeLists.txt @@ -1,4 +1,5 @@ -set(COMPONENT_SRCS "semihost_vfs_example_main.c") +set(COMPONENT_SRCS ) set(COMPONENT_ADD_INCLUDEDIRS ".") -register_component() +idf_component_register(SRCS "semihost_vfs_example_main.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/storage/spiffs/main/CMakeLists.txt b/examples/storage/spiffs/main/CMakeLists.txt index 8d041d56d1..026db13131 100644 --- a/examples/storage/spiffs/main/CMakeLists.txt +++ b/examples/storage/spiffs/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "spiffs_example_main.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "spiffs_example_main.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/storage/spiffsgen/main/CMakeLists.txt b/examples/storage/spiffsgen/main/CMakeLists.txt index fdae02e50f..6153893c3c 100644 --- a/examples/storage/spiffsgen/main/CMakeLists.txt +++ b/examples/storage/spiffsgen/main/CMakeLists.txt @@ -1,7 +1,5 @@ -set(COMPONENT_SRCS "spiffsgen_example_main.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "spiffsgen_example_main.c" + INCLUDE_DIRS ".") # Create a SPIFFS image from the contents of the 'spiffs_image' directory # that fits the partition named 'storage'. FLASH_IN_PROJECT indicates that diff --git a/examples/storage/wear_levelling/main/CMakeLists.txt b/examples/storage/wear_levelling/main/CMakeLists.txt index e344e9a767..c92569631f 100644 --- a/examples/storage/wear_levelling/main/CMakeLists.txt +++ b/examples/storage/wear_levelling/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "wear_levelling_example_main.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "wear_levelling_example_main.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/system/app_trace_to_host/main/CMakeLists.txt b/examples/system/app_trace_to_host/main/CMakeLists.txt index 767689da75..b8adc44f73 100644 --- a/examples/system/app_trace_to_host/main/CMakeLists.txt +++ b/examples/system/app_trace_to_host/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "app_trace_to_host_example_main.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "app_trace_to_host_example_main.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/system/base_mac_address/main/CMakeLists.txt b/examples/system/base_mac_address/main/CMakeLists.txt index 364317db42..ab68da3e75 100644 --- a/examples/system/base_mac_address/main/CMakeLists.txt +++ b/examples/system/base_mac_address/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "base_mac_address_example_main.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "base_mac_address_example_main.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/system/console/components/cmd_nvs/CMakeLists.txt b/examples/system/console/components/cmd_nvs/CMakeLists.txt index 7c2d3c7d04..ab8257f9ca 100644 --- a/examples/system/console/components/cmd_nvs/CMakeLists.txt +++ b/examples/system/console/components/cmd_nvs/CMakeLists.txt @@ -1,7 +1,3 @@ -set(COMPONENT_ADD_INCLUDEDIRS .) - -set(COMPONENT_SRCS "cmd_nvs.c") - -set(COMPONENT_REQUIRES console nvs_flash) - -register_component() +idf_component_register(SRCS "cmd_nvs.c" + INCLUDE_DIRS . + REQUIRES console nvs_flash) \ No newline at end of file diff --git a/examples/system/console/components/cmd_system/CMakeLists.txt b/examples/system/console/components/cmd_system/CMakeLists.txt index b45a40c31b..ff4612b959 100644 --- a/examples/system/console/components/cmd_system/CMakeLists.txt +++ b/examples/system/console/components/cmd_system/CMakeLists.txt @@ -1,7 +1,3 @@ -set(COMPONENT_ADD_INCLUDEDIRS .) - -set(COMPONENT_SRCS "cmd_system.c") - -set(COMPONENT_REQUIRES console spi_flash) - -register_component() +idf_component_register(SRCS "cmd_system.c" + INCLUDE_DIRS . + REQUIRES console spi_flash) \ No newline at end of file diff --git a/examples/system/console/main/CMakeLists.txt b/examples/system/console/main/CMakeLists.txt index b285886390..5afdb190ad 100644 --- a/examples/system/console/main/CMakeLists.txt +++ b/examples/system/console/main/CMakeLists.txt @@ -1,5 +1,3 @@ -set(COMPONENT_SRCS "cmd_wifi.c" - "console_example_main.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "cmd_wifi.c" + "console_example_main.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/system/cpp_exceptions/main/CMakeLists.txt b/examples/system/cpp_exceptions/main/CMakeLists.txt index f735cc5a64..6668d4f291 100644 --- a/examples/system/cpp_exceptions/main/CMakeLists.txt +++ b/examples/system/cpp_exceptions/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "exception_example_main.cpp") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "exception_example_main.cpp" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/system/cpp_pthread/main/CMakeLists.txt b/examples/system/cpp_pthread/main/CMakeLists.txt index f95c5997c7..f4c4d218e0 100644 --- a/examples/system/cpp_pthread/main/CMakeLists.txt +++ b/examples/system/cpp_pthread/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "cpp_pthread.cpp") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "cpp_pthread.cpp" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/system/deep_sleep/main/CMakeLists.txt b/examples/system/deep_sleep/main/CMakeLists.txt index e99ca4de9d..c64fc7ac48 100644 --- a/examples/system/deep_sleep/main/CMakeLists.txt +++ b/examples/system/deep_sleep/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "deep_sleep_example_main.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "deep_sleep_example_main.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/system/esp_event/default_event_loop/main/CMakeLists.txt b/examples/system/esp_event/default_event_loop/main/CMakeLists.txt index 85970762ab..e0287b7b9e 100644 --- a/examples/system/esp_event/default_event_loop/main/CMakeLists.txt +++ b/examples/system/esp_event/default_event_loop/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "main.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "main.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/system/esp_event/user_event_loops/main/CMakeLists.txt b/examples/system/esp_event/user_event_loops/main/CMakeLists.txt index 85970762ab..e0287b7b9e 100644 --- a/examples/system/esp_event/user_event_loops/main/CMakeLists.txt +++ b/examples/system/esp_event/user_event_loops/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "main.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "main.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/system/esp_timer/main/CMakeLists.txt b/examples/system/esp_timer/main/CMakeLists.txt index 09db9ec296..eefc6db70d 100644 --- a/examples/system/esp_timer/main/CMakeLists.txt +++ b/examples/system/esp_timer/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "esp_timer_example_main.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "esp_timer_example_main.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/system/freertos/real_time_stats/main/CMakeLists.txt b/examples/system/freertos/real_time_stats/main/CMakeLists.txt index 85970762ab..e0287b7b9e 100644 --- a/examples/system/freertos/real_time_stats/main/CMakeLists.txt +++ b/examples/system/freertos/real_time_stats/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "main.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "main.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/system/gcov/main/CMakeLists.txt b/examples/system/gcov/main/CMakeLists.txt index 8c9cbd3eaf..0da58c5e1e 100644 --- a/examples/system/gcov/main/CMakeLists.txt +++ b/examples/system/gcov/main/CMakeLists.txt @@ -1,8 +1,6 @@ -set(COMPONENT_SRCS "gcov_example.c" - "gcov_example_func.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "gcov_example.c" + "gcov_example_func.c" + INCLUDE_DIRS ".") set_source_files_properties(gcov_example.c PROPERTIES COMPILE_FLAGS diff --git a/examples/system/himem/main/CMakeLists.txt b/examples/system/himem/main/CMakeLists.txt index a875dec50c..780e49a35c 100644 --- a/examples/system/himem/main/CMakeLists.txt +++ b/examples/system/himem/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "himem_test_main.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "himem_test_main.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/system/light_sleep/main/CMakeLists.txt b/examples/system/light_sleep/main/CMakeLists.txt index fc813fb9ea..36b6c93cc1 100644 --- a/examples/system/light_sleep/main/CMakeLists.txt +++ b/examples/system/light_sleep/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "light_sleep_example_main.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "light_sleep_example_main.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/system/network_tests/main/CMakeLists.txt b/examples/system/network_tests/main/CMakeLists.txt index c16f42adb9..f379bf03a2 100644 --- a/examples/system/network_tests/main/CMakeLists.txt +++ b/examples/system/network_tests/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "net_suite.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "net_suite.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/system/ota/advanced_https_ota/main/CMakeLists.txt b/examples/system/ota/advanced_https_ota/main/CMakeLists.txt index 19abec788c..f24c785feb 100644 --- a/examples/system/ota/advanced_https_ota/main/CMakeLists.txt +++ b/examples/system/ota/advanced_https_ota/main/CMakeLists.txt @@ -1,9 +1,4 @@ -set(COMPONENT_SRCS "advanced_https_ota_example.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - - -# Embed the server root certificate into the final binary -idf_build_get_property(project_dir PROJECT_DIR) -set(COMPONENT_EMBED_TXTFILES ${project_dir}/server_certs/ca_cert.pem) - -register_component() +idf_component_register(SRCS "advanced_https_ota_example.c" + INCLUDE_DIRS "." + # Embed the server root certificate into the final binary + EMBED_TXTFILES ${project_dir}/server_certs/ca_cert.pem) diff --git a/examples/system/ota/native_ota_example/main/CMakeLists.txt b/examples/system/ota/native_ota_example/main/CMakeLists.txt index 1e5d1ed0f5..c09881022c 100644 --- a/examples/system/ota/native_ota_example/main/CMakeLists.txt +++ b/examples/system/ota/native_ota_example/main/CMakeLists.txt @@ -1,8 +1,5 @@ -set(COMPONENT_SRCS "native_ota_example.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - # Embed the server root certificate into the final binary idf_build_get_property(project_dir PROJECT_DIR) -set(COMPONENT_EMBED_TXTFILES ${project_dir}/server_certs/ca_cert.pem) - -register_component() +idf_component_register(SRCS "native_ota_example.c" + INCLUDE_DIRS "." + EMBED_TXTFILES ${project_dir}/server_certs/ca_cert.pem) \ No newline at end of file diff --git a/examples/system/ota/otatool/main/CMakeLists.txt b/examples/system/ota/otatool/main/CMakeLists.txt index 2dc1cb53a0..4c341608ea 100644 --- a/examples/system/ota/otatool/main/CMakeLists.txt +++ b/examples/system/ota/otatool/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "otatool_main.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "otatool_main.c" + INCLUDE_DIRS ".") \ 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 index c5db485eff..f8c5c183cf 100644 --- a/examples/system/ota/simple_ota_example/main/CMakeLists.txt +++ b/examples/system/ota/simple_ota_example/main/CMakeLists.txt @@ -1,9 +1,5 @@ -set(COMPONENT_SRCS "simple_ota_example.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - - # Embed the server root certificate into the final binary idf_build_get_property(project_dir PROJECT_DIR) -set(COMPONENT_EMBED_TXTFILES ${project_dir}/server_certs/ca_cert.pem) - -register_component() +idf_component_register(SRCS "simple_ota_example.c" + INCLUDE_DIRS "." + EMBED_TXTFILES ${project_dir}/server_certs/ca_cert.pem) diff --git a/examples/system/select/main/CMakeLists.txt b/examples/system/select/main/CMakeLists.txt index bf59f84c44..3dd427e874 100644 --- a/examples/system/select/main/CMakeLists.txt +++ b/examples/system/select/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "select_example.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "select_example.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/system/sysview_tracing/main/CMakeLists.txt b/examples/system/sysview_tracing/main/CMakeLists.txt index dfee658c9a..a23c5937bc 100644 --- a/examples/system/sysview_tracing/main/CMakeLists.txt +++ b/examples/system/sysview_tracing/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "sysview_tracing.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "sysview_tracing.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/system/sysview_tracing_heap_log/main/CMakeLists.txt b/examples/system/sysview_tracing_heap_log/main/CMakeLists.txt index 58d592c8b2..689bafd3ba 100644 --- a/examples/system/sysview_tracing_heap_log/main/CMakeLists.txt +++ b/examples/system/sysview_tracing_heap_log/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "sysview_heap_log.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "sysview_heap_log.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/system/task_watchdog/main/CMakeLists.txt b/examples/system/task_watchdog/main/CMakeLists.txt index ef06f3cc55..e805c40ac1 100644 --- a/examples/system/task_watchdog/main/CMakeLists.txt +++ b/examples/system/task_watchdog/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "task_watchdog_example_main.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "task_watchdog_example_main.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/system/ulp/main/CMakeLists.txt b/examples/system/ulp/main/CMakeLists.txt index d426857dc6..af7cb3f765 100644 --- a/examples/system/ulp/main/CMakeLists.txt +++ b/examples/system/ulp/main/CMakeLists.txt @@ -1,10 +1,6 @@ -# Set usual component variables -set(COMPONENT_SRCS "ulp_example_main.c") -set(COMPONENT_ADD_INCLUDEDIRS "") -set(COMPONENT_REQUIRES soc nvs_flash ulp) - -register_component() - +idf_component_register(SRCS "ulp_example_main.c" + INCLUDE_DIRS "" + REQUIRES soc nvs_flash ulp) # # ULP support additions to component CMakeLists.txt. # diff --git a/examples/system/ulp_adc/main/CMakeLists.txt b/examples/system/ulp_adc/main/CMakeLists.txt index 5f64763179..ef85f9b2fd 100644 --- a/examples/system/ulp_adc/main/CMakeLists.txt +++ b/examples/system/ulp_adc/main/CMakeLists.txt @@ -1,10 +1,6 @@ -# Set usual component variables -set(COMPONENT_SRCS "ulp_adc_example_main.c") -set(COMPONENT_ADD_INCLUDEDIRS "") -set(COMPONENT_REQUIRES soc nvs_flash ulp driver) - -register_component() - +idf_component_register(SRCS "ulp_adc_example_main.c" + INCLUDE_DIRS "" + REQUIRES soc nvs_flash ulp driver) # # ULP support additions to component CMakeLists.txt. # @@ -22,4 +18,4 @@ set(ulp_exp_dep_srcs "ulp_adc_example_main.c") # # 4. Call function to build ULP binary and embed in project using the argument # values above. -ulp_embed_binary(${ulp_app_name} ${ulp_s_sources} ${ulp_exp_dep_srcs}) \ No newline at end of file +ulp_embed_binary(${ulp_app_name} ${ulp_s_sources} ${ulp_exp_dep_srcs}) diff --git a/examples/system/unit_test/components/testable/CMakeLists.txt b/examples/system/unit_test/components/testable/CMakeLists.txt index 1df93d6d88..59adfac9d6 100644 --- a/examples/system/unit_test/components/testable/CMakeLists.txt +++ b/examples/system/unit_test/components/testable/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "mean.c") -set(COMPONENT_ADD_INCLUDEDIRS "include") - -register_component() +idf_component_register(SRCS "mean.c" + INCLUDE_DIRS "include") \ No newline at end of file diff --git a/examples/system/unit_test/components/testable/test/CMakeLists.txt b/examples/system/unit_test/components/testable/test/CMakeLists.txt index bbb5b276da..33dded71ae 100644 --- a/examples/system/unit_test/components/testable/test/CMakeLists.txt +++ b/examples/system/unit_test/components/testable/test/CMakeLists.txt @@ -1,6 +1,3 @@ -set(COMPONENT_SRCDIRS ".") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -set(COMPONENT_REQUIRES unity testable) - -register_component() +idf_component_register(SRC_DIRS "." + INCLUDE_DIRS "." + REQUIRES unity testable) \ No newline at end of file diff --git a/examples/system/unit_test/main/CMakeLists.txt b/examples/system/unit_test/main/CMakeLists.txt index f726378150..0631174b7c 100644 --- a/examples/system/unit_test/main/CMakeLists.txt +++ b/examples/system/unit_test/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "example_unit_test_main.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "example_unit_test_main.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/system/unit_test/test/main/CMakeLists.txt b/examples/system/unit_test/test/main/CMakeLists.txt index b849174c77..8a4d168eac 100644 --- a/examples/system/unit_test/test/main/CMakeLists.txt +++ b/examples/system/unit_test/test/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "example_unit_test_test.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "example_unit_test_test.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/wifi/espnow/main/CMakeLists.txt b/examples/wifi/espnow/main/CMakeLists.txt index 151eab724b..c752a271b6 100644 --- a/examples/wifi/espnow/main/CMakeLists.txt +++ b/examples/wifi/espnow/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "espnow_example_main.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "espnow_example_main.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/wifi/getting_started/softAP/main/CMakeLists.txt b/examples/wifi/getting_started/softAP/main/CMakeLists.txt index 6724060715..a89388299c 100644 --- a/examples/wifi/getting_started/softAP/main/CMakeLists.txt +++ b/examples/wifi/getting_started/softAP/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "softap_example_main.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "softap_example_main.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/wifi/getting_started/station/main/CMakeLists.txt b/examples/wifi/getting_started/station/main/CMakeLists.txt index 3cd1031283..444b0f59f1 100644 --- a/examples/wifi/getting_started/station/main/CMakeLists.txt +++ b/examples/wifi/getting_started/station/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "station_example_main.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "station_example_main.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/wifi/iperf/components/iperf/CMakeLists.txt b/examples/wifi/iperf/components/iperf/CMakeLists.txt index 11a8f571e2..29cca1e3ec 100644 --- a/examples/wifi/iperf/components/iperf/CMakeLists.txt +++ b/examples/wifi/iperf/components/iperf/CMakeLists.txt @@ -1,7 +1,3 @@ -set(COMPONENT_ADD_INCLUDEDIRS .) - -set(COMPONENT_SRCS "iperf.c") - -set(COMPONENT_REQUIRES lwip) - -register_component() +idf_component_register(SRCS "iperf.c" + INCLUDE_DIRS . + REQUIRES lwip) \ No newline at end of file diff --git a/examples/wifi/iperf/main/CMakeLists.txt b/examples/wifi/iperf/main/CMakeLists.txt index e94ff94b07..978cc99e0e 100644 --- a/examples/wifi/iperf/main/CMakeLists.txt +++ b/examples/wifi/iperf/main/CMakeLists.txt @@ -1,5 +1,3 @@ -set(COMPONENT_SRCS "cmd_wifi.c" - "iperf_example_main.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "cmd_wifi.c" + "iperf_example_main.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/wifi/power_save/main/CMakeLists.txt b/examples/wifi/power_save/main/CMakeLists.txt index f7fc34d94a..e02dc88c90 100644 --- a/examples/wifi/power_save/main/CMakeLists.txt +++ b/examples/wifi/power_save/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "power_save.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "power_save.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/wifi/scan/main/CMakeLists.txt b/examples/wifi/scan/main/CMakeLists.txt index 0b789863af..9719433b43 100644 --- a/examples/wifi/scan/main/CMakeLists.txt +++ b/examples/wifi/scan/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "scan.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "scan.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/wifi/simple_sniffer/components/pcap/CMakeLists.txt b/examples/wifi/simple_sniffer/components/pcap/CMakeLists.txt index 15f5b5da63..ca59591e53 100644 --- a/examples/wifi/simple_sniffer/components/pcap/CMakeLists.txt +++ b/examples/wifi/simple_sniffer/components/pcap/CMakeLists.txt @@ -1,5 +1,2 @@ -set(COMPONENT_ADD_INCLUDEDIRS .) - -set(COMPONENT_SRCS "pcap.c") - -register_component() +idf_component_register(SRCS "pcap.c" + INCLUDE_DIRS .) \ No newline at end of file diff --git a/examples/wifi/simple_sniffer/main/CMakeLists.txt b/examples/wifi/simple_sniffer/main/CMakeLists.txt index 8e95d42fc3..9e14ddef0d 100644 --- a/examples/wifi/simple_sniffer/main/CMakeLists.txt +++ b/examples/wifi/simple_sniffer/main/CMakeLists.txt @@ -1,10 +1,3 @@ - -# 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(COMPONENT_SRCS "simple_sniffer_example_main.c" - "cmd_sniffer.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "simple_sniffer_example_main.c" + "cmd_sniffer.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/wifi/smart_config/main/CMakeLists.txt b/examples/wifi/smart_config/main/CMakeLists.txt index a716681e47..5f956d6660 100644 --- a/examples/wifi/smart_config/main/CMakeLists.txt +++ b/examples/wifi/smart_config/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "smartconfig_main.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "smartconfig_main.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/wifi/wpa2_enterprise/main/CMakeLists.txt b/examples/wifi/wpa2_enterprise/main/CMakeLists.txt index 10640a32db..1c847a1f62 100644 --- a/examples/wifi/wpa2_enterprise/main/CMakeLists.txt +++ b/examples/wifi/wpa2_enterprise/main/CMakeLists.txt @@ -1,8 +1,4 @@ -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() +idf_component_register(SRCS "wpa2_enterprise_main.c" + INCLUDE_DIRS "." + EMBED_TXTFILES wpa2_ca.pem wpa2_client.crt wpa2_client.key) \ No newline at end of file diff --git a/examples/wifi/wps/main/CMakeLists.txt b/examples/wifi/wps/main/CMakeLists.txt index c0a1063f66..5ca4a9211f 100644 --- a/examples/wifi/wps/main/CMakeLists.txt +++ b/examples/wifi/wps/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "wps.c") -set(COMPONENT_ADD_INCLUDEDIRS ".") - -register_component() +idf_component_register(SRCS "wps.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/tools/cmake/convert_to_cmake.py b/tools/cmake/convert_to_cmake.py index 80d9296d62..0ba7fa62f5 100755 --- a/tools/cmake/convert_to_cmake.py +++ b/tools/cmake/convert_to_cmake.py @@ -161,17 +161,14 @@ def convert_component(project_path, component_path): cflags = v.get("CFLAGS", None) with open(cmakelists_path, "w") as f: - f.write("set(COMPONENT_ADD_INCLUDEDIRS %s)\n\n" % component_add_includedirs) - - f.write("# Edit following two lines to set component requirements (see docs)\n") - f.write("set(COMPONENT_REQUIRES "")\n") - f.write("set(COMPONENT_PRIV_REQUIRES "")\n\n") - if component_srcs is not None: - f.write("set(COMPONENT_SRCS %s)\n\n" % component_srcs) - f.write("register_component()\n") + f.write("idf_component_register(SRCS %s)\n" % component_srcs) + f.write(" INCLUDE_DIRS %s" % component_add_includedirs) + f.write(" # Edit following two lines to set component requirements (see docs)\n") + f.write(" REQUIRES "")\n") + f.write(" PRIV_REQUIRES "")\n\n") else: - f.write("register_config_only_component()\n") + f.write("idf_component_register()\n") if cflags is not None: f.write("target_compile_options(${COMPONENT_LIB} PRIVATE %s)\n" % cflags) diff --git a/tools/unit-test-app/components/test_utils/CMakeLists.txt b/tools/unit-test-app/components/test_utils/CMakeLists.txt index 50efbdbbb7..7932a10a68 100644 --- a/tools/unit-test-app/components/test_utils/CMakeLists.txt +++ b/tools/unit-test-app/components/test_utils/CMakeLists.txt @@ -1,9 +1,6 @@ -set(COMPONENT_SRCS "ref_clock.c" - "test_runner.c" - "test_utils.c") -set(COMPONENT_ADD_INCLUDEDIRS include) - -set(COMPONENT_REQUIRES spi_flash idf_test unity) - -register_component() +idf_component_register(SRCS "ref_clock.c" + "test_runner.c" + "test_utils.c" + INCLUDE_DIRS include + REQUIRES spi_flash idf_test unity) diff --git a/tools/unit-test-app/main/CMakeLists.txt b/tools/unit-test-app/main/CMakeLists.txt index 47f681d36a..95f9935aa9 100644 --- a/tools/unit-test-app/main/CMakeLists.txt +++ b/tools/unit-test-app/main/CMakeLists.txt @@ -1,4 +1,2 @@ -set(COMPONENT_SRCS "app_main.c") -set(COMPONENT_ADD_INCLUDEDIRS "") - -register_component() +idf_component_register(SRCS "app_main.c" + INCLUDE_DIRS "") \ No newline at end of file