ppd/CMakeLists.txt
2023-03-14 14:30:03 +01:00

41 lines
2.1 KiB
CMake

cmake_minimum_required(VERSION 3.18.0)
project(ppd)
set(CMAKE_EXPORT_COMPILE_COMMANDS True)
find_package(PkgConfig REQUIRED)
find_package(OpenSSL REQUIRED)
pkg_check_modules(bsock REQUIRED bsock)
set(CXXFLAGS -Wall -Wextra -Werror -std=c++17 -Og -g)
set(CFLAGS -Wall -Wextra -Werror -std=c2x -Og -g)
add_library(common OBJECT ${CMAKE_CURRENT_SOURCE_DIR}/common/io.cc)
target_link_directories(common PRIVATE ${bsock_LIBRARY_DIRS})
target_link_libraries(common ${bsock_LIBRARIES})
target_compile_options(common PRIVATE ${CXXFLAGS})
target_include_directories(common PRIVATE ${bsock_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR}/include)
add_executable(dsmbr ${CMAKE_CURRENT_SOURCE_DIR}/dsmbr/dsmbr.cc
${CMAKE_CURRENT_SOURCE_DIR}/dsmbr/dmsg.cc
${CMAKE_CURRENT_SOURCE_DIR}/dsmbr/generator.cc)
target_link_libraries(dsmbr common pthread OpenSSL::SSL ${bsock_LIBRARIES})
target_link_directories(dsmbr PRIVATE ${bsock_LIBRARY_DIRS})
target_compile_options(dsmbr PRIVATE ${CXXFLAGS})
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})
target_compile_options(ppd PRIVATE ${CXXFLAGS})
target_include_directories(ppd PRIVATE ${bsock_INCLUDE_DIRS} ${OPENSSL_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/include)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/modules)
# 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()