Respect GNUInstallDirs

This allows packagers to set the proper directories to install stuff
too using CMAKE_INSTALL_PREFIX, CMAKE_INSTALL_LIBDIR, etc.

Also make installing systemd unit files optional, for systemd without
systemd, but enable them by default
pull/1/head
Bart Ribbers 5 years ago
parent 87e8190d44
commit 75aafafa6e
No known key found for this signature in database
GPG Key ID: 699D16185DAFAE61

@ -3,6 +3,11 @@ project(Applauncherd)
cmake_minimum_required(VERSION 2.6)
cmake_policy(VERSION 2.6)
include(FeatureSummary)
include(GNUInstallDirs)
option(INSTALL_SYSTEMD_UNITS "Install systemd unit files" ON)
#
# NOTE: For verbose build use VERBOSE=1
#
@ -56,6 +61,6 @@ else (EXISTS ${Doxygen})
endif (EXISTS ${Doxygen})
# Install html documentation
install(DIRECTORY doc/implementation-documentation DESTINATION /usr/share/doc/applauncherd OPTIONAL)
install(DIRECTORY doc/user-documentation DESTINATION /usr/share/doc/applauncherd OPTIONAL)
install(DIRECTORY doc/mdeclarativecache-documentation DESTINATION /usr/share/doc/applauncherd OPTIONAL)
install(DIRECTORY doc/implementation-documentation DESTINATION ${CMAKE_INSTALL_FULL_DOCDIR} OPTIONAL)
install(DIRECTORY doc/user-documentation DESTINATION ${CMAKE_INSTALL_FULL_DOCDIR} OPTIONAL)
install(DIRECTORY doc/mdeclarativecache-documentation DESTINATION ${CMAKE_INSTALL_FULL_DOCDIR} OPTIONAL)

@ -17,5 +17,8 @@ add_executable(booster-generic ${SRC} ${MOC_SRC})
add_dependencies(booster-generic applauncherd)
# Add install rule
install(TARGETS booster-generic DESTINATION /usr/libexec/mapplauncherd/)
install(FILES booster-generic.service DESTINATION /usr/lib/systemd/user/)
install(TARGETS booster-generic DESTINATION ${CMAKE_INSTALL_FULL_LIBEXECDIR}/mapplauncherd/)
if(INSTALL_SYSTEMD_UNITS)
install(FILES booster-generic.service DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/systemd/user/)
endif()

@ -19,6 +19,4 @@ add_executable(invoker ${SRC})
target_link_libraries(invoker ${DBUS_LDFLAGS})
# Add install rule
install(TARGETS invoker DESTINATION /usr/bin/)
install(TARGETS invoker DESTINATION ${CMAKE_INSTALL_FULL_BINDIR})

@ -32,5 +32,5 @@ target_link_libraries(applauncherd ${SYSTEMD_LIBRARIES})
# Add install rule
install(TARGETS applauncherd DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR})
install(FILES ${HEADERS} DESTINATION /usr/include/applauncherd
install(FILES ${HEADERS} DESTINATION ${CMAKE_INSTALL_FULL_INCLUDEDIR}/applauncherd
PERMISSIONS OWNER_READ GROUP_READ WORLD_READ)

@ -26,4 +26,4 @@ link_libraries(${DBUS_LDFLAGS})
add_executable(single-instance ${SRC})
# Add install rule
install(TARGETS single-instance DESTINATION /usr/bin/)
install(TARGETS single-instance DESTINATION ${CMAKE_INSTALL_FULL_BINDIR})

Loading…
Cancel
Save