From 2a31ef00964409cc112f991e7f78ce102eb9adb5 Mon Sep 17 00:00:00 2001 From: Manuel Bl <10954524+manuelbl@users.noreply.github.com> Date: Sat, 1 Aug 2020 10:28:25 +0200 Subject: [PATCH] Update example build configuration --- examples/mac_address/CMakeLists.txt | 11 +++++------ examples/mac_address/main/CMakeLists.txt | 8 ++++---- examples/provisioning/CMakeLists.txt | 11 +++++------ examples/provisioning/main/CMakeLists.txt | 8 ++++---- examples/shutdown/CMakeLists.txt | 13 ++++++------- examples/shutdown/main/CMakeLists.txt | 8 ++++---- 6 files changed, 28 insertions(+), 31 deletions(-) diff --git a/examples/mac_address/CMakeLists.txt b/examples/mac_address/CMakeLists.txt index 27e5b6b..7e3937d 100644 --- a/examples/mac_address/CMakeLists.txt +++ b/examples/mac_address/CMakeLists.txt @@ -1,9 +1,8 @@ -# 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) - -get_filename_component(TTN_DIR ../.. ABSOLUTE) -set(EXTRA_COMPONENT_DIRS "${TTN_DIR}") - include($ENV{IDF_PATH}/tools/cmake/project.cmake) + +# Update the below line to match the path to the ttn-esp32 library, +# e.g. list(APPEND EXTRA_COMPONENT_DIRS "/Users/me/Documents/ttn-esp32") +list(APPEND EXTRA_COMPONENT_DIRS "../..") + project(mac_address) diff --git a/examples/mac_address/main/CMakeLists.txt b/examples/mac_address/main/CMakeLists.txt index e931882..8aa291e 100644 --- a/examples/mac_address/main/CMakeLists.txt +++ b/examples/mac_address/main/CMakeLists.txt @@ -1,4 +1,4 @@ -set(COMPONENT_SRCS "main.cpp") -set(COMPONENT_ADD_INCLUDEDIRS "") - -register_component() +idf_component_register( + SRCS "main.cpp" + INCLUDE_DIRS "." + REQUIRES ttn-esp32) diff --git a/examples/provisioning/CMakeLists.txt b/examples/provisioning/CMakeLists.txt index cb0bee0..1cc1bb7 100644 --- a/examples/provisioning/CMakeLists.txt +++ b/examples/provisioning/CMakeLists.txt @@ -1,9 +1,8 @@ -# 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) - -get_filename_component(TTN_DIR ../.. ABSOLUTE) -set(EXTRA_COMPONENT_DIRS "${TTN_DIR}") - include($ENV{IDF_PATH}/tools/cmake/project.cmake) + +# Update the below line to match the path to the ttn-esp32 library, +# e.g. list(APPEND EXTRA_COMPONENT_DIRS "/Users/me/Documents/ttn-esp32") +list(APPEND EXTRA_COMPONENT_DIRS "../..") + project(provisioning) diff --git a/examples/provisioning/main/CMakeLists.txt b/examples/provisioning/main/CMakeLists.txt index e931882..8aa291e 100644 --- a/examples/provisioning/main/CMakeLists.txt +++ b/examples/provisioning/main/CMakeLists.txt @@ -1,4 +1,4 @@ -set(COMPONENT_SRCS "main.cpp") -set(COMPONENT_ADD_INCLUDEDIRS "") - -register_component() +idf_component_register( + SRCS "main.cpp" + INCLUDE_DIRS "." + REQUIRES ttn-esp32) diff --git a/examples/shutdown/CMakeLists.txt b/examples/shutdown/CMakeLists.txt index b6b2f10..4e4be0a 100644 --- a/examples/shutdown/CMakeLists.txt +++ b/examples/shutdown/CMakeLists.txt @@ -1,9 +1,8 @@ -# 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) - -get_filename_component(TTN_DIR ../.. ABSOLUTE) -set(EXTRA_COMPONENT_DIRS "${TTN_DIR}") - include($ENV{IDF_PATH}/tools/cmake/project.cmake) -project(send_recv) + +# Update the below line to match the path to the ttn-esp32 library, +# e.g. list(APPEND EXTRA_COMPONENT_DIRS "/Users/me/Documents/ttn-esp32") +list(APPEND EXTRA_COMPONENT_DIRS "../..") + +project(shutdown) diff --git a/examples/shutdown/main/CMakeLists.txt b/examples/shutdown/main/CMakeLists.txt index e931882..8aa291e 100644 --- a/examples/shutdown/main/CMakeLists.txt +++ b/examples/shutdown/main/CMakeLists.txt @@ -1,4 +1,4 @@ -set(COMPONENT_SRCS "main.cpp") -set(COMPONENT_ADD_INCLUDEDIRS "") - -register_component() +idf_component_register( + SRCS "main.cpp" + INCLUDE_DIRS "." + REQUIRES ttn-esp32)