move things around, only add spdlog if it's not present yet

This commit is contained in:
Florian Lüke 2024-11-23 11:00:18 +01:00
parent e25f76eebf
commit 8f8b463a14
8 changed files with 71 additions and 40 deletions

3
.gitmodules vendored
View file

@ -6,3 +6,6 @@
path = external/nng path = external/nng
url = https://github.com/nanomsg/nng.git url = https://github.com/nanomsg/nng.git
branch = main branch = main
[submodule "external/spdlog"]
path = external/spdlog
url = https://github.com/gabime/spdlog

View file

@ -12,6 +12,9 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
set(CMAKE_VERBOSE_MAKEFILE ON CACHE BOOL "ON") set(CMAKE_VERBOSE_MAKEFILE ON CACHE BOOL "ON")
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(Protobuf REQUIRED) find_package(Protobuf REQUIRED)
#protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS proto/service.proto) #protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS proto/service.proto)
add_library(mnode-proto proto/service.proto) add_library(mnode-proto proto/service.proto)

View file

@ -14,3 +14,10 @@ if (NOT mesytec-mvlc)
message("-- Using mesytec-mvlc from external/mesytec-mvlc") message("-- Using mesytec-mvlc from external/mesytec-mvlc")
add_subdirectory(mesytec-mvlc) add_subdirectory(mesytec-mvlc)
endif() endif()
find_package(spdlog QUIET)
if (NOT TARGET spdlog)
message("-- Using spdlog from external/spdlog")
add_subdirectory(spdlog)
endif()

@ -1 +1 @@
Subproject commit 8e883f6747b864173d7821956ca4ef22ea2607d1 Subproject commit 030347f75b99e34c855c9e4256b0a282e3f30eb7

1
external/spdlog vendored Submodule

@ -0,0 +1 @@
Subproject commit 8e5613379f5140fefb0b60412fbf1f5406e7c7f8

View file

