This repository has been archived by the owner on Dec 17, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 78
/
CMakeLists.txt
82 lines (65 loc) · 2.42 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
OPTION(ENABLE_POLICYKIT "Enable policykit integration" ON)
if (ENABLE_POLICYKIT)
find_package(PolkitQt-1)
if (NOT POLKITQT-1_LIB_DIR AND NOT POLKITQT-1_INCLUDE_DIR)
message(WARNING "Qt bindings for policykit are not found. Razor policykit integration won't be built")
message(STATUS "Hint: package libpolkit-qt-1-devel on openSUSE")
else ()
project(razor-policykit-agent)
message(STATUS "PolkitQt-1: ${POLKITQT-1_VERSION_STRING}")
message(STATUS " libs: ${POLKITQT-1_CORE_LIBRARY} ${POLKITQT-1_AGENT_LIBRARY}")
message(STATUS " include: ${POLKITQT-1_INCLUDE_DIR}")
find_package(PkgConfig)
pkg_check_modules(POLKIT_AGENT REQUIRED polkit-agent-1)
message(STATUS "polkit agent: ${POLKIT_AGENT_INCLUDE_DIRS} ${POLKIT_AGENT_LIBRARIES}")
# TODO/FIXME: pkg-config for hardcoded paths
# pkg-config --cflags glib-2.0
# pkg-config --cflags polkit-agent-1
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/src
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_SOURCE_DIR}/libraries
${POLKIT_AGENT_INCLUDE_DIRS}
${POLKITQT-1_INCLUDE_DIR}
)
set(razor-policykit-agent_SRCS
src/main.cpp
src/policykitagent.cpp
src/policykitagentgui.cpp
)
set(razor-policykit-agent_H
src/policykitagent.h
src/policykitagentgui.h
)
set(razor-policykit-agent_UI
src/policykitagentgui.ui
)
# Translations **********************************
include(RazorTranslate)
razor_translate_ts(razor-policykit-agent_QM_FILES
SOURCES
${razor-policykit-agent_H}
${razor-policykit-agent_SRCS}
${razor-policykit-agent_UI}
)
#************************************************
QT4_WRAP_CPP(razor-policykit-agent_MOCS ${razor-policykit-agent_H})
QT4_WRAP_UI(razor-policykit-agent_UI_CPP ${razor-policykit-agent_UI})
add_executable(razor-policykit-agent
${razor-policykit-agent_SRCS}
${razor-policykit-agent_MOCS}
${razor-policykit-agent_UI_CPP}
${razor-policykit-agent_QM_FILES}
)
target_link_libraries(razor-policykit-agent
${QT_QTCORE_LIBRARY}
${QT_QTGUI_LIBRARY}
${POLKITQT-1_CORE_LIBRARY}
${POLKITQT-1_AGENT_LIBRARY}
${POLKIT_AGENT_LIBRARIES}
qtxdg razorqt
)
# install
install(TARGETS razor-policykit-agent DESTINATION bin)
endif()
endif (ENABLE_POLICYKIT)