Skip to content

Commit 900722c

Browse files
authored
Merge pull request #1 from openDAQ/dev
MQTT streaming server implementation
2 parents 7f3b04a + bf975e4 commit 900722c

32 files changed

Lines changed: 2690 additions & 0 deletions

CMakeLists.txt

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# CMakeList.txt : CMake project for OpenDAQHistorianFB, include source and define
2+
# project specific logic here.
3+
#
4+
set(CMAKE_POLICY_VERSION_MINIMUM 3.5)
5+
cmake_minimum_required(VERSION 3.25)
6+
7+
set(REPO_NAME mqtt_module)
8+
set(REPO_OPTION_PREFIX MQTT_MODULE)
9+
10+
project (${REPO_NAME} CXX)
11+
12+
# Enable Hot Reload for MSVC compilers if supported.
13+
if (POLICY CMP0141)
14+
cmake_policy(SET CMP0141 NEW)
15+
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$<IF:$<AND:$<C_COMPILER_ID:MSVC>,$<CXX_COMPILER_ID:MSVC>>,$<$<CONFIG:Debug,RelWithDebInfo>:EditAndContinue>,$<$<CONFIG:Debug,RelWithDebInfo>:ProgramDatabase>>")
16+
endif()
17+
18+
if (POLICY CMP0135)
19+
cmake_policy(SET CMP0135 NEW)
20+
endif()
21+
22+
if (POLICY CMP0077)
23+
cmake_policy(SET CMP0077 NEW)
24+
endif()
25+
26+
27+
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
28+
list(APPEND CMAKE_MESSAGE_CONTEXT ${REPO_NAME})
29+
set(CMAKE_MESSAGE_CONTEXT_SHOW ON CACHE BOOL "Show CMake message context")
30+
31+
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
32+
33+
option(OPENDAQ_DEVICE_EXAMPLE_ENABLE_EXAMPLE_APPS "Enable building example applications" OFF)
34+
35+
include(CommonUtils)
36+
setup_repo(${REPO_OPTION_PREFIX})
37+
38+
if(OPENDAQ_DEVICE_EXAMPLE_ENABLE_EXAMPLE_APPS)
39+
set(DAQMODULES_REF_DEVICE_MODULE ON CACHE BOOL "" FORCE)
40+
endif()
41+
42+
43+
find_package(OpenSSL REQUIRED)
44+
if (OPENSSL_FOUND)
45+
message(STATUS "Found OpenSSL ${OPENSSL_VERSION}")
46+
else()
47+
message(STATUS "OpenSSL Not Found")
48+
endif()
49+
50+
add_subdirectory(external)
51+
add_subdirectory(mqtt_streaming_protocol)
52+
add_subdirectory(mqtt_streaming_server_module)
53+
54+
if(OPENDAQ_DEVICE_EXAMPLE_ENABLE_EXAMPLE_APPS)
55+
message(STATUS "Example applications have been enabled")
56+
add_subdirectory(examples)
57+
endif()
58+
59+
60+
61+
# Set CPack variables
62+
set(CPACK_COMPONENTS_ALL RUNTIME)
63+
set(CPACK_PROJECT_NAME ${PROJECT_NAME})
64+
set(CPACK_PACKAGE_NAME ${PROJECT_NAME})
65+
set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
66+
set(CPACK_OUTPUT_FILE_PREFIX "${CMAKE_BINARY_DIR}/package")
67+
68+
# Set the CPack generator based on the platform
69+
if (WIN32)
70+
set(CPACK_GENERATOR "ZIP")
71+
elseif (UNIX AND NOT APPLE)
72+
cmake_host_system_information(RESULT DISTRO_ID QUERY DISTRIB_ID)
73+
cmake_host_system_information(RESULT DISTRO_VERSION_ID QUERY DISTRIB_VERSION_ID)
74+
set(CPACK_SYSTEM_NAME "${DISTRO_ID}${DISTRO_VERSION_ID}")
75+
set(CPACK_GENERATOR "TGZ")
76+
endif()
77+
78+
# Include CPack for packaging
79+
include(CPack)

CMakePresets.json

