Create tar archive automatically in build process
Posted: Wed May 24, 2023 9:16 am
Hi, how I should configure CMakeLists.txt to automatically generate tar archive in build process?
I've tried this script, but I can't figure out, which target I am supposed to use.
This script reports error:
And it seems that execute_process didn't run at all (when it wasn't commented, of course).
I've tried this script, but I can't figure out, which target I am supposed to use.
Code: Select all
idf_component_register(
SRCS "embedded_vfs.c" "microtar.c"
INCLUDE_DIRS "include"
EMBED_FILES
embedded.tar
)
# execute_process(COMMAND rm embedded.tar)
# execute_process(COMMAND tar -cf embedded.tar --owner dev --group dev -C files . --transform 's/^\.//')
add_custom_command(
OUTPUT embedded.tar
COMMAND tar -cf "embedded.tar" -C files
)
target_add_binary_data(PROJECT_DIR "embedded.tar" BINARY)
I've tried ${PROJECT_NAME}.elf and embedded_files (component's name) as well, but neither have worked.Cannot specify sources for target "PROJECT_DIR" which is not built by this project.
And it seems that execute_process didn't run at all (when it wasn't commented, of course).