2024-12-28 17:54:15 +01:00
|
|
|
set(MVLC_NNG_MNODE_WARN_FLAGS -Wall -Werror=return-type)
|
2023-06-27 20:19:58 +02:00
|
|
|
|
2024-12-28 07:06:05 +01:00
|
|
|
add_library(mesytec-mnode-nng mnode_nng.cc)
|
|
|
|
target_include_directories(mesytec-mnode-nng
|
|
|
|
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../include>
|
|
|
|
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/mesytec-mnode)
|
|
|
|
target_link_libraries(mesytec-mnode-nng PUBLIC nng PRIVATE spdlog)
|
|
|
|
|
2024-12-12 00:31:03 +01:00
|
|
|
add_library(mesytec-mnode mnode_nng.cc mnode_nng_async.cc mnode_nng_proto.cc)
|
2024-12-07 20:35:29 +01:00
|
|
|
target_include_directories(mesytec-mnode
|
|
|
|
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../include>
|
|
|
|
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/mesytec-mnode)
|
2024-12-12 00:31:03 +01:00
|
|
|
target_link_libraries(mesytec-mnode PUBLIC nng mnode-proto PRIVATE spdlog)
|
2024-12-07 20:35:29 +01:00
|
|
|
target_compile_features(mesytec-mnode PRIVATE cxx_std_17)
|
2024-12-21 01:30:00 +01:00
|
|
|
target_compile_options(mesytec-mnode PRIVATE ${MVLC_NNG_MNODE_WARN_FLAGS})
|
2024-11-23 03:05:05 +01:00
|
|
|
|
2024-12-25 05:47:38 +01:00
|
|
|
add_library(mana INTERFACE)
|
|
|
|
target_link_libraries(mana INTERFACE nlohmann_json::nlohmann_json mesytec-mvlc)
|
2024-12-28 07:06:05 +01:00
|
|
|
target_include_directories(mana
|
|
|
|
INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../include>
|
|
|
|
INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/mesytec-mnode>)
|
2024-12-25 05:47:38 +01:00
|
|
|
|
2024-12-17 18:19:31 +01:00
|
|
|
add_subdirectory(tools)
|
2024-12-23 12:59:57 +01:00
|
|
|
|
|
|
|
if (MNODE_BUILD_TESTS)
|
|
|
|
function (add_mnode_gtest name)
|
|
|
|
add_executable(test_${name} ${name}.test.cc)
|
2024-12-25 03:17:53 +01:00
|
|
|
target_link_libraries(test_${name} PRIVATE mesytec-mnode GTest::gtest_main spdlog)
|
2024-12-26 18:42:25 +01:00
|
|
|
add_test(NAME test_${name} COMMAND $<TARGET_FILE:test_${name}>)
|
2024-12-23 12:59:57 +01:00
|
|
|
endfunction()
|
|
|
|
|
|
|
|
add_mnode_gtest(mana)
|
2024-12-25 05:47:38 +01:00
|
|
|
target_link_libraries(test_mana PRIVATE mana)
|
2024-12-23 12:59:57 +01:00
|
|
|
endif()
|
2024-12-25 23:37:37 +01:00
|
|
|
|
2024-12-26 00:32:56 +01:00
|
|
|
add_library(rxi-logc INTERFACE)
|
|
|
|
target_sources(rxi-logc INTERFACE internal/rxi/log.c)
|
2024-12-27 18:49:19 +01:00
|
|
|
target_compile_options(rxi-logc INTERFACE -DLOG_USE_COLOR)
|
2024-12-26 00:32:56 +01:00
|
|
|
|
2024-12-25 23:37:37 +01:00
|
|
|
add_library(mana-plugin-c-test SHARED mana_plugin_c_test.c)
|
2024-12-26 00:32:56 +01:00
|
|
|
target_link_libraries(mana-plugin-c-test PRIVATE rxi-logc)
|
2024-12-25 23:37:37 +01:00
|
|
|
|
2024-12-27 18:49:19 +01:00
|
|
|
add_library(mana-plugin-cpp-test SHARED mana_plugin_cpp_test.cc)
|
|
|
|
target_link_libraries(mana-plugin-cpp-test PRIVATE rxi-logc)
|
|
|
|
|
2024-12-25 23:37:37 +01:00
|
|
|
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)
|
2024-12-26 01:46:58 +01:00
|
|
|
target_link_libraries(mana-plugin-root-histogram PRIVATE mana mesytec-mnode rxi-logc ${ROOT_LIBRARIES})
|
2024-12-25 23:37:37 +01:00
|
|
|
endif()
|
2024-12-26 03:08:26 +01:00
|
|
|
|
|
|
|
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()
|
2024-12-28 07:06:05 +01:00
|
|
|
|
|
|
|
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)
|