summaryrefslogtreecommitdiffstats
path: root/src/cmake/plugin.cmake
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2018-09-12 12:12:36 +0200
committerDave Barach <openvpp@barachs.net>2018-09-12 17:04:36 +0000
commit0fa900e482451d05449501c1422bfa7c47eec661 (patch)
treec9f17a9fa246221aec040d334ef0ae52143768b5 /src/cmake/plugin.cmake
parent79dcbc74cd417f4caf41bc398ccba94cab7d656b (diff)
cmake: create cmake VPP module, update sample-plugin so it uses it
Change-Id: I32e91ba8e55797ffe169f98b09bdb42caa5c7de2 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/cmake/plugin.cmake')
-rw-r--r--src/cmake/plugin.cmake17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/cmake/plugin.cmake b/src/cmake/plugin.cmake
index 39c940daed4..f68c955f64f 100644
--- a/src/cmake/plugin.cmake
+++ b/src/cmake/plugin.cmake
@@ -19,7 +19,7 @@ macro(add_vpp_plugin name)
${ARGN}
)
set(plugin_name ${name}_plugin)
- set(api_headers)
+ set(api_includes)
if(NOT PLUGIN_COMPONENT)
set(PLUGIN_COMPONENT vpp-plugin-misc)
endif()
@@ -27,7 +27,7 @@ macro(add_vpp_plugin name)
foreach(f ${PLUGIN_API_FILES})
get_filename_component(dir ${f} DIRECTORY)
vpp_generate_api_header(${f} plugins ${PLUGIN_COMPONENT})
- list(APPEND api_headers ${f}.h ${f}.json)
+ list(APPEND api_includes ${f}.h ${f}.json)
set_property(GLOBAL APPEND PROPERTY VPP_API_FILES ${rpath}/${f})
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/${f}.h
@@ -35,9 +35,11 @@ macro(add_vpp_plugin name)
COMPONENT vpp-dev
)
endforeach()
- add_library(${plugin_name} SHARED ${PLUGIN_SOURCES} ${api_headers})
+ add_library(${plugin_name} SHARED ${PLUGIN_SOURCES} ${api_includes})
target_compile_options(${plugin_name} PRIVATE -Wall)
- add_dependencies(${plugin_name} vpp_version_h api_headers)
+ if(NOT VPP_EXTERNAL_PROJECT)
+ add_dependencies(${plugin_name} vpp_version_h api_headers)
+ endif()
set_target_properties(${plugin_name} PROPERTIES
PREFIX ""
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/vpp_plugins)
@@ -62,8 +64,11 @@ macro(add_vpp_plugin name)
endif()
if(PLUGIN_API_TEST_SOURCES)
set(test_plugin_name ${name}_test_plugin)
- add_library(${test_plugin_name} SHARED ${PLUGIN_API_TEST_SOURCES} ${api_headers})
- add_dependencies(${test_plugin_name} api_headers)
+ add_library(${test_plugin_name} SHARED ${PLUGIN_API_TEST_SOURCES}
+ ${api_includes})
+ if(NOT VPP_EXTERNAL_PROJECT)
+ add_dependencies(${test_plugin_name} api_headers)
+ endif()
set_target_properties(${test_plugin_name} PROPERTIES
PREFIX ""
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/vpp_api_test_plugins)