Fry3DX/cmake/EmbedText.cmake
Nexoniarz f3e8eca87b Fry3DX 0.4: an easy 3D modeller
Shapes with live settings, shape editing, knife and hole tools, drawing
shapes onto other objects, combining objects (add / subtract / overlap),
copies, thickness, painting with stickers and layers, a Layout tab, a
Print tab with checks, packed .fry files with autosave, export to GLB,
glTF, FBX, OBJ, 3MF, STL and PLY, folders in Layers, its own crash
screen, and a website for GitHub Pages in docs/.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NMSrd5oe1GpUD7E6d825KP
2026-10-19 21:18:35 +02:00

22 lines
721 B
CMake

# cmake -DOUT=file.inc -DFILES="a;b" -P EmbedText.cmake
# Writes { "name", "text" }, entries as C++ raw string literals, split into chunks so no single
# literal is too long for MSVC.
string(REPLACE "|" ";" FILES "${FILES}")
set(result "")
foreach(f ${FILES})
get_filename_component(name ${f} NAME)
file(READ ${f} text)
string(LENGTH "${text}" len)
set(literal "")
set(pos 0)
while(pos LESS len)
string(SUBSTRING "${text}" ${pos} 4000 chunk)
string(APPEND literal "R\"keel(${chunk})keel\"\n")
math(EXPR pos "${pos} + 4000")
endwhile()
if(literal STREQUAL "")
set(literal "\"\"")
endif()
string(APPEND result "{\"${name}\",\n${literal}},\n")
endforeach()
file(WRITE ${OUT} "${result}")