function(vpp_generate_api_c_header file)
set (output_name ${CMAKE_CURRENT_BINARY_DIR}/${file}.h)
get_filename_component(output_dir ${output_name} DIRECTORY)
function(vpp_generate_api_c_header file)
set (output_name ${CMAKE_CURRENT_BINARY_DIR}/${file}.h)
get_filename_component(output_dir ${output_name} DIRECTORY)
ARGS --includedir ${CMAKE_SOURCE_DIR} --input ${CMAKE_CURRENT_SOURCE_DIR}/${file} --output ${output_name}
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${file}
COMMENT "Generating API header ${output_name}"
)
endfunction()
ARGS --includedir ${CMAKE_SOURCE_DIR} --input ${CMAKE_CURRENT_SOURCE_DIR}/${file} --output ${output_name}
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${file}
COMMENT "Generating API header ${output_name}"
)
endfunction()
set (output_name ${CMAKE_CURRENT_BINARY_DIR}/${file}.json)
get_filename_component(output_dir ${output_name} DIRECTORY)
set (output_name ${CMAKE_CURRENT_BINARY_DIR}/${file}.json)
get_filename_component(output_dir ${output_name} DIRECTORY)
ARGS --includedir ${CMAKE_SOURCE_DIR} --input ${CMAKE_CURRENT_SOURCE_DIR}/${file} JSON --output ${output_name}
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${file}
COMMENT "Generating API header ${output_name}"
)
ARGS --includedir ${CMAKE_SOURCE_DIR} --input ${CMAKE_CURRENT_SOURCE_DIR}/${file} JSON --output ${output_name}
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${file}
COMMENT "Generating API header ${output_name}"
)
# @param dir - the install directory under ROOT/share/vpp/api to place the
# generated .json file
##############################################################################
# @param dir - the install directory under ROOT/share/vpp/api to place the
# generated .json file
##############################################################################
set(target ${name}_api_headers)
file(RELATIVE_PATH rpath ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
foreach(file ${ARGN})
set(target ${name}_api_headers)
file(RELATIVE_PATH rpath ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
foreach(file ${ARGN})
list(APPEND header_files ${file}.h ${file}.json)
set_property(GLOBAL APPEND PROPERTY VPP_API_FILES ${rpath}/${file})
endforeach()
list(APPEND header_files ${file}.h ${file}.json)
set_property(GLOBAL APPEND PROPERTY VPP_API_FILES ${rpath}/${file})
endforeach()