mirror of
https://gitlab.com/prpl-foundation/prplmesh/prplMesh.git
synced 2025-12-20 01:21:22 +08:00
framework: cmake: adjust to new broker
Remove MSGLIB references. Add the new broker files. Disable common tests (until adjusted to the new broker). Signed-off-by: Vitaly Bukhovsky <vitaly@devalore.com>
This commit is contained in:
committed by
mergify[bot]
parent
8ebea4badb
commit
5f9f3be679
@@ -1,17 +1,12 @@
|
||||
project(multiap_framework C CXX)
|
||||
|
||||
set(MSGLIB "zmq" CACHE STRING "Which messaging library backend to use")
|
||||
set_property(CACHE MSGLIB PROPERTY STRINGS "zmq" "nng" "None")
|
||||
|
||||
find_package(json-c REQUIRED)
|
||||
|
||||
add_subdirectory(platform)
|
||||
add_subdirectory(external)
|
||||
add_subdirectory(tlvf)
|
||||
add_subdirectory(common)
|
||||
if (NOT MSGLIB STREQUAL "None")
|
||||
add_subdirectory(transport)
|
||||
endif()
|
||||
|
||||
add_dependencies(mapfcommon elpp)
|
||||
add_dependencies(tlvf elpp)
|
||||
|
||||
@@ -6,35 +6,8 @@ configure_file(
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/logging.conf" DESTINATION share)
|
||||
file(COPY "${CMAKE_CURRENT_BINARY_DIR}/logging.conf" DESTINATION "${CMAKE_MULTIAP_OUTPUT_DIRECTORY}/share/")
|
||||
|
||||
# Messaging
|
||||
if(MSGLIB STREQUAL "None")
|
||||
|
||||
message(STATUS "${BoldYellow}Messaging library - None${ColourReset}")
|
||||
set(sources logger.cpp encryption.cpp utils.cpp)
|
||||
|
||||
else()
|
||||
|
||||
message(STATUS "${BoldGreen}Messaging library - ${MSGLIB}${ColourReset}")
|
||||
find_package(${MSGLIB} REQUIRED)
|
||||
set(MSGLIB_TARGET ${MSGLIB}::${MSGLIB})
|
||||
set(sources logger.cpp encryption.cpp utils.cpp message_factory.cpp broker_config.cpp broker_interface.cpp ${MSGLIB}/broker.cpp ${MSGLIB}/socket.cpp ${MSGLIB}/context.cpp ${MSGLIB}/poller.cpp )
|
||||
|
||||
add_executable(version ${MSGLIB}/version.cpp)
|
||||
target_link_libraries(version mapfcommon elpp ${MSGLIB_TARGET})
|
||||
|
||||
add_executable(local_bus local_bus.cpp)
|
||||
target_link_libraries(local_bus PRIVATE mapfcommon elpp json-c)
|
||||
|
||||
configure_file(
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/local_bus.conf.in"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/local_bus.conf"
|
||||
)
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/local_bus.conf" DESTINATION share)
|
||||
file(COPY "${CMAKE_CURRENT_BINARY_DIR}/local_bus.conf" DESTINATION "${CMAKE_MULTIAP_OUTPUT_DIRECTORY}/share")
|
||||
install(TARGETS version DESTINATION bin)
|
||||
install(TARGETS local_bus DESTINATION bin)
|
||||
|
||||
endif()
|
||||
# mapfcommon sources
|
||||
set(sources message.cpp logger.cpp encryption.cpp utils.cpp)
|
||||
|
||||
# We use OpenSSL 1.1.x for Encryption
|
||||
find_package(OpenSSL 1.1 QUIET)
|
||||
@@ -49,7 +22,6 @@ add_library(mapfcommon ${sources})
|
||||
set_target_properties(mapfcommon PROPERTIES VERSION ${prplmesh_VERSION} SOVERSION ${prplmesh_VERSION_MAJOR})
|
||||
target_link_libraries(mapfcommon
|
||||
PRIVATE
|
||||
${MSGLIB_TARGET}
|
||||
elpp
|
||||
json-c
|
||||
PUBLIC
|
||||
@@ -70,7 +42,6 @@ target_include_directories(mapfcommon
|
||||
PUBLIC
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/${MSGLIB}/include>
|
||||
PRIVATE
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/>
|
||||
)
|
||||
@@ -81,4 +52,4 @@ install(TARGETS mapfcommon EXPORT mapfCommon
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
|
||||
install(EXPORT mapfCommon NAMESPACE mapf:: DESTINATION lib/cmake/mapfCommon)
|
||||
add_subdirectory(test)
|
||||
# add_subdirectory(test)
|
||||
|
||||
@@ -1,18 +1,11 @@
|
||||
if(BUILD_TESTS)
|
||||
if(MSGLIB STREQUAL "None")
|
||||
add_executable(encryption_test encryption_test.cpp)
|
||||
target_link_libraries(encryption_test mapfcommon elpp)
|
||||
install(TARGETS encryption_test DESTINATION bin/tests/common)
|
||||
add_test(NAME encryption_test COMMAND $<TARGET_FILE:encryption_test>)
|
||||
else()
|
||||
add_subdirectory(messages)
|
||||
file(GLOB tests *_test.cpp)
|
||||
foreach(test ${tests})
|
||||
get_filename_component(target ${test} NAME_WE)
|
||||
add_executable(${target} ${test})
|
||||
target_link_libraries(${target} mapfcommon dummy_messages elpp)
|
||||
install(TARGETS ${target} DESTINATION bin/tests/common)
|
||||
add_test(NAME ${target} COMMAND $<TARGET_FILE:${target}>)
|
||||
endforeach(test ${tests})
|
||||
endif()
|
||||
add_subdirectory(messages)
|
||||
file(GLOB tests *_test.cpp)
|
||||
foreach(test ${tests})
|
||||
get_filename_component(target ${test} NAME_WE)
|
||||
add_executable(${target} ${test})
|
||||
target_link_libraries(${target} mapfcommon dummy_messages elpp)
|
||||
install(TARGETS ${target} DESTINATION bin/tests/common)
|
||||
add_test(NAME ${target} COMMAND $<TARGET_FILE:${target}>)
|
||||
endforeach(test ${tests})
|
||||
endif()
|
||||
|
||||
@@ -1,11 +1,20 @@
|
||||
add_library(ieee1905_transport_lib ieee1905_transport.cpp ieee1905_transport_network.cpp ieee1905_transport_netlink.cpp ieee1905_transport_local_bus.cpp ieee1905_transport_packet_processing.cpp)
|
||||
add_library(ieee1905_transport_lib
|
||||
ieee1905_transport.cpp
|
||||
ieee1905_transport_broker.cpp
|
||||
ieee1905_transport_network.cpp
|
||||
ieee1905_transport_netlink.cpp
|
||||
ieee1905_transport_local_bus.cpp
|
||||
ieee1905_transport_packet_processing.cpp)
|
||||
|
||||
set_target_properties(ieee1905_transport_lib PROPERTIES VERSION ${prplmesh_VERSION} SOVERSION ${prplmesh_VERSION_MAJOR})
|
||||
target_link_libraries(ieee1905_transport_lib PUBLIC tlvf ieee1905_transport_messages mapfcommon PRIVATE elpp)
|
||||
target_link_libraries(ieee1905_transport_lib
|
||||
PUBLIC bcl tlvf btlvf ieee1905_transport_messages mapfcommon
|
||||
PRIVATE elpp)
|
||||
target_include_directories(ieee1905_transport_lib PUBLIC include/)
|
||||
|
||||
add_library(ieee1905_transport_messages ieee1905_transport_messages.cpp)
|
||||
set_target_properties(ieee1905_transport_messages PROPERTIES VERSION ${prplmesh_VERSION} SOVERSION ${prplmesh_VERSION_MAJOR})
|
||||
target_link_libraries(ieee1905_transport_messages PUBLIC mapfcommon PRIVATE elpp)
|
||||
target_link_libraries(ieee1905_transport_messages PUBLIC mapfcommon bcl PRIVATE elpp)
|
||||
target_include_directories(ieee1905_transport_messages PUBLIC
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user