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)