summaryrefslogtreecommitdiffstats
path: root/src/cmake
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmake')
-rw-r--r--src/cmake/api.cmake7
-rw-r--r--src/cmake/library.cmake2
-rw-r--r--src/cmake/plugin.cmake6
3 files changed, 10 insertions, 5 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()
diff --git a/src/cmake/library.cmake b/src/cmake/library.cmake
index 6aa0ae848f9..9ed53e9dba7 100644
--- a/src/cmake/library.cmake
+++ b/src/cmake/library.cmake
@@ -33,7 +33,7 @@ macro(add_vpp_library lib)
endif()
if(ARG_API_FILES)
- vpp_add_api_files(${lib}_api_headers ${ARG_API_FILES})
+ vpp_add_api_files(${lib} ${ARG_API_FILES})
foreach(file ${ARG_API_FILES})
get_filename_component(dir ${file} DIRECTORY)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${file}.h DESTINATION include/${lib}/${dir})
diff --git a/src/cmake/plugin.cmake b/src/cmake/plugin.cmake
index 4087325b0d6..a5b4bf51a16 100644
--- a/src/cmake/plugin.cmake
+++ b/src/cmake/plugin.cmake
@@ -20,9 +20,11 @@ macro(add_vpp_plugin name)
)
set(plugin_name ${name}_plugin)
set(api_headers)
+ file(RELATIVE_PATH rpath ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
foreach(f ${PLUGIN_API_FILES})
- vpp_generate_api_header(${f} plugins)
- list(APPEND api_headers ${f}.h ${f}.json)
+ vpp_generate_api_header(${f} plugins)
+ list(APPEND api_headers ${f}.h ${f}.json)
+ set_property(GLOBAL APPEND PROPERTY VPP_API_FILES ${rpath}/${f})
endforeach()
add_library(${plugin_name} SHARED ${PLUGIN_SOURCES} ${api_headers})
add_dependencies(${plugin_name} vpp_version_h api_headers)