CMakeLists.txt
3.14 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
cmake_minimum_required(VERSION 3.5)
cmake_policy(SET CMP0048 NEW)
include(CheckCXXCompilerFlag)
project(FlashMQ VERSION 0.9.7 LANGUAGES CXX)
add_definitions(-DOPENSSL_API_COMPAT=0x10100000L)
add_definitions(-DFLASHMQ_VERSION=\"${PROJECT_VERSION}\")
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
SET(CMAKE_CXX_FLAGS "-msse4.2")
check_cxx_compiler_flag("-rdynamic" COMPILER_SUPPORTS_RDYNAMIC)
if (${COMPILER_SUPPORTS_RDYNAMIC})
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -rdynamic")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -rdynamic")
endif()
add_compile_options(-Wall)
add_executable(FlashMQ
forward_declarations.h
mainapp.h
utils.h
threaddata.h
client.h
session.h
mqttpacket.h
exceptions.h
types.h
subscriptionstore.h
rwlockguard.h
retainedmessage.h
cirbuf.h
logger.h
authplugin.h
configfileparser.h
sslctxmanager.h
timer.h
iowrapper.h
mosquittoauthoptcompatwrap.h
settings.h
listener.h
unscopedlock.h
scopedsocket.h
bindaddr.h
oneinstancelock.h
evpencodectxmanager.h
acltree.h
enums.h
threadlocalutils.h
flashmq_plugin.h
retainedmessagesdb.h
persistencefile.h
sessionsandsubscriptionsdb.h
qospacketqueue.h
threadauth.h
threadloop.h
mainapp.cpp
main.cpp
utils.cpp
threaddata.cpp
client.cpp
session.cpp
mqttpacket.cpp
exceptions.cpp
types.cpp
subscriptionstore.cpp
rwlockguard.cpp
retainedmessage.cpp
cirbuf.cpp
logger.cpp
authplugin.cpp
configfileparser.cpp
sslctxmanager.cpp
timer.cpp
iowrapper.cpp
mosquittoauthoptcompatwrap.cpp
settings.cpp
listener.cpp
unscopedlock.cpp
scopedsocket.cpp
bindaddr.cpp
oneinstancelock.cpp
evpencodectxmanager.cpp
acltree.cpp
threadlocalutils.cpp
flashmq_plugin.cpp
retainedmessagesdb.cpp
persistencefile.cpp
sessionsandsubscriptionsdb.cpp
qospacketqueue.cpp
threadauth.cpp
threadloop.cpp
)
target_link_libraries(FlashMQ pthread dl ssl crypto)
install(TARGETS FlashMQ
RUNTIME DESTINATION "/usr/bin/")
install(DIRECTORY DESTINATION "/var/lib/flashmq")
install(DIRECTORY DESTINATION "/var/log/flashmq")
install(FILES flashmq.conf DESTINATION "/etc/flashmq")
install(FILES debian/flashmq.service DESTINATION "/lib/systemd/system")
SET(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_SOURCE_DIR}/debian/conffiles;${CMAKE_CURRENT_SOURCE_DIR}/debian/preinst;${CMAKE_CURRENT_SOURCE_DIR}/debian/postinst;${CMAKE_CURRENT_SOURCE_DIR}/debian/postrm;${CMAKE_CURRENT_SOURCE_DIR}/debian/prerm")
SET(CPACK_GENERATOR "DEB")
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Wiebe Cazemier <wiebe@halfgaar.net>")
SET(CPACK_DEBIAN_PACKAGE_DESCRIPTION "Light-weight, high performance MQTT server capable of million+ messages per second.")
SET(CPACK_PACKAGE_HOMEPAGE_URL "https://www.flashmq.org/")
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libssl1.1 (>= 1.1.0)")
SET(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
SET(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR})
SET(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH})
INCLUDE(CPack)