summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorMauro Sardara <msardara@cisco.com>2019-09-23 19:34:23 +0200
committerMauro Sardara <msardara@cisco.com>2019-09-24 11:14:16 +0200
commita0da41b243661a039481d2c254d7db8f55f18d2b (patch)
treee06e06a609588ceb8f5e293abc02a4a02da39d4d /CMakeLists.txt
parentd6bd901a818e10f2e224bfaaaf20b39b60b6009f (diff)
[HICN-279] Added libmemif packaging.
Change-Id: Ie8662059163b7a01211bb18fb8f6b77bbbc07279 Signed-off-by: Mauro Sardara <msardara@cisco.com>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt32
1 files changed, 22 insertions, 10 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1d1d75061..c0d689331 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -28,6 +28,7 @@ option(BUILD_APPS "Build the hicn apps" OFF)
option(BUILD_CTRL "Build the hicn control tools" ON)
option(BUILD_HICNPLUGIN "Build the hicn vpp plugin" OFF)
option(BUILD_HICNEXTRAPLUGIN "Build the hicn extra plugin" OFF)
+option(BUILD_SYSREPOPLUGIN "Build the sysrepo plugin" OFF)
list(APPEND dir_options
BUILD_LIBHICN
@@ -36,6 +37,10 @@ list(APPEND dir_options
BUILD_UTILS
BUILD_APPS
BUILD_CTRL
+ BUILD_HICNPLUGIN
+ BUILD_HICNEXTRAPLUGIN
+ BUILD_SYSREPOPLUGIN
+ BUILD_LIBMEMIF
)
set(BUILD_LIBHICN_DIR lib)
@@ -45,7 +50,9 @@ set(BUILD_UTILS_DIR utils)
set(BUILD_APPS_DIR apps)
set(BUILD_CTRL_DIR ctrl)
set(BUILD_HICNPLUGIN_DIR hicn-plugin)
-set(BUILD_HICNEXTRAPLUGIN_DIR utils/extras/)
+set(BUILD_SYSREPOPLUGIN_DIR ctrl/sysrepo-plugins)
+set(BUILD_HICNEXTRAPLUGIN_DIR extras/hicn-extra-plugin)
+set(BUILD_LIBMEMIF_DIR extras/libmemif)
## Add enabled components
foreach (opt ${dir_options})
@@ -69,11 +76,20 @@ set(HICN_CTRL hicn-ctrl)
set(LIBHICN_CTRL hicn-ctrl)
set(HICN_APPS hicn-apps)
set(FACE_MGR facemgr)
+set(LIBMEMIF memif)
if (BUILD_HICNPLUGIN AND "${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
- list(APPEND subdirs
- ${BUILD_HICNPLUGIN_DIR}
- )
+ find_package(Libmemif)
+
+ if (NOT Libmemif_FOUND)
+ message(STATUS "Libmemif not found in the system. Building it as external project.")
+ list(INSERT subdirs 0
+ ${BUILD_LIBMEMIF_DIR}
+ )
+
+ unset(LIBMEMIF_INCLUDE_DIRS)
+ unset(LIBMEMIF_LIBRARIES)
+ endif()
list(APPEND HICN_BINARY_API_INCLUDE_DIRS
${PROJECT_BINARY_DIR}/hicn-plugin
@@ -83,20 +99,16 @@ if (BUILD_HICNPLUGIN AND "${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
set(LIBTRANSPORT ${LIBTRANSPORT}-memif)
endif()
-if (BUILD_HICNEXTRAPLUGIN AND "${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
- list(APPEND subdirs
- ${BUILD_HICNEXTRAPLUGIN_DIR}
- )
-endif()
-
## Libraries targets
set(LIBHICN_SHARED ${LIBHICN}.shared)
set(LIBTRANSPORT_SHARED ${LIBTRANSPORT}.shared)
set(LIBHICN_CTRL_SHARED ${LIBHICN_CTRL}.shared)
+set(LIBMEMIF_SHARED ${LIBMEMIF}.shared)
set(LIBHICN_STATIC ${LIBHICN}.static)
set(LIBTRANSPORT_STATIC ${LIBTRANSPORT}.static)
set(LIBHICN_CTRL_STATIC ${LIBHICN_CTRL}.static)
+set(LIBMEMIF_STATIC ${LIBMEMIF}.static)
## HEADER FILES
set(HICN_INCLUDE_DIRS "" "" CACHE INTERNAL "" FORCE)