mesytec-mnode/src/CMakeLists.txt
2024-12-07 16:12:40 +01:00

58 lines
2.3 KiB
CMake

set(MVLC_NNG_NODE_WARN_FLAGS -Wall -Wextra -Wpedantic)
# Bit of a hack to set the variables here. If set earlier clang-tidy will for
# some reason pickup log.c and warn about some va_list stuff. Might be because
# log.c is in the source directory as the same does not happen with the imgui
# object library. TODO: move logc to externals.
#find_program(CLANG_TIDY_EXECUTABLE clang-tidy)
#if (CLANG_TIDY_EXECUTABLE)
# set(CMAKE_C_CLANG_TIDY clang-tidy -p ${CMAKE_BINARY_DIR} --extra-arg=-std=c11)
# set(CMAKE_CXX_CLANG_TIDY clang-tidy -p ${CMAKE_BINARY_DIR} --extra-arg=-std=c++17)
#endif()
#add_library(dp_common dp_common.c)
#target_compile_features(dp_common PRIVATE c_std_11)
#target_compile_options(dp_common PUBLIC ${DP_WARN_FLAGS}) # spread warning flags
#target_link_libraries(dp_common
# PUBLIC logc
# PUBLIC nng
# PUBLIC Threads::Threads
#)
#target_include_directories(dp_common INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
add_library(mesytec-node-nng mesytec_node_nng.cc)
target_include_directories(mesytec-node-nng PUBLIC $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include>)
target_link_libraries(mesytec-node-nng PUBLIC nng PUBLIC spdlog)
target_compile_features(mesytec-node-nng PUBLIC cxx_std_17)
add_library(mesytec-node-dev INTERFACE)
target_link_libraries(mesytec-node-dev INTERFACE mesytec-node-nng mesytec-mvlc)
function(add_node_dev_executable name)
add_executable(${name} ${name}.cc)
target_link_libraries(${name} PRIVATE mesytec-node-dev)
target_compile_options(${name} PRIVATE ${MVLC_NNG_NODE_WARN_FLAGS})
endfunction()
function(add_node_proto_dev_executable name)
add_node_dev_executable(${name})
target_link_libraries(${name} PRIVATE mnode-proto mesytec-mvlc)
endfunction()
add_node_dev_executable(pair_producer)
add_node_dev_executable(pair_consumer)
add_node_dev_executable(pair_inproc)
add_node_dev_executable(mvlc_nng_replay)
add_node_dev_executable(mesy_nng_pipeline_main)
add_node_dev_executable(mesy_nng_push_pull_main)
add_node_dev_executable(mesy_nng_pub_producer)
add_node_dev_executable(mesy_nng_sub_consumer)
add_node_proto_dev_executable(mnode_proto_test1)
add_node_proto_dev_executable(mnode_proto_ping_client)
add_node_proto_dev_executable(mnode_proto_ping_server)
#add_subdirectory(qt)
#unset(CMAKE_C_CLANG_TIDY)
#unset(CMAKE_CXX_CLANG_TIDY)