Files
ota_ws_update/CMakeLists.txt
2023-10-09 15:53:05 +07:00

68 lines
1.7 KiB
CMake

set( srcs
source/ota_ws_update_http.c
)
set( includedir
include
)
set( priv_includedir
private_include
)
set(require
""
)
set( priv_require
esp_http_server
app_update
esp_encrypted_img
)
set( embed_file
source/ota_ws_update.html
)
set( embed_txt_file
""
)
if(CONFIG_OTA_PRE_ENCRYPTED_MODE)
list(APPEND srcs
source/ota_ws_update_esp_preencrypted.c
esp_encrypted_img/src/esp_encrypted_img.c
)
list(APPEND priv_includedir
esp_encrypted_img/include
)
list(APPEND embed_txt_file
rsa_key/private.pem
)
else()
list(APPEND srcs
source/ota_ws_update_esp.c
)
endif()
idf_component_register(
SRCS ${srcs}
INCLUDE_DIRS ${includedir}
PRIV_INCLUDE_DIRS ${priv_includedir}
REQUIRES ${require}
PRIV_REQUIRES ${priv_require}
EMBED_FILES ${embed_file}
EMBED_TXTFILES ${embed_txt_file}
)
if(CONFIG_OTA_PRE_ENCRYPTED_MODE)
include(esp_encrypted_img/project_include.cmake)
#redefine ESP_IMG_GEN_TOOL_PATH
set(ESP_IMG_GEN_TOOL_PATH ${CMAKE_CURRENT_LIST_DIR}/esp_encrypted_img/tools/esp_enc_img_gen.py)
#openssl genrsa -out rsa_key/private.pem 3072
# for rsa_key on components dir
create_esp_enc_img(${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}.bin
${COMPONENT_DIR}/rsa_key/private.pem ${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}_secure.bin app)
# for rsa_key on project dir
#create_esp_enc_img(${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}.bin
# ${project_dir}/rsa_key/private.pem ${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}_secure.bin app)
endif()