This repository has been archived by the owner on Nov 20, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 40
/
CMakeLists.txt
140 lines (114 loc) · 4.15 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
cmake_minimum_required(VERSION 3.0)
set(LIGHTLYSHADERS kwin4_effect_lightlyshaders)
project(${LIGHTLYSHADERS})
set(QT_MIN_VERSION "5.4.0")
set(KF5_MIN_VERSION "5.9.0")
find_package(ECM REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS
Gui
Core
DBus
UiTools
Widgets
X11Extras
OpenGL
Network
Xml
)
include_directories(${Qt5Widgets_INCLUDE_DIRS} ${Qt5X11Extras_INCLUDE_DIRS} ${Qt5Network_INCLUDE_DIRS} ${Qt5OpenGL_INCLUDE_DIRS} ${Qt5Xml_INCLUDE_DIRS})
add_definitions(${Qt5Widgets_DEFINITIONS})
include(KDEInstallDirs)
include(KDECMakeSettings)
include(KDECompilerSettings)
# required frameworks by Core
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
Config
ConfigWidgets
CoreAddons
Crash
GlobalAccel
I18n
KIO
Service
Init
Notifications
Service
WidgetsAddons
WindowSystem
GuiAddons
)
find_package(X11 REQUIRED)
find_package(XCB REQUIRED)
execute_process(COMMAND kf5-config --install module OUTPUT_VARIABLE MODULEPATH OUTPUT_STRIP_TRAILING_WHITESPACE)
find_path(EFFECTS_H kwineffects.h PATH_SUFFIXES kf5)
if (EFFECTS_H)
include_directories(${EFFECTS_H})
else (EFFECTS_H)
message(STATUS "didnt find kwineffects.h, not building effects")
endif (EFFECTS_H)
find_library(KWIN_EFFECTS NAMES kwineffects PATH_SUFFIXES kf5)
find_library(KWIN_GLUTILS NAMES kwinglutils PATH_SUFFIXES kf5)
find_library(OPENGL NAMES GL)
if (NOT KWIN_EFFECTS)
message(STATUS "didnt find kwineffects lib, not building effects")
endif (NOT KWIN_EFFECTS)
if (NOT KWIN_GLUTILS)
message(STATUS "didnt find kwin glutils lib, not building effects")
endif (NOT KWIN_GLUTILS)
if (NOT OPENGL)
message(STATUS "didnt find opengl, not building effects")
endif (NOT OPENGL)
if (NOT EFFECTS_H OR NOT KWIN_GLUTILS OR NOT KWIN_EFFECTS OR NOT OPENGL)
message(FATAL_ERROR "cant continue")
endif (NOT EFFECTS_H OR NOT KWIN_GLUTILS OR NOT KWIN_EFFECTS OR NOT OPENGL)
add_library(${LIGHTLYSHADERS} MODULE lightlyshaders.cpp dbus.h)
target_link_libraries(${LIGHTLYSHADERS}
PUBLIC
Qt5::Core
Qt5::Gui
Qt5::DBus
${KWIN_EFFECTS}
${KWIN_GLUTILS}
epoxy
GL
PRIVATE
KF5::ConfigCore
KF5::CoreAddons
KF5::ConfigWidgets
KF5::GuiAddons
KF5::WindowSystem
)
if (XCB_FOUND)
target_link_libraries(${LIGHTLYSHADERS} PUBLIC Qt5::X11Extras XCB::XCB)
else (XCB_FOUND)
if (X11_FOUND)
target_link_libraries(${LIGHTLYSHADERS} PUBLIC ${X11_X11_LIB} ${X11_LIBRARIES})
endif (X11_FOUND)
endif (XCB_FOUND)
#kcoreaddons_desktop_to_json(${LIGHTLYSHADERS} lightlyshaders.desktop)
install(TARGETS ${LIGHTLYSHADERS} DESTINATION ${MODULEPATH}/kwin/effects/plugins)
# execute_process(COMMAND kf5-config --install services OUTPUT_VARIABLE SERVICEPATH OUTPUT_STRIP_TRAILING_WHITESPACE)
#install(FILES lightlyshaders.desktop DESTINATION ${SERVICEPATH}/kwin)
execute_process(COMMAND kf5-config --install data OUTPUT_VARIABLE DATAPATH OUTPUT_STRIP_TRAILING_WHITESPACE)
install(FILES shaders_140/lightlyshaders.frag DESTINATION ${DATAPATH}/kwin/shaders/1.40)
install(FILES shaders_110/lightlyshaders.frag DESTINATION ${DATAPATH}/kwin/shaders/1.10)
#config
project(kwin4_lightlyshaders_config)
set(kwin4_lightlyshaders_config_SOURCES lightlyshaders_config.cpp)
ki18n_wrap_ui(kwin4_lightlyshaders_config_SOURCES lightlyshaders_config.ui)
qt5_add_dbus_interface(kwin4_lightlyshaders_config_SOURCES org.kde.kwin.Effects.xml kwineffects_interface)
add_library(kwin4_lightlyshaders_config MODULE ${kwin4_lightlyshaders_config_SOURCES})
target_link_libraries(kwin4_lightlyshaders_config
PUBLIC
kwineffects
Qt5::Widgets
PRIVATE
KF5::ConfigWidgets
KF5::WindowSystem
KF5::I18n
KF5::GlobalAccel
)
kcoreaddons_desktop_to_json(kwin4_lightlyshaders_config lightlyshaders_config.desktop)
install(TARGETS kwin4_lightlyshaders_config DESTINATION ${MODULEPATH}/kwin/effects/configs)
install(FILES lightlyshaders_config.desktop DESTINATION ${SERVICES_INSTALL_DIR}/kwin)