1 Star 0 Fork 1

苏州芯仪半导体科技有限公司/beshell-component

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
embed-files.cmake 1.22 KB
一键复制 编辑 原始数据 按行查看 历史
alee 提交于 2024-03-09 22:12 . demo code
function(embed_file input_file output_file)
file(TIMESTAMP input_file_time ${input_file})
file(TIMESTAMP output_file_time ${output_file})
if(file1_time STRGREATER file2_time)
message("input was modified more recently than output")
endif()
# get_filename_component(varname ${input_file} NAME)
# string(REPLACE "." "_" varname ${varname})
# string(REPLACE "/" "_" varname ${varname})
# string(REPLACE "\\" "_" varname ${varname})
# string(REPLACE ":" "_" varname ${varname})
# add_custom_command(
# OUTPUT ${output_file}
# COMMAND ${CMAKE_COMMAND} -E echo "embed ${input_file} as ${output_file}"
# # COMMAND echo \#pragma once > ${output_file}
# # COMMAND echo >> ${output_file}
# # COMMAND echo -n const char embeded_file_${varname} = R(\\\" >> ${output_file}
# # COMMAND cat ${input_file} >> ${output_file}
# # COMMAND echo -n >> ${output_file}
# # COMMAND echo \\\")\; >> ${output_file}
# DEPENDS ${input_file}
# )
# add_custom_target(target_embed_${varname} ALL DEPENDS ${output_file})
endfunction()
embed_file(${CMAKE_CURRENT_LIST_DIR}/src/module/wifi.js ${CMAKE_CURRENT_LIST_DIR}/src/module/wifi.js.h)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/seminstruments/beshell-component.git
git@gitee.com:seminstruments/beshell-component.git
seminstruments
beshell-component
beshell-component
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385