summaryrefslogtreecommitdiffstats
path: root/src/input/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'src/input/CMakeLists.txt')
-rw-r--r--src/input/CMakeLists.txt21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/input/CMakeLists.txt b/src/input/CMakeLists.txt
index fcb5ff5..44cf6b6 100644
--- a/src/input/CMakeLists.txt
+++ b/src/input/CMakeLists.txt
@@ -57,6 +57,27 @@ if(UNIX)
x11FakeMouseHandler.cpp
privilegedHandlerForwarder.cpp
)
+
+ # we need pkg-config to find out where to install the action file:
+ find_package(PkgConfig)
+ if(NOT PKG_CONFIG_FOUND)
+ # we will try to make a best effort and put our policy file into
+ # ${PREFIX}/share/polkit-1, but only if we can find
+ # the pkexec executable.
+ find_program(PKEXEC_LOCATION pkexec)
+ if(PKEXEC_LOCATION OR ENABLE_POLKIT)
+ set(POLKIT_FOUND ON)
+ endif()
+ else()
+ pkg_check_modules(POLKIT "polkit-gobject-1")
+ endif()
+
+ # now, arrange for policykit integration:
+ if(POLKIT_FOUND OR ENABLE_POLKIT)
+ set_property(SOURCE ${pvsprivinputd_SRCS}
+ APPEND
+ PROPERTY COMPILE_DEFINITIONS HAVE_POLKIT)
+ endif()
endif()
add_library(