aboutsummaryrefslogtreecommitdiffstats
path: root/src/vcl
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/vcl
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/vcl')
-rw-r--r--src/vcl/CMakeLists.txt19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/vcl/CMakeLists.txt b/src/vcl/CMakeLists.txt
index e592ce54f32..840a62ad85e 100644
--- a/src/vcl/CMakeLists.txt
+++ b/src/vcl/CMakeLists.txt
@@ -14,20 +14,19 @@
##############################################################################
# vppcom shared library
##############################################################################
-add_library(vppcom SHARED
+add_vpp_library(vppcom
+ SOURCES
vppcom.c
vcl_bapi.c
vcl_cfg.c
vcl_event.c
vcl_private.c
+
+ LINK_LIBRARIES
+ vppinfra svm vlibmemoryclient rt pthread
)
-target_link_libraries(vppcom vppinfra svm vlibmemoryclient rt pthread)
-install(TARGETS vppcom DESTINATION lib)
-##############################################################################
-# vcl headers
-##############################################################################
-vpp_add_header_files(vcl
+add_vpp_headers(vcl
ldp.h
vcl_event.h
sock_test.h
@@ -43,7 +42,7 @@ vpp_add_header_files(vcl
##############################################################################
option(VPP_BUILD_VCL_TESTS "Build vcl tests." ON)
if(VPP_BUILD_VCL_TESTS)
- set(VCL_TESTS
+ foreach(test
vcl_test_server
vcl_test_client
sock_test_server
@@ -51,9 +50,7 @@ if(VPP_BUILD_VCL_TESTS)
test_vcl_listener_server
test_vcl_listener_client
)
- foreach(test ${VCL_TESTS})
- add_executable(${test} ${test}.c)
- target_link_libraries(${test} vppcom)
+ add_vpp_executable(${test} SOURCES ${test}.c LINK_LIBRARIES vppcom)
endforeach()
endif(VPP_BUILD_VCL_TESTS)