diff --git a/components/app_trace/CMakeLists.txt b/components/app_trace/CMakeLists.txt index 5a6f19dbb..56ad26369 100644 --- a/components/app_trace/CMakeLists.txt +++ b/components/app_trace/CMakeLists.txt @@ -1,4 +1,7 @@ -set(COMPONENT_SRCDIRS "." "gcov") +set(COMPONENT_SRCS "app_trace.c" + "app_trace_util.c" + "gcov/gcov_rtio.c" + "host_file_io.c") set(COMPONENT_ADD_INCLUDEDIRS "include") if(CONFIG_SYSVIEW_ENABLE) @@ -7,11 +10,10 @@ if(CONFIG_SYSVIEW_ENABLE) sys_view/SEGGER sys_view/Sample/OS) - list(APPEND COMPONENT_SRCDIRS - "sys_view/SEGGER" - "sys_view/Sample/OS" - "sys_view/Sample/Config" - "sys_view/esp32") + set(COMPONENT_SRCS "SEGGER/SEGGER_SYSVIEW.c" + "esp32/SEGGER_RTT_esp32.c" + "Sample/Config/SEGGER_SYSVIEW_Config_FreeRTOS.c" + "Sample/OS/SEGGER_SYSVIEW_FreeRTOS.c") endif() set(COMPONENT_REQUIRES) diff --git a/components/app_update/CMakeLists.txt b/components/app_update/CMakeLists.txt index b69d109b8..ef2684a2c 100644 --- a/components/app_update/CMakeLists.txt +++ b/components/app_update/CMakeLists.txt @@ -1,4 +1,4 @@ -set(COMPONENT_SRCDIRS ".") +set(COMPONENT_SRCS "esp_ota_ops.c") set(COMPONENT_ADD_INCLUDEDIRS "include") set(COMPONENT_REQUIRES spi_flash partition_table) diff --git a/components/asio/CMakeLists.txt b/components/asio/CMakeLists.txt index 9be66380e..43d428f8d 100644 --- a/components/asio/CMakeLists.txt +++ b/components/asio/CMakeLists.txt @@ -1,7 +1,5 @@ set(COMPONENT_ADD_INCLUDEDIRS asio/asio/include port/include) -set(COMPONENT_SRCDIRS asio/asio/src) - -set(COMPONENT_SRCEXCLUDE asio/asio/src/asio_ssl.cpp) +set(COMPONENT_SRCS "asio/asio/src/asio.cpp") set(COMPONENT_REQUIRES lwip) diff --git a/components/aws_iot/CMakeLists.txt b/components/aws_iot/CMakeLists.txt index f7644bd7a..79a973bca 100644 --- a/components/aws_iot/CMakeLists.txt +++ b/components/aws_iot/CMakeLists.txt @@ -1,6 +1,25 @@ if(CONFIG_AWS_IOT_SDK) set(COMPONENT_ADD_INCLUDEDIRS "include aws-iot-device-sdk-embedded-C/include") - set(COMPONENT_SRCDIRS "aws-iot-device-sdk-embedded-C/src port") + set(aws_sdk_dir aws-iot-device-sdk-embedded-C/src) + set(COMPONENT_SRCS "${aws_sdk_dir}/aws_iot_jobs_interface.c" + "${aws_sdk_dir}/aws_iot_jobs_json.c" + "${aws_sdk_dir}/aws_iot_jobs_topics.c" + "${aws_sdk_dir}/aws_iot_jobs_types.c" + "${aws_sdk_dir}/aws_iot_json_utils.c" + "${aws_sdk_dir}/aws_iot_mqtt_client.c" + "${aws_sdk_dir}/aws_iot_mqtt_client_common_internal.c" + "${aws_sdk_dir}/aws_iot_mqtt_client_connect.c" + "${aws_sdk_dir}/aws_iot_mqtt_client_publish.c" + "${aws_sdk_dir}/aws_iot_mqtt_client_subscribe.c" + "${aws_sdk_dir}/aws_iot_mqtt_client_unsubscribe.c" + "${aws_sdk_dir}/aws_iot_mqtt_client_yield.c" + "${aws_sdk_dir}/aws_iot_shadow.c" + "${aws_sdk_dir}/aws_iot_shadow_actions.c" + "${aws_sdk_dir}/aws_iot_shadow_json.c" + "${aws_sdk_dir}/aws_iot_shadow_records.c" + "port/network_mbedtls_wrapper.c" + "port/threads_freertos.c" + "port/timer.c") else() message(STATUS "Building empty aws_iot component due to configuration") endif() diff --git a/components/bootloader/subproject/CMakeLists.txt b/components/bootloader/subproject/CMakeLists.txt index 7a34d8ea2..6d3c44c44 100644 --- a/components/bootloader/subproject/CMakeLists.txt +++ b/components/bootloader/subproject/CMakeLists.txt @@ -10,14 +10,12 @@ if(NOT IDF_PATH) "in by the parent build process.") endif() -set(COMPONENTS bootloader esptool_py esp32 partition_table soc bootloader_support log spi_flash micro-ecc soc) +set(COMPONENTS bootloader esptool_py esp32 partition_table soc bootloader_support log spi_flash micro-ecc soc main) set(BOOTLOADER_BUILD 1) add_definitions(-DBOOTLOADER_BUILD=1) set(COMPONENT_REQUIRES_COMMON log esp32 soc) -set(MAIN_SRCS main/bootloader_start.c) - include("${IDF_PATH}/tools/cmake/project.cmake") project(bootloader) diff --git a/components/bootloader/subproject/main/CMakeLists.txt b/components/bootloader/subproject/main/CMakeLists.txt new file mode 100644 index 000000000..d090e9757 --- /dev/null +++ b/components/bootloader/subproject/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "bootloader_start.c") +set(COMPONENT_ADD_INCLUDEDIRS "") +set(COMPONENT_REQUIRES "bootloader bootloader_support") +register_component() diff --git a/components/bootloader_support/CMakeLists.txt b/components/bootloader_support/CMakeLists.txt index bc610eb96..50aca978c 100644 --- a/components/bootloader_support/CMakeLists.txt +++ b/components/bootloader_support/CMakeLists.txt @@ -1,4 +1,17 @@ -set(COMPONENT_SRCDIRS "src") +set(COMPONENT_SRCS "src/bootloader_clock.c" + "src/bootloader_common.c" + "src/bootloader_flash.c" + "src/bootloader_init.c" + "src/bootloader_random.c" + "src/bootloader_sha.c" + "src/bootloader_utility.c" + "src/efuse.c" + "src/esp_image_format.c" + "src/flash_encrypt.c" + "src/flash_partitions.c" + "src/flash_qio_mode.c" + "src/secure_boot.c" + "src/secure_boot_signatures.c") if(${BOOTLOADER_BUILD}) set(COMPONENT_ADD_INCLUDEDIRS "include include_bootloader") diff --git a/components/bt/CMakeLists.txt b/components/bt/CMakeLists.txt index f64668f9f..df6fa250d 100644 --- a/components/bt/CMakeLists.txt +++ b/components/bt/CMakeLists.txt @@ -1,6 +1,6 @@ if(CONFIG_BT_ENABLED) - set(COMPONENT_SRCDIRS .) + set(COMPONENT_SRCS "bt.c") set(COMPONENT_ADD_INCLUDEDIRS include) if(CONFIG_BLUEDROID_ENABLED) @@ -41,43 +41,234 @@ if(CONFIG_BT_ENABLED) list(APPEND COMPONENT_ADD_INCLUDEDIRS bluedroid/api/include/api) - list(APPEND COMPONENT_SRCDIRS - bluedroid/bta/dm - bluedroid/bta/gatt - bluedroid/bta/hh - bluedroid/bta/sdp - bluedroid/bta/av - bluedroid/bta/ar - bluedroid/bta/sys - bluedroid/bta/jv - bluedroid/device - bluedroid/hci - bluedroid/main - bluedroid/osi - bluedroid/external/sbc/decoder/srce - bluedroid/external/sbc/encoder/srce - bluedroid/btc/core - bluedroid/btc/profile/esp/blufi - bluedroid/btc/profile/std/gap - bluedroid/btc/profile/std/gatt - bluedroid/btc/profile/std/a2dp - bluedroid/btc/profile/std/avrc - bluedroid/btc/profile/std/spp - bluedroid/stack/btm - bluedroid/stack/btu - bluedroid/stack/gap - bluedroid/stack/gatt - bluedroid/stack/hcic - bluedroid/stack/l2cap - bluedroid/stack/sdp - bluedroid/stack/smp - bluedroid/stack/avct - bluedroid/stack/avrc - bluedroid/stack/avdt - bluedroid/stack/a2dp - bluedroid/stack/rfcomm - bluedroid/api - ) + list(APPEND COMPONENT_SRCS "bluedroid/api/esp_a2dp_api.c" + "bluedroid/api/esp_avrc_api.c" + "bluedroid/api/esp_blufi_api.c" + "bluedroid/api/esp_bt_device.c" + "bluedroid/api/esp_bt_main.c" + "bluedroid/api/esp_gap_ble_api.c" + "bluedroid/api/esp_gap_bt_api.c" + "bluedroid/api/esp_gatt_common_api.c" + "bluedroid/api/esp_gattc_api.c" + "bluedroid/api/esp_gatts_api.c" + "bluedroid/api/esp_hf_client_api.c" + "bluedroid/api/esp_spp_api.c" + "bluedroid/bta/ar/bta_ar.c" + "bluedroid/bta/av/bta_av_aact.c" + "bluedroid/bta/av/bta_av_act.c" + "bluedroid/bta/av/bta_av_api.c" + "bluedroid/bta/av/bta_av_cfg.c" + "bluedroid/bta/av/bta_av_ci.c" + "bluedroid/bta/av/bta_av_main.c" + "bluedroid/bta/av/bta_av_sbc.c" + "bluedroid/bta/av/bta_av_ssm.c" + "bluedroid/bta/dm/bta_dm_act.c" + "bluedroid/bta/dm/bta_dm_api.c" + "bluedroid/bta/dm/bta_dm_cfg.c" + "bluedroid/bta/dm/bta_dm_ci.c" + "bluedroid/bta/dm/bta_dm_co.c" + "bluedroid/bta/dm/bta_dm_main.c" + "bluedroid/bta/dm/bta_dm_pm.c" + "bluedroid/bta/dm/bta_dm_sco.c" + "bluedroid/bta/gatt/bta_gatt_common.c" + "bluedroid/bta/gatt/bta_gattc_act.c" + "bluedroid/bta/gatt/bta_gattc_api.c" + "bluedroid/bta/gatt/bta_gattc_cache.c" + "bluedroid/bta/gatt/bta_gattc_ci.c" + "bluedroid/bta/gatt/bta_gattc_co.c" + "bluedroid/bta/gatt/bta_gattc_main.c" + "bluedroid/bta/gatt/bta_gattc_utils.c" + "bluedroid/bta/gatt/bta_gatts_act.c" + "bluedroid/bta/gatt/bta_gatts_api.c" + "bluedroid/bta/gatt/bta_gatts_co.c" + "bluedroid/bta/gatt/bta_gatts_main.c" + "bluedroid/bta/gatt/bta_gatts_utils.c" + "bluedroid/bta/hh/bta_hh_act.c" + "bluedroid/bta/hh/bta_hh_api.c" + "bluedroid/bta/hh/bta_hh_cfg.c" + "bluedroid/bta/hh/bta_hh_le.c" + "bluedroid/bta/hh/bta_hh_main.c" + "bluedroid/bta/hh/bta_hh_utils.c" + "bluedroid/bta/jv/bta_jv_act.c" + "bluedroid/bta/jv/bta_jv_api.c" + "bluedroid/bta/jv/bta_jv_cfg.c" + "bluedroid/bta/jv/bta_jv_main.c" + "bluedroid/bta/sdp/bta_sdp.c" + "bluedroid/bta/sdp/bta_sdp_act.c" + "bluedroid/bta/sdp/bta_sdp_api.c" + "bluedroid/bta/sdp/bta_sdp_cfg.c" + "bluedroid/bta/sys/bta_sys_conn.c" + "bluedroid/bta/sys/bta_sys_main.c" + "bluedroid/bta/sys/utl.c" + "bluedroid/btc/core/btc_alarm.c" + "bluedroid/btc/core/btc_ble_storage.c" + "bluedroid/btc/core/btc_config.c" + "bluedroid/btc/core/btc_dev.c" + "bluedroid/btc/core/btc_dm.c" + "bluedroid/btc/core/btc_main.c" + "bluedroid/btc/core/btc_manage.c" + "bluedroid/btc/core/btc_profile_queue.c" + "bluedroid/btc/core/btc_sec.c" + "bluedroid/btc/core/btc_sm.c" + "bluedroid/btc/core/btc_storage.c" + "bluedroid/btc/core/btc_task.c" + "bluedroid/btc/core/btc_util.c" + "bluedroid/btc/profile/esp/blufi/blufi_prf.c" + "bluedroid/btc/profile/esp/blufi/blufi_protocol.c" + "bluedroid/btc/profile/std/a2dp/bta_av_co.c" + "bluedroid/btc/profile/std/a2dp/btc_a2dp.c" + "bluedroid/btc/profile/std/a2dp/btc_a2dp_control.c" + "bluedroid/btc/profile/std/a2dp/btc_a2dp_sink.c" + "bluedroid/btc/profile/std/a2dp/btc_a2dp_source.c" + "bluedroid/btc/profile/std/a2dp/btc_av.c" + "bluedroid/btc/profile/std/avrc/btc_avrc.c" + "bluedroid/btc/profile/std/gap/btc_gap_ble.c" + "bluedroid/btc/profile/std/gap/btc_gap_bt.c" + "bluedroid/btc/profile/std/gatt/btc_gatt_common.c" + "bluedroid/btc/profile/std/gatt/btc_gatt_util.c" + "bluedroid/btc/profile/std/gatt/btc_gattc.c" + "bluedroid/btc/profile/std/gatt/btc_gatts.c" + "bluedroid/btc/profile/std/spp/btc_spp.c" + "bluedroid/device/bdaddr.c" + "bluedroid/device/controller.c" + "bluedroid/device/interop.c" + "bluedroid/external/sbc/decoder/srce/alloc.c" + "bluedroid/external/sbc/decoder/srce/bitalloc-sbc.c" + "bluedroid/external/sbc/decoder/srce/bitalloc.c" + "bluedroid/external/sbc/decoder/srce/bitstream-decode.c" + "bluedroid/external/sbc/decoder/srce/decoder-oina.c" + "bluedroid/external/sbc/decoder/srce/decoder-private.c" + "bluedroid/external/sbc/decoder/srce/decoder-sbc.c" + "bluedroid/external/sbc/decoder/srce/dequant.c" + "bluedroid/external/sbc/decoder/srce/framing-sbc.c" + "bluedroid/external/sbc/decoder/srce/framing.c" + "bluedroid/external/sbc/decoder/srce/oi_codec_version.c" + "bluedroid/external/sbc/decoder/srce/synthesis-8-generated.c" + "bluedroid/external/sbc/decoder/srce/synthesis-dct8.c" + "bluedroid/external/sbc/decoder/srce/synthesis-sbc.c" + "bluedroid/external/sbc/encoder/srce/sbc_analysis.c" + "bluedroid/external/sbc/encoder/srce/sbc_dct.c" + "bluedroid/external/sbc/encoder/srce/sbc_dct_coeffs.c" + "bluedroid/external/sbc/encoder/srce/sbc_enc_bit_alloc_mono.c" + "bluedroid/external/sbc/encoder/srce/sbc_enc_bit_alloc_ste.c" + "bluedroid/external/sbc/encoder/srce/sbc_enc_coeffs.c" + "bluedroid/external/sbc/encoder/srce/sbc_encoder.c" + "bluedroid/external/sbc/encoder/srce/sbc_packing.c" + "bluedroid/hci/buffer_allocator.c" + "bluedroid/hci/hci_audio.c" + "bluedroid/hci/hci_hal_h4.c" + "bluedroid/hci/hci_layer.c" + "bluedroid/hci/hci_packet_factory.c" + "bluedroid/hci/hci_packet_parser.c" + "bluedroid/hci/packet_fragmenter.c" + "bluedroid/main/bte_init.c" + "bluedroid/main/bte_main.c" + "bluedroid/osi/alarm.c" + "bluedroid/osi/allocator.c" + "bluedroid/osi/buffer.c" + "bluedroid/osi/config.c" + "bluedroid/osi/fixed_queue.c" + "bluedroid/osi/future.c" + "bluedroid/osi/hash_functions.c" + "bluedroid/osi/hash_map.c" + "bluedroid/osi/list.c" + "bluedroid/osi/mutex.c" + "bluedroid/osi/osi.c" + "bluedroid/osi/semaphore.c" + "bluedroid/stack/a2dp/a2d_api.c" + "bluedroid/stack/a2dp/a2d_sbc.c" + "bluedroid/stack/avct/avct_api.c" + "bluedroid/stack/avct/avct_ccb.c" + "bluedroid/stack/avct/avct_l2c.c" + "bluedroid/stack/avct/avct_lcb.c" + "bluedroid/stack/avct/avct_lcb_act.c" + "bluedroid/stack/avdt/avdt_ad.c" + "bluedroid/stack/avdt/avdt_api.c" + "bluedroid/stack/avdt/avdt_ccb.c" + "bluedroid/stack/avdt/avdt_ccb_act.c" + "bluedroid/stack/avdt/avdt_l2c.c" + "bluedroid/stack/avdt/avdt_msg.c" + "bluedroid/stack/avdt/avdt_scb.c" + "bluedroid/stack/avdt/avdt_scb_act.c" + "bluedroid/stack/avrc/avrc_api.c" + "bluedroid/stack/avrc/avrc_bld_ct.c" + "bluedroid/stack/avrc/avrc_bld_tg.c" + "bluedroid/stack/avrc/avrc_opt.c" + "bluedroid/stack/avrc/avrc_pars_ct.c" + "bluedroid/stack/avrc/avrc_pars_tg.c" + "bluedroid/stack/avrc/avrc_sdp.c" + "bluedroid/stack/avrc/avrc_utils.c" + "bluedroid/stack/btm/btm_acl.c" + "bluedroid/stack/btm/btm_ble.c" + "bluedroid/stack/btm/btm_ble_addr.c" + "bluedroid/stack/btm/btm_ble_adv_filter.c" + "bluedroid/stack/btm/btm_ble_batchscan.c" + "bluedroid/stack/btm/btm_ble_bgconn.c" + "bluedroid/stack/btm/btm_ble_cont_energy.c" + "bluedroid/stack/btm/btm_ble_gap.c" + "bluedroid/stack/btm/btm_ble_multi_adv.c" + "bluedroid/stack/btm/btm_ble_privacy.c" + "bluedroid/stack/btm/btm_dev.c" + "bluedroid/stack/btm/btm_devctl.c" + "bluedroid/stack/btm/btm_inq.c" + "bluedroid/stack/btm/btm_main.c" + "bluedroid/stack/btm/btm_pm.c" + "bluedroid/stack/btm/btm_sco.c" + "bluedroid/stack/btm/btm_sec.c" + "bluedroid/stack/btu/btu_hcif.c" + "bluedroid/stack/btu/btu_init.c" + "bluedroid/stack/btu/btu_task.c" + "bluedroid/stack/gap/gap_api.c" + "bluedroid/stack/gap/gap_ble.c" + "bluedroid/stack/gap/gap_conn.c" + "bluedroid/stack/gap/gap_utils.c" + "bluedroid/stack/gatt/att_protocol.c" + "bluedroid/stack/gatt/gatt_api.c" + "bluedroid/stack/gatt/gatt_attr.c" + "bluedroid/stack/gatt/gatt_auth.c" + "bluedroid/stack/gatt/gatt_cl.c" + "bluedroid/stack/gatt/gatt_db.c" + "bluedroid/stack/gatt/gatt_main.c" + "bluedroid/stack/gatt/gatt_sr.c" + "bluedroid/stack/gatt/gatt_utils.c" + "bluedroid/stack/hcic/hciblecmds.c" + "bluedroid/stack/hcic/hcicmds.c" + "bluedroid/stack/l2cap/l2c_api.c" + "bluedroid/stack/l2cap/l2c_ble.c" + "bluedroid/stack/l2cap/l2c_csm.c" + "bluedroid/stack/l2cap/l2c_fcr.c" + "bluedroid/stack/l2cap/l2c_link.c" + "bluedroid/stack/l2cap/l2c_main.c" + "bluedroid/stack/l2cap/l2c_ucd.c" + "bluedroid/stack/l2cap/l2c_utils.c" + "bluedroid/stack/l2cap/l2cap_client.c" + "bluedroid/stack/rfcomm/port_api.c" + "bluedroid/stack/rfcomm/port_rfc.c" + "bluedroid/stack/rfcomm/port_utils.c" + "bluedroid/stack/rfcomm/rfc_l2cap_if.c" + "bluedroid/stack/rfcomm/rfc_mx_fsm.c" + "bluedroid/stack/rfcomm/rfc_port_fsm.c" + "bluedroid/stack/rfcomm/rfc_port_if.c" + "bluedroid/stack/rfcomm/rfc_ts_frames.c" + "bluedroid/stack/rfcomm/rfc_utils.c" + "bluedroid/stack/sdp/sdp_api.c" + "bluedroid/stack/sdp/sdp_db.c" + "bluedroid/stack/sdp/sdp_discovery.c" + "bluedroid/stack/sdp/sdp_main.c" + "bluedroid/stack/sdp/sdp_server.c" + "bluedroid/stack/sdp/sdp_utils.c" + "bluedroid/stack/smp/aes.c" + "bluedroid/stack/smp/p_256_curvepara.c" + "bluedroid/stack/smp/p_256_ecc_pp.c" + "bluedroid/stack/smp/p_256_multprecision.c" + "bluedroid/stack/smp/smp_act.c" + "bluedroid/stack/smp/smp_api.c" + "bluedroid/stack/smp/smp_br_main.c" + "bluedroid/stack/smp/smp_cmac.c" + "bluedroid/stack/smp/smp_keys.c" + "bluedroid/stack/smp/smp_l2c.c" + "bluedroid/stack/smp/smp_main.c" + "bluedroid/stack/smp/smp_utils.c") endif() endif() diff --git a/components/console/CMakeLists.txt b/components/console/CMakeLists.txt index 0b0da5394..1aa4ce020 100644 --- a/components/console/CMakeLists.txt +++ b/components/console/CMakeLists.txt @@ -1,5 +1,8 @@ set(COMPONENT_ADD_INCLUDEDIRS .) -set(COMPONENT_SRCDIRS linenoise argtable3 .) +set(COMPONENT_SRCS "argtable3/argtable3.c" + "commands.c" + "linenoise/linenoise.c" + "split_argv.c") set(COMPONENT_REQUIRES) diff --git a/components/cxx/CMakeLists.txt b/components/cxx/CMakeLists.txt index a797640cc..29ee8016e 100644 --- a/components/cxx/CMakeLists.txt +++ b/components/cxx/CMakeLists.txt @@ -1,4 +1,5 @@ -set(COMPONENT_SRCDIRS ".") +set(COMPONENT_SRCS "cxx_exception_stubs.cpp" + "cxx_guards.cpp") set(COMPONENT_REQUIRES) register_component() diff --git a/components/driver/CMakeLists.txt b/components/driver/CMakeLists.txt index 0c72aecc4..5e396ede5 100644 --- a/components/driver/CMakeLists.txt +++ b/components/driver/CMakeLists.txt @@ -1,4 +1,25 @@ -set(COMPONENT_SRCDIRS ".") +set(COMPONENT_SRCS "can.c" + "gpio.c" + "i2c.c" + "i2s.c" + "ledc.c" + "mcpwm.c" + "pcnt.c" + "periph_ctrl.c" + "rmt.c" + "rtc_module.c" + "sdio_slave.c" + "sdmmc_host.c" + "sdmmc_transaction.c" + "sdspi_crc.c" + "sdspi_host.c" + "sdspi_transaction.c" + "sigmadelta.c" + "spi_common.c" + "spi_master.c" + "spi_slave.c" + "timer.c" + "uart.c") set(COMPONENT_ADD_INCLUDEDIRS "include") set(COMPONENT_PRIV_INCLUDEDIRS "include/driver") diff --git a/components/esp-tls/CMakeLists.txt b/components/esp-tls/CMakeLists.txt index 9bad42868..23f953d94 100644 --- a/components/esp-tls/CMakeLists.txt +++ b/components/esp-tls/CMakeLists.txt @@ -1,4 +1,4 @@ -set(COMPONENT_SRCDIRS ".") +set(COMPONENT_SRCS "esp_tls.c") set(COMPONENT_ADD_INCLUDEDIRS ".") set(COMPONENT_REQUIRES mbedtls) diff --git a/components/esp32/CMakeLists.txt b/components/esp32/CMakeLists.txt index b26f5efe2..56e311c3a 100644 --- a/components/esp32/CMakeLists.txt +++ b/components/esp32/CMakeLists.txt @@ -2,7 +2,7 @@ if(BOOTLOADER_BUILD) # For bootloader, all we need from esp32 is headers set(COMPONENT_ADD_INCLUDEDIRS include) set(COMPONENT_REQUIRES ${COMPONENTS}) - set(COMPONENT_SRCDIRS "") + set(COMPONENT_SRCS ) register_component(esp32) # as cmake won't attach linker args to a header-only library, attach @@ -17,7 +17,47 @@ if(BOOTLOADER_BUILD) else() # Regular app build - set(COMPONENT_SRCDIRS ". hwcrypto") + set(COMPONENT_SRCS "brownout.c" + "cache_err_int.c" + "clk.c" + "coexist.c" + "core_dump.c" + "cpu_start.c" + "crosscore_int.c" + "dbg_stubs.c" + "dport_access.c" + "dport_panic_highint_hdl.S" + "esp_err_to_name.c" + "esp_timer.c" + "esp_timer_esp32.c" + "ets_timer_legacy.c" + "event_default_handlers.c" + "event_loop.c" + "fast_crypto_ops.c" + "freertos_hooks.c" + "gdbstub.c" + "hw_random.c" + "hwcrypto/aes.c" + "hwcrypto/sha.c" + "int_wdt.c" + "intr_alloc.c" + "ipc.c" + "lib_printf.c" + "panic.c" + "phy_init.c" + "pm_esp32.c" + "pm_locks.c" + "pm_trace.c" + "reset_reason.c" + "restore.c" + "sleep_modes.c" + "spiram.c" + "spiram_psram.c" + "stack_check.c" + "system_api.c" + "task_wdt.c" + "wifi_init.c" + "wifi_os_adapter.c") set(COMPONENT_ADD_INCLUDEDIRS "include") set(COMPONENT_REQUIRES driver tcpip_adapter) diff --git a/components/esp_adc_cal/CMakeLists.txt b/components/esp_adc_cal/CMakeLists.txt index fc21f1eca..8bb99092e 100644 --- a/components/esp_adc_cal/CMakeLists.txt +++ b/components/esp_adc_cal/CMakeLists.txt @@ -1,4 +1,4 @@ -set(COMPONENT_SRCDIRS ".") +set(COMPONENT_SRCS "esp_adc_cal.c") set(COMPONENT_ADD_INCLUDEDIRS "include") set(COMPONENT_REQUIRES) diff --git a/components/esp_http_client/CMakeLists.txt b/components/esp_http_client/CMakeLists.txt index 31bc1185e..7e7d29996 100644 --- a/components/esp_http_client/CMakeLists.txt +++ b/components/esp_http_client/CMakeLists.txt @@ -1,4 +1,10 @@ -set(COMPONENT_SRCDIRS "." "lib") +set(COMPONENT_SRCS "esp_http_client.c" + "lib/http_auth.c" + "lib/http_header.c" + "lib/http_utils.c" + "lib/transport.c" + "lib/transport_ssl.c" + "lib/transport_tcp.c") set(COMPONENT_ADD_INCLUDEDIRS "include") set(COMPONENT_PRIV_INCLUDEDIRS "lib/include") diff --git a/components/esp_https_ota/CMakeLists.txt b/components/esp_https_ota/CMakeLists.txt index bfc6c1205..6ef0a5c9e 100644 --- a/components/esp_https_ota/CMakeLists.txt +++ b/components/esp_https_ota/CMakeLists.txt @@ -1,5 +1,5 @@ set(COMPONENT_ADD_INCLUDEDIRS include) -set(COMPONENT_SRCDIRS "src") +set(COMPONENT_SRCS "src/esp_https_ota.c") set(COMPONENT_REQUIRES esp_http_client) set(COMPONENT_PRIV_REQUIRES log app_update) diff --git a/components/ethernet/CMakeLists.txt b/components/ethernet/CMakeLists.txt index 165d89fbe..ef7c9a0f9 100644 --- a/components/ethernet/CMakeLists.txt +++ b/components/ethernet/CMakeLists.txt @@ -1,4 +1,8 @@ -set(COMPONENT_SRCDIRS . eth_phy) +set(COMPONENT_SRCS "emac_dev.c" + "emac_main.c" + "eth_phy/phy_common.c" + "eth_phy/phy_lan8720.c" + "eth_phy/phy_tlk110.c") set(COMPONENT_ADD_INCLUDEDIRS "include") set(COMPONENT_REQUIRES) diff --git a/components/expat/CMakeLists.txt b/components/expat/CMakeLists.txt index e94f77512..02037dc21 100644 --- a/components/expat/CMakeLists.txt +++ b/components/expat/CMakeLists.txt @@ -1,5 +1,10 @@ set(COMPONENT_ADD_INCLUDEDIRS expat/expat/lib port/include) -set(COMPONENT_SRCDIRS expat/expat/lib) +set(COMPONENT_SRCS "expat/expat/lib/loadlibrary.c" + "expat/expat/lib/xmlparse.c" + "expat/expat/lib/xmlrole.c" + "expat/expat/lib/xmltok.c" + "expat/expat/lib/xmltok_impl.c" + "expat/expat/lib/xmltok_ns.c") set(COMPONENT_REQUIRES) diff --git a/components/fatfs/CMakeLists.txt b/components/fatfs/CMakeLists.txt index 3d24c50bf..4df07d30b 100644 --- a/components/fatfs/CMakeLists.txt +++ b/components/fatfs/CMakeLists.txt @@ -1,4 +1,13 @@ -set(COMPONENT_SRCDIRS src) +set(COMPONENT_SRCS "src/diskio.c" + "src/diskio_rawflash.c" + "src/diskio_sdmmc.c" + "src/diskio_wl.c" + "src/ff.c" + "src/ffsystem.c" + "src/ffunicode.c" + "src/vfs_fat.c" + "src/vfs_fat_sdmmc.c" + "src/vfs_fat_spiflash.c") set(COMPONENT_ADD_INCLUDEDIRS src) set(COMPONENT_REQUIRES wear_levelling sdmmc) diff --git a/components/freertos/CMakeLists.txt b/components/freertos/CMakeLists.txt index e0618d4a9..bcd9b0c42 100644 --- a/components/freertos/CMakeLists.txt +++ b/components/freertos/CMakeLists.txt @@ -1,6 +1,22 @@ set(COMPONENT_ADD_INCLUDEDIRS include) set(COMPONENT_PRIV_INCLUDEDIRS include/freertos) -set(COMPONENT_SRCDIRS ".") +set(COMPONENT_SRCS "FreeRTOS-openocd.c" + "croutine.c" + "event_groups.c" + "list.c" + "port.c" + "portasm.S" + "queue.c" + "ringbuf.c" + "tasks.c" + "timers.c" + "xtensa_context.S" + "xtensa_init.c" + "xtensa_intr.c" + "xtensa_intr_asm.S" + "xtensa_overlay_os_hook.c" + "xtensa_vector_defaults.S" + "xtensa_vectors.S") set(COMPONENT_REQUIRES) register_component() diff --git a/components/heap/CMakeLists.txt b/components/heap/CMakeLists.txt index 9c4ccf16d..f71ed9d84 100644 --- a/components/heap/CMakeLists.txt +++ b/components/heap/CMakeLists.txt @@ -1,4 +1,7 @@ -set(COMPONENT_SRCS heap_caps_init.c heap_caps.c multi_heap.c heap_trace.c) +set(COMPONENT_SRCS "heap_caps.c" + "heap_caps_init.c" + "heap_trace.c" + "multi_heap.c") if(NOT CONFIG_HEAP_POISONING_DISABLED) set(COMPONENT_SRCS ${COMPONENT_SRCS} multi_heap_poisoning.c) diff --git a/components/http_server/CMakeLists.txt b/components/http_server/CMakeLists.txt index ba62bf3ac..700a0b9cb 100644 --- a/components/http_server/CMakeLists.txt +++ b/components/http_server/CMakeLists.txt @@ -1,6 +1,11 @@ set(COMPONENT_ADD_INCLUDEDIRS include) set(COMPONENT_PRIV_INCLUDEDIRS src/port/esp32 src/util) -set(COMPONENT_SRCDIRS src src/util) +set(COMPONENT_SRCS "src/httpd_main.c" + "src/httpd_parse.c" + "src/httpd_sess.c" + "src/httpd_txrx.c" + "src/httpd_uri.c" + "src/util/ctrl_sock.c") set(COMPONENT_REQUIRES nghttp) # for http_parser.h set(COMPONENT_PRIV_REQUIRES lwip) diff --git a/components/jsmn/CMakeLists.txt b/components/jsmn/CMakeLists.txt index 7c19d9ccb..f6776023f 100644 --- a/components/jsmn/CMakeLists.txt +++ b/components/jsmn/CMakeLists.txt @@ -1,4 +1,4 @@ -set(COMPONENT_SRCDIRS "src") +set(COMPONENT_SRCS "src/jsmn.c") set(COMPONENT_ADD_INCLUDEDIRS "include") set(COMPONENT_REQUIRES "") diff --git a/components/json/CMakeLists.txt b/components/json/CMakeLists.txt index 0b8ba83d6..9535315e5 100644 --- a/components/json/CMakeLists.txt +++ b/components/json/CMakeLists.txt @@ -1,4 +1,6 @@ -set(COMPONENT_SRCDIRS cJSON) +set(COMPONENT_SRCS "cJSON/cJSON.c" + "cJSON/cJSON_Utils.c" + "cJSON/test.c") set(COMPONENT_ADD_INCLUDEDIRS cJSON) set(COMPONENT_REQUIRES "") diff --git a/components/libsodium/CMakeLists.txt b/components/libsodium/CMakeLists.txt index 0ad301662..abc7d7be3 100644 --- a/components/libsodium/CMakeLists.txt +++ b/components/libsodium/CMakeLists.txt @@ -2,71 +2,217 @@ set(SRC libsodium/src/libsodium) set(COMPONENT_REQUIRES "mbedtls") -set(COMPONENT_SRCDIRS - port +set(COMPONENT_SRCS + "port/randombytes_esp32.c" + "port/crypto_hash_mbedtls/crypto_hash_sha512_mbedtls.c" + "port/crypto_hash_mbedtls/crypto_hash_sha256_mbedtls.c" # Derived from libsodium/src/libsodium/Makefile.am # (ignoring the !MINIMAL set) - ${SRC}/crypto_aead/chacha20poly1305/sodium - ${SRC}/crypto_aead/xchacha20poly1305/sodium - ${SRC}/crypto_auth - ${SRC}/crypto_auth/hmacsha256 - ${SRC}/crypto_auth/hmacsha512 - ${SRC}/crypto_auth/hmacsha512256 - ${SRC}/crypto_box - ${SRC}/crypto_box/curve25519xsalsa20poly1305 - ${SRC}/crypto_core/curve25519/ref10 - ${SRC}/crypto_core/hchacha20 - ${SRC}/crypto_core/hsalsa20/ref2 - ${SRC}/crypto_core/hsalsa20 - ${SRC}/crypto_core/salsa/ref - ${SRC}/crypto_generichash - ${SRC}/crypto_generichash/blake2b - ${SRC}/crypto_generichash/blake2b/ref - ${SRC}/crypto_hash - ${SRC}/crypto_hash/sha256 - ${SRC}/crypto_hash/sha512 - ${SRC}/crypto_kdf/blake2b - ${SRC}/crypto_kdf - ${SRC}/crypto_kx - ${SRC}/crypto_onetimeauth - ${SRC}/crypto_onetimeauth/poly1305 - ${SRC}/crypto_onetimeauth/poly1305/donna - ${SRC}/crypto_pwhash/argon2 - ${SRC}/crypto_pwhash - ${SRC}/crypto_pwhash/scryptsalsa208sha256 - ${SRC}/crypto_pwhash/scryptsalsa208sha256/nosse - ${SRC}/crypto_scalarmult - ${SRC}/crypto_scalarmult/curve25519 - ${SRC}/crypto_scalarmult/curve25519/ref10 - ${SRC}/crypto_secretbox - ${SRC}/crypto_secretbox/xsalsa20poly1305 - ${SRC}/crypto_shorthash - ${SRC}/crypto_shorthash/siphash24 - ${SRC}/crypto_shorthash/siphash24/ref - ${SRC}/crypto_sign - ${SRC}/crypto_sign/ed25519 - ${SRC}/crypto_sign/ed25519/ref10 - ${SRC}/crypto_stream/chacha20 - ${SRC}/crypto_stream/chacha20/ref - ${SRC}/crypto_stream - ${SRC}/crypto_stream/salsa20 - ${SRC}/crypto_stream/salsa20/ref - ${SRC}/crypto_stream/xsalsa20 - ${SRC}/crypto_verify/sodium - ${SRC}/randombytes - ${SRC}/sodium + "${SRC}/crypto_aead/chacha20poly1305/sodium/aead_chacha20poly1305.c" + "${SRC}/crypto_aead/xchacha20poly1305/sodium/aead_xchacha20poly1305.c" + "${SRC}/crypto_auth/crypto_auth.c" + "${SRC}/crypto_auth/hmacsha256/auth_hmacsha256.c" + "${SRC}/crypto_auth/hmacsha512/auth_hmacsha512.c" + "${SRC}/crypto_auth/hmacsha512256/auth_hmacsha512256.c" + "${SRC}/crypto_auth/hmacsha256/auth_hmacsha256.c" + "${SRC}/crypto_auth/hmacsha512/auth_hmacsha512.c" + "${SRC}/crypto_auth/hmacsha512256/auth_hmacsha512256.c" + "${SRC}/crypto_box/crypto_box.c" + "${SRC}/crypto_box/crypto_box_seal.c" + "${SRC}/crypto_box/crypto_box_easy.c" + "${SRC}/crypto_box/curve25519xchacha20poly1305/box_curve25519xchacha20poly1305.c" + "${SRC}/crypto_box/curve25519xsalsa20poly1305/box_curve25519xsalsa20poly1305.c" + "${SRC}/crypto_box/curve25519xsalsa20poly1305/box_curve25519xsalsa20poly1305.c" + "${SRC}/crypto_core/curve25519/ref10/curve25519_ref10.c" + "${SRC}/crypto_core/hchacha20/core_hchacha20.c" + "${SRC}/crypto_core/hsalsa20/ref2/core_hsalsa20_ref2.c" + "${SRC}/crypto_core/hsalsa20/core_hsalsa20.c" + "${SRC}/crypto_core/hsalsa20/ref2/core_hsalsa20_ref2.c" + "${SRC}/crypto_core/salsa/ref/core_salsa_ref.c" + "${SRC}/crypto_generichash/crypto_generichash.c" + "${SRC}/crypto_generichash/blake2b/generichash_blake2.c" + "${SRC}/crypto_generichash/blake2b/ref/blake2b-ref.c" + "${SRC}/crypto_generichash/blake2b/ref/blake2b-compress-sse41.c" + "${SRC}/crypto_generichash/blake2b/ref/generichash_blake2b.c" + "${SRC}/crypto_generichash/blake2b/ref/blake2b-compress-ssse3.c" + "${SRC}/crypto_generichash/blake2b/ref/blake2b-compress-avx2.c" + "${SRC}/crypto_generichash/blake2b/ref/blake2b-compress-ref.c" + "${SRC}/crypto_generichash/blake2b/generichash_blake2.c" + "${SRC}/crypto_generichash/blake2b/ref/blake2b-ref.c" + "${SRC}/crypto_generichash/blake2b/ref/blake2b-compress-sse41.c" + "${SRC}/crypto_generichash/blake2b/ref/generichash_blake2b.c" + "${SRC}/crypto_generichash/blake2b/ref/blake2b-compress-ssse3.c" + "${SRC}/crypto_generichash/blake2b/ref/blake2b-compress-avx2.c" + "${SRC}/crypto_generichash/blake2b/ref/blake2b-compress-ref.c" + "${SRC}/crypto_generichash/blake2b/ref/blake2b-ref.c" + "${SRC}/crypto_generichash/blake2b/ref/blake2b-compress-sse41.c" + "${SRC}/crypto_generichash/blake2b/ref/generichash_blake2b.c" + "${SRC}/crypto_generichash/blake2b/ref/blake2b-compress-ssse3.c" + "${SRC}/crypto_generichash/blake2b/ref/blake2b-compress-avx2.c" + "${SRC}/crypto_generichash/blake2b/ref/blake2b-compress-ref.c" + "${SRC}/crypto_hash/crypto_hash.c" + "${SRC}/crypto_hash/sha512/hash_sha512.c" + "${SRC}/crypto_hash/sha256/hash_sha256.c" + "${SRC}/crypto_hash/sha512/cp/hash_sha512_cp.c" + "${SRC}/crypto_hash/sha256/cp/hash_sha256_cp.c" + "${SRC}/crypto_hash/sha256/hash_sha256.c" + "${SRC}/crypto_hash/sha256/cp/hash_sha256_cp.c" + "${SRC}/crypto_hash/sha512/hash_sha512.c" + "${SRC}/crypto_hash/sha512/cp/hash_sha512_cp.c" + "${SRC}/crypto_kdf/blake2b/kdf_blake2b.c" + "${SRC}/crypto_kdf/crypto_kdf.c" + "${SRC}/crypto_kdf/blake2b/kdf_blake2b.c" + "${SRC}/crypto_kx/crypto_kx.c" + "${SRC}/crypto_onetimeauth/crypto_onetimeauth.c" + "${SRC}/crypto_onetimeauth/poly1305/onetimeauth_poly1305.c" + "${SRC}/crypto_onetimeauth/poly1305/sse2/poly1305_sse2.c" + "${SRC}/crypto_onetimeauth/poly1305/donna/poly1305_donna.c" + "${SRC}/crypto_onetimeauth/poly1305/onetimeauth_poly1305.c" + "${SRC}/crypto_onetimeauth/poly1305/sse2/poly1305_sse2.c" + "${SRC}/crypto_onetimeauth/poly1305/donna/poly1305_donna.c" + "${SRC}/crypto_onetimeauth/poly1305/donna/poly1305_donna.c" + "${SRC}/crypto_pwhash/argon2/argon2-encoding.c" + "${SRC}/crypto_pwhash/argon2/argon2-fill-block-ssse3.c" + "${SRC}/crypto_pwhash/argon2/blake2b-long.c" + "${SRC}/crypto_pwhash/argon2/pwhash_argon2i.c" + "${SRC}/crypto_pwhash/argon2/argon2.c" + "${SRC}/crypto_pwhash/argon2/argon2-fill-block-ref.c" + "${SRC}/crypto_pwhash/argon2/argon2-core.c" + "${SRC}/crypto_pwhash/crypto_pwhash.c" + "${SRC}/crypto_pwhash/scryptsalsa208sha256/pbkdf2-sha256.c" + "${SRC}/crypto_pwhash/scryptsalsa208sha256/scrypt_platform.c" + "${SRC}/crypto_pwhash/scryptsalsa208sha256/crypto_scrypt-common.c" + "${SRC}/crypto_pwhash/scryptsalsa208sha256/pwhash_scryptsalsa208sha256.c" + "${SRC}/crypto_pwhash/argon2/argon2-encoding.c" + "${SRC}/crypto_pwhash/argon2/argon2-fill-block-ssse3.c" + "${SRC}/crypto_pwhash/argon2/blake2b-long.c" + "${SRC}/crypto_pwhash/argon2/pwhash_argon2i.c" + "${SRC}/crypto_pwhash/argon2/argon2.c" + "${SRC}/crypto_pwhash/argon2/argon2-fill-block-ref.c" + "${SRC}/crypto_pwhash/argon2/argon2-core.c" + "${SRC}/crypto_pwhash/scryptsalsa208sha256/nosse/pwhash_scryptsalsa208sha256_nosse.c" + "${SRC}/crypto_pwhash/scryptsalsa208sha256/sse/pwhash_scryptsalsa208sha256_sse.c" + "${SRC}/crypto_pwhash/scryptsalsa208sha256/pbkdf2-sha256.c" + "${SRC}/crypto_pwhash/scryptsalsa208sha256/scrypt_platform.c" + "${SRC}/crypto_pwhash/scryptsalsa208sha256/crypto_scrypt-common.c" + "${SRC}/crypto_pwhash/scryptsalsa208sha256/pwhash_scryptsalsa208sha256.c" + "${SRC}/crypto_pwhash/scryptsalsa208sha256/nosse/pwhash_scryptsalsa208sha256_nosse.c" + "${SRC}/crypto_pwhash/scryptsalsa208sha256/sse/pwhash_scryptsalsa208sha256_sse.c" + "${SRC}/crypto_pwhash/scryptsalsa208sha256/nosse/pwhash_scryptsalsa208sha256_nosse.c" + "${SRC}/crypto_scalarmult/crypto_scalarmult.c" + "${SRC}/crypto_scalarmult/curve25519/scalarmult_curve25519.c" + "${SRC}/crypto_scalarmult/curve25519/sandy2x/fe_frombytes_sandy2x.c" + "${SRC}/crypto_scalarmult/curve25519/sandy2x/curve25519_sandy2x.c" + "${SRC}/crypto_scalarmult/curve25519/sandy2x/fe51_invert.c" + "${SRC}/crypto_scalarmult/curve25519/donna_c64/curve25519_donna_c64.c" + "${SRC}/crypto_scalarmult/curve25519/ref10/x25519_ref10.c" + "${SRC}/crypto_scalarmult/curve25519/sandy2x/fe51_pack.S" + "${SRC}/crypto_scalarmult/curve25519/sandy2x/fe51_mul.S" + "${SRC}/crypto_scalarmult/curve25519/sandy2x/ladder_base.S" + "${SRC}/crypto_scalarmult/curve25519/sandy2x/sandy2x.S" + "${SRC}/crypto_scalarmult/curve25519/sandy2x/ladder.S" + "${SRC}/crypto_scalarmult/curve25519/sandy2x/consts.S" + "${SRC}/crypto_scalarmult/curve25519/sandy2x/fe51_nsquare.S" + "${SRC}/crypto_scalarmult/curve25519/scalarmult_curve25519.c" + "${SRC}/crypto_scalarmult/curve25519/sandy2x/fe_frombytes_sandy2x.c" + "${SRC}/crypto_scalarmult/curve25519/sandy2x/curve25519_sandy2x.c" + "${SRC}/crypto_scalarmult/curve25519/sandy2x/fe51_invert.c" + "${SRC}/crypto_scalarmult/curve25519/donna_c64/curve25519_donna_c64.c" + "${SRC}/crypto_scalarmult/curve25519/ref10/x25519_ref10.c" + "${SRC}/crypto_scalarmult/curve25519/sandy2x/fe51_pack.S" + "${SRC}/crypto_scalarmult/curve25519/sandy2x/fe51_mul.S" + "${SRC}/crypto_scalarmult/curve25519/sandy2x/ladder_base.S" + "${SRC}/crypto_scalarmult/curve25519/sandy2x/sandy2x.S" + "${SRC}/crypto_scalarmult/curve25519/sandy2x/ladder.S" + "${SRC}/crypto_scalarmult/curve25519/sandy2x/consts.S" + "${SRC}/crypto_scalarmult/curve25519/sandy2x/fe51_nsquare.S" + "${SRC}/crypto_scalarmult/curve25519/ref10/x25519_ref10.c" + "${SRC}/crypto_secretbox/crypto_secretbox_easy.c" + "${SRC}/crypto_secretbox/crypto_secretbox.c" + "${SRC}/crypto_secretbox/xsalsa20poly1305/secretbox_xsalsa20poly1305.c" + "${SRC}/crypto_secretbox/xchacha20poly1305/secretbox_xchacha20poly1305.c" + "${SRC}/crypto_secretbox/xsalsa20poly1305/secretbox_xsalsa20poly1305.c" + "${SRC}/crypto_shorthash/crypto_shorthash.c" + "${SRC}/crypto_shorthash/siphash24/shorthash_siphashx24.c" + "${SRC}/crypto_shorthash/siphash24/shorthash_siphash24.c" + "${SRC}/crypto_shorthash/siphash24/ref/shorthash_siphashx24_ref.c" + "${SRC}/crypto_shorthash/siphash24/ref/shorthash_siphash24_ref.c" + "${SRC}/crypto_shorthash/siphash24/shorthash_siphashx24.c" + "${SRC}/crypto_shorthash/siphash24/shorthash_siphash24.c" + "${SRC}/crypto_shorthash/siphash24/ref/shorthash_siphashx24_ref.c" + "${SRC}/crypto_shorthash/siphash24/ref/shorthash_siphash24_ref.c" + "${SRC}/crypto_shorthash/siphash24/ref/shorthash_siphashx24_ref.c" + "${SRC}/crypto_shorthash/siphash24/ref/shorthash_siphash24_ref.c" + "${SRC}/crypto_sign/crypto_sign.c" + "${SRC}/crypto_sign/ed25519/sign_ed25519.c" + "${SRC}/crypto_sign/ed25519/ref10/obsolete.c" + "${SRC}/crypto_sign/ed25519/ref10/open.c" + "${SRC}/crypto_sign/ed25519/ref10/keypair.c" + "${SRC}/crypto_sign/ed25519/ref10/sign.c" + "${SRC}/crypto_sign/ed25519/sign_ed25519.c" + "${SRC}/crypto_sign/ed25519/ref10/obsolete.c" + "${SRC}/crypto_sign/ed25519/ref10/open.c" + "${SRC}/crypto_sign/ed25519/ref10/keypair.c" + "${SRC}/crypto_sign/ed25519/ref10/sign.c" + "${SRC}/crypto_sign/ed25519/ref10/obsolete.c" + "${SRC}/crypto_sign/ed25519/ref10/open.c" + "${SRC}/crypto_sign/ed25519/ref10/keypair.c" + "${SRC}/crypto_sign/ed25519/ref10/sign.c" + "${SRC}/crypto_stream/chacha20/stream_chacha20.c" + "${SRC}/crypto_stream/chacha20/ref/chacha20_ref.c" + "${SRC}/crypto_stream/chacha20/dolbeau/chacha20_dolbeau-ssse3.c" + "${SRC}/crypto_stream/chacha20/dolbeau/chacha20_dolbeau-avx2.c" + "${SRC}/crypto_stream/chacha20/ref/chacha20_ref.c" + "${SRC}/crypto_stream/crypto_stream.c" + "${SRC}/crypto_stream/salsa20/stream_salsa20.c" + "${SRC}/crypto_stream/salsa208/stream_salsa208.c" + "${SRC}/crypto_stream/salsa2012/stream_salsa2012.c" + "${SRC}/crypto_stream/chacha20/stream_chacha20.c" + "${SRC}/crypto_stream/aes128ctr/stream_aes128ctr.c" + "${SRC}/crypto_stream/xsalsa20/stream_xsalsa20.c" + "${SRC}/crypto_stream/xchacha20/stream_xchacha20.c" + "${SRC}/crypto_stream/salsa20/ref/salsa20_ref.c" + "${SRC}/crypto_stream/salsa20/xmm6/salsa20_xmm6.c" + "${SRC}/crypto_stream/salsa20/xmm6int/salsa20_xmm6int-avx2.c" + "${SRC}/crypto_stream/salsa20/xmm6int/salsa20_xmm6int-sse2.c" + "${SRC}/crypto_stream/salsa208/ref/stream_salsa208_ref.c" + "${SRC}/crypto_stream/salsa2012/ref/stream_salsa2012_ref.c" + "${SRC}/crypto_stream/chacha20/ref/chacha20_ref.c" + "${SRC}/crypto_stream/chacha20/dolbeau/chacha20_dolbeau-ssse3.c" + "${SRC}/crypto_stream/chacha20/dolbeau/chacha20_dolbeau-avx2.c" + "${SRC}/crypto_stream/aes128ctr/nacl/consts_aes128ctr.c" + "${SRC}/crypto_stream/aes128ctr/nacl/stream_aes128ctr_nacl.c" + "${SRC}/crypto_stream/aes128ctr/nacl/beforenm_aes128ctr.c" + "${SRC}/crypto_stream/aes128ctr/nacl/afternm_aes128ctr.c" + "${SRC}/crypto_stream/aes128ctr/nacl/xor_afternm_aes128ctr.c" + "${SRC}/crypto_stream/aes128ctr/nacl/int128_aes128ctr.c" + "${SRC}/crypto_stream/salsa20/xmm6/salsa20_xmm6-asm.S" + "${SRC}/crypto_stream/salsa20/stream_salsa20.c" + "${SRC}/crypto_stream/salsa20/ref/salsa20_ref.c" + "${SRC}/crypto_stream/salsa20/xmm6/salsa20_xmm6.c" + "${SRC}/crypto_stream/salsa20/xmm6int/salsa20_xmm6int-avx2.c" + "${SRC}/crypto_stream/salsa20/xmm6int/salsa20_xmm6int-sse2.c" + "${SRC}/crypto_stream/salsa20/xmm6/salsa20_xmm6-asm.S" + "${SRC}/crypto_stream/salsa20/ref/salsa20_ref.c" + "${SRC}/crypto_stream/xsalsa20/stream_xsalsa20.c" + "${SRC}/crypto_verify/sodium/verify.c" + "${SRC}/randombytes/randombytes.c" + "${SRC}/randombytes/sysrandom/randombytes_sysrandom.c" + "${SRC}/randombytes/salsa20/randombytes_salsa20_random.c" + "${SRC}/randombytes/nativeclient/randombytes_nativeclient.c" + "${SRC}/sodium/runtime.c" + "${SRC}/sodium/utils.c" + "${SRC}/sodium/core.c" + "${SRC}/sodium/version.c" ) if(CONFIG_LIBSODIUM_USE_MBEDTLS_SHA) - set(COMPONENT_SRCDIRS ${COMPONENT_SRCDIRS} - port/crypto_hash_mbedtls - ) + set(COMPONENT_SRCS "port/crypto_hash_mbedtls/crypto_hash_sha256_mbedtls.c" + "port/crypto_hash_mbedtls/crypto_hash_sha512_mbedtls.c") else() - set(COMPONENT_SRCDIRS ${COMPONENT_SRCDIRS} - ${SRC}/crypto_hash/sha256/cp - ${SRC}/crypto_hash/sha512/cp - ) + set(COMPONENT_SRCS "port/crypto_hash_mbedtls/crypto_hash_sha256_mbedtls.c" + "port/crypto_hash_mbedtls/crypto_hash_sha512_mbedtls.c") endif() set(COMPONENT_ADD_INCLUDEDIRS ${SRC}/include port_include) diff --git a/components/log/CMakeLists.txt b/components/log/CMakeLists.txt index ad162fe1e..84b6cf460 100644 --- a/components/log/CMakeLists.txt +++ b/components/log/CMakeLists.txt @@ -1,4 +1,4 @@ -set(COMPONENT_SRCDIRS ".") +set(COMPONENT_SRCS "log.c") set(COMPONENT_ADD_INCLUDEDIRS "include") set(COMPONENT_REQUIRES) register_component() diff --git a/components/lwip/CMakeLists.txt b/components/lwip/CMakeLists.txt index 45126db65..63930f6fe 100644 --- a/components/lwip/CMakeLists.txt +++ b/components/lwip/CMakeLists.txt @@ -5,27 +5,118 @@ set(COMPONENT_ADD_INCLUDEDIRS port/esp32/include/arch ) -set(COMPONENT_SRCDIRS - apps/dhcpserver - apps/ping - lwip/src/api - lwip/src/apps/sntp - lwip/src/core - lwip/src/core/ipv4 - lwip/src/core/ipv6 - lwip/src/netif - lwip/src/netif/ppp - port/esp32 - port/esp32/freertos - port/esp32/netif - port/esp32/debug - ) +set(COMPONENT_SRCS "apps/dhcpserver/dhcpserver.c" + "apps/ping/esp_ping.c" + "apps/ping/ping.c" + "lwip/src/api/api_lib.c" + "lwip/src/api/api_msg.c" + "lwip/src/api/err.c" + "lwip/src/api/netbuf.c" + "lwip/src/api/netdb.c" + "lwip/src/api/netifapi.c" + "lwip/src/api/sockets.c" + "lwip/src/api/tcpip.c" + "lwip/src/apps/sntp/sntp.c" + "lwip/src/core/def.c" + "lwip/src/core/dns.c" + "lwip/src/core/inet_chksum.c" + "lwip/src/core/init.c" + "lwip/src/core/ip.c" + "lwip/src/core/ipv4/autoip.c" + "lwip/src/core/ipv4/dhcp.c" + "lwip/src/core/ipv4/etharp.c" + "lwip/src/core/ipv4/icmp.c" + "lwip/src/core/ipv4/igmp.c" + "lwip/src/core/ipv4/ip4.c" + "lwip/src/core/ipv4/ip4_addr.c" + "lwip/src/core/ipv4/ip4_frag.c" + "lwip/src/core/ipv6/dhcp6.c" + "lwip/src/core/ipv6/ethip6.c" + "lwip/src/core/ipv6/icmp6.c" + "lwip/src/core/ipv6/inet6.c" + "lwip/src/core/ipv6/ip6.c" + "lwip/src/core/ipv6/ip6_addr.c" + "lwip/src/core/ipv6/ip6_frag.c" + "lwip/src/core/ipv6/mld6.c" + "lwip/src/core/ipv6/nd6.c" + "lwip/src/core/mem.c" + "lwip/src/core/memp.c" + "lwip/src/core/netif.c" + "lwip/src/core/pbuf.c" + "lwip/src/core/raw.c" + "lwip/src/core/stats.c" + "lwip/src/core/sys.c" + "lwip/src/core/tcp.c" + "lwip/src/core/tcp_in.c" + "lwip/src/core/tcp_out.c" + "lwip/src/core/timeouts.c" + "lwip/src/core/udp.c" + "lwip/src/netif/ethernet.c" + "lwip/src/netif/ethernetif.c" + "lwip/src/netif/lowpan6.c" + "lwip/src/netif/ppp/auth.c" + "lwip/src/netif/ppp/ccp.c" + "lwip/src/netif/ppp/chap-md5.c" + "lwip/src/netif/ppp/chap-new.c" + "lwip/src/netif/ppp/chap_ms.c" + "lwip/src/netif/ppp/demand.c" + "lwip/src/netif/ppp/eap.c" + "lwip/src/netif/ppp/ecp.c" + "lwip/src/netif/ppp/eui64.c" + "lwip/src/netif/ppp/fsm.c" + "lwip/src/netif/ppp/ipcp.c" + "lwip/src/netif/ppp/ipv6cp.c" + "lwip/src/netif/ppp/lcp.c" + "lwip/src/netif/ppp/magic.c" + "lwip/src/netif/ppp/mppe.c" + "lwip/src/netif/ppp/multilink.c" + "lwip/src/netif/ppp/ppp.c" + "lwip/src/netif/ppp/pppapi.c" + "lwip/src/netif/ppp/pppcrypt.c" + "lwip/src/netif/ppp/pppoe.c" + "lwip/src/netif/ppp/pppol2tp.c" + "lwip/src/netif/ppp/pppos.c" + "lwip/src/netif/ppp/upap.c" + "lwip/src/netif/ppp/utils.c" + "lwip/src/netif/ppp/vj.c" + "lwip/src/netif/slipif.c" + "port/esp32/debug/lwip_debug.c" + "port/esp32/freertos/sys_arch.c" + "port/esp32/netif/ethernetif.c" + "port/esp32/netif/wlanif.c" + "port/esp32/vfs_lwip.c") if(CONFIG_PPP_SUPPORT) - list(APPEND COMPONENT_SRCDIRS - lwip/src/netif/ppp - lwip/src/netif/ppp/polarssl - ) + list(APPEND COMPONENT_SRCS "lwip/src/netif/ppp/auth.c" + "lwip/src/netif/ppp/ccp.c" + "lwip/src/netif/ppp/chap-md5.c" + "lwip/src/netif/ppp/chap-new.c" + "lwip/src/netif/ppp/chap_ms.c" + "lwip/src/netif/ppp/demand.c" + "lwip/src/netif/ppp/eap.c" + "lwip/src/netif/ppp/ecp.c" + "lwip/src/netif/ppp/eui64.c" + "lwip/src/netif/ppp/fsm.c" + "lwip/src/netif/ppp/ipcp.c" + "lwip/src/netif/ppp/ipv6cp.c" + "lwip/src/netif/ppp/lcp.c" + "lwip/src/netif/ppp/magic.c" + "lwip/src/netif/ppp/mppe.c" + "lwip/src/netif/ppp/multilink.c" + "lwip/src/netif/ppp/polarssl/arc4.c" + "lwip/src/netif/ppp/polarssl/des.c" + "lwip/src/netif/ppp/polarssl/md4.c" + "lwip/src/netif/ppp/polarssl/md5.c" + "lwip/src/netif/ppp/polarssl/sha1.c" + "lwip/src/netif/ppp/ppp.c" + "lwip/src/netif/ppp/pppapi.c" + "lwip/src/netif/ppp/pppcrypt.c" + "lwip/src/netif/ppp/pppoe.c" + "lwip/src/netif/ppp/pppol2tp.c" + "lwip/src/netif/ppp/pppos.c" + "lwip/src/netif/ppp/upap.c" + "lwip/src/netif/ppp/utils.c" + "lwip/src/netif/ppp/vj.c") endif() set(COMPONENT_REQUIRES vfs) diff --git a/components/mbedtls/CMakeLists.txt b/components/mbedtls/CMakeLists.txt index ffac9fea8..aca00dddb 100644 --- a/components/mbedtls/CMakeLists.txt +++ b/components/mbedtls/CMakeLists.txt @@ -1,7 +1,90 @@ set(COMPONENT_ADD_INCLUDEDIRS port/include mbedtls/include) -set(COMPONENT_SRCDIRS mbedtls/library port) - -set(COMPONENT_SRCEXCLUDE mbedtls/library/net_sockets.c) +set(COMPONENT_SRCS "mbedtls/library/aes.c" + "mbedtls/library/aesni.c" + "mbedtls/library/arc4.c" + "mbedtls/library/aria.c" + "mbedtls/library/asn1parse.c" + "mbedtls/library/asn1write.c" + "mbedtls/library/base64.c" + "mbedtls/library/bignum.c" + "mbedtls/library/blowfish.c" + "mbedtls/library/camellia.c" + "mbedtls/library/ccm.c" + "mbedtls/library/certs.c" + "mbedtls/library/chacha20.c" + "mbedtls/library/chachapoly.c" + "mbedtls/library/cipher.c" + "mbedtls/library/cipher_wrap.c" + "mbedtls/library/cmac.c" + "mbedtls/library/ctr_drbg.c" + "mbedtls/library/debug.c" + "mbedtls/library/des.c" + "mbedtls/library/dhm.c" + "mbedtls/library/ecdh.c" + "mbedtls/library/ecdsa.c" + "mbedtls/library/ecjpake.c" + "mbedtls/library/ecp.c" + "mbedtls/library/ecp_curves.c" + "mbedtls/library/entropy.c" + "mbedtls/library/entropy_poll.c" + "mbedtls/library/error.c" + "mbedtls/library/gcm.c" + "mbedtls/library/havege.c" + "mbedtls/library/hkdf.c" + "mbedtls/library/hmac_drbg.c" + "mbedtls/library/md.c" + "mbedtls/library/md2.c" + "mbedtls/library/md4.c" + "mbedtls/library/md5.c" + "mbedtls/library/md_wrap.c" + "mbedtls/library/memory_buffer_alloc.c" + "mbedtls/library/net_sockets.c" + "mbedtls/library/nist_kw.c" + "mbedtls/library/oid.c" + "mbedtls/library/padlock.c" + "mbedtls/library/pem.c" + "mbedtls/library/pk.c" + "mbedtls/library/pk_wrap.c" + "mbedtls/library/pkcs11.c" + "mbedtls/library/pkcs12.c" + "mbedtls/library/pkcs5.c" + "mbedtls/library/pkparse.c" + "mbedtls/library/pkwrite.c" + "mbedtls/library/platform.c" + "mbedtls/library/platform_util.c" + "mbedtls/library/poly1305.c" + "mbedtls/library/ripemd160.c" + "mbedtls/library/rsa.c" + "mbedtls/library/rsa_internal.c" + "mbedtls/library/sha1.c" + "mbedtls/library/sha256.c" + "mbedtls/library/sha512.c" + "mbedtls/library/ssl_cache.c" + "mbedtls/library/ssl_ciphersuites.c" + "mbedtls/library/ssl_cli.c" + "mbedtls/library/ssl_cookie.c" + "mbedtls/library/ssl_srv.c" + "mbedtls/library/ssl_ticket.c" + "mbedtls/library/ssl_tls.c" + "mbedtls/library/threading.c" + "mbedtls/library/timing.c" + "mbedtls/library/version.c" + "mbedtls/library/version_features.c" + "mbedtls/library/x509.c" + "mbedtls/library/x509_create.c" + "mbedtls/library/x509_crl.c" + "mbedtls/library/x509_crt.c" + "mbedtls/library/x509_csr.c" + "mbedtls/library/x509write_crt.c" + "mbedtls/library/x509write_csr.c" + "mbedtls/library/xtea.c" + "port/esp_bignum.c" + "port/esp_hardware.c" + "port/esp_sha1.c" + "port/esp_sha256.c" + "port/esp_sha512.c" + "port/mbedtls_debug.c" + "port/net_sockets.c") set(COMPONENT_REQUIRES lwip) diff --git a/components/mdns/CMakeLists.txt b/components/mdns/CMakeLists.txt index 4ab664110..0933e3005 100644 --- a/components/mdns/CMakeLists.txt +++ b/components/mdns/CMakeLists.txt @@ -1,4 +1,6 @@ -set(COMPONENT_SRCDIRS ".") +set(COMPONENT_SRCS "mdns.c" + "mdns_console.c" + "mdns_networking.c") set(COMPONENT_ADD_INCLUDEDIRS "include") set(COMPONENT_PRIV_INCLUDEDIRS "private_include") set(COMPONENT_REQUIRES lwip mbedtls console tcpip_adapter) diff --git a/components/micro-ecc/CMakeLists.txt b/components/micro-ecc/CMakeLists.txt index 24e0a9e6f..a0e1693b1 100644 --- a/components/micro-ecc/CMakeLists.txt +++ b/components/micro-ecc/CMakeLists.txt @@ -1,5 +1,5 @@ -# only compile the micro-ecc/uECC.c source file -set(COMPONENT_SRCS micro-ecc/uECC.c) +# only compile the "micro-ecc/uECC.c" source file +set(COMPONENT_SRCS "micro-ecc/uECC.c") set(COMPONENT_ADD_INCLUDEDIRS micro-ecc) diff --git a/components/newlib/CMakeLists.txt b/components/newlib/CMakeLists.txt index 4bc0db3f9..a1d6d3367 100644 --- a/components/newlib/CMakeLists.txt +++ b/components/newlib/CMakeLists.txt @@ -1,4 +1,11 @@ -set(COMPONENT_SRCDIRS ".") +set(COMPONENT_SRCS "locks.c" + "pthread.c" + "random.c" + "reent_init.c" + "select.c" + "syscall_table.c" + "syscalls.c" + "time.c") set(COMPONENT_ADD_INCLUDEDIRS platform_include include) if(CONFIG_SPIRAM_CACHE_WORKAROUND) diff --git a/components/nghttp/CMakeLists.txt b/components/nghttp/CMakeLists.txt index c7e4b754b..b1a4b1642 100644 --- a/components/nghttp/CMakeLists.txt +++ b/components/nghttp/CMakeLists.txt @@ -1,4 +1,26 @@ set(COMPONENT_ADD_INCLUDEDIRS port/include nghttp2/lib/includes) -set(COMPONENT_SRCDIRS nghttp2/lib port) +set(COMPONENT_SRCS "nghttp2/lib/nghttp2_buf.c" + "nghttp2/lib/nghttp2_callbacks.c" + "nghttp2/lib/nghttp2_debug.c" + "nghttp2/lib/nghttp2_frame.c" + "nghttp2/lib/nghttp2_hd.c" + "nghttp2/lib/nghttp2_hd_huffman.c" + "nghttp2/lib/nghttp2_hd_huffman_data.c" + "nghttp2/lib/nghttp2_helper.c" + "nghttp2/lib/nghttp2_http.c" + "nghttp2/lib/nghttp2_map.c" + "nghttp2/lib/nghttp2_mem.c" + "nghttp2/lib/nghttp2_npn.c" + "nghttp2/lib/nghttp2_option.c" + "nghttp2/lib/nghttp2_outbound_item.c" + "nghttp2/lib/nghttp2_pq.c" + "nghttp2/lib/nghttp2_priority_spec.c" + "nghttp2/lib/nghttp2_queue.c" + "nghttp2/lib/nghttp2_rcbuf.c" + "nghttp2/lib/nghttp2_session.c" + "nghttp2/lib/nghttp2_stream.c" + "nghttp2/lib/nghttp2_submit.c" + "nghttp2/lib/nghttp2_version.c" + "port/http_parser.c") register_component() diff --git a/components/nvs_flash/CMakeLists.txt b/components/nvs_flash/CMakeLists.txt index 1fe5ecf26..ce7efbb14 100644 --- a/components/nvs_flash/CMakeLists.txt +++ b/components/nvs_flash/CMakeLists.txt @@ -1,4 +1,9 @@ -set(COMPONENT_SRCDIRS src) +set(COMPONENT_SRCS "src/nvs_api.cpp" + "src/nvs_item_hash_list.cpp" + "src/nvs_page.cpp" + "src/nvs_pagemanager.cpp" + "src/nvs_storage.cpp" + "src/nvs_types.cpp") set(COMPONENT_ADD_INCLUDEDIRS include) set(COMPONENT_REQUIRES spi_flash) diff --git a/components/openssl/CMakeLists.txt b/components/openssl/CMakeLists.txt index 84d02ffe8..3a96598f0 100644 --- a/components/openssl/CMakeLists.txt +++ b/components/openssl/CMakeLists.txt @@ -1,6 +1,13 @@ set(COMPONENT_ADD_INCLUDEDIRS include) set(COMPONENT_PRIV_INCLUDEDIRS include/internal include/platform include/openssl) -set(COMPONENT_SRCDIRS library platform) +set(COMPONENT_SRCS "library/ssl_cert.c" + "library/ssl_lib.c" + "library/ssl_methods.c" + "library/ssl_pkey.c" + "library/ssl_stack.c" + "library/ssl_x509.c" + "platform/ssl_pm.c" + "platform/ssl_port.c") set(COMPONENT_REQUIRES mbedtls) diff --git a/components/pthread/CMakeLists.txt b/components/pthread/CMakeLists.txt index 0b93e09ed..157793707 100644 --- a/components/pthread/CMakeLists.txt +++ b/components/pthread/CMakeLists.txt @@ -1,4 +1,6 @@ -set(COMPONENT_SRCDIRS ".") +set(COMPONENT_SRCS "pthread.c" + "pthread_cond_var.c" + "pthread_local_storage.c") set(COMPONENT_ADD_INCLUDEDIRS "include") set(COMPONENT_REQUIRES) register_component() diff --git a/components/sdmmc/CMakeLists.txt b/components/sdmmc/CMakeLists.txt index 58b9aeb67..41defd5e9 100644 --- a/components/sdmmc/CMakeLists.txt +++ b/components/sdmmc/CMakeLists.txt @@ -1,4 +1,9 @@ -set(COMPONENT_SRCDIRS ".") +set(COMPONENT_SRCS "sdmmc_cmd.c" + "sdmmc_common.c" + "sdmmc_init.c" + "sdmmc_io.c" + "sdmmc_mmc.c" + "sdmmc_sd.c") set(COMPONENT_ADD_INCLUDEDIRS "include") set(COMPONENT_REQUIRES driver) register_component() diff --git a/components/smartconfig_ack/CMakeLists.txt b/components/smartconfig_ack/CMakeLists.txt index 8b18007de..1518776ce 100644 --- a/components/smartconfig_ack/CMakeLists.txt +++ b/components/smartconfig_ack/CMakeLists.txt @@ -1,4 +1,4 @@ -set(COMPONENT_SRCDIRS ".") +set(COMPONENT_SRCS "smartconfig_ack.c") set(COMPONENT_ADD_INCLUDEDIRS "include") set(COMPONENT_PRIV_REQUIRES lwip tcpip_adapter) diff --git a/components/soc/CMakeLists.txt b/components/soc/CMakeLists.txt index a6a916b64..b46bde850 100644 --- a/components/soc/CMakeLists.txt +++ b/components/soc/CMakeLists.txt @@ -1,9 +1,12 @@ set(SOC_NAME esp32) -set(COMPONENT_SRCDIRS ${SOC_NAME} src) +include(${IDF_PATH}/components/soc/${SOC_NAME}/sources.cmake) + +spaces2list(SOC_SRCS) +add_prefix(COMPONENT_SRCS "${SOC_NAME}/" ${SOC_SRCS}) +list(APPEND COMPONENT_SRCS "src/memory_layout_utils.c") + set(COMPONENT_ADD_INCLUDEDIRS ${SOC_NAME}/include include) set(COMPONENT_REQUIRES) - - -register_component() +register_component() \ No newline at end of file diff --git a/components/soc/esp32/sources.cmake b/components/soc/esp32/sources.cmake new file mode 100644 index 000000000..25e2061af --- /dev/null +++ b/components/soc/esp32/sources.cmake @@ -0,0 +1,14 @@ +set(SOC_SRCS "cpu_util.c" + "gpio_periph.c" + "rtc_clk.c" + "rtc_clk_init.c" + "rtc_init.c" + "rtc_periph.c" + "rtc_pm.c" + "rtc_sleep.c" + "rtc_time.c" + "rtc_wdt.c" + "sdio_slave_periph.c" + "sdmmc_periph.c" + "soc_memory_layout.c" + "spi_periph.c") \ No newline at end of file diff --git a/components/spi_flash/CMakeLists.txt b/components/spi_flash/CMakeLists.txt index 1eafba54d..0445b5334 100644 --- a/components/spi_flash/CMakeLists.txt +++ b/components/spi_flash/CMakeLists.txt @@ -1,10 +1,14 @@ if(BOOTLOADER_BUILD) # Bootloader needs SPIUnlock from this file, but doesn't # need other parts of this component - set(COMPONENT_SRCS spi_flash_rom_patch.c) + set(COMPONENT_SRCS "spi_flash_rom_patch.c") set(COMPONENT_PRIV_REQUIRES bootloader_support) else() - set(COMPONENT_SRCDIRS .) + set(COMPONENT_SRCS "cache_utils.c" + "flash_mmap.c" + "flash_ops.c" + "partition.c" + "spi_flash_rom_patch.c") set(COMPONENT_PRIV_REQUIRES bootloader_support app_update) endif() diff --git a/components/spiffs/CMakeLists.txt b/components/spiffs/CMakeLists.txt index 54356cb0d..c0903655d 100644 --- a/components/spiffs/CMakeLists.txt +++ b/components/spiffs/CMakeLists.txt @@ -1,6 +1,12 @@ set(COMPONENT_ADD_INCLUDEDIRS "include") set(COMPONENT_PRIV_INCLUDEDIRS "." "spiffs/src") -set(COMPONENT_SRCDIRS "." "spiffs/src") +set(COMPONENT_SRCS "esp_spiffs.c" + "spiffs/src/spiffs_cache.c" + "spiffs/src/spiffs_check.c" + "spiffs/src/spiffs_gc.c" + "spiffs/src/spiffs_hydrogen.c" + "spiffs/src/spiffs_nucleus.c" + "spiffs_api.c") set(COMPONENT_REQUIRES spi_flash) set(COMPONENT_PRIV_REQUIRES bootloader_support) diff --git a/components/tcpip_adapter/CMakeLists.txt b/components/tcpip_adapter/CMakeLists.txt index 24deb2f24..2868696ac 100644 --- a/components/tcpip_adapter/CMakeLists.txt +++ b/components/tcpip_adapter/CMakeLists.txt @@ -1,4 +1,4 @@ -set(COMPONENT_SRCDIRS ".") +set(COMPONENT_SRCS "tcpip_adapter_lwip.c") set(COMPONENT_ADD_INCLUDEDIRS "include") set(COMPONENT_REQUIRES lwip) diff --git a/components/ulp/CMakeLists.txt b/components/ulp/CMakeLists.txt index fc21f1eca..9c71467b3 100644 --- a/components/ulp/CMakeLists.txt +++ b/components/ulp/CMakeLists.txt @@ -1,4 +1,5 @@ -set(COMPONENT_SRCDIRS ".") +set(COMPONENT_SRCS "ulp.c" + "ulp_macro.c") set(COMPONENT_ADD_INCLUDEDIRS "include") set(COMPONENT_REQUIRES) diff --git a/components/vfs/CMakeLists.txt b/components/vfs/CMakeLists.txt index fc21f1eca..77083dc20 100644 --- a/components/vfs/CMakeLists.txt +++ b/components/vfs/CMakeLists.txt @@ -1,4 +1,5 @@ -set(COMPONENT_SRCDIRS ".") +set(COMPONENT_SRCS "vfs.c" + "vfs_uart.c") set(COMPONENT_ADD_INCLUDEDIRS "include") set(COMPONENT_REQUIRES) diff --git a/components/wear_levelling/CMakeLists.txt b/components/wear_levelling/CMakeLists.txt index 8b5db6231..59b81ccfa 100644 --- a/components/wear_levelling/CMakeLists.txt +++ b/components/wear_levelling/CMakeLists.txt @@ -1,4 +1,10 @@ -set(COMPONENT_SRCDIRS ".") +set(COMPONENT_SRCS "Partition.cpp" + "SPI_Flash.cpp" + "WL_Ext_Perf.cpp" + "WL_Ext_Safe.cpp" + "WL_Flash.cpp" + "crc32.cpp" + "wear_levelling.cpp") set(COMPONENT_ADD_INCLUDEDIRS "include") set(COMPONENT_PRIV_INCLUDEDIRS private_include) set(COMPONENT_REQUIRES spi_flash) diff --git a/components/wpa_supplicant/CMakeLists.txt b/components/wpa_supplicant/CMakeLists.txt index 2f63ff398..8564f1ba0 100644 --- a/components/wpa_supplicant/CMakeLists.txt +++ b/components/wpa_supplicant/CMakeLists.txt @@ -1,4 +1,76 @@ -set(COMPONENT_SRCDIRS src/crypto port src/fast_crypto src/wpa2/eap_peer src/wpa2/tls src/wpa2/utils src/wps) +set(COMPONENT_SRCS "port/os_xtensa.c" + "src/crypto/aes-cbc.c" + "src/crypto/aes-internal-dec.c" + "src/crypto/aes-internal-enc.c" + "src/crypto/aes-internal.c" + "src/crypto/aes-unwrap.c" + "src/crypto/aes-wrap.c" + "src/crypto/bignum.c" + "src/crypto/crypto_internal-cipher.c" + "src/crypto/crypto_internal-modexp.c" + "src/crypto/crypto_internal-rsa.c" + "src/crypto/crypto_internal.c" + "src/crypto/des-internal.c" + "src/crypto/dh_group5.c" + "src/crypto/dh_groups.c" + "src/crypto/md4-internal.c" + "src/crypto/md5-internal.c" + "src/crypto/md5.c" + "src/crypto/ms_funcs.c" + "src/crypto/rc4.c" + "src/crypto/sha1-internal.c" + "src/crypto/sha1-pbkdf2.c" + "src/crypto/sha1.c" + "src/crypto/sha256-internal.c" + "src/crypto/sha256.c" + "src/fast_crypto/fast_aes-cbc.c" + "src/fast_crypto/fast_aes-unwrap.c" + "src/fast_crypto/fast_aes-wrap.c" + "src/fast_crypto/fast_crypto_internal-cipher.c" + "src/fast_crypto/fast_crypto_internal-modexp.c" + "src/fast_crypto/fast_crypto_internal.c" + "src/fast_crypto/fast_sha256-internal.c" + "src/fast_crypto/fast_sha256.c" + "src/wpa2/eap_peer/chap.c" + "src/wpa2/eap_peer/eap.c" + "src/wpa2/eap_peer/eap_common.c" + "src/wpa2/eap_peer/eap_mschapv2.c" + "src/wpa2/eap_peer/eap_peap.c" + "src/wpa2/eap_peer/eap_peap_common.c" + "src/wpa2/eap_peer/eap_tls.c" + "src/wpa2/eap_peer/eap_tls_common.c" + "src/wpa2/eap_peer/eap_ttls.c" + "src/wpa2/eap_peer/mschapv2.c" + "src/wpa2/tls/asn1.c" + "src/wpa2/tls/bignum.c" + "src/wpa2/tls/pkcs1.c" + "src/wpa2/tls/pkcs5.c" + "src/wpa2/tls/pkcs8.c" + "src/wpa2/tls/rsa.c" + "src/wpa2/tls/tls_internal.c" + "src/wpa2/tls/tlsv1_client.c" + "src/wpa2/tls/tlsv1_client_read.c" + "src/wpa2/tls/tlsv1_client_write.c" + "src/wpa2/tls/tlsv1_common.c" + "src/wpa2/tls/tlsv1_cred.c" + "src/wpa2/tls/tlsv1_record.c" + "src/wpa2/tls/tlsv1_server.c" + "src/wpa2/tls/tlsv1_server_read.c" + "src/wpa2/tls/tlsv1_server_write.c" + "src/wpa2/tls/x509v3.c" + "src/wpa2/utils/base64.c" + "src/wpa2/utils/ext_password.c" + "src/wps/eap_common.c" + "src/wps/uuid.c" + "src/wps/wps.c" + "src/wps/wps_attr_build.c" + "src/wps/wps_attr_parse.c" + "src/wps/wps_attr_process.c" + "src/wps/wps_common.c" + "src/wps/wps_dev_attr.c" + "src/wps/wps_enrollee.c" + "src/wps/wps_registrar.c" + "src/wps/wps_validate.c") set(COMPONENT_ADD_INCLUDEDIRS include port/include) set(COMPONENT_REQUIRES "") diff --git a/components/xtensa-debug-module/CMakeLists.txt b/components/xtensa-debug-module/CMakeLists.txt index 810d299d1..465690d82 100644 --- a/components/xtensa-debug-module/CMakeLists.txt +++ b/components/xtensa-debug-module/CMakeLists.txt @@ -1,4 +1,5 @@ -set(COMPONENT_SRCDIRS ".") +set(COMPONENT_SRCS "eri.c" + "trax.c") set(COMPONENT_ADD_INCLUDEDIRS "include") set(COMPONENT_REQUIRES "") diff --git a/docs/en/api-guides/build-system-cmake.rst b/docs/en/api-guides/build-system-cmake.rst index d0423c01e..dfa679c2f 100644 --- a/docs/en/api-guides/build-system-cmake.rst +++ b/docs/en/api-guides/build-system-cmake.rst @@ -170,14 +170,14 @@ An example project directory tree might look like this:: This example "myProject" contains the following elements: -- A top-level project CMakeLists.txt file. This is the primary file which CMake uses to learn how to build the project. The project CMakeLists.txt file sets the ``MAIN_SRCS`` variable which lists all of the source files in the "main" directory (part of this project's executable). It may set other project-wide CMake variables, as well. Then it includes the file :idf_file:`/tools/cmake/project.cmake` which +- A top-level project CMakeLists.txt file. This is the primary file which CMake uses to learn how to build the project; and may set project-wide CMake variables. It includes the file :idf_file:`/tools/cmake/project.cmake` which implements the rest of the build system. Finally, it sets the project name and defines the project. - "sdkconfig" project configuration file. This file is created/updated when ``idf.py menuconfig`` runs, and holds configuration for all of the components in the project (including ESP-IDF itself). The "sdkconfig" file may or may not be added to the source control system of the project. - Optional "components" directory contains components that are part of the project. A project does not have to contain custom components of this kind, but it can be useful for structuring reusable code or including third party components that aren't part of ESP-IDF. -- "main" directory is a special "by convention" directory that contains source code for the project executable itself. These source files are listed in the project's CMakeLists file. You don't need to name this directory "main", but we recommend you follow this convention. If you have a lot of source files in your project, we recommend grouping most into components instead of putting them all in "main". +- "main" directory is a special "pseudo-component" that contains source code for the project itself. "main" is a default name, the CMake variable ``COMPONENT_DIRS`` includes this component but you can modify this variable (or set ``EXTRA_COMPONENT_DIRS`` in the top-level CMakeLists.txt) to look for components in other places. If you have a lot of source files in your project, we recommend grouping most into components instead of putting them all in "main". - "build" directory is where build output is created. This directory is created by ``idf.py`` if it doesn't already exist. CMake configures the project and generates interim build files in this directory. Then, after the main build process is run, this directory will also contain interim object files and libraries as well as final binary output files. This directory is usually not added to source control or distributed with the project source code. @@ -200,8 +200,6 @@ Minimal project:: cmake_minimum_required(VERSION 3.5) - set(MAIN_SRCS main/src1.c main/src2.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(myProject) @@ -214,11 +212,6 @@ Mandatory Parts The inclusion of these four lines, in the order shown above, is necessary for every project: - ``cmake_minimum_required(VERSION 3.5)`` tells CMake what version is required to build the project. ESP-IDF is designed to work with CMake 3.5 or newer. This line must be the first line in the CMakeLists.txt file. -- ``set(MAIN_SRCS xxx)`` sets a variable - ``MAIN_SRCS`` to be a list of the "main" source files in the project. Paths are relative to the CMakeLists. They don't specifically need to be under the "main" sub-directory, but this structure is encouraged. - - It is *strongly recommended not to add a lot of files to the MAIN_SRCS list*. If you have a lot of source files then it recommended to organise them functionally into individual components under the project "components" directory. This will make your project more maintainable, reusable, and easier to configure. Components are further explained below. - - ``MAIN_SRCS`` must name at least one source file (although that file doesn't need to necessarily include an ``app_main()`` function or anything else). - ``include($ENV{IDF_PATH}/tools/cmake/project.cmake)`` pulls in the rest of the CMake functionality to configure the project, discover all the components, etc. - ``project(myProject)`` creates the project itself, and specifies the project name. The project name is used for the final binary output files of the app - ie ``myProject.elf``, ``myProject.bin``. Only one project can be defined per CMakeLists file. @@ -268,11 +261,11 @@ Minimal Component CMakeLists The minimal component ``CMakeLists.txt`` file is as follows:: - set(COMPONENT_SRCDIRS ".") + set(COMPONENT_SRCS "foo.c") set(COMPONENT_ADD_INCLUDEDIRS "include") register_component() -- ``COMPONENT_SRCDIRS`` is a (space-separated) list of directories to search for source files. Source files (``*.c``, ``*.cpp``, ``*.cc``, ``*.S``) in these directories will be compiled into the component library. +- ``COMPONENT_SRCS`` is a (space-separated) list of source files (``*.c``, ``*.cpp``, ``*.cc``, ``*.S``). These source files will be compiled into the component library. - ``COMPONENT_ADD_INCLUDEDIRS`` is a (space-separated) list of directories to add to the global include search path for any component which requires this component, and also the main source files. - ``register_component()`` is required to add the component (using the variables set above) to the build. A library with the name of the component will be built and linked into the final app. If this step is skipped (perhaps due to use of a CMake `if function `_ or similar), this component will not be part of the build. @@ -320,12 +313,17 @@ The following variables can be set inside ``component.mk`` to control the build the component directory, which will be added to the include search path for this component's source files only. - ``COMPONENT_PRIV_REQUIRES`` is a (space-separated) list of components that are required to either compile or link this component's source files. These components' header paths do not propagate to other components which require it, they are only used to compile this component's sources. See `Component Requirements`_ for more details. +- ``COMPONENT_SRCS``: Paths to individual source files to compile as part of the component. This is the recommended way of adding source files to the build. - ``COMPONENT_SRCDIRS``: Directory paths, must be relative to the component directory, which will be searched for source files (``*.cpp``, - ``*.c``, ``*.S``). Set this to specify a list of directories which contain source files. -- ``COMPONENT_SRCS``: Paths to individual source files to compile. Setting this causes ``COMPONENT_SRCDIRS`` to be ignored. Setting this variable instead gives you finer grained control over which files are compiled. - If you don't set ``COMPONENT_SRCDIRS`` or ``COMPONENT_SRCS``, your component won't compile a library but it may still add include paths for use when compiling other components or the source files listed in ``MAIN_SRCS``. + ``*.c``, ``*.S``). Source files are globbed from the listed directories and compiled as part of the component in place of ``COMPONENT_SRCS``, i.e. setting this will cause ``COMPONENT_SRCS`` to be ignored. + This can be a convenient way of including source files to the components en masse, but is generally not recommended due to caveats attached to CMake globbing (see `File Globbing & Incremental Builds`). - ``COMPONENT_SRCEXCLUDE``: Paths to source files to exclude from component. Can be set in conjunction with ``COMPONENT_SRCDIRS`` if there is a directory with a large number of source files to include in the component but one or more source files which should not be. Paths can be specified relative to the component directory or absolute. +.. note:: + + If you don't set ``COMPONENT_SRCDIRS`` or ``COMPONENT_SRCS``, your component won't compile a library but it may still add include paths for use when compiling other components. + + Controlling Component Compilation --------------------------------- @@ -399,7 +397,6 @@ When creating a project - Those components' requirements (evaluated recursively). - The "common" components that every component depends on. - Setting ``COMPONENTS`` to the minimal list of required components can significantly reduce compile times. -- When compiling the project's source files (``MAIN_SRCS``), the public header directories (``COMPONENT_ADD_INCLUDEDIRS`` list) of all components included in the build are available. .. _component-requirements-implementation: @@ -777,22 +774,20 @@ File Globbing & Incremental Builds .. highlight:: cmake -The preferred way to include source files in an ESP-IDF component is to set ``COMPONENT_SRC_DIRS``:: - - set(COMPONENT_SRCDIRS library platform) - -The build system will automatically find (via "file globbing") all source files in this directory. Alternatively, files can be specified individually:: +The preferred way to include source files in an ESP-IDF component is to list them manually in COMPONENT_SRCS:: set(COMPONENT_SRCS library/a.c library/b.c platform/platform.c) -CMake_ recommends always to name all files individually (ie ``COMPONENT_SRCS``). This is because CMake is automatically re-run whenever a CMakeLists file changes. If a new source file is added and file globbing is used, then CMake won't know to automatically re-run and this file won't be added to the build. +This preference reflects the `CMake best practice `_ of manually listing source files. This could, however, be inconvenient when there are lots of source files to add to the build. The ESP-IDF build system provides an alternative way for specifying source files using ``COMPONENT_SRCDIRS``:: + + set(COMPONENT_SRCDIRS library platform) + +This uses globbing behind the scenes to find source files in the specified directories. Be aware, however, that if a new source file is added and this method is used, then CMake won't know to automatically re-run and this file won't be added to the build. The trade-off is acceptable when you're adding the file yourself, because you can trigger a clean build or run ``idf.py reconfigure`` to manually re-run CMake_. However, the problem gets harder when you share your project with others who may check out a new version using a source control tool like Git... For components which are part of ESP-IDF, we use a third party Git CMake integration module (:idf_file:`/tools/cmake/third_party/GetGitRevisionDescription.cmake`) which automatically re-runs CMake any time the repository commit changes. This means if you check out a new ESP-IDF version, CMake will automatically rerun. -For project CMakeLists files, ``MAIN_SRCS`` is a list of source files. Therefore if a new file is added, CMakeLists will change and this triggers a re-run of CMake. (This is the approach which CMake_ recommends.) - For project components (not part of ESP-IDF), there are a few different options: - If keeping your project file in Git, ESP-IDF will automatically track the Git revision and re-run CMake if the revision changes. @@ -889,15 +884,6 @@ It does so by running ``make`` to expand the ESP-IDF build system variables whic The conversion tool is not capable of dealing with complex Makefile logic or unusual targets. These will need to be converted by hand. -'main' is no longer a component -------------------------------- - -In the GNU Make build system ``main`` is a component with a ``component.mk`` file like other components. - -Due to CMake requirements for building executables, ``main`` source files are now linked directly into the final binary. The source files in ``main`` must be listed in the ``MAIN_SRCS`` variable (see :ref:`project mandatory variables ` for more details). At least one source file has to be listed here (although it doesn't need to contain anything in particular). - -In general, it's better not to have too many source files in ``MAIN_SRCS``. If you find that you are adding many source files here, see if you can reorganize and group some into project components (see the :ref:`example project structure `, above). - No Longer Available in CMake ---------------------------- @@ -930,8 +916,7 @@ The following variables no longer have default values: No Longer Necessary ------------------- -It is no longer necessary to set ``COMPONENT_SRCDIRS`` if setting ``COMPONENT_SRCS`` (in fact, in the CMake-based system ``COMPONENT_SRCDIRS`` is ignored if ``COMPONENT_SRCS`` is set). - +It is no longer necessary to set ``COMPONENT_SRCDIRS`` if setting ``COMPONENT_SRCS`` (in fact, in the CMake-based system ``COMPONENT_SRCS`` is ignored if ``COMPONENT_SRCDIRS`` is set). .. _esp-idf-template: https://github.com/espressif/esp-idf-template .. _cmake: https://cmake.org diff --git a/examples/bluetooth/a2dp_gatts_coex/CMakeLists.txt b/examples/bluetooth/a2dp_gatts_coex/CMakeLists.txt index 3243515f3..3c9fa474c 100644 --- a/examples/bluetooth/a2dp_gatts_coex/CMakeLists.txt +++ b/examples/bluetooth/a2dp_gatts_coex/CMakeLists.txt @@ -2,11 +2,5 @@ # CMakeLists in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS - main/bt_app_av.c - main/bt_app_core.c - main/main.c - ) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(bt_ble_coex) diff --git a/examples/bluetooth/a2dp_gatts_coex/main/CMakeLists.txt b/examples/bluetooth/a2dp_gatts_coex/main/CMakeLists.txt new file mode 100644 index 000000000..a55538b5f --- /dev/null +++ b/examples/bluetooth/a2dp_gatts_coex/main/CMakeLists.txt @@ -0,0 +1,6 @@ +set(COMPONENT_SRCS "bt_app_av.c" + "bt_app_core.c" + "main.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/bluetooth/a2dp_sink/CMakeLists.txt b/examples/bluetooth/a2dp_sink/CMakeLists.txt index 4d14857a0..cc8e45027 100644 --- a/examples/bluetooth/a2dp_sink/CMakeLists.txt +++ b/examples/bluetooth/a2dp_sink/CMakeLists.txt @@ -2,11 +2,5 @@ # CMakeLists in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS - main/bt_app_av.c - main/bt_app_core.c - main/main.c - ) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(a2dp_sink) diff --git a/examples/bluetooth/a2dp_sink/main/CMakeLists.txt b/examples/bluetooth/a2dp_sink/main/CMakeLists.txt new file mode 100644 index 000000000..a55538b5f --- /dev/null +++ b/examples/bluetooth/a2dp_sink/main/CMakeLists.txt @@ -0,0 +1,6 @@ +set(COMPONENT_SRCS "bt_app_av.c" + "bt_app_core.c" + "main.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/bluetooth/a2dp_source/CMakeLists.txt b/examples/bluetooth/a2dp_source/CMakeLists.txt index 1b4c44799..7c4e21528 100644 --- a/examples/bluetooth/a2dp_source/CMakeLists.txt +++ b/examples/bluetooth/a2dp_source/CMakeLists.txt @@ -2,10 +2,5 @@ # CMakeLists in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS - main/bt_app_core.c - main/main.c - ) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(a2dp_source) diff --git a/examples/bluetooth/a2dp_source/main/CMakeLists.txt b/examples/bluetooth/a2dp_source/main/CMakeLists.txt new file mode 100644 index 000000000..98b05a101 --- /dev/null +++ b/examples/bluetooth/a2dp_source/main/CMakeLists.txt @@ -0,0 +1,5 @@ +set(COMPONENT_SRCS "bt_app_core.c" + "main.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/bluetooth/ble_adv/CMakeLists.txt b/examples/bluetooth/ble_adv/CMakeLists.txt index 04715a858..22b94847f 100644 --- a/examples/bluetooth/ble_adv/CMakeLists.txt +++ b/examples/bluetooth/ble_adv/CMakeLists.txt @@ -2,9 +2,5 @@ # CMakeLists in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS - main/app_bt.c - ) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(ble_adv) diff --git a/examples/bluetooth/ble_adv/main/CMakeLists.txt b/examples/bluetooth/ble_adv/main/CMakeLists.txt new file mode 100644 index 000000000..d005e6012 --- /dev/null +++ b/examples/bluetooth/ble_adv/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "app_bt.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/bluetooth/ble_eddystone/CMakeLists.txt b/examples/bluetooth/ble_eddystone/CMakeLists.txt index 05d77c7c6..9c5943ef0 100644 --- a/examples/bluetooth/ble_eddystone/CMakeLists.txt +++ b/examples/bluetooth/ble_eddystone/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/esp_eddystone_api.c main/esp_eddystone_demo.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(ble_eddystone_demo) diff --git a/examples/bluetooth/ble_eddystone/main/CMakeLists.txt b/examples/bluetooth/ble_eddystone/main/CMakeLists.txt new file mode 100644 index 000000000..66a4e1aa6 --- /dev/null +++ b/examples/bluetooth/ble_eddystone/main/CMakeLists.txt @@ -0,0 +1,5 @@ +set(COMPONENT_SRCS "esp_eddystone_api.c" + "esp_eddystone_demo.c") +set(COMPONENT_ADD_INCLUDEDIRS "") + +register_component() diff --git a/examples/bluetooth/ble_hid_device_demo/CMakeLists.txt b/examples/bluetooth/ble_hid_device_demo/CMakeLists.txt index 9cacc3489..f8c948007 100644 --- a/examples/bluetooth/ble_hid_device_demo/CMakeLists.txt +++ b/examples/bluetooth/ble_hid_device_demo/CMakeLists.txt @@ -1,11 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/ble_hidd_demo_main.c - main/hid_dev.c - main/hid_device_le_prf.c - main/esp_hidd_prf_api.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(hidd_demos) diff --git a/examples/bluetooth/ble_hid_device_demo/main/CMakeLists.txt b/examples/bluetooth/ble_hid_device_demo/main/CMakeLists.txt new file mode 100644 index 000000000..cada4eb3c --- /dev/null +++ b/examples/bluetooth/ble_hid_device_demo/main/CMakeLists.txt @@ -0,0 +1,7 @@ +set(COMPONENT_SRCS "ble_hidd_demo_main.c" + "esp_hidd_prf_api.c" + "hid_dev.c" + "hid_device_le_prf.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/bluetooth/ble_ibeacon/CMakeLists.txt b/examples/bluetooth/ble_ibeacon/CMakeLists.txt index 5eb1d7363..dce22425d 100644 --- a/examples/bluetooth/ble_ibeacon/CMakeLists.txt +++ b/examples/bluetooth/ble_ibeacon/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/ibeacon_demo.c main/esp_ibeacon_api.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(ble_ibeacon_demo) diff --git a/examples/bluetooth/ble_ibeacon/main/CMakeLists.txt b/examples/bluetooth/ble_ibeacon/main/CMakeLists.txt new file mode 100644 index 000000000..1ae1a02e6 --- /dev/null +++ b/examples/bluetooth/ble_ibeacon/main/CMakeLists.txt @@ -0,0 +1,5 @@ +set(COMPONENT_SRCS "esp_ibeacon_api.c" + "ibeacon_demo.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/bluetooth/ble_spp_client/CMakeLists.txt b/examples/bluetooth/ble_spp_client/CMakeLists.txt index 93abbbfb3..301d8408e 100644 --- a/examples/bluetooth/ble_spp_client/CMakeLists.txt +++ b/examples/bluetooth/ble_spp_client/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/spp_client_demo.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(spp_client_demo) diff --git a/examples/bluetooth/ble_spp_client/main/CMakeLists.txt b/examples/bluetooth/ble_spp_client/main/CMakeLists.txt new file mode 100644 index 000000000..de584f397 --- /dev/null +++ b/examples/bluetooth/ble_spp_client/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "spp_client_demo.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/bluetooth/ble_spp_server/CMakeLists.txt b/examples/bluetooth/ble_spp_server/CMakeLists.txt index c0508f801..b4dcebe6a 100644 --- a/examples/bluetooth/ble_spp_server/CMakeLists.txt +++ b/examples/bluetooth/ble_spp_server/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/ble_spp_server_demo.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(ble_spp_server_demo) diff --git a/examples/bluetooth/ble_spp_server/main/CMakeLists.txt b/examples/bluetooth/ble_spp_server/main/CMakeLists.txt new file mode 100644 index 000000000..99f35ee07 --- /dev/null +++ b/examples/bluetooth/ble_spp_server/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "ble_spp_server_demo.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/bluetooth/ble_throughput/throughput_client/CMakeLists.txt b/examples/bluetooth/ble_throughput/throughput_client/CMakeLists.txt index c557a916e..3a592ef4f 100644 --- a/examples/bluetooth/ble_throughput/throughput_client/CMakeLists.txt +++ b/examples/bluetooth/ble_throughput/throughput_client/CMakeLists.txt @@ -2,9 +2,5 @@ # CMakeLists in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS - main/example_ble_client_throughput.c - ) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(throughput_client_demo) diff --git a/examples/bluetooth/ble_throughput/throughput_client/main/CMakeLists.txt b/examples/bluetooth/ble_throughput/throughput_client/main/CMakeLists.txt new file mode 100644 index 000000000..1fe275526 --- /dev/null +++ b/examples/bluetooth/ble_throughput/throughput_client/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "example_ble_client_throughput.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/bluetooth/ble_throughput/throughput_server/CMakeLists.txt b/examples/bluetooth/ble_throughput/throughput_server/CMakeLists.txt index 8d3bd0cbb..adcc12d73 100644 --- a/examples/bluetooth/ble_throughput/throughput_server/CMakeLists.txt +++ b/examples/bluetooth/ble_throughput/throughput_server/CMakeLists.txt @@ -2,9 +2,5 @@ # CMakeLists in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS - main/example_ble_server_throughput.c - ) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(throughput_server_demo) diff --git a/examples/bluetooth/ble_throughput/throughput_server/main/CMakeLists.txt b/examples/bluetooth/ble_throughput/throughput_server/main/CMakeLists.txt new file mode 100644 index 000000000..3c1f62ac8 --- /dev/null +++ b/examples/bluetooth/ble_throughput/throughput_server/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "example_ble_server_throughput.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/bluetooth/blufi/CMakeLists.txt b/examples/bluetooth/blufi/CMakeLists.txt index e016e161a..b85d34bbb 100644 --- a/examples/bluetooth/blufi/CMakeLists.txt +++ b/examples/bluetooth/blufi/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/blufi_security.c main/blufi_example_main.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(blufi_demo) diff --git a/examples/bluetooth/blufi/main/CMakeLists.txt b/examples/bluetooth/blufi/main/CMakeLists.txt new file mode 100644 index 000000000..cbb9b24c3 --- /dev/null +++ b/examples/bluetooth/blufi/main/CMakeLists.txt @@ -0,0 +1,5 @@ +set(COMPONENT_SRCS "blufi_example_main.c" + "blufi_security.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/bluetooth/bt_discovery/CMakeLists.txt b/examples/bluetooth/bt_discovery/CMakeLists.txt index b79d221bd..6b73adc36 100644 --- a/examples/bluetooth/bt_discovery/CMakeLists.txt +++ b/examples/bluetooth/bt_discovery/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/bt_discovery.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(bt_discovery) diff --git a/examples/bluetooth/bt_discovery/main/CMakeLists.txt b/examples/bluetooth/bt_discovery/main/CMakeLists.txt new file mode 100644 index 000000000..68ddbfb4c --- /dev/null +++ b/examples/bluetooth/bt_discovery/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "bt_discovery.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/bluetooth/bt_spp_acceptor/CMakeLists.txt b/examples/bluetooth/bt_spp_acceptor/CMakeLists.txt index 5ed97b387..8b26ee3f5 100644 --- a/examples/bluetooth/bt_spp_acceptor/CMakeLists.txt +++ b/examples/bluetooth/bt_spp_acceptor/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/example_spp_acceptor_demo.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(bt_spp_acceptor_demo) diff --git a/examples/bluetooth/bt_spp_acceptor/main/CMakeLists.txt b/examples/bluetooth/bt_spp_acceptor/main/CMakeLists.txt new file mode 100644 index 000000000..0694503f9 --- /dev/null +++ b/examples/bluetooth/bt_spp_acceptor/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "example_spp_acceptor_demo.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/bluetooth/bt_spp_initiator/CMakeLists.txt b/examples/bluetooth/bt_spp_initiator/CMakeLists.txt index fc8eb551b..4ee5f0778 100644 --- a/examples/bluetooth/bt_spp_initiator/CMakeLists.txt +++ b/examples/bluetooth/bt_spp_initiator/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/example_spp_initiator_demo.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(bt_spp_initiator_demo) diff --git a/examples/bluetooth/bt_spp_initiator/main/CMakeLists.txt b/examples/bluetooth/bt_spp_initiator/main/CMakeLists.txt new file mode 100644 index 000000000..1eae1b74c --- /dev/null +++ b/examples/bluetooth/bt_spp_initiator/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "example_spp_initiator_demo.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/bluetooth/bt_spp_vfs_acceptor/CMakeLists.txt b/examples/bluetooth/bt_spp_vfs_acceptor/CMakeLists.txt index b37ab5f68..46030210a 100644 --- a/examples/bluetooth/bt_spp_vfs_acceptor/CMakeLists.txt +++ b/examples/bluetooth/bt_spp_vfs_acceptor/CMakeLists.txt @@ -1,10 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS - main/example_spp_vfs_acceptor_demo.c - main/spp_task.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(bt_spp_vfs_acceptor_demo) diff --git a/examples/bluetooth/bt_spp_vfs_acceptor/main/CMakeLists.txt b/examples/bluetooth/bt_spp_vfs_acceptor/main/CMakeLists.txt new file mode 100644 index 000000000..b224db80b --- /dev/null +++ b/examples/bluetooth/bt_spp_vfs_acceptor/main/CMakeLists.txt @@ -0,0 +1,5 @@ +set(COMPONENT_SRCS "example_spp_vfs_acceptor_demo.c" + "spp_task.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/bluetooth/bt_spp_vfs_initiator/CMakeLists.txt b/examples/bluetooth/bt_spp_vfs_initiator/CMakeLists.txt index 94c7b230d..a13390392 100644 --- a/examples/bluetooth/bt_spp_vfs_initiator/CMakeLists.txt +++ b/examples/bluetooth/bt_spp_vfs_initiator/CMakeLists.txt @@ -1,10 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS - main/example_spp_vfs_initiator_demo.c - main/spp_task.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(bt_spp_vfs_initiator_demo) diff --git a/examples/bluetooth/bt_spp_vfs_initiator/main/CMakeLists.txt b/examples/bluetooth/bt_spp_vfs_initiator/main/CMakeLists.txt new file mode 100644 index 000000000..f3b911135 --- /dev/null +++ b/examples/bluetooth/bt_spp_vfs_initiator/main/CMakeLists.txt @@ -0,0 +1,5 @@ +set(COMPONENT_SRCS "example_spp_vfs_initiator_demo.c" + "spp_task.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/bluetooth/controller_hci_uart/CMakeLists.txt b/examples/bluetooth/controller_hci_uart/CMakeLists.txt index 0c7fcbdd9..49c95f4da 100644 --- a/examples/bluetooth/controller_hci_uart/CMakeLists.txt +++ b/examples/bluetooth/controller_hci_uart/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/controller_hci_uart_demo.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(controller_hci_uart) diff --git a/examples/bluetooth/controller_hci_uart/main/CMakeLists.txt b/examples/bluetooth/controller_hci_uart/main/CMakeLists.txt new file mode 100644 index 000000000..2f40a64c6 --- /dev/null +++ b/examples/bluetooth/controller_hci_uart/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "controller_hci_uart_demo.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/bluetooth/gatt_client/CMakeLists.txt b/examples/bluetooth/gatt_client/CMakeLists.txt index 5e41444ab..d32eb6bee 100644 --- a/examples/bluetooth/gatt_client/CMakeLists.txt +++ b/examples/bluetooth/gatt_client/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/gattc_demo.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(gatt_client_demo) diff --git a/examples/bluetooth/gatt_client/main/CMakeLists.txt b/examples/bluetooth/gatt_client/main/CMakeLists.txt new file mode 100644 index 000000000..7c79edcea --- /dev/null +++ b/examples/bluetooth/gatt_client/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "gattc_demo.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/bluetooth/gatt_security_client/CMakeLists.txt b/examples/bluetooth/gatt_security_client/CMakeLists.txt index 787f0b763..8f468d764 100644 --- a/examples/bluetooth/gatt_security_client/CMakeLists.txt +++ b/examples/bluetooth/gatt_security_client/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/example_ble_sec_gattc_demo.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(sec_gattc_demo) diff --git a/examples/bluetooth/gatt_security_client/main/CMakeLists.txt b/examples/bluetooth/gatt_security_client/main/CMakeLists.txt new file mode 100644 index 000000000..32cea7e2e --- /dev/null +++ b/examples/bluetooth/gatt_security_client/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "example_ble_sec_gattc_demo.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/bluetooth/gatt_security_server/CMakeLists.txt b/examples/bluetooth/gatt_security_server/CMakeLists.txt index d232d02b3..8e9d61ff9 100644 --- a/examples/bluetooth/gatt_security_server/CMakeLists.txt +++ b/examples/bluetooth/gatt_security_server/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/example_ble_sec_gatts_demo.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(sec_gatts_demo) diff --git a/examples/bluetooth/gatt_security_server/main/CMakeLists.txt b/examples/bluetooth/gatt_security_server/main/CMakeLists.txt new file mode 100644 index 000000000..87df03c69 --- /dev/null +++ b/examples/bluetooth/gatt_security_server/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "example_ble_sec_gatts_demo.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/bluetooth/gatt_server/CMakeLists.txt b/examples/bluetooth/gatt_server/CMakeLists.txt index 74a0560be..fb1760c1e 100644 --- a/examples/bluetooth/gatt_server/CMakeLists.txt +++ b/examples/bluetooth/gatt_server/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/gatts_demo.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(gatt_server_demos) diff --git a/examples/bluetooth/gatt_server/main/CMakeLists.txt b/examples/bluetooth/gatt_server/main/CMakeLists.txt new file mode 100644 index 000000000..d23e5ffc7 --- /dev/null +++ b/examples/bluetooth/gatt_server/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "gatts_demo.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/bluetooth/gatt_server_service_table/CMakeLists.txt b/examples/bluetooth/gatt_server_service_table/CMakeLists.txt index 2f5653065..d6dc6a416 100644 --- a/examples/bluetooth/gatt_server_service_table/CMakeLists.txt +++ b/examples/bluetooth/gatt_server_service_table/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/gatts_table_creat_demo.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(gatt_server_service_table_demo) diff --git a/examples/bluetooth/gatt_server_service_table/main/CMakeLists.txt b/examples/bluetooth/gatt_server_service_table/main/CMakeLists.txt new file mode 100644 index 000000000..7588b5a7a --- /dev/null +++ b/examples/bluetooth/gatt_server_service_table/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "gatts_table_creat_demo.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/bluetooth/gattc_multi_connect/CMakeLists.txt b/examples/bluetooth/gattc_multi_connect/CMakeLists.txt index 73566a731..6a7a6b3b8 100644 --- a/examples/bluetooth/gattc_multi_connect/CMakeLists.txt +++ b/examples/bluetooth/gattc_multi_connect/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/gattc_multi_connect.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(gatt_multi_connect) diff --git a/examples/bluetooth/gattc_multi_connect/main/CMakeLists.txt b/examples/bluetooth/gattc_multi_connect/main/CMakeLists.txt new file mode 100644 index 000000000..19dcf60d3 --- /dev/null +++ b/examples/bluetooth/gattc_multi_connect/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "gattc_multi_connect.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/ethernet/ethernet/CMakeLists.txt b/examples/ethernet/ethernet/CMakeLists.txt index 0b4d20f08..ccd3c7cbe 100644 --- a/examples/ethernet/ethernet/CMakeLists.txt +++ b/examples/ethernet/ethernet/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/ethernet_example_main.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(ethernet_demo) diff --git a/examples/ethernet/ethernet/main/CMakeLists.txt b/examples/ethernet/ethernet/main/CMakeLists.txt new file mode 100644 index 000000000..8c0c9fa0f --- /dev/null +++ b/examples/ethernet/ethernet/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "ethernet_example_main.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/get-started/blink/CMakeLists.txt b/examples/get-started/blink/CMakeLists.txt index 56450928b..33a52a5d5 100644 --- a/examples/get-started/blink/CMakeLists.txt +++ b/examples/get-started/blink/CMakeLists.txt @@ -2,7 +2,5 @@ # CMakeLists in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/blink.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(blink) diff --git a/examples/get-started/blink/main/CMakeLists.txt b/examples/get-started/blink/main/CMakeLists.txt new file mode 100644 index 000000000..69f12a384 --- /dev/null +++ b/examples/get-started/blink/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "blink.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/get-started/hello_world/CMakeLists.txt b/examples/get-started/hello_world/CMakeLists.txt index 1d4853e77..8a022b848 100644 --- a/examples/get-started/hello_world/CMakeLists.txt +++ b/examples/get-started/hello_world/CMakeLists.txt @@ -2,7 +2,5 @@ # CMakeLists in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/hello_world_main.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(hello-world) diff --git a/examples/get-started/hello_world/main/CMakeLists.txt b/examples/get-started/hello_world/main/CMakeLists.txt new file mode 100644 index 000000000..b79b83195 --- /dev/null +++ b/examples/get-started/hello_world/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "hello_world_main.c") +set(COMPONENT_ADD_INCLUDEDIRS "") + +register_component() \ No newline at end of file diff --git a/examples/mesh/internal_communication/CMakeLists.txt b/examples/mesh/internal_communication/CMakeLists.txt index 485f63621..d0cf18781 100644 --- a/examples/mesh/internal_communication/CMakeLists.txt +++ b/examples/mesh/internal_communication/CMakeLists.txt @@ -2,10 +2,5 @@ # CMakeLists in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/mesh_light.c main/mesh_main.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(internal_transceiver) - -include_directories(main/include) - diff --git a/examples/mesh/internal_communication/main/CMakeLists.txt b/examples/mesh/internal_communication/main/CMakeLists.txt new file mode 100644 index 000000000..451eeceed --- /dev/null +++ b/examples/mesh/internal_communication/main/CMakeLists.txt @@ -0,0 +1,5 @@ +set(COMPONENT_SRCS "mesh_light.c" + "mesh_main.c") +set(COMPONENT_ADD_INCLUDEDIRS ". include") + +register_component() diff --git a/examples/mesh/manual_networking/CMakeLists.txt b/examples/mesh/manual_networking/CMakeLists.txt index 485f63621..d0cf18781 100644 --- a/examples/mesh/manual_networking/CMakeLists.txt +++ b/examples/mesh/manual_networking/CMakeLists.txt @@ -2,10 +2,5 @@ # CMakeLists in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/mesh_light.c main/mesh_main.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(internal_transceiver) - -include_directories(main/include) - diff --git a/examples/mesh/manual_networking/main/CMakeLists.txt b/examples/mesh/manual_networking/main/CMakeLists.txt new file mode 100644 index 000000000..451eeceed --- /dev/null +++ b/examples/mesh/manual_networking/main/CMakeLists.txt @@ -0,0 +1,5 @@ +set(COMPONENT_SRCS "mesh_light.c" + "mesh_main.c") +set(COMPONENT_ADD_INCLUDEDIRS ". include") + +register_component() diff --git a/examples/peripherals/adc/CMakeLists.txt b/examples/peripherals/adc/CMakeLists.txt index 2232b277c..b01d63521 100644 --- a/examples/peripherals/adc/CMakeLists.txt +++ b/examples/peripherals/adc/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/adc1_example_main.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(adc) diff --git a/examples/peripherals/adc/main/CMakeLists.txt b/examples/peripherals/adc/main/CMakeLists.txt new file mode 100644 index 000000000..9b5d48fc6 --- /dev/null +++ b/examples/peripherals/adc/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "adc1_example_main.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/peripherals/adc2/CMakeLists.txt b/examples/peripherals/adc2/CMakeLists.txt index 650e3100a..7ea7329c1 100644 --- a/examples/peripherals/adc2/CMakeLists.txt +++ b/examples/peripherals/adc2/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/adc2_example_main.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(adc2) diff --git a/examples/peripherals/adc2/main/CMakeLists.txt b/examples/peripherals/adc2/main/CMakeLists.txt new file mode 100644 index 000000000..1d7776ecf --- /dev/null +++ b/examples/peripherals/adc2/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "adc2_example_main.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/peripherals/can/can_alert_and_recovery/CMakeLists.txt b/examples/peripherals/can/can_alert_and_recovery/CMakeLists.txt index c5e43497c..4d4838176 100644 --- a/examples/peripherals/can/can_alert_and_recovery/CMakeLists.txt +++ b/examples/peripherals/can/can_alert_and_recovery/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/can_alert_and_recovery_example_main.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(can_alert_and_recovery_example) diff --git a/examples/peripherals/can/can_alert_and_recovery/main/CMakeLists.txt b/examples/peripherals/can/can_alert_and_recovery/main/CMakeLists.txt new file mode 100644 index 000000000..cf9bf40a9 --- /dev/null +++ b/examples/peripherals/can/can_alert_and_recovery/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "can_alert_and_recovery_example_main.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/peripherals/can/can_network/can_network_listen_only/CMakeLists.txt b/examples/peripherals/can/can_network/can_network_listen_only/CMakeLists.txt index 3f0f7a1c0..42617e10f 100644 --- a/examples/peripherals/can/can_network/can_network_listen_only/CMakeLists.txt +++ b/examples/peripherals/can/can_network/can_network_listen_only/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/can_network_example_listen_only_main.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(can_network_listen_only) diff --git a/examples/peripherals/can/can_network/can_network_listen_only/main/CMakeLists.txt b/examples/peripherals/can/can_network/can_network_listen_only/main/CMakeLists.txt new file mode 100644 index 000000000..5eab299b0 --- /dev/null +++ b/examples/peripherals/can/can_network/can_network_listen_only/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "can_network_example_listen_only_main.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/peripherals/can/can_network/can_network_master/CMakeLists.txt b/examples/peripherals/can/can_network/can_network_master/CMakeLists.txt index f64b5e445..33ac7b660 100644 --- a/examples/peripherals/can/can_network/can_network_master/CMakeLists.txt +++ b/examples/peripherals/can/can_network/can_network_master/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/can_network_example_master_main.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(can_network_master) diff --git a/examples/peripherals/can/can_network/can_network_master/main/CMakeLists.txt b/examples/peripherals/can/can_network/can_network_master/main/CMakeLists.txt new file mode 100644 index 000000000..f0dc1d6a7 --- /dev/null +++ b/examples/peripherals/can/can_network/can_network_master/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "can_network_example_master_main.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/peripherals/can/can_network/can_network_slave/CMakeLists.txt b/examples/peripherals/can/can_network/can_network_slave/CMakeLists.txt index 4c7f9c933..1550db156 100644 --- a/examples/peripherals/can/can_network/can_network_slave/CMakeLists.txt +++ b/examples/peripherals/can/can_network/can_network_slave/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/can_network_example_slave_main.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(can_network_slave) diff --git a/examples/peripherals/can/can_network/can_network_slave/main/CMakeLists.txt b/examples/peripherals/can/can_network/can_network_slave/main/CMakeLists.txt new file mode 100644 index 000000000..4a002fbfc --- /dev/null +++ b/examples/peripherals/can/can_network/can_network_slave/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "can_network_example_slave_main.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/peripherals/can/can_self_test/CMakeLists.txt b/examples/peripherals/can/can_self_test/CMakeLists.txt index c6ab8e924..027060e22 100644 --- a/examples/peripherals/can/can_self_test/CMakeLists.txt +++ b/examples/peripherals/can/can_self_test/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/can_self_test_example_main.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(can_self_test_example) diff --git a/examples/peripherals/can/can_self_test/main/CMakeLists.txt b/examples/peripherals/can/can_self_test/main/CMakeLists.txt new file mode 100644 index 000000000..21db765a8 --- /dev/null +++ b/examples/peripherals/can/can_self_test/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "can_self_test_example_main.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/peripherals/gpio/CMakeLists.txt b/examples/peripherals/gpio/CMakeLists.txt index 82873edc4..6ac490d38 100644 --- a/examples/peripherals/gpio/CMakeLists.txt +++ b/examples/peripherals/gpio/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/gpio_example_main.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(gpio) diff --git a/examples/peripherals/gpio/main/CMakeLists.txt b/examples/peripherals/gpio/main/CMakeLists.txt new file mode 100644 index 000000000..d768cb825 --- /dev/null +++ b/examples/peripherals/gpio/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "gpio_example_main.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/peripherals/i2c/CMakeLists.txt b/examples/peripherals/i2c/CMakeLists.txt index 048d75fb3..1db34db22 100644 --- a/examples/peripherals/i2c/CMakeLists.txt +++ b/examples/peripherals/i2c/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/i2c_example_main.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(i2c) diff --git a/examples/peripherals/i2c/main/CMakeLists.txt b/examples/peripherals/i2c/main/CMakeLists.txt new file mode 100644 index 000000000..02386f719 --- /dev/null +++ b/examples/peripherals/i2c/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "i2c_example_main.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/peripherals/i2s/CMakeLists.txt b/examples/peripherals/i2s/CMakeLists.txt index 6520061d4..19c5f8830 100644 --- a/examples/peripherals/i2s/CMakeLists.txt +++ b/examples/peripherals/i2s/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/i2s_example_main.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(esp32-i2s-driver-example) diff --git a/examples/peripherals/i2s/main/CMakeLists.txt b/examples/peripherals/i2s/main/CMakeLists.txt new file mode 100644 index 000000000..dbb7b172a --- /dev/null +++ b/examples/peripherals/i2s/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "i2s_example_main.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/peripherals/i2s_adc_dac/CMakeLists.txt b/examples/peripherals/i2s_adc_dac/CMakeLists.txt index 8e7fe3c07..4b27d7cd6 100644 --- a/examples/peripherals/i2s_adc_dac/CMakeLists.txt +++ b/examples/peripherals/i2s_adc_dac/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/app_main.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(i2s-adc-dac) diff --git a/examples/peripherals/i2s_adc_dac/main/CMakeLists.txt b/examples/peripherals/i2s_adc_dac/main/CMakeLists.txt new file mode 100644 index 000000000..6b0350063 --- /dev/null +++ b/examples/peripherals/i2s_adc_dac/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "app_main.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/peripherals/ledc/CMakeLists.txt b/examples/peripherals/ledc/CMakeLists.txt index c0c15b6f9..0ce275c8e 100644 --- a/examples/peripherals/ledc/CMakeLists.txt +++ b/examples/peripherals/ledc/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/ledc_example_main.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(ledc) diff --git a/examples/peripherals/ledc/main/CMakeLists.txt b/examples/peripherals/ledc/main/CMakeLists.txt new file mode 100644 index 000000000..6405eb95f --- /dev/null +++ b/examples/peripherals/ledc/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "ledc_example_main.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/peripherals/mcpwm/mcpwm_basic_config/CMakeLists.txt b/examples/peripherals/mcpwm/mcpwm_basic_config/CMakeLists.txt index a3ee8315f..53eb976ea 100644 --- a/examples/peripherals/mcpwm/mcpwm_basic_config/CMakeLists.txt +++ b/examples/peripherals/mcpwm/mcpwm_basic_config/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/mcpwm_basic_config_example.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(mcpwm_basic_config) diff --git a/examples/peripherals/mcpwm/mcpwm_basic_config/main/CMakeLists.txt b/examples/peripherals/mcpwm/mcpwm_basic_config/main/CMakeLists.txt new file mode 100644 index 000000000..d5fdbf560 --- /dev/null +++ b/examples/peripherals/mcpwm/mcpwm_basic_config/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "mcpwm_basic_config_example.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/peripherals/mcpwm/mcpwm_bldc_control/CMakeLists.txt b/examples/peripherals/mcpwm/mcpwm_bldc_control/CMakeLists.txt index ed09e85b2..10ed869e1 100644 --- a/examples/peripherals/mcpwm/mcpwm_bldc_control/CMakeLists.txt +++ b/examples/peripherals/mcpwm/mcpwm_bldc_control/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/mcpwm_bldc_control_hall_sensor_example.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(mcpwm_bldc_control_hall_sensor) diff --git a/examples/peripherals/mcpwm/mcpwm_bldc_control/main/CMakeLists.txt b/examples/peripherals/mcpwm/mcpwm_bldc_control/main/CMakeLists.txt new file mode 100644 index 000000000..a52ad9451 --- /dev/null +++ b/examples/peripherals/mcpwm/mcpwm_bldc_control/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "mcpwm_bldc_control_hall_sensor_example.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/peripherals/mcpwm/mcpwm_brushed_dc_control/CMakeLists.txt b/examples/peripherals/mcpwm/mcpwm_brushed_dc_control/CMakeLists.txt index 4076c2839..a4baf8b40 100644 --- a/examples/peripherals/mcpwm/mcpwm_brushed_dc_control/CMakeLists.txt +++ b/examples/peripherals/mcpwm/mcpwm_brushed_dc_control/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/mcpwm_brushed_dc_control_example.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(mcpwm_brushed_dc_control) diff --git a/examples/peripherals/mcpwm/mcpwm_brushed_dc_control/main/CMakeLists.txt b/examples/peripherals/mcpwm/mcpwm_brushed_dc_control/main/CMakeLists.txt new file mode 100644 index 000000000..1259035cb --- /dev/null +++ b/examples/peripherals/mcpwm/mcpwm_brushed_dc_control/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "mcpwm_brushed_dc_control_example.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/peripherals/mcpwm/mcpwm_servo_control/CMakeLists.txt b/examples/peripherals/mcpwm/mcpwm_servo_control/CMakeLists.txt index fc3fab809..524c0ec97 100644 --- a/examples/peripherals/mcpwm/mcpwm_servo_control/CMakeLists.txt +++ b/examples/peripherals/mcpwm/mcpwm_servo_control/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/mcpwm_servo_control_example.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(mcpwm_servo_control) diff --git a/examples/peripherals/mcpwm/mcpwm_servo_control/main/CMakeLists.txt b/examples/peripherals/mcpwm/mcpwm_servo_control/main/CMakeLists.txt new file mode 100644 index 000000000..c8fa3d96b --- /dev/null +++ b/examples/peripherals/mcpwm/mcpwm_servo_control/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "mcpwm_servo_control_example.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/peripherals/pcnt/CMakeLists.txt b/examples/peripherals/pcnt/CMakeLists.txt index 2a7c8f40e..8f9d35a79 100644 --- a/examples/peripherals/pcnt/CMakeLists.txt +++ b/examples/peripherals/pcnt/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/pcnt_example_main.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(pcnt) diff --git a/examples/peripherals/pcnt/main/CMakeLists.txt b/examples/peripherals/pcnt/main/CMakeLists.txt new file mode 100644 index 000000000..2bd277955 --- /dev/null +++ b/examples/peripherals/pcnt/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "pcnt_example_main.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/peripherals/rmt_nec_tx_rx/CMakeLists.txt b/examples/peripherals/rmt_nec_tx_rx/CMakeLists.txt index 468032294..5e3f6b365 100644 --- a/examples/peripherals/rmt_nec_tx_rx/CMakeLists.txt +++ b/examples/peripherals/rmt_nec_tx_rx/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/infrared_nec_main.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(infrared_nec) diff --git a/examples/peripherals/rmt_nec_tx_rx/main/CMakeLists.txt b/examples/peripherals/rmt_nec_tx_rx/main/CMakeLists.txt new file mode 100644 index 000000000..80c75b228 --- /dev/null +++ b/examples/peripherals/rmt_nec_tx_rx/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "infrared_nec_main.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/peripherals/rmt_tx/CMakeLists.txt b/examples/peripherals/rmt_tx/CMakeLists.txt index 7aa64fedb..cf5f789fd 100644 --- a/examples/peripherals/rmt_tx/CMakeLists.txt +++ b/examples/peripherals/rmt_tx/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/rmt_tx_main.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(rmt_tx) diff --git a/examples/peripherals/rmt_tx/main/CMakeLists.txt b/examples/peripherals/rmt_tx/main/CMakeLists.txt new file mode 100644 index 000000000..a0a9147a2 --- /dev/null +++ b/examples/peripherals/rmt_tx/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "rmt_tx_main.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/peripherals/sdio/host/CMakeLists.txt b/examples/peripherals/sdio/host/CMakeLists.txt index 507af55e7..fb1d9a33e 100644 --- a/examples/peripherals/sdio/host/CMakeLists.txt +++ b/examples/peripherals/sdio/host/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/app_main.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(sdio_host) diff --git a/examples/peripherals/sdio/host/components/esp_slave/CMakeLists.txt b/examples/peripherals/sdio/host/components/esp_slave/CMakeLists.txt index c864bbba2..1cda8805c 100644 --- a/examples/peripherals/sdio/host/components/esp_slave/CMakeLists.txt +++ b/examples/peripherals/sdio/host/components/esp_slave/CMakeLists.txt @@ -1,4 +1,4 @@ -set(COMPONENT_SRCDIRS ".") +set(COMPONENT_SRCS "esp_slave.c") set(COMPONENT_ADD_INCLUDEDIRS "include") set(COMPONENT_REQUIRES driver sdmmc) diff --git a/examples/peripherals/sdio/host/main/CMakeLists.txt b/examples/peripherals/sdio/host/main/CMakeLists.txt new file mode 100644 index 000000000..6b0350063 --- /dev/null +++ b/examples/peripherals/sdio/host/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "app_main.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/peripherals/sdio/slave/CMakeLists.txt b/examples/peripherals/sdio/slave/CMakeLists.txt index f5d89e6d0..c99445397 100644 --- a/examples/peripherals/sdio/slave/CMakeLists.txt +++ b/examples/peripherals/sdio/slave/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/app_main.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(sdio_slave) diff --git a/examples/peripherals/sdio/slave/main/CMakeLists.txt b/examples/peripherals/sdio/slave/main/CMakeLists.txt new file mode 100644 index 000000000..6b0350063 --- /dev/null +++ b/examples/peripherals/sdio/slave/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "app_main.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/peripherals/sigmadelta/CMakeLists.txt b/examples/peripherals/sigmadelta/CMakeLists.txt index 3f4df2cfc..3a7098cb2 100644 --- a/examples/peripherals/sigmadelta/CMakeLists.txt +++ b/examples/peripherals/sigmadelta/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/sigmadelta_example_main.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(sigmadelta) diff --git a/examples/peripherals/sigmadelta/main/CMakeLists.txt b/examples/peripherals/sigmadelta/main/CMakeLists.txt new file mode 100644 index 000000000..1b0f2299f --- /dev/null +++ b/examples/peripherals/sigmadelta/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "sigmadelta_example_main.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/peripherals/spi_master/CMakeLists.txt b/examples/peripherals/spi_master/CMakeLists.txt index d27864187..6494ac1fd 100644 --- a/examples/peripherals/spi_master/CMakeLists.txt +++ b/examples/peripherals/spi_master/CMakeLists.txt @@ -1,17 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS - main/spi_master_example_main.c - main/pretty_effect.c - main/decode_image.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(spi_master) - -# Embed the image into the final binary -# -# (If this was a component, we would set COMPONENT_EMBED_TXTFILES here.) -target_add_binary_data(spi_master.elf - "main/image.jpg" BINARY) diff --git a/examples/peripherals/spi_master/main/CMakeLists.txt b/examples/peripherals/spi_master/main/CMakeLists.txt new file mode 100644 index 000000000..806ccae2b --- /dev/null +++ b/examples/peripherals/spi_master/main/CMakeLists.txt @@ -0,0 +1,9 @@ +set(COMPONENT_SRCS "decode_image.c" + "pretty_effect.c" + "spi_master_example_main.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + + +set(COMPONENT_EMBED_FILES image.jpg) + +register_component() diff --git a/examples/peripherals/spi_slave/receiver/CMakeLists.txt b/examples/peripherals/spi_slave/receiver/CMakeLists.txt index 21c05d9e6..a55b703ab 100644 --- a/examples/peripherals/spi_slave/receiver/CMakeLists.txt +++ b/examples/peripherals/spi_slave/receiver/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/app_main.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(spi-slave-receiver) diff --git a/examples/peripherals/spi_slave/receiver/main/CMakeLists.txt b/examples/peripherals/spi_slave/receiver/main/CMakeLists.txt new file mode 100644 index 000000000..6b0350063 --- /dev/null +++ b/examples/peripherals/spi_slave/receiver/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "app_main.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/peripherals/spi_slave/sender/CMakeLists.txt b/examples/peripherals/spi_slave/sender/CMakeLists.txt index 0c95698e9..f9144aa84 100644 --- a/examples/peripherals/spi_slave/sender/CMakeLists.txt +++ b/examples/peripherals/spi_slave/sender/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/app_main.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(spi-slave-sender) diff --git a/examples/peripherals/spi_slave/sender/main/CMakeLists.txt b/examples/peripherals/spi_slave/sender/main/CMakeLists.txt new file mode 100644 index 000000000..6b0350063 --- /dev/null +++ b/examples/peripherals/spi_slave/sender/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "app_main.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/peripherals/timer_group/CMakeLists.txt b/examples/peripherals/timer_group/CMakeLists.txt index 7f851e164..247819ef3 100644 --- a/examples/peripherals/timer_group/CMakeLists.txt +++ b/examples/peripherals/timer_group/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/timer_group_example_main.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(timer_group) diff --git a/examples/peripherals/timer_group/main/CMakeLists.txt b/examples/peripherals/timer_group/main/CMakeLists.txt new file mode 100644 index 000000000..9a96ce906 --- /dev/null +++ b/examples/peripherals/timer_group/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "timer_group_example_main.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/peripherals/touch_pad_interrupt/CMakeLists.txt b/examples/peripherals/touch_pad_interrupt/CMakeLists.txt index efdecaba1..9ab076f8e 100644 --- a/examples/peripherals/touch_pad_interrupt/CMakeLists.txt +++ b/examples/peripherals/touch_pad_interrupt/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/tp_interrupt_main.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(touch_pad_interrupt) diff --git a/examples/peripherals/touch_pad_interrupt/main/CMakeLists.txt b/examples/peripherals/touch_pad_interrupt/main/CMakeLists.txt new file mode 100644 index 000000000..b77bf9c7b --- /dev/null +++ b/examples/peripherals/touch_pad_interrupt/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "tp_interrupt_main.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/peripherals/touch_pad_read/CMakeLists.txt b/examples/peripherals/touch_pad_read/CMakeLists.txt index f246a1ad5..828816fe4 100644 --- a/examples/peripherals/touch_pad_read/CMakeLists.txt +++ b/examples/peripherals/touch_pad_read/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/tp_read_main.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(touch_pad_read) diff --git a/examples/peripherals/touch_pad_read/main/CMakeLists.txt b/examples/peripherals/touch_pad_read/main/CMakeLists.txt new file mode 100644 index 000000000..b556e8c0e --- /dev/null +++ b/examples/peripherals/touch_pad_read/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "tp_read_main.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/peripherals/uart_async_rxtxtasks/CMakeLists.txt b/examples/peripherals/uart_async_rxtxtasks/CMakeLists.txt index 4ab23a834..ea67b8aa6 100644 --- a/examples/peripherals/uart_async_rxtxtasks/CMakeLists.txt +++ b/examples/peripherals/uart_async_rxtxtasks/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/uart_async_rxtxtasks_main.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(uart_async_rxtxtasks) diff --git a/examples/peripherals/uart_async_rxtxtasks/main/CMakeLists.txt b/examples/peripherals/uart_async_rxtxtasks/main/CMakeLists.txt new file mode 100644 index 000000000..b57232352 --- /dev/null +++ b/examples/peripherals/uart_async_rxtxtasks/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "uart_async_rxtxtasks_main.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/peripherals/uart_echo/CMakeLists.txt b/examples/peripherals/uart_echo/CMakeLists.txt index b7ab8a582..0dc35072c 100644 --- a/examples/peripherals/uart_echo/CMakeLists.txt +++ b/examples/peripherals/uart_echo/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/uart_echo_example_main.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(uart_echo) diff --git a/examples/peripherals/uart_echo/main/CMakeLists.txt b/examples/peripherals/uart_echo/main/CMakeLists.txt new file mode 100644 index 000000000..1ca803f13 --- /dev/null +++ b/examples/peripherals/uart_echo/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "uart_echo_example_main.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/peripherals/uart_echo_rs485/CMakeLists.txt b/examples/peripherals/uart_echo_rs485/CMakeLists.txt index 7df245118..dba97cb4f 100644 --- a/examples/peripherals/uart_echo_rs485/CMakeLists.txt +++ b/examples/peripherals/uart_echo_rs485/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/rs485_example.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(echo_rs485) diff --git a/examples/peripherals/uart_echo_rs485/main/CMakeLists.txt b/examples/peripherals/uart_echo_rs485/main/CMakeLists.txt new file mode 100644 index 000000000..8b3393049 --- /dev/null +++ b/examples/peripherals/uart_echo_rs485/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "rs485_example.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/peripherals/uart_events/CMakeLists.txt b/examples/peripherals/uart_events/CMakeLists.txt index 464886f25..d89fe7267 100644 --- a/examples/peripherals/uart_events/CMakeLists.txt +++ b/examples/peripherals/uart_events/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/uart_events_example_main.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(uart_events) diff --git a/examples/peripherals/uart_events/main/CMakeLists.txt b/examples/peripherals/uart_events/main/CMakeLists.txt new file mode 100644 index 000000000..5a408ef1e --- /dev/null +++ b/examples/peripherals/uart_events/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "uart_events_example_main.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/peripherals/uart_select/CMakeLists.txt b/examples/peripherals/uart_select/CMakeLists.txt index c761f9d60..8cf5a7bd1 100644 --- a/examples/peripherals/uart_select/CMakeLists.txt +++ b/examples/peripherals/uart_select/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/uart_select_example_main.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(uart_select) diff --git a/examples/peripherals/uart_select/main/CMakeLists.txt b/examples/peripherals/uart_select/main/CMakeLists.txt new file mode 100644 index 000000000..4e3ae00de --- /dev/null +++ b/examples/peripherals/uart_select/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "uart_select_example_main.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/protocols/asio/chat_client/CMakeLists.txt b/examples/protocols/asio/chat_client/CMakeLists.txt index 78d29f0bd..e0480c277 100644 --- a/examples/protocols/asio/chat_client/CMakeLists.txt +++ b/examples/protocols/asio/chat_client/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/chat_client.cpp) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(asio_chat_client) diff --git a/examples/protocols/asio/chat_client/components/CMakeLists.txt b/examples/protocols/asio/chat_client/components/CMakeLists.txt index 4bb51e6a5..e51766724 100644 --- a/examples/protocols/asio/chat_client/components/CMakeLists.txt +++ b/examples/protocols/asio/chat_client/components/CMakeLists.txt @@ -1,4 +1,4 @@ -set(COMPONENT_SRCDIRS ".") +set(COMPONENT_SRCS "wifi_asio.cpp") set(COMPONENT_PRIV_REQUIRES asio nvs_flash console) diff --git a/examples/protocols/asio/chat_client/main/CMakeLists.txt b/examples/protocols/asio/chat_client/main/CMakeLists.txt new file mode 100644 index 000000000..25419de4a --- /dev/null +++ b/examples/protocols/asio/chat_client/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "chat_client.cpp") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/protocols/asio/chat_server/CMakeLists.txt b/examples/protocols/asio/chat_server/CMakeLists.txt index 91331df14..c8c629856 100644 --- a/examples/protocols/asio/chat_server/CMakeLists.txt +++ b/examples/protocols/asio/chat_server/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/chat_server.cpp) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(asio_chat_server) diff --git a/examples/protocols/asio/chat_server/components/CMakeLists.txt b/examples/protocols/asio/chat_server/components/CMakeLists.txt index 4bb51e6a5..e51766724 100644 --- a/examples/protocols/asio/chat_server/components/CMakeLists.txt +++ b/examples/protocols/asio/chat_server/components/CMakeLists.txt @@ -1,4 +1,4 @@ -set(COMPONENT_SRCDIRS ".") +set(COMPONENT_SRCS "wifi_asio.cpp") set(COMPONENT_PRIV_REQUIRES asio nvs_flash console) diff --git a/examples/protocols/asio/chat_server/main/CMakeLists.txt b/examples/protocols/asio/chat_server/main/CMakeLists.txt new file mode 100644 index 000000000..7e44a9039 --- /dev/null +++ b/examples/protocols/asio/chat_server/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "chat_server.cpp") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/protocols/asio/tcp_echo_server/CMakeLists.txt b/examples/protocols/asio/tcp_echo_server/CMakeLists.txt index 76bf9bcb6..b8d5638f7 100644 --- a/examples/protocols/asio/tcp_echo_server/CMakeLists.txt +++ b/examples/protocols/asio/tcp_echo_server/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/echo_server.cpp) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(asio_tcp_echo_server) diff --git a/examples/protocols/asio/tcp_echo_server/components/CMakeLists.txt b/examples/protocols/asio/tcp_echo_server/components/CMakeLists.txt index 4bb51e6a5..e51766724 100644 --- a/examples/protocols/asio/tcp_echo_server/components/CMakeLists.txt +++ b/examples/protocols/asio/tcp_echo_server/components/CMakeLists.txt @@ -1,4 +1,4 @@ -set(COMPONENT_SRCDIRS ".") +set(COMPONENT_SRCS "wifi_asio.cpp") set(COMPONENT_PRIV_REQUIRES asio nvs_flash console) diff --git a/examples/protocols/asio/tcp_echo_server/main/CMakeLists.txt b/examples/protocols/asio/tcp_echo_server/main/CMakeLists.txt new file mode 100644 index 000000000..04c3c94d9 --- /dev/null +++ b/examples/protocols/asio/tcp_echo_server/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "echo_server.cpp") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/protocols/asio/udp_echo_server/CMakeLists.txt b/examples/protocols/asio/udp_echo_server/CMakeLists.txt index 143a364e4..8d5c3a692 100644 --- a/examples/protocols/asio/udp_echo_server/CMakeLists.txt +++ b/examples/protocols/asio/udp_echo_server/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/udp_echo_server.cpp) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(asio_udp_echo_server) diff --git a/examples/protocols/asio/udp_echo_server/components/CMakeLists.txt b/examples/protocols/asio/udp_echo_server/components/CMakeLists.txt index 4bb51e6a5..e51766724 100644 --- a/examples/protocols/asio/udp_echo_server/components/CMakeLists.txt +++ b/examples/protocols/asio/udp_echo_server/components/CMakeLists.txt @@ -1,4 +1,4 @@ -set(COMPONENT_SRCDIRS ".") +set(COMPONENT_SRCS "wifi_asio.cpp") set(COMPONENT_PRIV_REQUIRES asio nvs_flash console) diff --git a/examples/protocols/asio/udp_echo_server/main/CMakeLists.txt b/examples/protocols/asio/udp_echo_server/main/CMakeLists.txt new file mode 100644 index 000000000..cd24937be --- /dev/null +++ b/examples/protocols/asio/udp_echo_server/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "udp_echo_server.cpp") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/protocols/aws_iot/subscribe_publish/CMakeLists.txt b/examples/protocols/aws_iot/subscribe_publish/CMakeLists.txt index c7cfd88f4..905829805 100644 --- a/examples/protocols/aws_iot/subscribe_publish/CMakeLists.txt +++ b/examples/protocols/aws_iot/subscribe_publish/CMakeLists.txt @@ -1,13 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/subscribe_publish_sample.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) -project(subscribe_publish) - -# Embed the certificate data directly in the built binary -target_add_binary_data(subscribe_publish.elf main/certs/aws-root-ca.pem TEXT) -target_add_binary_data(subscribe_publish.elf main/certs/certificate.pem.crt TEXT) -target_add_binary_data(subscribe_publish.elf main/certs/private.pem.key TEXT) +project(subscribe_publish) \ No newline at end of file diff --git a/examples/protocols/aws_iot/subscribe_publish/main/CMakeLists.txt b/examples/protocols/aws_iot/subscribe_publish/main/CMakeLists.txt new file mode 100644 index 000000000..d5fc09071 --- /dev/null +++ b/examples/protocols/aws_iot/subscribe_publish/main/CMakeLists.txt @@ -0,0 +1,28 @@ +set(COMPONENT_SRCS "subscribe_publish_sample.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + + +register_component() + +if(CONFIG_EXAMPLE_EMBEDDED_CERTS) +target_add_binary_data(${COMPONENT_NAME} "certs/aws-root-ca.pem" TEXT) + +if(NOT IDF_CI_BUILD) + add_custom_command(OUTPUT certs/certificate.pem.crt certs/private.pem.key + COMMAND echo "Dummy certificate data for continuous integration" > + certs/certificate.pem.crt + COMMAND echo "Dummy certificate data for continuous integration" > + certs/private.pem.key + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + VERBATIM) + add_custom_target(example_certificates DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/certs/certificate.pem.crt ${CMAKE_CURRENT_BINARY_DIR}/certs/private.pem.key) + + add_dependencies(${COMPONENT_NAME} example_certificates) + + target_add_binary_data(${COMPONENT_NAME} "${CMAKE_CURRENT_BINARY_DIR}/certs/certificate.pem.crt" TEXT) + target_add_binary_data(${COMPONENT_NAME} "${CMAKE_CURRENT_BINARY_DIR}/certs/private.pem.key" TEXT) +else() + target_add_binary_data(${COMPONENT_NAME} "certs/certificate.pem.crt" TEXT) + target_add_binary_data(${COMPONENT_NAME} "certs/private.pem.key" TEXT) +endif() +endif() \ No newline at end of file diff --git a/examples/protocols/aws_iot/thing_shadow/CMakeLists.txt b/examples/protocols/aws_iot/thing_shadow/CMakeLists.txt index 37d5d9a9c..fe87b29cc 100644 --- a/examples/protocols/aws_iot/thing_shadow/CMakeLists.txt +++ b/examples/protocols/aws_iot/thing_shadow/CMakeLists.txt @@ -1,13 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/thing_shadow_sample.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(thing_shadow) - -# Embed the certificate data directly in the built binary -target_add_binary_data(thing_shadow.elf main/certs/aws-root-ca.pem TEXT) -target_add_binary_data(thing_shadow.elf main/certs/certificate.pem.crt TEXT) -target_add_binary_data(thing_shadow.elf main/certs/private.pem.key TEXT) diff --git a/examples/protocols/aws_iot/thing_shadow/main/CMakeLists.txt b/examples/protocols/aws_iot/thing_shadow/main/CMakeLists.txt new file mode 100644 index 000000000..ee14baf02 --- /dev/null +++ b/examples/protocols/aws_iot/thing_shadow/main/CMakeLists.txt @@ -0,0 +1,28 @@ +set(COMPONENT_SRCS "thing_shadow_sample.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + + +register_component() + +if(CONFIG_EXAMPLE_EMBEDDED_CERTS) +target_add_binary_data(${COMPONENT_NAME} "certs/aws-root-ca.pem" TEXT) + +if(NOT IDF_CI_BUILD) + add_custom_command(OUTPUT certs/certificate.pem.crt certs/private.pem.key + COMMAND echo "Dummy certificate data for continuous integration" > + certs/certificate.pem.crt + COMMAND echo "Dummy certificate data for continuous integration" > + certs/private.pem.key + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + VERBATIM) + add_custom_target(example_certificates DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/certs/certificate.pem.crt ${CMAKE_CURRENT_BINARY_DIR}/certs/private.pem.key) + + add_dependencies(${COMPONENT_NAME} example_certificates) + + target_add_binary_data(${COMPONENT_NAME} "${CMAKE_CURRENT_BINARY_DIR}/certs/certificate.pem.crt" TEXT) + target_add_binary_data(${COMPONENT_NAME} "${CMAKE_CURRENT_BINARY_DIR}/certs/private.pem.key" TEXT) +else() + target_add_binary_data(${COMPONENT_NAME} "certs/certificate.pem.crt" TEXT) + target_add_binary_data(${COMPONENT_NAME} "certs/private.pem.key" TEXT) +endif() +endif() \ No newline at end of file diff --git a/examples/protocols/coap_client/CMakeLists.txt b/examples/protocols/coap_client/CMakeLists.txt index 43378b8b6..495538d3d 100644 --- a/examples/protocols/coap_client/CMakeLists.txt +++ b/examples/protocols/coap_client/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/coap_client_example_main.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(coap_client) diff --git a/examples/protocols/coap_client/main/CMakeLists.txt b/examples/protocols/coap_client/main/CMakeLists.txt new file mode 100644 index 000000000..eb1a1db15 --- /dev/null +++ b/examples/protocols/coap_client/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "coap_client_example_main.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/protocols/coap_server/CMakeLists.txt b/examples/protocols/coap_server/CMakeLists.txt index 8495b8578..16689d2e3 100644 --- a/examples/protocols/coap_server/CMakeLists.txt +++ b/examples/protocols/coap_server/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/coap_server_example_main.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(coap_server) diff --git a/examples/protocols/coap_server/main/CMakeLists.txt b/examples/protocols/coap_server/main/CMakeLists.txt new file mode 100644 index 000000000..8650fb114 --- /dev/null +++ b/examples/protocols/coap_server/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "coap_server_example_main.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/protocols/esp_http_client/CMakeLists.txt b/examples/protocols/esp_http_client/CMakeLists.txt index 5241b97bd..6896d5acd 100644 --- a/examples/protocols/esp_http_client/CMakeLists.txt +++ b/examples/protocols/esp_http_client/CMakeLists.txt @@ -2,13 +2,5 @@ # CMakeLists in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/esp_http_client_example.c main/app_wifi.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(esp-http-client-example) - -# Embed the server root certificate into the final binary -# -# (If this was a component, we would set COMPONENT_EMBED_TXTFILES here.) -target_add_binary_data(esp-http-client-example.elf - "main/howsmyssl_com_root_cert.pem" TEXT) diff --git a/examples/protocols/esp_http_client/main/CMakeLists.txt b/examples/protocols/esp_http_client/main/CMakeLists.txt new file mode 100644 index 000000000..093811e66 --- /dev/null +++ b/examples/protocols/esp_http_client/main/CMakeLists.txt @@ -0,0 +1,11 @@ +set(COMPONENT_SRCS "app_wifi.c" + "esp_http_client_example.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + + +# Embed the server root certificate into the final binary +# +# (If this was a component, we would set COMPONENT_EMBED_TXTFILES here.) +set(COMPONENT_EMBED_TXTFILES howsmyssl_com_root_cert.pem) + +register_component() diff --git a/examples/protocols/http2_request/CMakeLists.txt b/examples/protocols/http2_request/CMakeLists.txt index b49128d5e..edda2c42f 100644 --- a/examples/protocols/http2_request/CMakeLists.txt +++ b/examples/protocols/http2_request/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/http2_request_example_main.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(http2-request) diff --git a/examples/protocols/http2_request/components/sh2lib/CMakeLists.txt b/examples/protocols/http2_request/components/sh2lib/CMakeLists.txt index 6d19bf48b..ec1b5a1e1 100644 --- a/examples/protocols/http2_request/components/sh2lib/CMakeLists.txt +++ b/examples/protocols/http2_request/components/sh2lib/CMakeLists.txt @@ -1,6 +1,6 @@ set(COMPONENT_ADD_INCLUDEDIRS .) -set(COMPONENT_SRCDIRS .) +set(COMPONENT_SRCS "sh2lib.c") set(COMPONENT_REQUIRES nghttp) set(COMPONENT_PRIV_REQUIRES lwip esp-tls) diff --git a/examples/protocols/http2_request/main/CMakeLists.txt b/examples/protocols/http2_request/main/CMakeLists.txt new file mode 100644 index 000000000..613900225 --- /dev/null +++ b/examples/protocols/http2_request/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "http2_request_example_main.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/protocols/http_request/CMakeLists.txt b/examples/protocols/http_request/CMakeLists.txt index a8f1470b9..1c818eb23 100644 --- a/examples/protocols/http_request/CMakeLists.txt +++ b/examples/protocols/http_request/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/http_request_example_main.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(http-request) diff --git a/examples/protocols/http_request/main/CMakeLists.txt b/examples/protocols/http_request/main/CMakeLists.txt new file mode 100644 index 000000000..8e346e8bb --- /dev/null +++ b/examples/protocols/http_request/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "http_request_example_main.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/protocols/http_server/advanced_tests/CMakeLists.txt b/examples/protocols/http_server/advanced_tests/CMakeLists.txt index 6edb47bda..b6f65f8f0 100644 --- a/examples/protocols/http_server/advanced_tests/CMakeLists.txt +++ b/examples/protocols/http_server/advanced_tests/CMakeLists.txt @@ -1,9 +1,7 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/tests.c main/main.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(tests) diff --git a/examples/protocols/http_server/advanced_tests/main/CMakeLists.txt b/examples/protocols/http_server/advanced_tests/main/CMakeLists.txt new file mode 100644 index 000000000..9fd69b1d3 --- /dev/null +++ b/examples/protocols/http_server/advanced_tests/main/CMakeLists.txt @@ -0,0 +1,5 @@ +set(COMPONENT_SRCS "main.c" + "tests.c") +set(COMPONENT_ADD_INCLUDEDIRS ". include") + +register_component() diff --git a/examples/protocols/http_server/persistent_sockets/CMakeLists.txt b/examples/protocols/http_server/persistent_sockets/CMakeLists.txt index b3587a5ef..2d453b679 100644 --- a/examples/protocols/http_server/persistent_sockets/CMakeLists.txt +++ b/examples/protocols/http_server/persistent_sockets/CMakeLists.txt @@ -1,9 +1,7 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/main.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(persistent_sockets) diff --git a/examples/protocols/http_server/persistent_sockets/main/CMakeLists.txt b/examples/protocols/http_server/persistent_sockets/main/CMakeLists.txt new file mode 100644 index 000000000..85970762a --- /dev/null +++ b/examples/protocols/http_server/persistent_sockets/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "main.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/protocols/http_server/simple/CMakeLists.txt b/examples/protocols/http_server/simple/CMakeLists.txt index 0b6dc948c..cc9d4fd83 100644 --- a/examples/protocols/http_server/simple/CMakeLists.txt +++ b/examples/protocols/http_server/simple/CMakeLists.txt @@ -1,10 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/main.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(simple) - - diff --git a/examples/protocols/http_server/simple/main/CMakeLists.txt b/examples/protocols/http_server/simple/main/CMakeLists.txt new file mode 100644 index 000000000..85970762a --- /dev/null +++ b/examples/protocols/http_server/simple/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "main.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/protocols/https_mbedtls/CMakeLists.txt b/examples/protocols/https_mbedtls/CMakeLists.txt index b564db2fa..a1f41ff87 100644 --- a/examples/protocols/https_mbedtls/CMakeLists.txt +++ b/examples/protocols/https_mbedtls/CMakeLists.txt @@ -2,13 +2,5 @@ # CMakeLists in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/https_mbedtls_example_main.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) -project(https-mbedtls) - -# Embed the server root certificate into the final binary -# -# (If this was a component, we would set COMPONENT_EMBED_TXTFILES here.) -target_add_binary_data(https-mbedtls.elf - "main/server_root_cert.pem" TEXT) +project(https-mbedtls) \ No newline at end of file diff --git a/examples/protocols/https_mbedtls/main/CMakeLists.txt b/examples/protocols/https_mbedtls/main/CMakeLists.txt new file mode 100644 index 000000000..c9b097c6b --- /dev/null +++ b/examples/protocols/https_mbedtls/main/CMakeLists.txt @@ -0,0 +1,10 @@ +set(COMPONENT_SRCS "https_mbedtls_example_main.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + + +# Embed the server root certificate into the final binary +# +# (If this was a component, we would set COMPONENT_EMBED_TXTFILES here.) +set(COMPONENT_EMBED_TXTFILES server_root_cert.pem) + +register_component() diff --git a/examples/protocols/https_request/CMakeLists.txt b/examples/protocols/https_request/CMakeLists.txt index 22118c45c..f77bc6610 100644 --- a/examples/protocols/https_request/CMakeLists.txt +++ b/examples/protocols/https_request/CMakeLists.txt @@ -2,13 +2,5 @@ # CMakeLists in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/https_request_example_main.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(https_request) - -# Embed the server root certificate into the final binary -# -# (If this was a component, we would set COMPONENT_EMBED_TXTFILES here.) -target_add_binary_data(https_request.elf - "main/server_root_cert.pem" TEXT) diff --git a/examples/protocols/https_request/main/CMakeLists.txt b/examples/protocols/https_request/main/CMakeLists.txt new file mode 100644 index 000000000..60a1a0664 --- /dev/null +++ b/examples/protocols/https_request/main/CMakeLists.txt @@ -0,0 +1,10 @@ +set(COMPONENT_SRCS "https_request_example_main.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + + +# Embed the server root certificate into the final binary +# +# (If this was a component, we would set COMPONENT_EMBED_TXTFILES here.) +set(COMPONENT_EMBED_TXTFILES server_root_cert.pem) + +register_component() diff --git a/examples/protocols/mdns/CMakeLists.txt b/examples/protocols/mdns/CMakeLists.txt index 57c5e9a2e..88b7c1e3f 100644 --- a/examples/protocols/mdns/CMakeLists.txt +++ b/examples/protocols/mdns/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/mdns_example_main.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(mdns-test) diff --git a/examples/protocols/mdns/main/CMakeLists.txt b/examples/protocols/mdns/main/CMakeLists.txt new file mode 100644 index 000000000..814837ea9 --- /dev/null +++ b/examples/protocols/mdns/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "mdns_example_main.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/protocols/openssl_client/CMakeLists.txt b/examples/protocols/openssl_client/CMakeLists.txt index 0fc241ddf..5449461ce 100644 --- a/examples/protocols/openssl_client/CMakeLists.txt +++ b/examples/protocols/openssl_client/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/openssl_client_example_main.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(openssl_client) diff --git a/examples/protocols/openssl_client/main/CMakeLists.txt b/examples/protocols/openssl_client/main/CMakeLists.txt new file mode 100644 index 000000000..d8e15c98c --- /dev/null +++ b/examples/protocols/openssl_client/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "openssl_client_example_main.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/protocols/openssl_server/CMakeLists.txt b/examples/protocols/openssl_server/CMakeLists.txt index dba98fc68..d3e5c5ccb 100644 --- a/examples/protocols/openssl_server/CMakeLists.txt +++ b/examples/protocols/openssl_server/CMakeLists.txt @@ -1,12 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/openssl_server_example_main.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(openssl_server) - -# Embed the certificate & key data directly in the built binary -target_add_binary_data(openssl_server.elf main/cacert.pem TEXT) -target_add_binary_data(openssl_server.elf main/prvtkey.pem TEXT) diff --git a/examples/protocols/openssl_server/main/CMakeLists.txt b/examples/protocols/openssl_server/main/CMakeLists.txt new file mode 100644 index 000000000..07b57ef29 --- /dev/null +++ b/examples/protocols/openssl_server/main/CMakeLists.txt @@ -0,0 +1,8 @@ +set(COMPONENT_SRCS "openssl_server_example_main.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + + +# Embed the certificate & key data directly in the built binary +set(COMPONENT_EMBED_TXTFILES cacert.pem prvtkey.pem) + +register_component() diff --git a/examples/protocols/pppos_client/CMakeLists.txt b/examples/protocols/pppos_client/CMakeLists.txt index c9378d72f..960952578 100644 --- a/examples/protocols/pppos_client/CMakeLists.txt +++ b/examples/protocols/pppos_client/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/pppos_client_main.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(pppos_client) diff --git a/examples/protocols/pppos_client/main/CMakeLists.txt b/examples/protocols/pppos_client/main/CMakeLists.txt new file mode 100644 index 000000000..e4ef1373f --- /dev/null +++ b/examples/protocols/pppos_client/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "pppos_client_main.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/protocols/sntp/CMakeLists.txt b/examples/protocols/sntp/CMakeLists.txt index d083f8fe1..dd46b088b 100644 --- a/examples/protocols/sntp/CMakeLists.txt +++ b/examples/protocols/sntp/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/sntp_example_main.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(sntp) diff --git a/examples/protocols/sntp/main/CMakeLists.txt b/examples/protocols/sntp/main/CMakeLists.txt new file mode 100644 index 000000000..c7c035ca0 --- /dev/null +++ b/examples/protocols/sntp/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "sntp_example_main.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/protocols/udp_multicast/CMakeLists.txt b/examples/protocols/udp_multicast/CMakeLists.txt index 998524292..fe4b8fe8e 100644 --- a/examples/protocols/udp_multicast/CMakeLists.txt +++ b/examples/protocols/udp_multicast/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/udp_multicast_example_main.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(udp-multicast) diff --git a/examples/protocols/udp_multicast/main/CMakeLists.txt b/examples/protocols/udp_multicast/main/CMakeLists.txt new file mode 100644 index 000000000..d3caeb6ed --- /dev/null +++ b/examples/protocols/udp_multicast/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "udp_multicast_example_main.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/storage/nvs_rw_blob/CMakeLists.txt b/examples/storage/nvs_rw_blob/CMakeLists.txt index 1dd6023f3..a4c9141fd 100644 --- a/examples/storage/nvs_rw_blob/CMakeLists.txt +++ b/examples/storage/nvs_rw_blob/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/nvs_blob_example_main.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(nvs-rw-blob) diff --git a/examples/storage/nvs_rw_blob/main/CMakeLists.txt b/examples/storage/nvs_rw_blob/main/CMakeLists.txt new file mode 100644 index 000000000..675c11a0e --- /dev/null +++ b/examples/storage/nvs_rw_blob/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "nvs_blob_example_main.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/storage/nvs_rw_value/CMakeLists.txt b/examples/storage/nvs_rw_value/CMakeLists.txt index 971a306ef..d0e9215d3 100644 --- a/examples/storage/nvs_rw_value/CMakeLists.txt +++ b/examples/storage/nvs_rw_value/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/nvs_value_example_main.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(nvs-rw-value) diff --git a/examples/storage/nvs_rw_value/main/CMakeLists.txt b/examples/storage/nvs_rw_value/main/CMakeLists.txt new file mode 100644 index 000000000..138346001 --- /dev/null +++ b/examples/storage/nvs_rw_value/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "nvs_value_example_main.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/storage/sd_card/CMakeLists.txt b/examples/storage/sd_card/CMakeLists.txt index ab4bcf2fa..00153c74c 100644 --- a/examples/storage/sd_card/CMakeLists.txt +++ b/examples/storage/sd_card/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/sd_card_example_main.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(sd_card) diff --git a/examples/storage/sd_card/main/CMakeLists.txt b/examples/storage/sd_card/main/CMakeLists.txt new file mode 100644 index 000000000..d0a4b53d9 --- /dev/null +++ b/examples/storage/sd_card/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "sd_card_example_main.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/storage/spiffs/CMakeLists.txt b/examples/storage/spiffs/CMakeLists.txt index 0356e25bf..1894b31ca 100644 --- a/examples/storage/spiffs/CMakeLists.txt +++ b/examples/storage/spiffs/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/spiffs_example_main.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(spiffs) diff --git a/examples/storage/spiffs/main/CMakeLists.txt b/examples/storage/spiffs/main/CMakeLists.txt new file mode 100644 index 000000000..8d041d56d --- /dev/null +++ b/examples/storage/spiffs/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "spiffs_example_main.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/storage/wear_levelling/CMakeLists.txt b/examples/storage/wear_levelling/CMakeLists.txt index bd35e0843..d404d3c24 100644 --- a/examples/storage/wear_levelling/CMakeLists.txt +++ b/examples/storage/wear_levelling/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/wear_levelling_example_main.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(wear_levelling_example) diff --git a/examples/storage/wear_levelling/main/CMakeLists.txt b/examples/storage/wear_levelling/main/CMakeLists.txt new file mode 100644 index 000000000..e344e9a76 --- /dev/null +++ b/examples/storage/wear_levelling/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "wear_levelling_example_main.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/system/app_trace_to_host/CMakeLists.txt b/examples/system/app_trace_to_host/CMakeLists.txt index f26a0fdb6..7182f8cca 100644 --- a/examples/system/app_trace_to_host/CMakeLists.txt +++ b/examples/system/app_trace_to_host/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/app_trace_to_host_test.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(app_trace_to_host_test) diff --git a/examples/system/app_trace_to_host/main/CMakeLists.txt b/examples/system/app_trace_to_host/main/CMakeLists.txt new file mode 100644 index 000000000..05e91af74 --- /dev/null +++ b/examples/system/app_trace_to_host/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "app_trace_to_host_test.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/system/base_mac_address/CMakeLists.txt b/examples/system/base_mac_address/CMakeLists.txt index 984dbb978..986095de5 100644 --- a/examples/system/base_mac_address/CMakeLists.txt +++ b/examples/system/base_mac_address/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/base_mac_address_example_main.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(base_mac_address) diff --git a/examples/system/base_mac_address/main/CMakeLists.txt b/examples/system/base_mac_address/main/CMakeLists.txt new file mode 100644 index 000000000..364317db4 --- /dev/null +++ b/examples/system/base_mac_address/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "base_mac_address_example_main.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/system/console/CMakeLists.txt b/examples/system/console/CMakeLists.txt index 416fc704a..d3f354f7f 100644 --- a/examples/system/console/CMakeLists.txt +++ b/examples/system/console/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/cmd_wifi.c main/console_example_main.c main/cmd_system.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(console) diff --git a/examples/system/console/main/CMakeLists.txt b/examples/system/console/main/CMakeLists.txt new file mode 100644 index 000000000..5f8bc4637 --- /dev/null +++ b/examples/system/console/main/CMakeLists.txt @@ -0,0 +1,6 @@ +set(COMPONENT_SRCS "cmd_system.c" + "cmd_wifi.c" + "console_example_main.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/system/cpp_exceptions/CMakeLists.txt b/examples/system/cpp_exceptions/CMakeLists.txt index 9fca88750..d3f354f7f 100644 --- a/examples/system/cpp_exceptions/CMakeLists.txt +++ b/examples/system/cpp_exceptions/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/exception_example_main.cpp) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) -project(cpp_exceptions_example) +project(console) diff --git a/examples/system/cpp_exceptions/main/CMakeLists.txt b/examples/system/cpp_exceptions/main/CMakeLists.txt new file mode 100644 index 000000000..f735cc5a6 --- /dev/null +++ b/examples/system/cpp_exceptions/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "exception_example_main.cpp") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/system/deep_sleep/CMakeLists.txt b/examples/system/deep_sleep/CMakeLists.txt index cf3d195aa..38e606ff2 100644 --- a/examples/system/deep_sleep/CMakeLists.txt +++ b/examples/system/deep_sleep/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/deep_sleep_example_main.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(deep_sleep) diff --git a/examples/system/deep_sleep/main/CMakeLists.txt b/examples/system/deep_sleep/main/CMakeLists.txt new file mode 100644 index 000000000..e99ca4de9 --- /dev/null +++ b/examples/system/deep_sleep/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "deep_sleep_example_main.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/system/esp_timer/CMakeLists.txt b/examples/system/esp_timer/CMakeLists.txt index 5165f3d2a..4222f063c 100644 --- a/examples/system/esp_timer/CMakeLists.txt +++ b/examples/system/esp_timer/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/esp_timer_example_main.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(esp_timer_example) diff --git a/examples/system/esp_timer/main/CMakeLists.txt b/examples/system/esp_timer/main/CMakeLists.txt new file mode 100644 index 000000000..09db9ec29 --- /dev/null +++ b/examples/system/esp_timer/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "esp_timer_example_main.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/system/gcov/CMakeLists.txt b/examples/system/gcov/CMakeLists.txt index b1cb9fd77..8a1f71568 100644 --- a/examples/system/gcov/CMakeLists.txt +++ b/examples/system/gcov/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/gcov_example_func.c main/gcov_example.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(gcov_example) diff --git a/examples/system/gcov/main/CMakeLists.txt b/examples/system/gcov/main/CMakeLists.txt new file mode 100644 index 000000000..170d5c552 --- /dev/null +++ b/examples/system/gcov/main/CMakeLists.txt @@ -0,0 +1,5 @@ +set(COMPONENT_SRCS "gcov_example.c" + "gcov_example_func.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/system/ota/native_ota_example/CMakeLists.txt b/examples/system/ota/native_ota_example/CMakeLists.txt index c4aa4d0d4..9e1828169 100644 --- a/examples/system/ota/native_ota_example/CMakeLists.txt +++ b/examples/system/ota/native_ota_example/CMakeLists.txt @@ -1,14 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/native_ota_example.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(native_ota) - -# Embed the server root certificate into the final binary -# -# (If this was a component, we would set COMPONENT_EMBED_TXTFILES here.) -target_add_binary_data(native_ota.elf - "../server_certs/ca_cert.pem" TEXT) diff --git a/examples/system/ota/native_ota_example/main/CMakeLists.txt b/examples/system/ota/native_ota_example/main/CMakeLists.txt new file mode 100644 index 000000000..f7e58ac26 --- /dev/null +++ b/examples/system/ota/native_ota_example/main/CMakeLists.txt @@ -0,0 +1,10 @@ +set(COMPONENT_SRCS "native_ota_example.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + + +# Embed the server root certificate into the final binary +# +# (If this was a component, we would set COMPONENT_EMBED_TXTFILES here.) +set(COMPONENT_EMBED_TXTFILES ../../server_certs/ca_cert.pem) + +register_component() diff --git a/examples/system/ota/simple_ota_example/CMakeLists.txt b/examples/system/ota/simple_ota_example/CMakeLists.txt index f15e70874..ae979292d 100644 --- a/examples/system/ota/simple_ota_example/CMakeLists.txt +++ b/examples/system/ota/simple_ota_example/CMakeLists.txt @@ -1,14 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/simple_ota_example.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) -project(simple_ota) - -# Embed the server root certificate into the final binary -# -# (If this was a component, we would set COMPONENT_EMBED_TXTFILES here.) -target_add_binary_data(simple_ota.elf - "../server_certs/ca_cert.pem" TEXT) +project(simple_ota) \ No newline at end of file diff --git a/examples/system/ota/simple_ota_example/main/CMakeLists.txt b/examples/system/ota/simple_ota_example/main/CMakeLists.txt new file mode 100644 index 000000000..6d7b30391 --- /dev/null +++ b/examples/system/ota/simple_ota_example/main/CMakeLists.txt @@ -0,0 +1,11 @@ +set(COMPONENT_SRCS "simple_ota_example.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + + +# Embed the server root certificate into the final binary +# +# (If this was a component, we would set COMPONENT_EMBED_TXTFILES here.) +set(COMPONENT_EMBED_TXTFILES ../../server_certs/ca_cert.pem) + + +register_component() diff --git a/examples/system/select/CMakeLists.txt b/examples/system/select/CMakeLists.txt index 3175ceeb0..2e8180b5d 100644 --- a/examples/system/select/CMakeLists.txt +++ b/examples/system/select/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/select_example.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(select) diff --git a/examples/system/select/main/CMakeLists.txt b/examples/system/select/main/CMakeLists.txt new file mode 100644 index 000000000..bf59f84c4 --- /dev/null +++ b/examples/system/select/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "select_example.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/system/task_watchdog/CMakeLists.txt b/examples/system/task_watchdog/CMakeLists.txt index e0f24b03f..4d3e6f98c 100644 --- a/examples/system/task_watchdog/CMakeLists.txt +++ b/examples/system/task_watchdog/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/task_watchdog_example_main.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(task_watchdog) diff --git a/examples/system/task_watchdog/main/CMakeLists.txt b/examples/system/task_watchdog/main/CMakeLists.txt new file mode 100644 index 000000000..ef06f3cc5 --- /dev/null +++ b/examples/system/task_watchdog/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "task_watchdog_example_main.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/wifi/espnow/CMakeLists.txt b/examples/wifi/espnow/CMakeLists.txt index 446cf5ccf..73c190ccb 100644 --- a/examples/wifi/espnow/CMakeLists.txt +++ b/examples/wifi/espnow/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/espnow_example_main.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(espnow_example) diff --git a/examples/wifi/espnow/main/CMakeLists.txt b/examples/wifi/espnow/main/CMakeLists.txt new file mode 100644 index 000000000..151eab724 --- /dev/null +++ b/examples/wifi/espnow/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "espnow_example_main.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/wifi/getting_started/softAP/CMakeLists.txt b/examples/wifi/getting_started/softAP/CMakeLists.txt index 57158b16b..83a0f1dbc 100644 --- a/examples/wifi/getting_started/softAP/CMakeLists.txt +++ b/examples/wifi/getting_started/softAP/CMakeLists.txt @@ -2,7 +2,5 @@ # CMakeLists in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/simple_wifi.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(simple_wifi) diff --git a/examples/wifi/getting_started/softAP/main/CMakeLists.txt b/examples/wifi/getting_started/softAP/main/CMakeLists.txt new file mode 100644 index 000000000..672406071 --- /dev/null +++ b/examples/wifi/getting_started/softAP/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "softap_example_main.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/wifi/getting_started/station/CMakeLists.txt b/examples/wifi/getting_started/station/CMakeLists.txt index 482582136..05a40120b 100644 --- a/examples/wifi/getting_started/station/CMakeLists.txt +++ b/examples/wifi/getting_started/station/CMakeLists.txt @@ -2,7 +2,5 @@ # CMakeLists in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/station_example_main.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(wifi_station) diff --git a/examples/wifi/getting_started/station/main/CMakeLists.txt b/examples/wifi/getting_started/station/main/CMakeLists.txt new file mode 100644 index 000000000..3cd103128 --- /dev/null +++ b/examples/wifi/getting_started/station/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "station_example_main.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/wifi/iperf/CMakeLists.txt b/examples/wifi/iperf/CMakeLists.txt index 7463023e9..069eeae86 100644 --- a/examples/wifi/iperf/CMakeLists.txt +++ b/examples/wifi/iperf/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/cmd_wifi.c main/main.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(iperf) diff --git a/examples/wifi/iperf/components/CMakeLists.txt b/examples/wifi/iperf/components/CMakeLists.txt index 352403c41..d51a81019 100644 --- a/examples/wifi/iperf/components/CMakeLists.txt +++ b/examples/wifi/iperf/components/CMakeLists.txt @@ -1,6 +1,6 @@ set(COMPONENT_ADD_INCLUDEDIRS .) -set(COMPONENT_SRCDIRS .) +set(COMPONENT_SRCS "iperf.c") set(COMPONENT_PRIV_REQUIRES lwip) diff --git a/examples/wifi/iperf/main/CMakeLists.txt b/examples/wifi/iperf/main/CMakeLists.txt new file mode 100644 index 000000000..2487dec22 --- /dev/null +++ b/examples/wifi/iperf/main/CMakeLists.txt @@ -0,0 +1,5 @@ +set(COMPONENT_SRCS "cmd_wifi.c" + "main.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/wifi/power_save/CMakeLists.txt b/examples/wifi/power_save/CMakeLists.txt index 65cc2011d..a9a182fe6 100644 --- a/examples/wifi/power_save/CMakeLists.txt +++ b/examples/wifi/power_save/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/power_save.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(power_save) diff --git a/examples/wifi/power_save/main/CMakeLists.txt b/examples/wifi/power_save/main/CMakeLists.txt new file mode 100644 index 000000000..f7fc34d94 --- /dev/null +++ b/examples/wifi/power_save/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "power_save.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/wifi/scan/CMakeLists.txt b/examples/wifi/scan/CMakeLists.txt index 9de12341a..0b74ad3db 100644 --- a/examples/wifi/scan/CMakeLists.txt +++ b/examples/wifi/scan/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/scan.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(scan) diff --git a/examples/wifi/scan/main/CMakeLists.txt b/examples/wifi/scan/main/CMakeLists.txt new file mode 100644 index 000000000..0b789863a --- /dev/null +++ b/examples/wifi/scan/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "scan.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/wifi/simple_wifi/main/CMakeLists.txt b/examples/wifi/simple_wifi/main/CMakeLists.txt new file mode 100644 index 000000000..e7c00ec94 --- /dev/null +++ b/examples/wifi/simple_wifi/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "simple_wifi.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/wifi/smart_config/CMakeLists.txt b/examples/wifi/smart_config/CMakeLists.txt index ae0b88ee6..71bda67e5 100644 --- a/examples/wifi/smart_config/CMakeLists.txt +++ b/examples/wifi/smart_config/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/smartconfig_main.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(smart_config) diff --git a/examples/wifi/smart_config/main/CMakeLists.txt b/examples/wifi/smart_config/main/CMakeLists.txt new file mode 100644 index 000000000..a716681e4 --- /dev/null +++ b/examples/wifi/smart_config/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "smartconfig_main.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/wifi/wpa2_enterprise/CMakeLists.txt b/examples/wifi/wpa2_enterprise/CMakeLists.txt index a489894e3..d50e6df21 100644 --- a/examples/wifi/wpa2_enterprise/CMakeLists.txt +++ b/examples/wifi/wpa2_enterprise/CMakeLists.txt @@ -1,17 +1,9 @@ # (Automatically converted from project Makefile by convert_to_cmake.py.) -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/wpa2_enterprise_main.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(wpa2-enterprise) - -# Embed CA, certificate & key directly into binary -target_add_binary_data(wpa2-enterprise.elf main/wpa2_ca.pem TEXT) -target_add_binary_data(wpa2-enterprise.elf main/wpa2_client.crt TEXT) -target_add_binary_data(wpa2-enterprise.elf main/wpa2_client.key TEXT) - diff --git a/examples/wifi/wpa2_enterprise/main/CMakeLists.txt b/examples/wifi/wpa2_enterprise/main/CMakeLists.txt new file mode 100644 index 000000000..10640a32d --- /dev/null +++ b/examples/wifi/wpa2_enterprise/main/CMakeLists.txt @@ -0,0 +1,8 @@ +set(COMPONENT_SRCS "wpa2_enterprise_main.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + + +# Embed CA, certificate & key directly into binary +set(COMPONENT_EMBED_TXTFILES wpa2_ca.pem wpa2_client.crt wpa2_client.key) + +register_component() diff --git a/examples/wifi/wps/CMakeLists.txt b/examples/wifi/wps/CMakeLists.txt index fd23de9aa..8bf9b9a8d 100644 --- a/examples/wifi/wps/CMakeLists.txt +++ b/examples/wifi/wps/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/wps.c) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(wps_example) diff --git a/examples/wifi/wps/main/CMakeLists.txt b/examples/wifi/wps/main/CMakeLists.txt new file mode 100644 index 000000000..c0a1063f6 --- /dev/null +++ b/examples/wifi/wps/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "wps.c") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/tools/ci/build_examples_cmake.sh b/tools/ci/build_examples_cmake.sh index e4f728cbd..d86d30fbd 100755 --- a/tools/ci/build_examples_cmake.sh +++ b/tools/ci/build_examples_cmake.sh @@ -65,7 +65,7 @@ RESULT_ISSUES=22 # magic number result code for issues found LOG_SUSPECTED=${LOG_PATH}/common_log.txt touch ${LOG_SUSPECTED} -EXAMPLE_PATHS=$( find ${IDF_PATH}/examples/ -type f -name CMakeLists.txt | grep -v "/components/" | sort ) +EXAMPLE_PATHS=$( find ${IDF_PATH}/examples/ -type f -name CMakeLists.txt | grep -v "/components/" | grep -v "/main/" | sort ) if [ $# -eq 0 ] then diff --git a/tools/ci/check_examples_cmake_make.sh b/tools/ci/check_examples_cmake_make.sh index 2f2d84413..079d18543 100755 --- a/tools/ci/check_examples_cmake_make.sh +++ b/tools/ci/check_examples_cmake_make.sh @@ -2,7 +2,7 @@ # While we support GNU Make & CMake together, check the same examples are present for both -CMAKE_EXAMPLE_PATHS=$( find ${IDF_PATH}/examples/ -type f -name CMakeLists.txt | grep -v "/components/") +CMAKE_EXAMPLE_PATHS=$( find ${IDF_PATH}/examples/ -type f -name CMakeLists.txt | grep -v "/components/" | grep -v "/main/") MAKE_EXAMPLE_PATHS=$( find ${IDF_PATH}/examples/ -type f -name Makefile ) # temporary: ignore ULP examples as no ULP toolchain support diff --git a/tools/ci/test_build_system_cmake.sh b/tools/ci/test_build_system_cmake.sh index de400fcb7..bb57375d1 100755 --- a/tools/ci/test_build_system_cmake.sh +++ b/tools/ci/test_build_system_cmake.sh @@ -78,7 +78,7 @@ function run_tests() take_build_snapshot touch ${IDF_PATH}/components/bootloader/subproject/main/bootloader_start.c idf.py build || failure "Failed to partial build bootloader" - assert_rebuilt ${BOOTLOADER_BINS} bootloader/CMakeFiles/bootloader.elf.dir/main/bootloader_start.c.obj + assert_rebuilt ${BOOTLOADER_BINS} bootloader/main/CMakeFiles/main.dir/bootloader_start.c.obj assert_not_rebuilt ${APP_BINS} ${PARTITION_BIN} print_status "Partition CSV file rebuilds partitions" diff --git a/tools/cmake/components.cmake b/tools/cmake/components.cmake index 0056a3b4a..bb4be0c86 100644 --- a/tools/cmake/components.cmake +++ b/tools/cmake/components.cmake @@ -22,8 +22,14 @@ function(register_component) spaces2list(COMPONENT_ADD_INCLUDEDIRS) spaces2list(COMPONENT_SRCEXCLUDE) - # Add to COMPONENT_SRCS by globbing in COMPONENT_SRCDIRS - if(NOT COMPONENT_SRCS) + if(COMPONENT_SRCDIRS) + # Warn user if both COMPONENT_SRCDIRS and COMPONENT_SRCS are set + if(COMPONENT_SRCS) + message(WARNING "COMPONENT_SRCDIRS and COMPONENT_SRCS are both set, COMPONENT_SRCS will be ignored") + endif() + + set(COMPONENT_SRCS "") + foreach(dir ${COMPONENT_SRCDIRS}) get_filename_component(abs_dir ${dir} ABSOLUTE BASE_DIR ${component_dir}) if(NOT IS_DIRECTORY ${abs_dir}) diff --git a/tools/cmake/convert_to_cmake.py b/tools/cmake/convert_to_cmake.py index 82e697171..be0b42510 100755 --- a/tools/cmake/convert_to_cmake.py +++ b/tools/cmake/convert_to_cmake.py @@ -82,10 +82,20 @@ def get_component_variables(project_path, component_path): if src is not None: srcs.append(src) make_vars["COMPONENT_SRCS"] = " ".join(srcs) - else: # Use COMPONENT_SRCDIRS - make_vars["COMPONENT_SRCDIRS"] = make_vars.get("COMPONENT_SRCDIRS", ".") + else: + component_srcs = list() + for component_srcdir in make_vars.get("COMPONENT_SRCDIRS", ".").split(" "): + component_srcdir_path = os.path.abspath(os.path.join(component_path, component_srcdir)) + + srcs = list() + srcs += glob.glob(os.path.join(component_srcdir_path, "*.[cS]")) + srcs += glob.glob(os.path.join(component_srcdir_path, "*.cpp")) + srcs = [('"%s"' % str(os.path.relpath(s, component_path))) for s in srcs] make_vars["COMPONENT_ADD_INCLUDEDIRS"] = make_vars.get("COMPONENT_ADD_INCLUDEDIRS", "include") + component_srcs += srcs + make_vars["COMPONENT_SRCS"] = " ".join(component_srcs) + return make_vars @@ -106,32 +116,10 @@ def convert_project(project_path): component_paths = project_vars["COMPONENT_PATHS"].split(" ") - # "main" component is made special in cmake, so extract it from the component_paths list - try: - main_component_path = [ p for p in component_paths if os.path.basename(p) == "main" ][0] - if debug: - print("Found main component %s" % main_component_path) - main_vars = get_component_variables(project_path, main_component_path) - except IndexError: - print("WARNING: Project has no 'main' component, but CMake-based system requires at least one file in MAIN_SRCS...") - main_vars = { "COMPONENT_SRCS" : ""} # dummy for MAIN_SRCS - - # Remove main component from list of components we're converting to cmake - component_paths = [ p for p in component_paths if os.path.basename(p) != "main" ] - # Convert components as needed for p in component_paths: convert_component(project_path, p) - # Look up project variables before we start writing the file, so nothing - # is created if there is an error - - main_srcs = main_vars["COMPONENT_SRCS"].split(" ") - # convert from component-relative to absolute paths - main_srcs = [ os.path.normpath(os.path.join(main_component_path, m)) for m in main_srcs ] - # convert to make relative to the project directory - main_srcs = [ os.path.relpath(m, project_path) for m in main_srcs ] - project_name = project_vars["PROJECT_NAME"] # Generate the project CMakeLists.txt file @@ -139,12 +127,11 @@ def convert_project(project_path): f.write(""" # (Automatically converted from project Makefile by convert_to_cmake.py.) -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) """) - f.write("set(MAIN_SRCS %s)\n" % " ".join(main_srcs)) f.write(""" include($ENV{IDF_PATH}/tools/cmake/project.cmake) """) @@ -164,16 +151,6 @@ def convert_component(project_path, component_path): # Look up all the variables before we start writing the file, so it's not # created if there's an erro component_srcs = v.get("COMPONENT_SRCS", None) - component_srcdirs = None - if component_srcs is not None: - # see if we should be using COMPONENT_SRCS or COMPONENT_SRCDIRS, if COMPONENT_SRCS is everything in SRCDIRS - component_allsrcs = [] - for d in v.get("COMPONENT_SRCDIRS", "").split(" "): - component_allsrcs += glob.glob(os.path.normpath(os.path.join(component_path, d, "*.[cS]"))) - component_allsrcs += glob.glob(os.path.normpath(os.path.join(component_path, d, "*.cpp"))) - abs_component_srcs = [os.path.normpath(os.path.join(component_path, p)) for p in component_srcs.split(" ")] - if set(component_allsrcs) == set(abs_component_srcs): - component_srcdirs = v.get("COMPONENT_SRCDIRS") component_add_includedirs = v["COMPONENT_ADD_INCLUDEDIRS"] cflags = v.get("CFLAGS", None) @@ -185,10 +162,7 @@ def convert_component(project_path, component_path): f.write("set(COMPONENT_REQUIRES "")\n") f.write("set(COMPONENT_PRIV_REQUIRES "")\n\n") - if component_srcdirs is not None: - f.write("set(COMPONENT_SRCDIRS %s)\n\n" % component_srcdirs) - f.write("register_component()\n") - elif component_srcs is not None: + if component_srcs is not None: f.write("set(COMPONENT_SRCS %s)\n\n" % component_srcs) f.write("register_component()\n") else: diff --git a/tools/cmake/idf_functions.cmake b/tools/cmake/idf_functions.cmake index b8c0f221d..9f6474ca1 100644 --- a/tools/cmake/idf_functions.cmake +++ b/tools/cmake/idf_functions.cmake @@ -22,8 +22,15 @@ macro(idf_set_global_variables) # (cmake calls this CMAKE_SOURCE_DIR, keeping old name for compatibility.) set(PROJECT_PATH "${CMAKE_SOURCE_DIR}") - # Note: Unlike older build system, "main" is no longer a component. See build docs for details. - set_default(COMPONENT_DIRS "${PROJECT_PATH}/components ${EXTRA_COMPONENT_DIRS} ${IDF_PATH}/components") + if(MAIN_SRCS) + message(WARNING "main is now a component, use of MAIN_SRCS is deprecated") + set_default(COMPONENT_DIRS "${PROJECT_PATH}/components ${EXTRA_COMPONENT_DIRS} \ + ${IDF_PATH}/components") + else() + set_default(COMPONENT_DIRS "${PROJECT_PATH}/components ${EXTRA_COMPONENT_DIRS} \ + ${IDF_PATH}/components ${PROJECT_PATH}/main") + endif() + spaces2list(COMPONENT_DIRS) spaces2list(COMPONENTS) @@ -140,8 +147,22 @@ endfunction() function(idf_add_executable) set(exe_target ${PROJECT_NAME}.elf) - spaces2list(MAIN_SRCS) - add_executable(${exe_target} "${MAIN_SRCS}") + if(MAIN_SRCS) + spaces2list(MAIN_SRCS) + add_executable(${exe_target} ${MAIN_SRCS}) + else() + # Create a dummy file to work around CMake requirement of having a source + # file while adding an executable + add_executable(${exe_target} "${CMAKE_CURRENT_BINARY_DIR}/dummy_main_src.c") + add_custom_command(OUTPUT dummy_main_src.c + COMMAND echo "" > dummy_main_src.c + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + VERBATIM) + + add_custom_target(dummy_main_src DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/dummy_main_src.c) + + add_dependencies(${exe_target} dummy_main_src) + endif() add_map_file(${exe_target}) endfunction() diff --git a/tools/cmake/scripts/expand_requirements.cmake b/tools/cmake/scripts/expand_requirements.cmake index 673357da1..29feda8b3 100644 --- a/tools/cmake/scripts/expand_requirements.cmake +++ b/tools/cmake/scripts/expand_requirements.cmake @@ -54,8 +54,16 @@ endfunction() # (expand_component_requirements() includes the component CMakeLists.txt, which then sets its component variables, # calls this dummy macro, and immediately exits again.) macro(register_component) - spaces2list(COMPONENT_REQUIRES) - set_property(GLOBAL PROPERTY "${COMPONENT}_REQUIRES" "${COMPONENT_REQUIRES}") + if(COMPONENT STREQUAL main AND NOT COMPONENT_REQUIRES) + set(main_component_requires ${COMPONENTS}) + list(REMOVE_ITEM main_component_requires "main") + + set_property(GLOBAL PROPERTY "${COMPONENT}_REQUIRES" "${main_component_requires}") + else() + spaces2list(COMPONENT_REQUIRES) + set_property(GLOBAL PROPERTY "${COMPONENT}_REQUIRES" "${COMPONENT_REQUIRES}") + endif() + spaces2list(COMPONENT_PRIV_REQUIRES) set_property(GLOBAL PROPERTY "${COMPONENT}_PRIV_REQUIRES" "${COMPONENT_PRIV_REQUIRES}") diff --git a/tools/cmake/utilities.cmake b/tools/cmake/utilities.cmake index e1c682c89..74d90d317 100644 --- a/tools/cmake/utilities.cmake +++ b/tools/cmake/utilities.cmake @@ -179,3 +179,14 @@ function(make_json_list list variable) string(REPLACE ";" "\", \"" result "[ \"${list}\" ]") set("${variable}" "${result}" PARENT_SCOPE) endfunction() + +# add_prefix +# +# Adds a prefix to each item in the specified list. +# +function(add_prefix var prefix) + foreach(elm ${ARGN}) + list(APPEND newlist "${prefix}${elm}") + endforeach() + set(${var} "${newlist}" PARENT_SCOPE) +endfunction() \ No newline at end of file