aboutsummaryrefslogtreecommitdiffstats
path: root/src/vat
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2018-08-26 11:04:40 +0200
committerDamjan Marion <damarion@cisco.com>2018-08-26 13:50:53 +0200
commit4553c95ab7cac75838433fdd5cd3c0d0c1d6e2e6 (patch)
tree248b50ad7df32be9f1662920ed9c322e23de6b91 /src/vat
parentd16004d56c22635a0e21b177933dc39b65a3642a (diff)
cmake: add add_vpp_library and add_vpp_executable macros
Change-Id: I1382021a6f616571b4b3243ba8c8999239d10815 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vat')
-rw-r--r--src/vat/CMakeLists.txt48
1 files changed, 23 insertions, 25 deletions
diff --git a/src/vat/CMakeLists.txt b/src/vat/CMakeLists.txt
index 9edfec76624..feb335c0679 100644
--- a/src/vat/CMakeLists.txt
+++ b/src/vat/CMakeLists.txt
@@ -14,50 +14,48 @@
##############################################################################
# vat plugin shared library
##############################################################################
-add_library(vatplugin SHARED plugin_api.c)
-target_link_libraries(vatplugin vppinfra)
-add_dependencies (vatplugin vppinfra)
-install(TARGETS vatplugin DESTINATION lib)
+add_vpp_library(vatplugin
+ SOURCES plugin_api.c
+ LINK_LIBRARIES vppinfra
+)
##############################################################################
# vpp_api_test
##############################################################################
-add_executable (vpp_api_test
+add_vpp_executable(vpp_api_test ENABLE_EXPORTS
+ SOURCES
api_format.c
main.c
plugin.c
json_format.c
- vat.h
- json_format.h
+
+ LINK_LIBRARIES
+ vlibmemoryclient
+ svm
+ vatplugin
+ vppinfra
+ Threads::Threads
+ rt m dl crypto
)
-target_link_libraries (vpp_api_test vlibmemoryclient svm vatplugin vppinfra
- Threads::Threads rt m dl crypto)
-set_target_properties(vpp_api_test PROPERTIES ENABLE_EXPORTS 1)
-install(TARGETS vpp_api_test DESTINATION bin)
##############################################################################
# vpp_json_test
##############################################################################
-add_executable (vpp_json_test
- json_format.h
- json_format.c
- json_test.c)
-target_link_libraries(vpp_json_test vppinfra m)
-set_target_properties(vpp_json_test PROPERTIES ENABLE_EXPORTS 1)
-install(TARGETS vpp_json_test DESTINATION bin)
+add_vpp_executable(vpp_json_test ENABLE_EXPORTS
+ SOURCES json_format.c json_test.c
+ LINK_LIBRARIES vppinfra m
+)
##############################################################################
# vat headers
##############################################################################
-vpp_add_header_files(vat
- vat.h
- json_format.h
-)
+install(FILES vat.h json_format.h DESTINATION include/vat)
##############################################################################
# restart
##############################################################################
-add_executable (vpp_restart restart.c)
-target_link_libraries (vpp_restart svmdb svm vppinfra pthread rt)
-install(TARGETS vpp_restart DESTINATION bin )
+add_vpp_executable(vpp_restart
+ SOURCES restart.c
+ LINK_LIBRARIES svm svmdb vppinfra Threads::Threads rt
+)