-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
144 lines (120 loc) · 3.86 KB
/
CMakeLists.txt
File metadata and controls
144 lines (120 loc) · 3.86 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
cmake_minimum_required(VERSION 3.13)
cmake_policy(VERSION 3.13)
project(fty-email
VERSION 1.0.0
DESCRIPTION "Email transport for 42ity (based on msmtp)"
)
##############################################################################################################
find_package(fty-cmake PATHS ${CMAKE_BINARY_DIR}/fty-cmake)
##############################################################################################################
##############################################################################################################
etn_target(static ${PROJECT_NAME}-static
SOURCES
src/email.cc
src/emailconfiguration.cc
src/fty_email_audit_log.cc
src/emailconfiguration.h
src/email.h
src/fty_email.h
src/fty_email_server.cc
src/fty_email_server.h
USES
czmq
mlm
magic
cxxtools # cxxtools cannot be use as public because we do not have the cmake package yet
fty-utils
fty_common
fty_proto
fty_common_mlm
fty_common_logging
fty_common_translation
PRIVATE
)
##############################################################################################################
etn_target(exe ${PROJECT_NAME}
SOURCES
src/fty_email.cc
USES
${PROJECT_NAME}-static
)
##############################################################################################################
etn_target(exe fty-sendmail
SOURCES
src/fty_sendmail.cc
USES
${PROJECT_NAME}-static
)
##############################################################################################################
etn_test_target(${PROJECT_NAME}-static
CONFIGS
test/conf/*
SOURCES
test/main.cpp
test/email.cpp
test/emailconfiguration.cpp
test/fty_email_server.cpp
SUBDIR
test
)
##############################################################################################################
# Agent config
etn_configure_file(
src/conf/${PROJECT_NAME}.cfg.in
TARGET ${PROJECT_NAME}
DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/${PROJECT_NAME}
)
# systemd service
etn_configure_file(
src/conf/${PROJECT_NAME}.service.in
TARGET ${PROJECT_NAME}
DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/systemd/system/
)
# .conf > lib/tmpfiles.d/
install(
FILES ${PROJECT_SOURCE_DIR}/src/conf/${PROJECT_NAME}.conf
DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/tmpfiles.d/
)
# script bin/
install(
PROGRAMS fty-device-scan
DESTINATION ${CMAKE_INSTALL_BINDIR}/
)
##############################################################################################################
set(CONF_TEST "${CMAKE_CURRENT_BINARY_DIR}/test_conf/")
file(COPY test/conf/smtp-test-10.cfg DESTINATION ${CONF_TEST}/)
file(COPY test/conf/test_en_US.json DESTINATION ${CONF_TEST}/)
# etn_test_target(fty-sendmail
# SOURCES
# test/main.cpp
# PUBLIC_INCLUDE_DIR
# src
# )
# if(BUILD_TESTING)
# enable_testing()
# # Create a target for the tests
# etn_test(${PROJECT_NAME}-test
# SOURCES
# test/fty_email_private_selftest.cc
# test/fty_email_selftest.cc
# src/fty_email_server.cc
# CONFIGS
# test/conf/smtp-test-10.cfg
# test/conf/test_en_US.json
# INCLUDE_DIRS
# src
# USES
# ${PROJECT_NAME}-static
# czmq
# cxxtools # cxxtools cannot be use as public because we do not have the cmake package yet
# fty_common
# fty_common_logging
# fty_proto
# fty_common_mlm
# fty_common_translation
# mlm
# magic
# fty-utils
# )
# endif()
##############################################################################################################