Lines changed: 182 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,182 @@
1+
{
2+
"version": 4,
3+
"configurePresets": [
4+
{
5+
"name": "debug",
6+
"hidden": true,
7+
"cacheVariables": {
8+
"CMAKE_BUILD_TYPE": "Debug"
9+
},
10+
"binaryDir": "build/${presetName}"
11+
},
12+
{
13+
"name": "release",
14+
"hidden": true,
15+
"cacheVariables": {
16+
"CMAKE_BUILD_TYPE": "Release"
17+
},
18+
"binaryDir": "build/${presetName}"
19+
},
20+
{
21+
"name": "gcc",
22+
"hidden": true,
23+
"cacheVariables": {
24+
"CMAKE_C_COMPILER": "gcc",
25+
"CMAKE_CXX_COMPILER": "g++"
26+
}
27+
},
28+
{
29+
"name": "clang",
30+
"hidden": true,
31+
"cacheVariables": {
32+
"CMAKE_C_COMPILER": "clang",
33+
"CMAKE_CXX_COMPILER": "clang++"
34+
}
35+
},
36+
{
37+
"name": "ninja",
38+
"hidden": true,
39+
"generator": "Ninja"
40+
},
41+
{
42+
"name": "msvc-17",
43+
"hidden": true,
44+
"generator": "Visual Studio 15 2017",
45+
"condition": {
46+
"type": "equals",
47+
"lhs": "${hostSystemName}",
48+
"rhs": "Windows"
49+
},
50+
"vendor": {
51+
"microsoft.com/VisualStudioSettings/CMake/1.0": {
52+
"hostOS": [ "Windows" ]
53+
}
54+
}
55+
},
56+
{
57+
"name": "msvc-22",
58+
"hidden": true,
59+
"generator": "Visual Studio 17 2022",
60+
"inherits": [
61+
"msvc-17"
62+
]
63+
},
64+
{
65+
"name": "msvc-x86",
66+
"hidden": true,
67+
"architecture": "Win32",
68+
"condition": {
69+
"type": "equals",
70+
"lhs": "${hostSystemName}",
71+
"rhs": "Windows"
72+
},
73+
"vendor": {
74+
"microsoft.com/VisualStudioSettings/CMake/1.0": {
75+
"hostOS": [ "Windows" ]
76+
}
77+
}
78+
},
79+
{
80+
"name": "msvc-x64",
81+
"hidden": true,
82+
"architecture": "x64",
83+
"condition": {
84+
"type": "equals",
85+
"lhs": "${hostSystemName}",
86+
"rhs": "Windows"
87+
},
88+
"vendor": {
89+
"microsoft.com/VisualStudioSettings/CMake/1.0": {
90+
"hostOS": [ "Windows" ]
91+
}
92+
}
93+
},
94+
{
95+
"name": "full",
96+
"hidden": true,
97+
"cacheVariables": {
98+
"OPENDAQ_DEVICE_EXAMPLE_ENABLE_EXAMPLE_APPS": "true"
99+
}
100+
},
101+
{
102+
"name": "x86/msvc-17",
103+
"displayName": "[MSVC 17] Release - x86",
104+
"inherits": [
105+
"full",
106+
"release",
107+
"msvc-17",
108+
"msvc-x86"
109+
]
110+
},
111+
{
112+
"name": "x64/msvc-17",
113+
"displayName": "[MSVC 17] Release - x64",
114+
"inherits": [
115+
"full",
116+
"release",
117+
"msvc-17",
118+
"msvc-x64"
119+
]
120+
},
121+
{
122+
"name": "x86/msvc-22",
123+
"displayName": "[MSVC 22] Release - x86",
124+
"inherits": [
125+
"full",
126+
"release",
127+
"msvc-22",
128+
"msvc-x86"
129+
]
130+
},
131+
{
132+
"name": "x64/msvc-22",
133+
"displayName": "[MSVC 22] Release - x64",
134+
"inherits": [
135+
"full",
136+
"release",
137+
"msvc-22",
138+
"msvc-x64"
139+
]
140+
},
141+
{
142+
"name": "x64/gcc/debug",
143+
"displayName": "[GCC] Debug - x64",
144+
"inherits": [
145+
"full",
146+
"debug",
147+
"gcc",
148+
"ninja"
149+
]
150+
},
151+
{
152+
"name": "x64/gcc/release",
153+
"displayName": "[GCC] Release - x64",
154+
"inherits": [
155+
"full",
156+
"release",
157+
"gcc",
158+
"ninja"
159+
]
160+
},
161+
{
162+
"name": "x64/clang/debug",
163+
"displayName": "[Clang] Debug - x64",
164+
"inherits": [
165+
"full",
166+
"debug",
167+
"clang",
168+
"ninja"
169+
]
170+
},
171+
{
172+
"name": "x64/clang/release",
173+
"displayName": "[Clang] Release - x64",
174+
"inherits": [
175+
"full",
176+
"release",
177+
"clang",
178+
"ninja"
179+
]
180+
}
181+
]
182+
}

0 commit comments

Comments
 (0)