CMakeLists.txt 474 字节
Newer Older
L
LiFeng 已提交
1
set(cmdpath python3)
O
overweight 已提交
2 3 4 5 6 7 8 9 10 11 12 13 14 15
set(pysrcpath ${CMAKE_CURRENT_SOURCE_DIR}/src/generate.py)
set(schemapath ${CMAKE_CURRENT_SOURCE_DIR}/schema)
set(outputpath ${CMAKE_BINARY_DIR}/json)

message("--  Generate .c and .h file into: " ${outputpath})
add_subdirectory(src)

execute_process(COMMAND ${cmdpath} ${pysrcpath} --gen-common --gen-ref -r --root=${schemapath} --out=${outputpath} ${schemapath}
    ERROR_VARIABLE err
    )

if (err)
    message(FATAL_ERROR "ERROR: " ${err})
endif()