Skip to content
Snippets Groups Projects
Commit e33012ab authored by Jan de Cuveland's avatar Jan de Cuveland Committed by Administrator
Browse files

Include current flesnet repository in cbmroot build flow

parent 3a625416
No related branches found
No related tags found
1 merge request!825Update flesnet version in cbmroot
......@@ -5,7 +5,7 @@ NicaFemto
Vc
cppzmq
flib_dpb/flib_dpb
fles/flesnet
flesnet/
jsroot
googletest
yaml-cpp/
......
......@@ -16,11 +16,10 @@ if(DOWNLOAD_EXTERNALS)
# Install header files
install(FILES cppzmq/zmq.hpp DESTINATION include)
Include(InstallFlesnet.cmake)
Set(FLES_IPC_INCLUDE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/flesnet/lib/fles_ipc PARENT_SCOPE)
Set(FLES_LOGGING_INCLUDE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/flesnet/lib/logging PARENT_SCOPE)
Set(IPC_INCLUDE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/fles/flesnet/lib/fles_ipc PARENT_SCOPE)
Set(IPCLOG_INCLUDE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/fles/flesnet/lib/logging PARENT_SCOPE)
Add_Subdirectory(fles)
Add_Subdirectory(flib_dpb)
find_package(Vc 1.4.1)
......@@ -45,7 +44,6 @@ if(DOWNLOAD_EXTERNALS)
)
Add_Subdirectory(xpu)
Include(InstallKFParticle.cmake)
Include(InstallNicaFemto.cmake)
Include(InstallAnalysisTree.cmake)
......
# Build parts of the flesnet software, which is maintained in the flesnet repository on github
#
# The included libraries provide the interface to the experiment data in timeslices
# both online and in timeslice archive (.tsa) files.
set(FLESNET_VERSION b1b8c37d6db9a66122ee375bea608c6c6e848665) # 2022-02-24
set(FLESNET_SRC_URL "https://github.com/cbm-fles/flesnet")
set(FLESNET_DESTDIR "${PROJECT_BINARY_DIR}/external/flesnet-prefix")
download_project_if_needed(
PROJECT flesnet
GIT_REPOSITORY ${FLESNET_SRC_URL}
GIT_TAG ${FLESNET_VERSION}
GIT_STASH TRUE
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/flesnet
TEST_FILE CMakeLists.txt
)
If(ProjectUpdated)
File(REMOVE_RECURSE ${FLESNET_DESTDIR})
Message("flesnet source directory was changed so build directory was deleted")
EndIf()
ExternalProject_Add(
flesnet
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/flesnet
CMAKE_CACHE_ARGS -DINCLUDE_ZMQ:BOOL=TRUE -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON
BUILD_IN_SOURCE 0
LOG_DOWNLOAD 1 LOG_CONFIGURE 1 LOG_BUILD 1 LOG_INSTALL 1
BUILD_COMMAND ${CMAKE_COMMAND} --build . --target logging fles_ipc
BUILD_BYPRODUCTS ${FLESNET_DESTDIR}/src/flesnet-build/lib/fles_ipc/${CMAKE_STATIC_LIBRARY_PREFIX}fles_ipc${CMAKE_STATIC_LIBRARY_SUFFIX}
INSTALL_COMMAND ""
)
add_library(external::fles_logging STATIC IMPORTED GLOBAL)
add_dependencies(external::fles_logging flesnet)
set_target_properties(external::fles_logging PROPERTIES
IMPORTED_LOCATION ${FLESNET_DESTDIR}/src/flesnet-build/lib/logging/${CMAKE_STATIC_LIBRARY_PREFIX}logging${CMAKE_STATIC_LIBRARY_SUFFIX}
)
target_include_directories(external::fles_logging INTERFACE
${CMAKE_CURRENT_SOURCE_DIR}/flesnet/lib/logging
${Boost_INCLUDE_DIRS}
)
target_compile_definitions(external::fles_logging
INTERFACE BOOST_LOG_DYN_LINK
INTERFACE BOOST_LOG_USE_NATIVE_SYSLOG
INTERFACE BOOST_ERROR_CODE_HEADER_ONLY
)
add_library(external::fles_ipc STATIC IMPORTED GLOBAL)
add_dependencies(external::fles_ipc flesnet external::fles_logging)
set_target_properties(external::fles_ipc PROPERTIES
IMPORTED_LOCATION ${FLESNET_DESTDIR}/src/flesnet-build/lib/fles_ipc/${CMAKE_STATIC_LIBRARY_PREFIX}fles_ipc${CMAKE_STATIC_LIBRARY_SUFFIX}
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_CURRENT_SOURCE_DIR}/flesnet/lib/fles_ipc
)
# Build the fles_ipc library which is maintained in the flesnet repository on github
#
# This library provides the interface to the experiment data in timeslices
# both online as delivered by flesnet and to timeslice archive (.tsa) files.
download_project_if_needed(PROJECT flesnet
GIT_REPOSITORY "https://github.com/cbm-fles/flesnet"
GIT_TAG "301000b321eb7bc3a47a79b2ceadf2aa844327fe"
GIT_STASH TRUE
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/flesnet
TEST_FILE CMakeLists.txt
)
# Create the logging library
add_library(fles_logging SHARED flesnet/lib/logging/log.cpp flesnet/lib/logging/log.hpp)
target_compile_definitions(fles_logging
PUBLIC BOOST_LOG_DYN_LINK
PUBLIC BOOST_LOG_USE_NATIVE_SYSLOG
PUBLIC BOOST_ERROR_CODE_HEADER_ONLY
)
target_include_directories(fles_logging PUBLIC flesnet/lib/logging/)
target_include_directories(fles_logging SYSTEM PUBLIC ${Boost_INCLUDE_DIRS})
target_link_directories(fles_logging PUBLIC ${Boost_LIBRARY_DIRS})
target_link_libraries(fles_logging boost_log)
Install(TARGETS fles_logging DESTINATION lib)
Set(INCLUDE_DIRECTORIES
)
Set(SYSTEM_INCLUDE_DIRECTORIES
${Boost_INCLUDE_DIR}
${ZMQ_INCLUDE_DIR}
${CMAKE_SOURCE_DIR}/external/cppzmq
${CMAKE_SOURCE_DIR}/external/fles/flesnet
${CMAKE_SOURCE_DIR}/external/fles/flesnet/lib/logging
)
Include_Directories( ${INCLUDE_DIRECTORIES})
Include_Directories(SYSTEM ${SYSTEM_INCLUDE_DIRECTORIES})
Set(LINK_DIRECTORIES
${Boost_LIBRARY_DIRS}
${ZMQ_LIBRARY_DIRS}
)
Link_Directories( ${LINK_DIRECTORIES})
Set(SRCS
flesnet/lib/fles_ipc/Microslice.cpp
flesnet/lib/fles_ipc/MicrosliceView.cpp
flesnet/lib/fles_ipc/StorableMicroslice.cpp
flesnet/lib/fles_ipc/StorableTimeslice.cpp
flesnet/lib/fles_ipc/System.cpp
flesnet/lib/fles_ipc/Timeslice.cpp
flesnet/lib/fles_ipc/TimeslicePublisher.cpp
flesnet/lib/fles_ipc/TimesliceReceiver.cpp
flesnet/lib/fles_ipc/TimesliceSubscriber.cpp
flesnet/lib/fles_ipc/TimesliceView.cpp
flesnet/lib/fles_ipc/TimesliceMultiInputArchive.cpp
flesnet/lib/fles_ipc/TimesliceMultiSubscriber.cpp
flesnet/lib/fles_ipc/TimesliceAutoSource.cpp
)
Set_Source_Files_Properties(${SRCS} COMPILE_FLAGS "-std=c++14 -O3 -ggdb -msse4.2 -Wall -Wpedantic -Wextra -Winit-self -Wundef -Wold-style-cast -Woverloaded-virtual -Wwrite-strings -Wnon-virtual-dtor -fno-omit-frame-pointer")
Set(LIBRARY_NAME fles_ipc)
If(UNIX AND NOT APPLE)
Set(DEPENDENCIES boost_thread boost_system boost_serialization boost_log boost_regex fles_logging zmq rt)
Else()
Set(DEPENDENCIES boost_thread boost_system boost_serialization boost_log boost_regex fles_logging zmq)
EndIf()
GENERATE_LIBRARY()
# Install header files
install(FILES flesnet/lib/logging/log.hpp DESTINATION include)
file(GLOB_RECURSE IPC_HEADERS flesnet/lib/fles_ipc/*.hpp)
install(FILES ${IPC_HEADERS} DESTINATION include)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment