summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2016-01-13 19:44:58 +0100
committerFlorent Le Coz <louiz@louiz.org>2016-01-13 14:01:04 +0100
commit25475b60ab363299ddbe5e81ded8968b76838b44 (patch)
treea081ed2c3e99fa9c3f6727457fbe10fbdc86ba43 /CMakeLists.txt
parent4233e1f6538351e3bf3c15c88454455998b718e5 (diff)
downloadbiboumi-25475b60ab363299ddbe5e81ded8968b76838b44.tar.gz
biboumi-25475b60ab363299ddbe5e81ded8968b76838b44.tar.bz2
biboumi-25475b60ab363299ddbe5e81ded8968b76838b44.tar.xz
biboumi-25475b60ab363299ddbe5e81ded8968b76838b44.zip
Generate systemd file from template and make installs it and the conf
The unit file Type=, as well as the executable path should now be correct with a simple “make install”, whatever the install prefix and the DESTDIR values are. ref #3152
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt18
1 files changed, 12 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7c27477..3ff7be6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -200,11 +200,10 @@ endif()
#
## Install target
#
-install(TARGETS ${PROJECT_NAME}
- RUNTIME DESTINATION bin)
-if(WITH_DOC)
- install(FILES ${MAN_PAGE} DESTINATION share/man/man1 OPTIONAL)
-endif()
+install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION bin)
+install(FILES ${MAN_PAGE} DESTINATION share/man/man1 OPTIONAL COMPONENT documentation)
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/biboumi.service DESTINATION /etc/systemd/system COMPONENT init)
+install(FILES conf/biboumi.cfg DESTINATION /etc/biboumi COMPONENT configuration)
#
## Dist target
@@ -228,4 +227,11 @@ endif()
add_custom_target(PrintBuildParameters ALL
${CMAKE_COMMAND} -E cmake_echo_color --cyan "Compiling ${PROJECT_NAME} with ${STR_WITH_BOTAN}, ${STR_WITH_CARES}")
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/biboumi.h.cmake ${CMAKE_BINARY_DIR}/src/biboumi.h)
+configure_file(biboumi.h.cmake src/biboumi.h)
+
+if(SYSTEMD_FOUND)
+ set(SYSTEMD_SERVICE_TYPE "notify")
+else()
+ set(SYSTEMD_SERVICE_TYPE "simple")
+endif()
+configure_file(unit/biboumi.service.cmake biboumi.service)