diff options
author | Damjan Marion <damarion@cisco.com> | 2018-07-30 12:45:07 +0200 |
---|---|---|
committer | Florin Coras <florin.coras@gmail.com> | 2018-08-17 22:14:39 +0000 |
commit | 612dd6a955e44d2c0fed1801fb8de585ca695c63 (patch) | |
tree | a49c3004a7122077a884dce483daebc280199761 /src/vlib/CMakeLists.txt | |
parent | 5d82d2f1495e189c4687a6462850cbbb3ea38b17 (diff) |
CMake as an alternative to autotools (experimental)
Change-Id: Ibc59323e849810531dd0963e85493efad3b86857
Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vlib/CMakeLists.txt')
-rw-r--r-- | src/vlib/CMakeLists.txt | 98 |
1 files changed, 98 insertions, 0 deletions
diff --git a/src/vlib/CMakeLists.txt b/src/vlib/CMakeLists.txt new file mode 100644 index 00000000000..dceb13e7ce4 --- /dev/null +++ b/src/vlib/CMakeLists.txt @@ -0,0 +1,98 @@ +# Copyright (c) 2018 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +############################################################################## +# Generate vlib/config.h +############################################################################## +set(PRE_DATA_SIZE 128 CACHE STRING "Buffer headroom size.") +configure_file( + ${CMAKE_SOURCE_DIR}/vlib/config.h.in + ${CMAKE_BINARY_DIR}/vlib/config.h +) +install(FILES ${CMAKE_BINARY_DIR}/vlib/config.h DESTINATION include/vlib) + +############################################################################## +# vlib shared library +############################################################################## +set(VLIB_SRCS + buffer.c + buffer_serialize.c + cli.c + counter.c + error.c + format.c + i2c.c + init.c + linux/pci.c + linux/physmem.c + linux/vfio.c + log.c + main.c + mc.c + node.c + node_cli.c + node_format.c + pci/pci.c + threads.c + threads_cli.c + trace.c + unix/cj.c + unix/cli.c + unix/input.c + unix/main.c + unix/mc_socket.c + unix/plugin.c + unix/util.c +) + +add_library(vlib SHARED ${VLIB_SRCS}) +target_link_libraries(vlib vppinfra svm ${CMAKE_DL_LIBS}) +install(TARGETS vlib DESTINATION lib) + +############################################################################## +# vlib headers +############################################################################## +vpp_add_header_files(vlib + buffer_funcs.h + buffer.h + buffer_node.h + cli_funcs.h + cli.h + counter.h + defs.h + error_funcs.h + error.h + format_funcs.h + global_funcs.h + i2c.h + init.h + linux/vfio.h + log.h + main.h + mc.h + node_funcs.h + node.h + pci/pci_config.h + pci/pci.h + physmem_funcs.h + physmem.h + threads.h + trace_funcs.h + trace.h + unix/cj.h + unix/mc_socket.h + unix/plugin.h + unix/unix.h + vlib.h +) + |