Added cmake installation path to systemd service files installation.
[profile/ivi/dlt-daemon.git] / systemd / CMakeLists.txt
1 #######
2 # Dlt - Diagnostic Log and Trace
3 # @licence make begin@
4 #
5 # Copyright (C) 2011-2012, BMW AG - Alexander Wenzel <alexander.aw.wenzel@bmw.de>
6
7 # Contributions are licensed to the GENIVI Alliance under one or more
8 # Contribution License Agreements.
9
10 # This Source Code Form is subject to the terms of the
11 # Mozilla Public License, v. 2.0. If a  copy of the MPL was not distributed with
12 # this file, You can obtain one at http://mozilla.org/MPL/2.0/.
13 #
14 # @licence end@
15 ########
16
17 if(WITH_SYSTEMD)
18
19     set(SYSTEMD_CONFIGURATIONS_FILES_DIR ${CMAKE_INSTALL_PREFIX}/lib/systemd/system )
20         
21     if(WITH_SYSTEMD_WATCHDOG)
22         set( DLT_WatchdogSec 2 )
23         message( STATUS "The systemd watchdog is enabled - timeout is set to ${DLT_WatchdogSec} seconds")
24     else(WITH_SYSTEMD_WATCHDOG) 
25         set( DLT_WatchdogSec 0 )
26         message( STATUS "The systemd watchdog is disabled")
27     endif(WITH_SYSTEMD_WATCHDOG)
28     
29     configure_file(${CMAKE_SOURCE_DIR}/systemd/dlt.service.cmake ${PROJECT_BINARY_DIR}/systemd/dlt.service)
30     message( STATUS "Configured systemd unit file:dlt.service" )
31     
32     configure_file(${CMAKE_SOURCE_DIR}/systemd/dlt-system.service.cmake ${PROJECT_BINARY_DIR}/systemd/dlt-system.service)
33     message( STATUS "Configured systemd unit file:dlt-system.service" )
34     
35     configure_file(${CMAKE_SOURCE_DIR}/systemd/dlt-receive.service.cmake ${PROJECT_BINARY_DIR}/systemd/dlt-receive.service)
36     message( STATUS "Configured systemd unit file:dlt-receive.service" )
37     
38     configure_file(${CMAKE_SOURCE_DIR}/systemd/dlt-example-user.service.cmake ${PROJECT_BINARY_DIR}/systemd/dlt-example-user.service)
39     message( STATUS "Configured systemd unit file:dlt-example-user.service" )
40     
41     set( DLT_ADAPTOR_UDP_APPID "DUDP" )
42     set( DLT_ADAPTOR_UDP_CTID "DCTI" )
43     set( DLT_ADAPTOR_UDP_PORT 4712 )
44     configure_file(${CMAKE_SOURCE_DIR}/systemd/dlt-adaptor-udp.service.cmake ${PROJECT_BINARY_DIR}/systemd/dlt-adaptor-udp.service)
45     message( STATUS "Configured systemd unit file:dlt-adaptor-udp.service" )
46     message(STATUS "DLT adaptor udp configuration: APPID=${DLT_ADAPTOR_UDP_APPID} CTID=${DLT_ADAPTOR_UDP_CTID} PORT=${DLT_ADAPTOR_UDP_PORT}" )
47     
48     
49     install(FILES ${PROJECT_BINARY_DIR}/systemd/dlt.service DESTINATION ${SYSTEMD_CONFIGURATIONS_FILES_DIR} )
50     install(FILES ${PROJECT_BINARY_DIR}/systemd/dlt-system.service DESTINATION ${SYSTEMD_CONFIGURATIONS_FILES_DIR} )
51     install(FILES ${PROJECT_BINARY_DIR}/systemd/dlt-receive.service DESTINATION ${SYSTEMD_CONFIGURATIONS_FILES_DIR} )
52     install(FILES ${PROJECT_BINARY_DIR}/systemd/dlt-example-user.service DESTINATION ${SYSTEMD_CONFIGURATIONS_FILES_DIR} )
53     install(FILES ${PROJECT_BINARY_DIR}/systemd/dlt-adaptor-udp.service DESTINATION ${SYSTEMD_CONFIGURATIONS_FILES_DIR} )
54     message(STATUS "Unit files will be installed to ${SYSTEMD_CONFIGURATIONS_FILES_DIR} after make install" )
55      
56 endif(WITH_SYSTEMD)