set(MVLC_NNG_MNODE_WARN_FLAGS -Wall -Werror=return-type) add_library(mesytec-mnode-nng mnode_nng.cc internal/mana_nng.cc) target_include_directories(mesytec-mnode-nng PUBLIC $ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/mesytec-mnode) target_link_libraries(mesytec-mnode-nng PUBLIC nng PRIVATE spdlog) add_library(mesytec-mnode mnode_nng.cc mnode_nng_async.cc mnode_nng_proto.cc) target_include_directories(mesytec-mnode PUBLIC $ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/mesytec-mnode) target_link_libraries(mesytec-mnode PUBLIC nng mnode-proto PRIVATE spdlog) target_compile_features(mesytec-mnode PRIVATE cxx_std_17) target_compile_options(mesytec-mnode PRIVATE ${MVLC_NNG_MNODE_WARN_FLAGS}) add_library(mana INTERFACE) target_link_libraries(mana INTERFACE nlohmann_json::nlohmann_json mesytec-mvlc) target_include_directories(mana INTERFACE $ INTERFACE $) add_subdirectory(tools) if (MNODE_BUILD_TESTS) function (add_mnode_gtest name) add_executable(test_${name} ${name}.test.cc) target_link_libraries(test_${name} PRIVATE mesytec-mnode GTest::gtest_main spdlog) add_test(NAME test_${name} COMMAND $) endfunction() add_mnode_gtest(mana) target_link_libraries(test_mana PRIVATE mana) endif() add_library(rxi-logc INTERFACE) target_sources(rxi-logc INTERFACE internal/rxi/log.c) target_compile_options(rxi-logc INTERFACE -DLOG_USE_COLOR) add_library(mana-plugin-c-test SHARED mana_plugin_c_test.c) target_link_libraries(mana-plugin-c-test PRIVATE rxi-logc) add_library(mana-plugin-cpp-test SHARED mana_plugin_cpp_test.cc) target_link_libraries(mana-plugin-cpp-test PRIVATE rxi-logc) find_package(ROOT COMPONENTS Hist) if (ROOT_FOUND) message("-- Using ROOT installation from ${ROOT_USE_FILE}") include(${ROOT_USE_FILE}) add_library(mana-plugin-root-histogram SHARED mana_plugin_root_histogram.cc) target_link_libraries(mana-plugin-root-histogram PRIVATE mana mesytec-mnode rxi-logc ${ROOT_LIBRARIES}) add_library(mana-plugin-root-rntuple-writer SHARED mana_plugin_root_rntuple_writer.cc) target_link_libraries(mana-plugin-root-rntuple-writer PRIVATE mana mesytec-mnode rxi-logc ${ROOT_LIBRARIES}) endif() if (pybind11_FOUND) add_library(mana-plugin-python SHARED mana_plugin_python.cc) target_link_libraries(mana-plugin-python PRIVATE mana mesytec-mnode rxi-logc pybind11::embed) file(CREATE_LINK ${CMAKE_CURRENT_SOURCE_DIR}/mana_python_test_plugin.py ${CMAKE_BINARY_DIR}/mana_python_test_plugin.py COPY_ON_ERROR SYMBOLIC) endif() add_library(mana-plugin-nng-server SHARED mana_plugin_nng_server.cc) target_link_libraries(mana-plugin-nng-server PRIVATE mesytec-mnode-nng mana rxi-logc)