-
-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathCMakeLists.txt
505 lines (443 loc) · 17.8 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
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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
# CMakeLists.txt
#
# Build instructions for the VSCP daemon.
#
# Copyright (C) 2000-2025 Ake Hedman the VSCP project
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#
# Windows
# -------
# cmake .. -G "Visual Studio 17 2022" -DVCPKG_TARGET_TRIPLET=x64-windows -DCMAKE_TOOLCHAIN_FILE=G:\vcpkg\scripts\buildsystems\vcpkg.cmake
# cmake --build . --config Release
#
cmake_minimum_required(VERSION 3.5)
project(vscpd LANGUAGES CXX C)
set(PACKAGE_AUTHOR "Ake Hedman, the VSCP Project")
# Version settings
if(NOT DEFINED MAJOR_VERSION)
SET(MAJOR_VERSION "15")
endif()
if(NOT DEFINED MINOR_VERSION)
SET(MINOR_VERSION "0")
endif()
if(NOT DEFINED PATCH_VERSION)
SET(PATCH_VERSION "3")
endif()
# Disable abi warnings (nlohmann)
if(WIN32)
add_compile_options("$<$<C_COMPILER_ID:MSVC>:/utf-8>")
add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/utf-8>")
else()
SET(GCC_VSCP_COMPILE_FLAGS "-Wno-psabi -D WITH_SYSTEMD")
endif()
# Profiling
#SET(GCC_VSCP_LINK_FLAGS "-lgcov")
SET(CPACK_PACKAGE_DESCRIPTION "the VSCP daemon")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "A daemon that act as a hub and logic controller for a VSCP based system. It is"
"possible to add drivers to physical devices, interface external nodes over"
"tcp/ip, websockets and to perform other higher end functionality.")
SET(CPACK_PACKAGE_VENDOR "the VSCP project")
SET(CPACK_PACKAGE_CONTACT "[email protected]")
set(CPACK_PACKAGE_NAME ${APP_LOW_NAME})
set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY ${APP_NAME})
SET(CPACK_PACKAGE_VERSION_MAJOR "${MAJOR_VERSION}")
SET(CPACK_PACKAGE_VERSION_MINOR "${MINOR_VERSION}")
SET(CPACK_PACKAGE_VERSION_PATCH "${PATCH_VERSION}")
SET(CPACK_PACKAGING_INSTALL_PREFIX "/")
SET(CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}_${MAJOR_VERSION}.${MINOR_VERSION}.${CPACK_PACKAGE_VERSION_PATCH}")
SET(CPACK_SOURCE_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}_${MAJOR_VERSION}.${MINOR_VERSION}.${CPACK_PACKAGE_VERSION_PATCH}")
#SET(CPACK_IGNORE_FILES "\\.psd$;/CVS/;/\\.svn/;/\\.git/;\\.swp$;/CMakeLists.txt.user;\\.#;/#;\\.tar.gz$;/CMakeFiles/;CMakeCache.txt;\\.qm$;/build/;\\.diff$;.DS_Store'")
set(CPACK_SOURCE_IGNORE_FILES ${CPACK_IGNORE_FILES})
SET(CPACK_NSIS_HELP_LINK ${APP_URL})
SET(CPACK_NSIS_URL_INFO_ABOUT ${APP_URL})
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
if(NOT DEFINED APP_LOW_NAME)
set(APP_LOW_NAME "vscpd")
endif()
if(NOT DEFINED APP_NAME)
set(APP_NAME "VSCPD")
endif()
if(NOT DEFINED APP_URL)
set(APP_URL "https://github.com/grodansparadis/vscp")
endif()
if(NOT DEFINED APP_VERSION)
set(APP_VERSION, "${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}")
endif()
# Man build and install
#if(NOT DEFINED WIN32)
# add_subdirectory(man)
# add_subdirectory(src/vscp/vscp-mkpasswd)
#endif()
option(USE_SSL "Use SSL" TRUE)
## --- C++14 build flags ---
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS ON)
# Build locations
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}")
# Generate position-independent code (-fPIC on UNIX)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
# --- System Libraries ---
include(GNUInstallDirs)
INCLUDE(InstallRequiredSystemLibraries)
# Disable abi warnings (nlohmann)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GCC_VSCP_COMPILE_FLAGS}")
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${GCC_VSCP_LINK_FLAGS}")
# * * * * CPACK * * * *
if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_SOURCE_DIR}/resources/debpkg/folders;"
"${CMAKE_CURRENT_SOURCE_DIR}/resources/debpkg/conffiles;"
"${CMAKE_CURRENT_SOURCE_DIR}/resources/debpkg/postinst;"
"${CMAKE_CURRENT_SOURCE_DIR}/resources/debpkg/logrotate;"
"${CMAKE_CURRENT_SOURCE_DIR}/resources/debpkg/prerm;"
"${CMAKE_CURRENT_SOURCE_DIR}/resources/debpkg/postrm;" )
IF(WIN32)
SET(CPACK_GENERATOR "NSIS" "ZIP")
ELSE(WIN32)
SET(CPACK_GENERATOR "DEB" "RPM" "TGZ" "ZIP")
ENDIF(WIN32)
SET(CPACK_COMPONENTS_ALL Libraries ApplicationData)
# Configure file with custom definitions for NSIS.
if(WIN32 AND NOT UNIX)
configure_file(
${PROJECT_SOURCE_DIR}/resources/nsis/NSIS.definitions.nsh.in
${CMAKE_CURRENT_BINARY_DIR}/resources/nsis/NSIS.definitions.nsh
)
else()
SET(CPACK_DEBIAN_PACKAGE_DEPENDS
"libuuid1, lsb-base (>=4.1+Debian3), libc6-dev (>= 2.14), libstdc++6 (>= 5.2), libgcc1 (>= 1:3.0), libssl-dev (>=1.0.0), libmosquitto-dev (>=1.4.10), libexpat1-dev (>=2.0), libmosquitto-dev, libsystemd-dev, libwrap0-dev (>=7.6), libz-dev")
SET(CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
SET(CPACK_DEBIAN_PACKAGE_SECTION "network")
SET(CPACK_DEBIAN_ARCHITECTURE ${CMAKE_SYSTEM_PROCESSOR})
set(CPACK_STRIP_FILES "bin/vscpd")
set(CPACK_SOURCE_STRIP_FILES "")
endif()
set(CPACK_PACKAGE_EXECUTABLES "vscpd")
# Load packaging facilities.
include(CPack)
endif(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
if(WIN32)
add_definitions(-D_WINSOCK_DEPRECATED_NO_WARNINGS)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
add_definitions(-DWIN32_LEAN_AND_MEANS)
add_definitions(-DOPENSSL_API_1_1)
add_definitions(-D_POSIX_C_SOURCE)
add_definitions(-DVCPKG_TARGET_TRIPLET=x64-windows)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
set(LIBS_SYSTEM ws2_32)
if (MSVC)
# # use precompiled headers
# set (CMAKE_AUTOMOC_MOC_OPTIONS "-bstdafx.h" "-fstdafx.h")
set (CMAKE_AUTOMOC_MOC_OPTIONS "-bstdafx.h ")
endif()
elseif(UNIX)
set(LIBS_SYSTEM c stdc++)
endif()
# set the module path
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/modules)
# pthreads
set (THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
# openssl
find_package(OpenSSL REQUIRED)
# libwebsockets
#find_package(libwebsockets CONFIG REQUIRED)
include(FindLibWebSockets)
# Windows Libs
if (WIN32)
# pthread
find_package(pthread REQUIRED)
# SQLite3
#find_package(unofficial-sqlite3 CONFIG REQUIRED)
# Mosquitto lib
find_package(mosquitto CONFIG REQUIRED)
# Expat C library
find_package(expat CONFIG REQUIRED)
# dlfcn
find_package(dlfcn-win32 CONFIG REQUIRED)
else()
# expat
include(FindEXPAT)
find_package(EXPAT REQUIRED)
include_directories(${EXPAT_INCLUDE_DIRS})
# Mosquitto lib
include(FindMosquitto)
endif(WIN32)
set(OPENSSL_VER "OPENSSL_API_${OPENSSL_VERSION_MAJOR}_${OPENSSL_VERSION_MINOR}")
message(STATUS "OPENSSL Version: ${OPENSSL_VER} - ${OPENSSL_VERSION}")
#add_definitions(-D${OPENSSL_VER})
# 1.1.0 / 1.1.1 / 3.0.0 / 3.1.0
string(FIND "${OPENSSL_VERSION}" "1.0" SSL_VER_POS)
if(NOT ${SSL_VER_POS} EQUAL -1)
add_definitions(-DOPENSSL_API_1_0)
message(STATUS "Open ssl version is 1.0")
endif()
string(FIND "${OPENSSL_VERSION}" "1.1" SSL_VER_POS)
if(NOT ${SSL_VER_POS} EQUAL -1)
add_definitions(-DOPENSSL_API_1_1)
message(STATUS "Open ssl version is 1.1")
endif()
string(FIND "${OPENSSL_VERSION}" "3.0" SSL_VER_POS)
if(NOT SSL_VER_POS EQUAL -1)
add_definitions(-DOPENSSL_API_3_0)
message(STATUS "Open ssl version is 3.0")
endif()
string(FIND "${OPENSSL_VERSION}" "3.1" SSL_VER_POS)
if(NOT SSL_VER_POS EQUAL -1)
add_definitions(-DOPENSSL_API_3_1)
message(STATUS "Open ssl version is 3.1")
endif()
if (WIN32)
add_executable(vscpd
src/vscp/daemon/vscpd.cpp
src/vscp/daemon/controlobject.h
src/vscp/daemon/controlobject.cpp
src/vscp/daemon/devicethread.h
src/vscp/daemon/devicethread.cpp
src/vscp/daemon/devicelist.h
src/vscp/daemon/devicelist.cpp
src/vscp/common/version.h
src/vscp/common/vscp.h
src/vscp/common/vscpremotetcpif.h
src/vscp/common/vscpremotetcpif.cpp
src/vscp/common/vscpdatetime.h
src/vscp/common/vscpdatetime.cpp
src/vscp/common/guid.h
src/vscp/common/guid.cpp
src/vscp/common/vscphelper.h
src/vscp/common/vscphelper.cpp
src/vscp/common/canal.h
src/vscp/common/canaldlldef.h
src/vscp/common/vscpcanaldeviceif.h
src/vscp/common/vscpcanaldeviceif.cpp
src/vscp/common/canal-xmlconfig.h
src/vscp/common/canal-xmlconfig.cpp
src/vscp/common/vscp-client-base.h
src/vscp/common/vscp-client-base.cpp
src/vscp/common/vscp-client-mqtt.h
src/vscp/common/vscp-client-mqtt.cpp
./third_party/mustache/mustache.hpp
./third_party/sqlite3/sqlite3.h
./third_party/sqlite3/sqlite3.c
src/common/windows/getopt.c
src/common/configfile.h
src/common/configfile.cpp
src/common/sockettcp.h
src/common/sockettcp.c
src/common/vscpbase64.h
src/common/vscpbase64.c
src/common/vscp-aes.h
src/common/vscp-aes.c
src/common/crc.h
src/common/crc.c
src/common/crc8.h
src/common/crc8.c
src/common/vscpmd5.h
src/common/vscpmd5.c
src/common/randpassword.h
src/common/randpassword.cpp
)
else()
add_executable(vscpd
src/vscp/daemon/vscpd.cpp
src/vscp/daemon/controlobject.h
src/vscp/daemon/controlobject.cpp
src/vscp/daemon/devicethread.h
src/vscp/daemon/devicethread.cpp
src/vscp/daemon/devicelist.h
src/vscp/daemon/devicelist.cpp
src/vscp/common/version.h
src/vscp/common/vscp.h
src/vscp/common/vscpremotetcpif.h
src/vscp/common/vscpremotetcpif.cpp
src/vscp/common/vscpdatetime.h
src/vscp/common/vscpdatetime.cpp
src/vscp/common/guid.h
src/vscp/common/guid.cpp
src/vscp/common/vscphelper.h
src/vscp/common/vscphelper.cpp
src/vscp/common/canal.h
src/vscp/common/canaldlldef.h
src/vscp/common/vscpcanaldeviceif.h
src/vscp/common/vscpcanaldeviceif.cpp
src/vscp/common/canal-xmlconfig.h
src/vscp/common/canal-xmlconfig.cpp
src/vscp/common/vscp-client-base.h
src/vscp/common/vscp-client-base.cpp
src/vscp/common/vscp-client-mqtt.h
src/vscp/common/vscp-client-mqtt.cpp
./third_party/mustache/mustache.hpp
./third_party/sqlite3/sqlite3.h
./third_party/sqlite3/sqlite3.c
src/common/configfile.h
src/common/configfile.cpp
src/common/sockettcp.h
src/common/sockettcp.c
src/common/vscpbase64.h
src/common/vscpbase64.c
src/common/vscp-aes.h
src/common/vscp-aes.c
src/common/crc.h
src/common/crc.c
src/common/crc8.h
src/common/crc8.c
src/common/vscpmd5.h
src/common/vscpmd5.c
src/common/randpassword.h
src/common/randpassword.cpp
)
endif()
# * * * Includes * * *
set(CMAKE_INCLUDE_CURRENT_DIR ON)
if (WIN32)
#find_path(PTHREAD_INCLUDE_DIR pthread.h)
include_directories( PUBLIC ./src/vscp/daemon
./src/common
./src/vscp/common/
./src/common/third_party
./third_party/nlohmann/include
./third_party/sqlite3/
./third_party/spdlog/include/
./third_party/mustache/
./src/common/windows
${PThreads4W_INCLUDE_DIR}
${CMAKE_BINARY_DIR}
${OPENSSL_INCLUDE_DIR}
${MOSQUITTO_INCLUDE_DIRS}
${LIBWEBSOCKETS_INCLUDE_DIR}
${EXPAT_INCLUDE_DIRS}
${DLFCN_INCLUDES}
${LOCAL_WIN_INCLUDE} )
else()
include_directories( PUBLIC ./src/vscp/daemon
./src/common
./src/vscp/common/
./src/common/third_party
./third_party/nlohmann/include
./third_party/sqlite3/
./third_party/mustache/
./third_party/spdlog/include/
${PThreads4W_INCLUDE_DIR}
${CMAKE_BINARY_DIR}
${OPENSSL_INCLUDE_DIR}
${MOSQUITTO_INCLUDE_DIRS}
${LIBWEBSOCKETS_INCLUDE_DIR}
${EXPAT_INCLUDE_DIRS}
${DLFCN_INCLUDES}
${LOCAL_WIN_INCLUDE}
${LIBWEBSOCKETS_INCLUDE_DIR} )
endif()
if(MSVC)
target_link_libraries(vscpd PRIVATE
netapi32.lib
PThreads4W::PThreads4W_CXXEXC
OpenSSL::SSL
OpenSSL::Crypto
OpenSSL::SSL OpenSSL::Crypto
${MOSQUITTO_LIBRARIES}
${LIBWEBSOCKETS_LIBRARIES}
expat::expat
dlfcn-win32::dl
# spdlog::spdlog spdlog::spdlog_header_only
)
else()
target_link_libraries(vscpd PRIVATE
m
dl
systemd
Threads::Threads
OpenSSL::SSL
OpenSSL::Crypto
${OPENSSL_LIBRARIES}
${LIBWEBSOCKETS_LIBRARIES}
${MOSQUITTO_LIBRARIES}
${EXPAT_LIBRARIES}
)
endif()
if(WIN32)
else()
# Build main directory structure
install(DIRECTORY
DESTINATION ${CMAKE_INSTALL_LOCALSTATEDIR}/lib/vscp
DIRECTORY_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ GROUP_EXECUTE)
install(DIRECTORY
DESTINATION ${CMAKE_INSTALL_LOCALSTATEDIR}/lib/vscp/drivers/level1/
DIRECTORY_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ GROUP_EXECUTE)
install(DIRECTORY
DESTINATION ${CMAKE_INSTALL_LOCALSTATEDIR}/lib/vscp/drivers/level2/
DIRECTORY_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ GROUP_EXECUTE)
install(DIRECTORY
DESTINATION ${CMAKE_INSTALL_LOCALSTATEDIR}/lib/vscp/web/html/
DIRECTORY_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ GROUP_EXECUTE)
install(DIRECTORY
DESTINATION ${CMAKE_INSTALL_LOCALSTATEDIR}/lib/vscp/web/html/js/
DIRECTORY_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ GROUP_EXECUTE)
install(DIRECTORY
DESTINATION ${CMAKE_INSTALL_LOCALSTATEDIR}/lib/vscp/web/html/css/
DIRECTORY_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ GROUP_EXECUTE)
install(DIRECTORY
DESTINATION ${CMAKE_INSTALL_LOCALSTATEDIR}/lib/vscp/web/html/images/
DIRECTORY_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ GROUP_EXECUTE)
# Location for log
install(DIRECTORY
DESTINATION ${CMAKE_INSTALL_LOCALSTATEDIR}/log/vscp/
DIRECTORY_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
# The VSCP daemon executable
install(TARGETS vscpd
RUNTIME DESTINATION
${CMAKE_INSTALL_SBINDIR})
# Password generation
# install(TARGETS vscp-mkpasswd
# RUNTIME DESTINATION
# ${CMAKE_INSTALL_BINDIR})
# The VSCP daemon systemctl service file
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/resources/linux/vscpd.service
DESTINATION ${CMAKE_INSTALL_LIBDIR}/systemd/system/)
# Default configuration file
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/resources/linux/vscpd.json
DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/vscp/
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
# Default encryption key
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/resources/vscp.key
DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/vscp/
PERMISSIONS OWNER_READ OWNER_WRITE)
# Readme for certs
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/resources/README-certs
DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/vscp/certs/
PERMISSIONS OWNER_READ OWNER_WRITE)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/resources/README-ca-certificates
DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/vscp/ca-certificates/
PERMISSIONS OWNER_READ OWNER_WRITE)
# Database
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/resources/database/vscp_events.sqlite3
DESTINATION ${CMAKE_INSTALL_LOCALSTATEDIR}/lib/vscp/vscpd/
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ GROUP_WRITE WORLD_READ)
# Scripts
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/resources/linux/vscp_eth_to_guid
${CMAKE_CURRENT_SOURCE_DIR}/resources/linux/download-event-db
DESTINATION ${CMAKE_INSTALL_BINDIR}
PERMISSIONS OWNER_READ OWNER_WRITE)
#SET(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA
# "${CMAKE_CURRENT_SOURCE_DIR}/prerm;${CMAKE_CURRENT_SOURCE_DIR}/postrm;${CMAKE_CURRENT_SOURCE_DIR}/files")
# enable start/restart vscpd service
#install(CODE "execute_process(COMMAND systemctl stop vscpd && systemctl enable vscpd && service vscpd start)")
endif()