forked from brettviren/appfwk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
107 lines (78 loc) · 4.78 KB
/
CMakeLists.txt
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
cmake_minimum_required(VERSION 3.12)
project(appfwk VERSION 1.1.0)
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../daq-buildtools/cmake ${CMAKE_MODULE_PATH})
include(DAQ)
daq_setup_environment()
find_package(Boost 1.70.0 COMPONENTS unit_test_framework program_options REQUIRED)
find_package(TRACE 3.15.09 REQUIRED)
find_package(cetlib REQUIRED) # Uses the daq-buildtools/cmake/Findcetlib.cmake
find_package(folly REQUIRED)
find_package(ers REQUIRED)
find_package(nlohmann_json REQUIRED )
set(APPFWK_DEPENDENCIES ${CETLIB} ${CETLIB_EXCEPT} ers::ers Folly::folly nlohmann_json::nlohmann_json pthread)
##############################################################################
daq_point_build_to( src )
<<<<<<< HEAD
add_library(appfwk SHARED src/QueueRegistry.cpp src/DAQProcess.cpp src/DAQModule.cpp src/Application.cpp)
=======
add_library(appfwk SHARED src/QueueRegistry.cpp src/DAQModule.cpp
src/DAQModuleManager.cpp src/DAQModuleHelper.cpp)
>>>>>>> 29dc0fb2a58beebbc254ce5688a54dbe22384f3e
target_link_libraries(appfwk ${APPFWK_DEPENDENCIES})
target_include_directories(appfwk PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}> )
# add_library(appfwk_QueryResponseCommandFacility_duneCommandFacility src/QueryResponseCommandFacility.cpp)
# target_link_libraries(appfwk_QueryResponseCommandFacility_duneCommandFacility appfwk)
macro(MakeDataTypeLibraries)
set(oneValueArgs CPPTYPE PREFIX)
cmake_parse_arguments(MAKE_DATATYPE "" "${oneValueArgs}" "" ${ARGN})
configure_file(src/FanOutDAQModule.cpp.in src/${MAKE_DATATYPE_PREFIX}FanOutDAQModule.cpp)
add_library(${MAKE_DATATYPE_PREFIX}FanOutDAQModule_duneDAQModule SHARED src/${MAKE_DATATYPE_PREFIX}FanOutDAQModule.cpp)
target_link_libraries(${MAKE_DATATYPE_PREFIX}FanOutDAQModule_duneDAQModule appfwk)
endmacro()
MakeDataTypeLibraries(CPPTYPE std::vector<int> PREFIX VectorInt)
MakeDataTypeLibraries(CPPTYPE std::string PREFIX String)
MakeDataTypeLibraries(CPPTYPE dunedaq::appfwk::NonCopyableType PREFIX NonCopyableType)
add_library(appfwk_fileCommandFacility_duneCommandFacility src/FileCommandFacility.cpp)
target_link_libraries(appfwk_fileCommandFacility_duneCommandFacility appfwk)
##############################################################################
daq_point_build_to( apps )
add_executable(daq_application apps/daq_application.cxx)
target_link_libraries(daq_application ${Boost_PROGRAM_OPTIONS_LIBRARY} appfwk)
add_executable(ddnode apps/ddnode.cpp)
target_link_libraries(ddnode appfwk)
##############################################################################
daq_point_build_to( doc )
# (No action taken, doc/ doesn't yet contain anything)
##############################################################################
daq_point_build_to( test )
add_library(appfwk_DummyModule_duneDAQModule test/DummyModule.cpp)
target_link_libraries(appfwk_DummyModule_duneDAQModule appfwk)
add_library(appfwk_FakeDataConsumerDAQModule_duneDAQModule test/FakeDataConsumerDAQModule.cpp)
target_link_libraries(appfwk_FakeDataConsumerDAQModule_duneDAQModule appfwk)
target_include_directories(appfwk_FakeDataConsumerDAQModule_duneDAQModule PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/test>)
add_library(appfwk_FakeDataProducerDAQModule_duneDAQModule test/FakeDataProducerDAQModule.cpp)
target_link_libraries(appfwk_FakeDataProducerDAQModule_duneDAQModule appfwk)
target_include_directories(appfwk_FakeDataProducerDAQModule_duneDAQModule PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/test>)
add_executable(queue_IO_check test/queue_IO_check.cxx)
target_link_libraries(queue_IO_check ${Boost_PROGRAM_OPTIONS_LIBRARY} appfwk)
# add_executable(dummy_test_app test/dummy_test_app.cxx)
# target_link_libraries(dummy_test_app appfwk appfwk_DummyModule_duneDAQModule ${Boost_PROGRAM_OPTIONS_LIBRARY} appfwk)
file(COPY test/producer_consumer_dynamic_test.json DESTINATION test)
##############################################################################
daq_point_build_to( unittest )
daq_add_unit_test(DAQModule_test appfwk )
daq_add_unit_test(DAQSink_DAQSource_test appfwk )
daq_add_unit_test(FanOutDAQModule_test appfwk )
daq_add_unit_test(FollyQueue_test ers::ers Folly::folly)
daq_add_unit_test(StdDeQueue_test ers::ers)
daq_add_unit_test(ThreadHelper_test ers::ers)
daq_add_unit_test(NamedObject_test )
##############################################################################
daq_install(TARGETS daq_application
appfwk
# appfwk_QueryResponseCommandFacility_duneCommandFacility
appfwk_fileCommandFacility_duneCommandFacility
VectorIntFanOutDAQModule_duneDAQModule
StringFanOutDAQModule_duneDAQModule
NonCopyableTypeFanOutDAQModule_duneDAQModule
)