diff options
| author | Sebastien Braun | 2010-10-06 15:13:31 +0200 |
|---|---|---|
| committer | Sebastien Braun | 2010-10-06 15:13:31 +0200 |
| commit | c8579de3b79b64bcb72adfd97d2ebf424e8df4b7 (patch) | |
| tree | 7a17024762217daec3c1f04384324091f40abaf5 /src/input/CMakeLists.txt | |
| parent | Fix deletion order bug (diff) | |
| download | pvs-c8579de3b79b64bcb72adfd97d2ebf424e8df4b7.tar.gz pvs-c8579de3b79b64bcb72adfd97d2ebf424e8df4b7.tar.xz pvs-c8579de3b79b64bcb72adfd97d2ebf424e8df4b7.zip | |
Detect the presence of PolKit on configuration
When no PolKit is installed, the program gets built without support
for it. This can be overriden by specifying -DENABLE_POLKIT=ON on
the cmake command line.
Diffstat (limited to 'src/input/CMakeLists.txt')
| -rw-r--r-- | src/input/CMakeLists.txt | 21 |
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( |
