From a5fb857ee48a9022eb1e6c9ea04e0aeff80f445b Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Thu, 20 Jun 2013 14:43:23 -0500 Subject: cmake work: properly generate and install the .service file for dbus activation --- CMakeLists.txt | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 5f04214..f656cb4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,9 +10,10 @@ set (GETTEXT_PACKAGE ${CMAKE_PROJECT_NAME}) option (enable_tests "Build the package's automatic tests." ON) option (full_warnings "Full compiler warnings." ON) option (enable_lcov "Generate lcov code coverage reports." ON) - +option (LOCAL_INSTALL "Support local installation." OFF) find_package(PkgConfig REQUIRED) +include (GNUInstallDirs) include (FindPkgConfig) include (GdbusCodegen) include (GSettings) @@ -44,6 +45,21 @@ add_custom_target (cppcheck COMMAND cppcheck --enable=all -q --error-exitcode=2 include_directories (${CMAKE_CURRENT_SOURCE_DIR}/src) include_directories (${CMAKE_CURRENT_BINARY_DIR}/src) +# Workaround for libexecdir on debian +if (EXISTS "/etc/debian_version") + set(CMAKE_INSTALL_LIBEXECDIR ${CMAKE_INSTALL_LIBDIR}) + set(CMAKE_INSTALL_FULL_LIBEXECDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBEXECDIR}") +endif() +message("Installing libexec files to ${CMAKE_INSTALL_FULL_LIBEXECDIR}") + +if(${LOCAL_INSTALL}) + set(DBUSSERVICEDIR "${CMAKE_INSTALL_DATADIR}/dbus-1/services/") +else() + EXEC_PROGRAM(${PKG_CONFIG_EXECUTABLE} ARGS dbus-1 --variable session_bus_services_dir OUTPUT_VARIABLE DBUSSERVICEDIR ) +endif() +message("Installing DBus services to ${DBUSSERVICEDIR}") + + add_subdirectory (src) add_subdirectory (data) add_subdirectory (po) -- cgit v1.2.3