summaryrefslogtreecommitdiffstats
path: root/src/cmake/api.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmake/api.cmake')
-rw-r--r--src/cmake/api.cmake7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/cmake/api.cmake b/src/cmake/api.cmake
index 644e80b8270..533448ad16e 100644
--- a/src/cmake/api.cmake
+++ b/src/cmake/api.cmake
@@ -50,11 +50,14 @@ function(vpp_generate_api_header file dir)
vpp_generate_api_json_header (${file} ${dir})
endfunction()
-function(vpp_add_api_files target)
+function(vpp_add_api_files name)
unset(header_files)
+ set(target ${name}_api_headers)
+ file(RELATIVE_PATH rpath ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
foreach(file ${ARGN})
vpp_generate_api_header (${file} core)
- list (APPEND header_files ${file}.h ${file}.json)
+ list(APPEND header_files ${file}.h ${file}.json)
+ set_property(GLOBAL APPEND PROPERTY VPP_API_FILES ${rpath}/${file})
endforeach()
add_custom_target(${target} DEPENDS ${header_files})
endfunction()