summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2018-09-13 18:43:19 +0200
committerMarco Varlese <marco.varlese@suse.de>2018-09-14 07:21:51 +0000
commit958192dc2abf427118a227d142f5b03807098cb2 (patch)
treeb10189273b9edce2a6124950fa7b2fbbae19fbb1
parentd23d39cc012e5b1075a2323d6e940ae5ad43de46 (diff)
cmake: use VPP package in VOM
Change-Id: I83b244be920521e580085beffb7e40613e67c8ee Signed-off-by: Damjan Marion <damarion@cisco.com>
-rw-r--r--extras/vom/CMakeLists.txt1
-rw-r--r--extras/vom/vom/CMakeLists.txt15
-rw-r--r--src/cmake/library.cmake4
3 files changed, 12 insertions, 8 deletions
diff --git a/extras/vom/CMakeLists.txt b/extras/vom/CMakeLists.txt
index e84e2a91850..916289023e8 100644
--- a/extras/vom/CMakeLists.txt
+++ b/extras/vom/CMakeLists.txt
@@ -22,6 +22,7 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib)
set(CMAKE_INSTALL_MESSAGE NEVER)
+find_package(VPP)
find_package(Threads REQUIRED)
add_subdirectory(vom)
diff --git a/extras/vom/vom/CMakeLists.txt b/extras/vom/vom/CMakeLists.txt
index 76abd4604c5..6285983faa2 100644
--- a/extras/vom/vom/CMakeLists.txt
+++ b/extras/vom/vom/CMakeLists.txt
@@ -228,12 +228,13 @@ list(APPEND VOM_HEADERS
vxlan_tunnel.hpp
)
-add_library(vom SHARED ${VOM_SOURCES})
-target_link_libraries(vom ${VAPICLIENT_LIB} Threads::Threads boost_thread
- ${BOOST_SYSTEM_LIB} ${BOOST_FILESYSTEM_LIB} ${BOOST_ASIO_LIB} m rt)
add_definitions(-Wall -Werror -std=gnu++11)
-install(TARGETS vom DESTINATION lib)
-foreach(file ${VOM_HEADERS})
- install(FILES ${file} DESTINATION include/vom)
-endforeach()
+add_vpp_library(vom
+ SOURCES ${VOM_SOURCES}
+
+ INSTALL_HEADERS ${VOM_HEADERS}
+
+ LINK_LIBRARIES ${VAPICLIENT_LIB} Threads::Threads boost_thread
+ ${BOOST_SYSTEM_LIB} ${BOOST_FILESYSTEM_LIB} ${BOOST_ASIO_LIB} m rt
+)
diff --git a/src/cmake/library.cmake b/src/cmake/library.cmake
index e0eb7af76fc..b9e4f9b4bd8 100644
--- a/src/cmake/library.cmake
+++ b/src/cmake/library.cmake
@@ -21,7 +21,9 @@ macro(add_vpp_library lib)
add_library(${lib} SHARED ${ARG_SOURCES})
target_compile_options(${lib} PRIVATE -Wall)
- set_target_properties(${lib} PROPERTIES SOVERSION ${VPP_LIB_VERSION})
+ if(VPP_LIB_VERSION)
+ set_target_properties(${lib} PROPERTIES SOVERSION ${VPP_LIB_VERSION})
+ endif()
# library deps
if(ARG_LINK_LIBRARIES)