cmake_minimum_required(VERSION 3.13) #project(freertos_examples) # project(H2O_main) project(h2o_app) #add_executable(my_app src/main.cpp) #add_executable(h2o_app src/main.cpp) #add_executable(h2o_app src/main.c) file(GLOB ESP32_CODE "src/*.cpp" "src/esp32/*.cpp" "src/esp32/*.c") #### add_executable(testOTA ${ESP32_CODE}) add_executable(h2o_app ${ESP32_CODE}) # target_include_directories(esp32 PRIVATE esp32/*.h) # target_include_directories(h2o_app PRIVATE src/esp32) # include_directories(h2o_app "src/esp32") include_directories("/src/esp32") # Tell IDF build to link against this target. # set(IDF_PROJECT_EXECUTABLE my_app) set(IDF_PROJECT_EXECUTABLE h2o_app) # include_directories(BEFORE freertos-configs) # Add FreeRTOS as a subdirectory. AFR_BOARD tells which board to target. set(AFR_BOARD espressif.esp32_devkitc CACHE INTERNAL "") add_subdirectory(amazon-freertos) # Link against the mqtt library so that we can use it. Dependencies are transitively # linked. # target_link_libraries(my_app PRIVATE AFR::ota) target_link_libraries(h2o_app PRIVATE AFR::demo_ota) target_link_libraries(h2o_app PRIVATE AFR::demo_mqtt) # target_link_libraries(h2o_app PRIVATE AFR::ota) # target_link_libraries(h2o_app PRIVATE AFR::mqtt) # file(GLOB ESP32_CODE_CPP "src/esp32/*.cpp") # add_executable(testOTA ${ESP32_CODE_CPP}) # file(GLOB ESP32_CODE_C "src/esp32/*.c") # add_executable(testOTA ${ESP32_CODE_C}) #set(COMPONENT_ADD_INCLUDEDIRS src/esp32) #set(COMPONENT_SRCDIRS src/esp32) # The following are to add "links" to esp_vApplicationTickHook & IdleHook set(COMPONENT_SRCDIRS amazon-freertos/vendors/espressif/esp-idf/components/esp32) set(COMPONENT_SRCS "freertos_hooks.c") # ADD_SUBDIRECTORY(src) # Add some extra components. IDF_EXTRA_COMPONENT_DIRS is a variable used by ESP-IDF # to collect extra components. ### get_filename_component( ### EXTRA_COMPONENT_DIRS ### "src/esp32" ABSOLUTE ### ) ### list(APPEND IDF_EXTRA_COMPONENT_DIRS ${EXTRA_COMPONENT_DIRS})