build: Add support to add_vpp_library for platform specific sources

Add support for adding Linux and FreeBSD specific sources to
add_vpp_library and support for installing Linux specific headers. Don't
add support for FreeBSD specific headers until we have some to install.

Type:	improvement
Change-Id: I38549cf4d71999b71b3298e529323956e54ddc36
Signed-off-by: Tom Jones <thj@freebsd.org>
diff --git a/src/vlib/CMakeLists.txt b/src/vlib/CMakeLists.txt
index 9c41216..61e8ba7 100644
--- a/src/vlib/CMakeLists.txt
+++ b/src/vlib/CMakeLists.txt
@@ -54,6 +54,17 @@
 ##############################################################################
 # vlib shared library
 ##############################################################################
+
+set(PLATFORM_SOURCES
+  linux/pci.c
+  linux/vfio.c
+  linux/vmbus.c
+)
+
+set(PLATFORM_HEADERS
+  linux/vfio.h
+)
+
 add_vpp_library(vlib
   SOURCES
   buffer.c
@@ -65,9 +76,6 @@
   format.c
   handoff_trace.c
   init.c
-  linux/pci.c
-  linux/vfio.c
-  linux/vmbus.c
   log.c
   main.c
   node.c
@@ -97,6 +105,7 @@
   vmbus/vmbus.c
   dma/dma.c
   dma/cli.c
+  ${PLATFORM_SOURCES}
 
   MULTIARCH_SOURCES
   buffer_funcs.c
@@ -118,7 +127,6 @@
   format_funcs.h
   global_funcs.h
   init.h
-  linux/vfio.h
   log.h
   main.h
   node_funcs.h
@@ -140,6 +148,7 @@
   unix/unix.h
   vlib.h
   vmbus/vmbus.h
+  ${PLATFORM_HEADERS}
 
   API_FILES
   pci/pci_types.api