Damjan Marion | 0fa900e | 2018-09-12 12:12:36 +0200 | [diff] [blame] | 1 | # Copyright (c) 2018 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: |
| 5 | # |
| 6 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 7 | # |
| 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. |
| 13 | |
| 14 | get_filename_component(CMAKE_CURRENT_LIST_DIR ${CMAKE_CURRENT_LIST_FILE} PATH) |
| 15 | |
| 16 | find_path(VPP_INCLUDE_DIR PATH_SUFFIXES NAMES vppinfra/clib.h) |
| 17 | find_program(VPP_APIGEN vppapigen) |
Oliver Giles | dc20371 | 2019-12-05 23:37:36 +0200 | [diff] [blame] | 18 | find_program(VPP_VAPI_C_GEN vapi_c_gen.py) |
| 19 | find_program(VPP_VAPI_CPP_GEN vapi_cpp_gen.py) |
Damjan Marion | 0fa900e | 2018-09-12 12:12:36 +0200 | [diff] [blame] | 20 | |
| 21 | if(VPP_INCLUDE_DIR AND VPP_APIGEN) |
| 22 | include_directories (${VPP_INCLUDE_DIR}) |
Benoît Ganne | e462e54 | 2023-08-21 09:24:38 +0200 | [diff] [blame] | 23 | include_directories (${VPP_INCLUDE_DIR}/vpp_plugins) |
Damjan Marion | 0fa900e | 2018-09-12 12:12:36 +0200 | [diff] [blame] | 24 | else() |
| 25 | message(FATAL_ERROR "VPP headers, libraries and/or tools not found") |
| 26 | endif() |
| 27 | |
| 28 | set(VPP_EXTERNAL_PROJECT 1) |
| 29 | |
| 30 | include(CheckCCompilerFlag) |
| 31 | |
| 32 | check_c_compiler_flag("-Wno-address-of-packed-member" compiler_flag_no_address_of_packed_member) |
| 33 | if (compiler_flag_no_address_of_packed_member) |
| 34 | add_definitions(-Wno-address-of-packed-member) |
| 35 | endif() |
| 36 | |
Damjan Marion | 599efc6 | 2020-05-07 16:49:45 +0200 | [diff] [blame] | 37 | set(VPP_RUNTIME_DIR "bin" CACHE STRING "Relative runtime directory path") |
| 38 | set(VPP_LIBRARY_DIR "lib" CACHE STRING "Relative library directory path") |
Benoît Ganne | fccced8 | 2021-08-19 15:17:03 +0200 | [diff] [blame] | 39 | set(VPP_BINARY_DIR ${CMAKE_BINARY_DIR}/CMakeFiles) |
Damjan Marion | 599efc6 | 2020-05-07 16:49:45 +0200 | [diff] [blame] | 40 | |
Damjan Marion | 0fa900e | 2018-09-12 12:12:36 +0200 | [diff] [blame] | 41 | include(${CMAKE_CURRENT_LIST_DIR}/cpu.cmake) |
| 42 | include(${CMAKE_CURRENT_LIST_DIR}/api.cmake) |
| 43 | include(${CMAKE_CURRENT_LIST_DIR}/library.cmake) |
| 44 | include(${CMAKE_CURRENT_LIST_DIR}/plugin.cmake) |
Damjan Marion | eeadc14 | 2018-09-13 20:02:12 +0200 | [diff] [blame] | 45 | include(${CMAKE_CURRENT_LIST_DIR}/pack.cmake) |