mirror of
https://github.com/ok-home/ota_ws_update.git
synced 2025-11-13 22:03:27 +03:00
chg Cmake
This commit is contained in:
@@ -1,46 +1,58 @@
|
|||||||
if(CONFIG_OTA_PRE_ENCRYPTED_MODE)
|
set( srcs
|
||||||
idf_component_register(
|
|
||||||
SRCS
|
|
||||||
source/ota_ws_update_esp_preencrypted.c
|
|
||||||
source/ota_ws_update_http.c
|
source/ota_ws_update_http.c
|
||||||
INCLUDE_DIRS
|
)
|
||||||
|
set( includedir
|
||||||
include
|
include
|
||||||
PRIV_INCLUDE_DIRS
|
)
|
||||||
|
set( priv_includedir
|
||||||
private_include
|
private_include
|
||||||
REQUIRES
|
)
|
||||||
|
set(require
|
||||||
|
""
|
||||||
|
)
|
||||||
|
set( priv_require
|
||||||
esp_http_server
|
esp_http_server
|
||||||
app_update
|
app_update
|
||||||
esp_encrypted_img
|
esp_encrypted_img
|
||||||
#esp_wifi
|
)
|
||||||
EMBED_FILES
|
set( embed_file
|
||||||
source/ota_ws_update.html
|
source/ota_ws_update.html
|
||||||
EMBED_TXTFILES
|
)
|
||||||
|
set( embed_txt_file
|
||||||
|
""
|
||||||
|
)
|
||||||
|
|
||||||
|
if(CONFIG_OTA_PRE_ENCRYPTED_MODE)
|
||||||
|
list(APPEND srcs
|
||||||
|
source/ota_ws_update_esp_preencrypted.c
|
||||||
|
)
|
||||||
|
list(APPEND embed_txt_file
|
||||||
rsa_key/private.pem
|
rsa_key/private.pem
|
||||||
)
|
)
|
||||||
#openssl genrsa -out rsa_key/private.pem 3072
|
|
||||||
#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)
|
|
||||||
# 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)
|
|
||||||
|
|
||||||
else()
|
else()
|
||||||
idf_component_register(
|
list(APPEND srcs
|
||||||
SRCS
|
|
||||||
source/ota_ws_update_esp.c
|
source/ota_ws_update_esp.c
|
||||||
source/ota_ws_update_http.c
|
|
||||||
INCLUDE_DIRS
|
|
||||||
include
|
|
||||||
PRIV_INCLUDE_DIRS
|
|
||||||
private_include
|
|
||||||
REQUIRES
|
|
||||||
esp_http_server
|
|
||||||
app_update
|
|
||||||
#esp_wifi
|
|
||||||
EMBED_FILES
|
|
||||||
source/ota_ws_update.html
|
|
||||||
)
|
)
|
||||||
endif()
|
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)
|
||||||
|
#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()
|
||||||
|
|||||||
Reference in New Issue
Block a user