@ -22,51 +22,68 @@ set(MVLC_NNG_NODE_WARN_FLAGS -Wall -Wextra -Wpedantic)
add_library(mesytec-node-nng mesytec_node_nng.cc) add_library(mesytec-node-nng mesytec_node_nng.cc)
target_include_directories(mesytec-node-nng PUBLIC $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include>) target_include_directories(mesytec-node-nng PUBLIC $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include>)
target_link_libraries(mesytec-node-nng PUBLIC mesytec-mvlc PUBLIC nng) target_link_libraries(mesytec-node-nng PUBLIC nng PUBLIC spdlog)
target_compile_features(mesytec-node-nng PUBLIC cxx_std_17) target_compile_features(mesytec-node-nng PUBLIC cxx_std_17)
add_executable(pair_producer pair_producer.cc) add_library(mesytec-node-dev INTERFACE)
target_compile_features(pair_producer PRIVATE cxx_std_17) target_link_libraries(mesytec-node-dev INTERFACE mesytec-node-nng mesytec-mvlc)
target_link_libraries(pair_producer PRIVATE mesytec-node-nng)
target_compile_options(pair_producer PRIVATE ${MVLC_NNG_NODE_WARN_FLAGS})
add_executable(pair_consumer pair_consumer.cc) function(add_node_dev_executable name)
target_compile_features(pair_consumer PRIVATE cxx_std_17) add_executable(${name} ${name}.cc)
target_link_libraries(pair_consumer PRIVATE mesytec-node-nng) target_link_libraries(${name} PRIVATE mesytec-node-dev)
target_compile_options(pair_consumer PRIVATE ${MVLC_NNG_NODE_WARN_FLAGS}) target_compile_options(${name} PRIVATE ${MVLC_NNG_NODE_WARN_FLAGS})
endfunction()
add_executable(pair_inproc pair_inproc.cc)
target_compile_features(pair_inproc PRIVATE cxx_std_17)
target_link_libraries(pair_inproc PRIVATE mesytec-node-nng)
target_compile_options(pair_inproc PRIVATE ${MVLC_NNG_NODE_WARN_FLAGS})
add_executable(mvlc_nng_replay mvlc_nng_replay.cc) add_node_dev_executable(pair_producer)
target_compile_features(mvlc_nng_replay PRIVATE cxx_std_17) add_node_dev_executable(pair_consumer)
target_link_libraries(mvlc_nng_replay PRIVATE mesytec-node-nng) add_node_dev_executable(pair_inproc)
target_compile_options(mvlc_nng_replay PRIVATE ${MVLC_NNG_NODE_WARN_FLAGS}) 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_dev_executable(mnode_proto_test1)
target_sources(mnode_proto_test1 PRIVATE thread_name.cc)
target_link_libraries(mnode_proto_test1 PRIVATE mnode-proto mesytec-mvlc)
add_executable(mesy_nng_pipeline_main mesy_nng_pipeline_main.cc) #add_node_dev_executable(pair_consumer pair_consumer.cc)
target_compile_features(mesy_nng_pipeline_main PRIVATE cxx_std_17) #target_compile_features(pair_consumer PRIVATE cxx_std_17)
target_link_libraries(mesy_nng_pipeline_main PRIVATE mesytec-node-nng) #target_link_libraries(pair_consumer PRIVATE mesytec-node-nng)
target_compile_options(mesy_nng_pipeline_main PRIVATE ${MVLC_NNG_NODE_WARN_FLAGS}) #target_compile_options(pair_consumer PRIVATE ${MVLC_NNG_NODE_WARN_FLAGS})
#
add_executable(mesy_nng_push_pull_main mesy_nng_push_pull_main.cc) #add_node_dev_executable(pair_inproc pair_inproc.cc)
target_compile_features(mesy_nng_push_pull_main PRIVATE cxx_std_17) #target_compile_features(pair_inproc PRIVATE cxx_std_17)
target_link_libraries(mesy_nng_push_pull_main PRIVATE mesytec-node-nng) #target_link_libraries(pair_inproc PRIVATE mesytec-node-nng)
target_compile_options(mesy_nng_push_pull_main PRIVATE ${MVLC_NNG_NODE_WARN_FLAGS}) #target_compile_options(pair_inproc PRIVATE ${MVLC_NNG_NODE_WARN_FLAGS})
#
add_executable(mesy_nng_pub_producer pub_producer.cc) #add_node_dev_executable(mvlc_nng_replay mvlc_nng_replay.cc)
target_compile_features(mesy_nng_pub_producer PRIVATE cxx_std_17) #target_compile_features(mvlc_nng_replay PRIVATE cxx_std_17)
target_link_libraries(mesy_nng_pub_producer PRIVATE mesytec-node-nng) #target_link_libraries(mvlc_nng_replay PRIVATE mesytec-node-nng PRIVATE mesytec-mvlc)
target_compile_options(mesy_nng_pub_producer PRIVATE ${MVLC_NNG_NODE_WARN_FLAGS}) #target_compile_options(mvlc_nng_replay PRIVATE ${MVLC_NNG_NODE_WARN_FLAGS})
#
add_executable(mesy_nng_sub_consumer sub_consumer.cc) #add_node_dev_executable(mesy_nng_pipeline_main mesy_nng_pipeline_main.cc)
target_compile_features(mesy_nng_sub_consumer PRIVATE cxx_std_17) #target_compile_features(mesy_nng_pipeline_main PRIVATE cxx_std_17)
target_link_libraries(mesy_nng_sub_consumer PRIVATE mesytec-node-nng) #target_link_libraries(mesy_nng_pipeline_main PRIVATE mesytec-node-nng)
target_compile_options(mesy_nng_sub_consumer PRIVATE ${MVLC_NNG_NODE_WARN_FLAGS}) #target_compile_options(mesy_nng_pipeline_main PRIVATE ${MVLC_NNG_NODE_WARN_FLAGS})
#
add_executable(mnode-proto-test1 mnode_proto_test1.cc thread_name.cc) #add_node_dev_executable(mesy_nng_push_pull_main mesy_nng_push_pull_main.cc)
target_link_libraries(mnode-proto-test1 PRIVATE mnode-proto PRIVATE mesytec-node-nng PRIVATE mesytec-mvlc) #target_compile_features(mesy_nng_push_pull_main PRIVATE cxx_std_17)
#target_link_libraries(mesy_nng_push_pull_main PRIVATE mesytec-node-nng)
#target_compile_options(mesy_nng_push_pull_main PRIVATE ${MVLC_NNG_NODE_WARN_FLAGS})
#
#add_node_dev_executable(mesy_nng_pub_producer pub_producer.cc)
#target_compile_features(mesy_nng_pub_producer PRIVATE cxx_std_17)
#target_link_libraries(mesy_nng_pub_producer PRIVATE mesytec-node-nng)
#target_compile_options(mesy_nng_pub_producer PRIVATE ${MVLC_NNG_NODE_WARN_FLAGS})
#
#add_node_dev_executable(mesy_nng_sub_consumer sub_consumer.cc)
#target_compile_features(mesy_nng_sub_consumer PRIVATE cxx_std_17)
#target_link_libraries(mesy_nng_sub_consumer PRIVATE mesytec-node-nng)
#target_compile_options(mesy_nng_sub_consumer PRIVATE ${MVLC_NNG_NODE_WARN_FLAGS})
#
#add_node_dev_executable(mnode-proto-test1 mnode_proto_test1.cc thread_name.cc)
#target_link_libraries(mnode-proto-test1 PRIVATE mnode-proto PRIVATE mesytec-node-nng PRIVATE mesytec-mvlc)
#add_subdirectory(qt) #add_subdirectory(qt)