This repository has been archived on 2022-05-21. You can view files and clone it, but cannot push or open issues or pull requests.
LEFTONE/cmake/crial.cmake
falsycat 80b3b82332 [RELEASE] u22-v04
This version is submitted for U22 final presentation. (squashed 158 commits)
2021-02-07 00:00:00 +00:00

20 lines
678 B
CMake

function(target_crial_sources target)
set(crial ${LEFTONE_TOOL_DIR}/crial.sh)
foreach (path ${ARGN})
get_filename_component(dirname ${path} DIRECTORY)
get_filename_component(basename ${path} NAME_WE)
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/crial/${dirname})
set(in ${CMAKE_CURRENT_SOURCE_DIR}/${path})
set(out ${CMAKE_CURRENT_BINARY_DIR}/crial/${dirname}/${basename}.h)
add_custom_command(
OUTPUT ${out}
COMMAND bash ${crial} < ${in} > ${out}
DEPENDS ${path} ${crial}
COMMENT "generating serializer from ${path}"
VERBATIM)
target_sources(${target} PRIVATE ${out})
endforeach()
endfunction()