2023-03-12 01:59:49 +00:00
|
|
|
cmake_minimum_required(VERSION 3.18.0)
|
2023-01-17 20:22:43 +00:00
|
|
|
project(ppd)
|
2023-01-05 16:17:48 +00:00
|
|
|
|
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-03-12 01:59:49 +00:00
|
|
|
find_package(OpenSSL REQUIRED)
|
2023-01-18 00:24:49 +00:00
|
|
|
pkg_check_modules(bsock REQUIRED bsock)
|
2023-01-05 16:17:48 +00:00
|
|
|
|
2023-03-14 13:30:03 +00:00
|
|
|
set(CXXFLAGS -Wall -Wextra -Werror -std=c++17 -Og -g)
|
|
|
|
set(CFLAGS -Wall -Wextra -Werror -std=c2x -Og -g)
|
2023-01-05 16:17:48 +00:00
|
|
|
|
2023-03-13 08:49:28 +00:00
|
|
|
add_library(common OBJECT ${CMAKE_CURRENT_SOURCE_DIR}/common/io.cc)
|
2023-03-12 01:59:49 +00:00
|
|
|
target_link_directories(common PRIVATE ${bsock_LIBRARY_DIRS})
|
|
|
|
target_link_libraries(common ${bsock_LIBRARIES})
|
2023-03-13 08:08:44 +00:00
|
|
|
target_compile_options(common PRIVATE ${CXXFLAGS})
|
2023-03-12 01:59:49 +00:00
|
|
|
target_include_directories(common PRIVATE ${bsock_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR}/include)
|
2023-01-05 16:17:48 +00:00
|
|
|
|
2023-03-02 14:12:35 +00:00
|
|
|
add_executable(dsmbr ${CMAKE_CURRENT_SOURCE_DIR}/dsmbr/dsmbr.cc
|
2023-03-11 02:38:01 +00:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/dsmbr/dmsg.cc
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/dsmbr/generator.cc)
|
2023-03-12 01:59:49 +00:00
|
|
|
target_link_libraries(dsmbr common pthread OpenSSL::SSL ${bsock_LIBRARIES})
|
|
|
|
target_link_directories(dsmbr PRIVATE ${bsock_LIBRARY_DIRS})
|
2023-03-13 08:08:44 +00:00
|
|
|
target_compile_options(dsmbr PRIVATE ${CXXFLAGS})
|
2023-03-12 01:59:49 +00:00
|
|
|
target_include_directories(dsmbr PRIVATE ${bsock_INCLUDE_DIRS} ${OPENSSL_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/include)
|
|
|
|
|
|
|
|
add_executable(ppd ${CMAKE_CURRENT_SOURCE_DIR}/ppd/ppd.cc)
|
|
|
|
target_link_libraries(ppd pthread common OpenSSL::SSL ${bsock_LIBRARIES})
|
|
|
|
target_link_directories(ppd PRIVATE ${bsock_LIBRARY_DIRS})
|
2023-03-13 08:08:44 +00:00
|
|
|
target_compile_options(ppd PRIVATE ${CXXFLAGS})
|
2023-03-12 01:59:49 +00:00
|
|
|
target_include_directories(ppd PRIVATE ${bsock_INCLUDE_DIRS} ${OPENSSL_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/include)
|
2023-01-18 00:24:49 +00:00
|
|
|
|
2023-03-12 12:00:08 +00:00
|
|
|
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/modules)
|
2023-01-18 00:24:49 +00:00
|
|
|
# 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()
|