1 # Copyright (c) 2015 Cisco and/or its affiliates.
2 # Licensed under the Apache License, Version 2.0 (the "License");
3 # you may not use this file except in compliance with the License.
4 # You may obtain a copy of the License at:
6 # http://www.apache.org/licenses/LICENSE-2.0
8 # Unless required by applicable law or agreed to in writing, software
9 # distributed under the License is distributed on an "AS IS" BASIS,
10 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 # See the License for the specific language governing permissions and
12 # limitations under the License.
16 ifneq ($(shell which cmake3),)
22 vpp_cmake_prefix_path = /opt/vpp/external/$(shell uname -m)
23 vpp_cmake_prefix_path += $(PACKAGE_INSTALL_DIR)external
24 vpp_cmake_prefix_path := $(subst $() $(),;,$(vpp_cmake_prefix_path))
27 vpp_cmake_args += -DCMAKE_INSTALL_PREFIX:PATH=$(PACKAGE_INSTALL_DIR)
28 vpp_cmake_args += -DCMAKE_BUILD_TYPE="$($(TAG)_TAG_BUILD_TYPE)"
29 vpp_cmake_args += -DCMAKE_PREFIX_PATH:PATH="$(vpp_cmake_prefix_path)"
31 vpp_cmake_args += -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON
33 ifneq ($(VPP_PLATFORM),)
34 vpp_cmake_args += -DVPP_PLATFORM="$(VPP_PLATFORM)"
36 ifneq ($(VPP_EXCLUDED_PLUGINS),)
37 vpp_cmake_args += -DVPP_EXCLUDED_PLUGINS="$(VPP_EXCLUDED_PLUGINS)"
39 ifneq (${SOURCE_DATE_EPOCH}),)
40 vpp_cmake_args += -DVPP_SOURCE_DATE_EPOCH="$(SOURCE_DATE_EPOCH)"
43 ifneq ($(VPP_EXTRA_CMAKE_ARGS),)
44 vpp_cmake_args += $(VPP_EXTRA_CMAKE_ARGS)
47 vpp_configure_depend += external-install
49 cd $(PACKAGE_BUILD_DIR) && \
50 $(CMAKE) -G Ninja $(vpp_cmake_args) $(call find_source_fn,$(PACKAGE_SOURCE))
51 vpp_build = $(CMAKE) --build $(PACKAGE_BUILD_DIR) -- $(MAKE_PARALLEL_FLAGS)
52 vpp_install = $(CMAKE) --build $(PACKAGE_BUILD_DIR) -- install | grep -v 'Set runtime path'
54 vpp-package-deb: vpp-install
55 @$(CMAKE) --build $(PACKAGE_BUILD_DIR)/vpp -- pkg-deb
56 @find $(PACKAGE_BUILD_DIR) \
58 \( -name '*.changes' -o -name '*.deb' -o -name '*.buildinfo' \) \
59 -exec mv {} $(CURDIR) \;