2023-01-05 16:17:48 +00:00
|
|
|
cmake_minimum_required(VERSION 3.10.0)
|
2023-01-17 20:22:43 +00:00
|
|
|
project(ppd)
|
2023-01-05 16:17:48 +00:00
|
|
|
|
|
|
|
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})
|
|
|
|
|
|
|
|
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/msg/msg.pb.cc
|
|
|
|
COMMAND mkdir -p ${CMAKE_CURRENT_BINARY_DIR}/msg/
|
|
|
|
COMMAND protoc --cpp_out=${CMAKE_CURRENT_BINARY_DIR}/msg/ --proto_path=${CMAKE_CURRENT_SOURCE_DIR}/msg/ msg.proto
|
|
|
|
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/msg/msg.proto)
|
|
|
|
|
2023-01-18 00:24:49 +00:00
|
|
|
set(CMAKE_EXPORT_COMPILE_COMMANDS True)
|
2023-01-05 16:17:48 +00:00
|
|
|
find_package(PkgConfig REQUIRED)
|
2023-01-18 00:24:49 +00:00
|
|
|
pkg_check_modules(bsock REQUIRED bsock)
|
2023-01-05 16:17:48 +00:00
|
|
|
|
|
|
|
|
2023-01-18 00:24:49 +00:00
|
|
|
# if (${ENABLE_FSTACK} MATCHES "y")
|
|
|
|
# pkg_check_modules(dpdk REQUIRED libdpdk)
|
|
|
|
# pkg_check_modules(bsdtopo REQUIRED bsdtopo)
|
|
|
|
# pkg_check_modules(ssl REQUIRED libssl)
|
|
|
|
# include_directories(${dpdk_INCLUDE_DIRS})
|
|
|
|
# include_directories(${ssl_INCLUDE_DIRS})
|
|
|
|
# include_directories(${bsdtopo_INCLUDE_DIRS})
|
|
|
|
# endif()
|
2023-01-05 16:17:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
set(CFLAGS -Wall -Wextra -Werror -Wno-unused-parameter -Wno-unused-variable -std=c++17 -O2 -g)
|
|
|
|
|
2023-01-18 00:24:49 +00:00
|
|
|
add_executable(dsmbr ${CMAKE_CURRENT_SOURCE_DIR}/ppd/dsmbr.cc
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/ppd/util.cc)
|
|
|
|
target_link_libraries(dsmbr pthread bsock)
|
|
|
|
target_compile_options(dsmbr PRIVATE ${CFLAGS} ${bsock_CFLAGS})
|
|
|
|
target_include_directories(dsmbr PRIVATE ${bsock_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR}/include)
|
2023-01-05 16:17:48 +00:00
|
|
|
|
|
|
|
add_executable(ppd ${CMAKE_CURRENT_SOURCE_DIR}/ppd/ppd.cc
|
2023-01-18 00:24:49 +00:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/ppd/util.cc)
|
|
|
|
target_link_libraries(ppd pthread bsock ${bsock_CFLAGS})
|
|
|
|
target_compile_options(ppd PRIVATE ${CFLAGS} ${bsock_INCLUDE_DIRS})
|
|
|
|
target_include_directories(ppd PRIVATE ${bsock_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR}/include)
|
|
|
|
|
|
|
|
# if (${ENABLE_FSTACK} MATCHES "y")
|
|
|
|
# add_executable(ppd_ff ${CMAKE_CURRENT_SOURCE_DIR}/ppd_ff/ppd.cc
|
|
|
|
# ${CMAKE_CURRENT_SOURCE_DIR}/ppd_ff/reqproc.cc
|
|
|
|
# ${CMAKE_CURRENT_BINARY_DIR}/msg/msg.pb.cc)
|
|
|
|
# target_link_libraries(ppd_ff ${protobuf_LINK_LIBRARIES} fstack ${ssl_LINK_LIBRARIES} bz2 z crypto ${dpdk_LIBRARIES} ${bsdtopo_LIBRARIES} librte_net_bond.a librte_bus_vdev.a)
|
|
|
|
# target_link_directories(ppd_ff PRIVATE /usr/local/lib ${dpdk_LIBRARY_DIRS} ${bsdtopo_LIBRARY_DIRS})
|
|
|
|
# target_compile_options(ppd_ff PRIVATE ${CFLAGS} ${dpdk_CFLAGS})
|
|
|
|
# endif()
|