aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2013-06-20 14:43:23 -0500
committerCharles Kerr <charles.kerr@canonical.com>2013-06-20 14:43:23 -0500
commita5fb857ee48a9022eb1e6c9ea04e0aeff80f445b (patch)
tree39875a1ae2657e2a2a543150686347c769ddfb83 /CMakeLists.txt
parent22e72bb60a789ba3a48aff737c8816908695b408 (diff)
downloadayatana-indicator-session-a5fb857ee48a9022eb1e6c9ea04e0aeff80f445b.tar.gz
ayatana-indicator-session-a5fb857ee48a9022eb1e6c9ea04e0aeff80f445b.tar.bz2
ayatana-indicator-session-a5fb857ee48a9022eb1e6c9ea04e0aeff80f445b.zip
cmake work: properly generate and install the .service file for dbus activation
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt18
1 files changed, 17 insertions, 1 deletions
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)