I am trying to build my application for different targets which sometimes require different CMake commands. So I did the following:
1. Clone the esp-idf-template application from Github.
2. Create an empty component named test_component.
3. Change the CMakeLists.txt in test_component so it looks like the following:
Code: Select all
if(ESP_PLATFORM)
message("Building with esp-idf...")
idf_component_register(
SRCS
"component.cpp"
INCLUDE_DIRS
"."
)
else()
message("Not building with esp-idf...")
# do some stuff for other platforms
endif()
Thank you in advance!