-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
158 lines (128 loc) · 4.66 KB
/
CMakeLists.txt
File metadata and controls
158 lines (128 loc) · 4.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
cmake_minimum_required(VERSION 3.12)
project(snbmodules VERSION 2.1.0)
find_package(daq-cmake REQUIRED)
daq_setup_environment()
# ers: for exceptions and normal output
# TRACE: for low-level debugging statements
# Boost unit_test_framework: for the unit tests
# Boost program_options: to allow command line options with descriptions/default values
find_package(ers REQUIRED)
find_package(TRACE REQUIRED)
find_package(Boost COMPONENTS unit_test_framework program_options iostreams REQUIRED)
find_package(iomanager REQUIRED)
find_package(appfwk REQUIRED)
find_package(logging REQUIRED)
find_package(nlohmann_json REQUIRED)
find_package(daqdataformats REQUIRED)
find_package(detdataformats REQUIRED)
find_package(datahandlinglibs REQUIRED)
find_package(fdreadoutlibs REQUIRED)
find_package(rclone REQUIRED)
find_package(LibtorrentRasterbar REQUIRED)
set(linked_libraries
iomanager::iomanager
logging::logging
ers::ers
appfwk::appfwk
daqdataformats::daqdataformats
detdataformats::detdataformats
nlohmann_json::nlohmann_json
datahandlinglibs::datahandlinglibs
Boost::iostreams
LibtorrentRasterbar::torrent-rasterbar
rclone::rclone
)
set(tests
snb_bookkeeper_app
snb_transfer_client_app
snb_bittorrent_full_test
snb_rclone_full_test
snb_transfer_metadata_save_load
snb_group_metadata_save_load
snb_client_test
snb_ip_format_test
snb_session_test
snb_client_available_test
snb_notification_test
)
set(INCLUDE_DIR "include/snbmodules/")
set(sources_client
transfer_client.cpp
transfer_session.cpp
)
set(includes_client
transfer_client.hpp
transfer_session.hpp
)
set(sources_interface
)
set(includes_interface
transfer_interface_abstract.hpp
transfer_interface_bittorrent.hpp
transfer_interface_SCP.hpp
transfer_interface_RClone.hpp
)
set(sources_bookkeeper
bookkeeper.cpp
)
set(includes_bookkeeper
bookkeeper.hpp
)
set(sources_common
group_metadata.cpp
transfer_metadata.cpp
notification_interface.cpp
iomanager_wrapper.cpp
transfer_interface_bittorrent.cpp
)
set(includes_common
metadata_abstract.hpp
group_metadata.hpp
transfer_metadata.hpp
protocols_enum.hpp
status_enum.hpp
ip_format.hpp
notification_interface.hpp
iomanager_wrapper.hpp
errors_declaration.hpp
)
list(TRANSFORM sources_client PREPEND client/)
list(TRANSFORM includes_client PREPEND client/)
list(TRANSFORM sources_interface PREPEND transfer_interface/)
list(TRANSFORM includes_interface PREPEND transfer_interface/)
list(TRANSFORM sources_bookkeeper PREPEND bookkeeper/)
list(TRANSFORM includes_bookkeeper PREPEND bookkeeper/)
list(TRANSFORM sources_common PREPEND common/)
list(TRANSFORM includes_common PREPEND common/)
##############################################################################
# Note that when the ers library is linked in, it uses a "::" because
# it's in an external package, not a local CMake target. The semantics
# are <namespace>::<shared library / executable>
daq_add_library(${sources_client} ${sources_interface} ${sources_bookkeeper} ${sources_common} LINK_LIBRARIES ${linked_libraries})
##############################################################################
# Plugins
daq_add_plugin(SNBFileTransfer duneDAQModule LINK_LIBRARIES ${Boost_PROGRAM_OPTIONS_LIBRARY} snbmodules)
daq_add_plugin(SNBTransferBookkeeper duneDAQModule LINK_LIBRARIES ${Boost_PROGRAM_OPTIONS_LIBRARY} snbmodules)
daq_add_plugin(SNBFileReaderModule duneDAQModule LINK_LIBRARIES snbmodules fdreadoutlibs::fdreadoutlibs)
set(SNBMODULES_USE_INTRINSICS ON)
if(${SNBMODULES_USE_INTRINSICS})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mavx2")
endif()
daq_add_plugin(SNBDataHandlerModule duneDAQModule LINK_LIBRARIES snbmodules fdreadoutlibs::fdreadoutlibs)
##############################################################################
# Integration tests
#TEMP_REMOVED#foreach(t IN LISTS tests)
#TEMP_REMOVED# daq_add_application( ${t} ${t}.cxx TEST LINK_LIBRARIES ${Boost_PROGRAM_OPTIONS_LIBRARY} snbmodules )
#TEMP_REMOVED#endforeach()
##############################################################################
# Apps
# foreach(app IN LISTS apps)
# daq_add_application( ${app} ${app}.cpp LINK_LIBRARIES ${Boost_PROGRAM_OPTIONS_LIBRARY} snbmodules )
# endforeach()
##############################################################################
# daq_add_unit_test(ValueWrapper_test)
##############################################################################
# Could add "toylibrary_test_program" to the argument list here, but
# presumably end users wouldn't care about an integration test program
# and just want the shared object library installed
daq_install()