diff mbox series

[v2,16/23] kernel-shark-qt: Instruct CMake to search for "pkexec"

Message ID 20181016155232.5257-17-ykaradzhov@vmware.com (mailing list archive)
State Accepted
Headers show
Series Add Qt-based GUI for KernelShark | expand

Commit Message

Yordan Karadzhov Oct. 16, 2018, 3:53 p.m. UTC
From: Yordan Karadzhov (VMware) <y.karadz@gmail.com>

CMake will search for "pkexec" and if it is found will add a line

to the CMake-generated header file.

Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
---
 kernel-shark-qt/build/deff.h.cmake | 3 +++
 kernel-shark-qt/src/CMakeLists.txt | 2 ++
 2 files changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/kernel-shark-qt/build/deff.h.cmake b/kernel-shark-qt/build/deff.h.cmake
index d1a1bb7..80d624c 100644
--- a/kernel-shark-qt/build/deff.h.cmake
+++ b/kernel-shark-qt/build/deff.h.cmake
@@ -20,6 +20,9 @@ 
 /** Location of the trace-cmd executable. */
 #cmakedefine TRACECMD_BIN_DIR "@TRACECMD_BIN_DIR@"
 
+/** "pkexec" executable. */
+#cmakedefine DO_AS_ROOT "@DO_AS_ROOT@"
+
 #ifdef __cplusplus
 
 	#include <QString>
diff --git a/kernel-shark-qt/src/CMakeLists.txt b/kernel-shark-qt/src/CMakeLists.txt
index 3b47ce1..6819f86 100644
--- a/kernel-shark-qt/src/CMakeLists.txt
+++ b/kernel-shark-qt/src/CMakeLists.txt
@@ -77,5 +77,7 @@  endif (Qt5Widgets_FOUND AND Qt5Network_FOUND)
 
 add_subdirectory(plugins)
 
+find_program(DO_AS_ROOT pkexec)
+
 configure_file( ${KS_DIR}/build/deff.h.cmake
                 ${KS_DIR}/src/KsCmakeDef.hpp)