summaryrefslogtreecommitdiffstats
path: root/src/input/CMakeLists.txt
diff options
context:
space:
mode:
authorSebastien Braun2010-10-06 15:17:40 +0200
committerSebastien Braun2010-10-06 15:17:40 +0200
commitdce35518d9b91b1bac0394792f83450fbe4aa3bc (patch)
tree42b966e7aa0984bfbddbd8d8b7a7923c780be86d /src/input/CMakeLists.txt
parentDetect the presence of PolKit on configuration (diff)
downloadpvs-dce35518d9b91b1bac0394792f83450fbe4aa3bc.tar.gz
pvs-dce35518d9b91b1bac0394792f83450fbe4aa3bc.tar.xz
pvs-dce35518d9b91b1bac0394792f83450fbe4aa3bc.zip
Install PolKit policy file
and try to detect the policy directory.
Diffstat (limited to 'src/input/CMakeLists.txt')
-rw-r--r--src/input/CMakeLists.txt19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/input/CMakeLists.txt b/src/input/CMakeLists.txt
index 44cf6b6..0cf5177 100644
--- a/src/input/CMakeLists.txt
+++ b/src/input/CMakeLists.txt
@@ -67,16 +67,35 @@ if(UNIX)
find_program(PKEXEC_LOCATION pkexec)
if(PKEXEC_LOCATION OR ENABLE_POLKIT)
set(POLKIT_FOUND ON)
+ set(POLKIT_PREFIX ${CMAKE_INSTALL_PREFIX})
+ set(POLKIT_POLICY_DIR ${POLKIT_PREFIX}/share/polkit-1/actions)
endif()
else()
pkg_check_modules(POLKIT "polkit-gobject-1")
+ if(POLKIT_FOUND)
+ execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE} polkit-gobject-1 --variable=policydir
+ OUTPUT_VARIABLE POLKIT_POLICY_DIR
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+ if(NOT POLKIT_POLICY_DIR)
+ set(POLKIT_FOUND OFF)
+ endif()
+ endif()
endif()
# now, arrange for policykit integration:
if(POLKIT_FOUND OR ENABLE_POLKIT)
+ if(NOT POLKIT_POLICY_DIR)
+ message(SEND_ERROR "PolicyKit integration is enabled, but cannot find PolicyKit's actions directory. Please set POLKIT_POLICY_DIR to the right value")
+ endif()
+
+ install(FILES org.openslx.pvs.input.policy
+ DESTINATION ${POLKIT_POLICY_DIR})
set_property(SOURCE ${pvsprivinputd_SRCS}
APPEND
PROPERTY COMPILE_DEFINITIONS HAVE_POLKIT)
+ message(STATUS "PolicyKit integration: enabled")
+ else()
+ message(STATUS "PolicyKit integration: disabled")
endif()
endif()