Buildsystem: embed generated file

si4web
Posts: 6
Joined: Wed Aug 18, 2021 5:11 pm

Buildsystem: embed generated file

Postby si4web » Thu Jan 20, 2022 4:16 pm

Hi ESP Forum!

I try to do html templating during the build process.

This is my main CMakeLists.txt:

Code: Select all

# The following five lines of boilerplate have to be in your project's
# CMakeLists in this exact order for cmake to work correctly
cmake_minimum_required(VERSION 3.5)
include(./components/custom-idf-components/custom_components.cmake)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(wlandevice)


add_custom_target( 
    templating
    COMMAND python ${CMAKE_CURRENT_SOURCE_DIR}/template_html.py ${CMAKE_CURRENT_SOURCE_DIR}/index_template.html
    COMMENT "Generation html file"
    )
    
target_add_binary_data(wlandevice.elf index.html BINARY DEPENDS templating)
Unfortunately i get following error:
-- Configuring done
CMake Error in CMakeLists.txt:
Cannot find source file:

C:/dev/ESP32/workspace/wlandevice/index.html

Tried extensions .c .C .c++ .cc .cpp .cxx .cu .mpp .m .M .mm .h .hh .h++
.hm .hpp .hxx .in .txx .f .F .for .f77 .f90 .f95 .f03 .ispc
It seems like the DEPENDS is not respected.

Any advice?

I'm using IDF 4.4 release

Who is online

Users browsing this forum: No registered users and 166 guests