This repository has been archived by the owner on Oct 23, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathCMakeLists.txt
118 lines (94 loc) · 3.22 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
cmake_minimum_required(VERSION 3.0)
set(SHAPECORNERS kwin4_effect_shapecorners)
project(${SHAPECORNERS})
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(${SHAPECORNERS} MODULE shapecorners.cpp)
target_link_libraries(${SHAPECORNERS}
PUBLIC
Qt5::Core
Qt5::Gui
${KWIN_EFFECTS}
${KWIN_GLUTILS}
epoxy
GL
PRIVATE
KF5::ConfigCore
KF5::CoreAddons
KF5::ConfigWidgets
KF5::GuiAddons
KF5::WindowSystem
)
if (XCB_FOUND)
target_link_libraries(${SHAPECORNERS} PUBLIC Qt5::X11Extras XCB::XCB)
else (XCB_FOUND)
if (X11_FOUND)
target_link_libraries(${SHAPECORNERS} PUBLIC ${X11_X11_LIB} ${X11_LIBRARIES})
endif (X11_FOUND)
endif (XCB_FOUND)
#kcoreaddons_desktop_to_json(${SHAPECORNERS} shapecorners.desktop)
install(TARGETS ${SHAPECORNERS} DESTINATION ${MODULEPATH}/kwin/effects/plugins)
# execute_process(COMMAND kf5-config --install services OUTPUT_VARIABLE SERVICEPATH OUTPUT_STRIP_TRAILING_WHITESPACE)
#install(FILES shapecorners.desktop DESTINATION ${SERVICEPATH}/kwin)
execute_process(COMMAND kf5-config --install data OUTPUT_VARIABLE DATAPATH OUTPUT_STRIP_TRAILING_WHITESPACE)
install(FILES shaders_140/shapecorners.frag DESTINATION ${DATAPATH}/kwin/shaders/1.40)
install(FILES shaders_110/shapecorners.frag DESTINATION ${DATAPATH}/kwin/shaders/1.10)