diff options
author | Neale Ranns <neale.ranns@cisco.com> | 2018-08-21 06:34:00 -0700 |
---|---|---|
committer | Neale Ranns <nranns@cisco.com> | 2018-08-22 08:06:55 +0000 |
commit | ffec78649735363778a192ad581020e7b73b472d (patch) | |
tree | 2b10ac5c187abeb2e7d1508c6b8f36d7e1a3a700 /src/CMakeLists.txt | |
parent | 505ec22c64b294fe683a99958a65d7979c9ccaaf (diff) |
CMake: install .json files in ROOT/share/... for papi.
Change-Id: I1a5325c5f026ba5e8d89608c285e934a6e1c16e6
Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r-- | src/CMakeLists.txt | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e6054e10ac4..c0b4bba2084 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -148,7 +148,7 @@ function(vpp_generate_api_c_header file) ) endfunction() -function(vpp_generate_api_json_header file) +function(vpp_generate_api_json_header file dir) set (output_name ${CMAKE_CURRENT_BINARY_DIR}/${file}.json) get_filename_component(output_dir ${output_name} DIRECTORY) add_custom_command (OUTPUT ${output_name} @@ -158,17 +158,24 @@ function(vpp_generate_api_json_header file) DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${file} COMMENT "Generating API header ${output_name}" ) + install(FILES ${output_name} DESTINATION share/vpp/api/${dir}/) endfunction() -function(vpp_generate_api_header file) +############################################################################## +# generate the .h and .json files for a .api file +# @param file - the name of the .api +# @param dir - the install directory under ROOT/share/vpp/api to place the +# generated .json file +############################################################################## +function(vpp_generate_api_header file dir) vpp_generate_api_c_header (${file}) - vpp_generate_api_json_header (${file}) + vpp_generate_api_json_header (${file} ${dir}) endfunction() function(vpp_add_api_files target) unset(header_files) foreach(file ${ARGN}) - vpp_generate_api_header (${file}) + vpp_generate_api_header (${file} core) list (APPEND header_files ${file}.h ${file}.json) endforeach() add_custom_target(${target} DEPENDS ${header_files}) |