Skip to content

Commit

Permalink
systemd install compatibility tryout
Browse files Browse the repository at this point in the history
  • Loading branch information
nickma82 committed Dec 3, 2017
1 parent fc3a976 commit 0936eeb
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,14 @@ install(
DESTINATION ${CMAKE_INSTALL_FULL_SYSCONFDIR}/${CMAKE_PROJECT_NAME}
)

# aggregate mbusd@.service from its template
if(IS_DIRECTORY /usr/lib/systemd/system)
find_package(PkgConfig)
pkg_check_modules(SystemD "systemd")
if(SystemD_FOUND)
message("found SystemD")

# aggregate mbusd@.service from its template
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/systemd-units/mbusd@.service.in mbusd@.service)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/mbusd@.service DESTINATION /usr/lib/systemd/system)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/mbusd@.service DESTINATION /lib/systemd/system)
endif()

# uninstall target
Expand Down

0 comments on commit 0936eeb

Please sign in to comment.