@@ -23,6 +23,8 @@ add_definitions("-DCOMPTON_VERSION=${COMPTON_VERSION}")
23
23
24
24
# == Options ==
25
25
26
+ include(CMakeDependentOption)
27
+
26
28
option(CONFIG_REGEX_PCRE "Enable PCRE regular expression support for blacklist entries (requires libpcre)" ON)
27
29
if (CONFIG_REGEX_PCRE)
28
30
add_definitions("-DCONFIG_REGEX_PCRE")
@@ -49,16 +51,43 @@ if (CONFIG_VSYNC_OPENGL)
49
51
list(APPEND compton_SRCS src/opengl.c)
50
52
endif ()
51
53
52
- option(CONFIG_VSYNC_OPENGL_GLSL "Enable GLSL" ON)
54
+ CMAKE_DEPENDENT_OPTION(CONFIG_VSYNC_OPENGL_GLSL
55
+ "Enable GLSL support (GLX background blur, etc.)" ON
56
+ "CONFIG_VSYNC_OPENGL" OFF)
53
57
if (CONFIG_VSYNC_OPENGL_GLSL)
54
58
add_definitions("-DCONFIG_VSYNC_OPENGL_GLSL")
55
59
endif ()
56
60
61
+ CMAKE_DEPENDENT_OPTION(CONFIG_VSYNC_OPENGL_FBO
62
+ "Enable OpenGL FBO support (GLX multi-pass blur, etc.)" ON
63
+ "CONFIG_VSYNC_OPENGL" OFF)
64
+ if (CONFIG_VSYNC_OPENGL_FBO)
65
+ add_definitions("-DCONFIG_VSYNC_OPENGL_FBO")
66
+ endif ()
67
+
68
+ CMAKE_DEPENDENT_OPTION(CONFIG_VSYNC_OPENGL_VBO
69
+ "Enable OpenGL VBO support (does nothing right now)" ON
70
+ "CONFIG_VSYNC_OPENGL" OFF)
71
+ if (CONFIG_VSYNC_OPENGL_VBO)
72
+ add_definitions("-DCONFIG_VSYNC_OPENGL_VBO")
73
+ endif ()
74
+
57
75
option(CONFIG_XINERAMA "Enable additional Xinerama features" ON)
58
76
if (CONFIG_XINERAMA)
59
77
add_definitions("-DCONFIG_XINERAMA")
60
78
endif ()
61
79
80
+ option(CONFIG_DBUS "Enable D-Bus support" ON)
81
+ if (CONFIG_DBUS)
82
+ add_definitions("-DCONFIG_DBUS")
83
+ list(APPEND compton_SRCS src/dbus.c)
84
+ endif ()
85
+
86
+ option(CONFIG_XSYNC "Enable X Sync support (X Sync fence)" ON)
87
+ if (CONFIG_XSYNC)
88
+ add_definitions("-DCONFIG_XSYNC")
89
+ endif ()
90
+
62
91
option(CONFIG_C2 "Enable matching system" ON)
63
92
if (CONFIG_C2)
64
93
add_definitions("-DCONFIG_C2")
@@ -85,10 +114,10 @@ macro(X11LIB_CHK lib)
85
114
if (NOT X11_${lib}_FOUND)
86
115
message(FATAL_ERROR "Could not find lib${lib}.")
87
116
endif ()
88
- target_link_libraries(compton " ${X11_${lib}_LIB}" )
117
+ target_link_libraries(compton ${X11_${lib}_LIB})
89
118
endmacro ()
90
119
91
- target_link_libraries(compton " ${X11_X11_LIB}" )
120
+ target_link_libraries(compton ${X11_X11_LIB})
92
121
X11LIB_CHK(Xcomposite)
93
122
X11LIB_CHK(Xdamage)
94
123
X11LIB_CHK(Xext)
@@ -102,26 +131,33 @@ endif ()
102
131
# --- Find libpcre ---
103
132
if (CONFIG_REGEX_PCRE)
104
133
pkg_check_modules(LIBPCRE REQUIRED libpcre>=8.12)
105
- add_definitions(" ${LIBPCRE_CFLAGS}" )
106
- target_link_libraries(compton " ${LIBPCRE_LDFLAGS}" )
134
+ add_definitions(${LIBPCRE_CFLAGS})
135
+ target_link_libraries(compton ${LIBPCRE_LDFLAGS})
107
136
endif ()
108
137
109
138
# --- Find libconfig ---
110
139
if (CONFIG_LIBCONFIG)
111
140
pkg_check_modules(LIBCONFIG REQUIRED libconfig>=1.3.2)
112
- add_definitions(" ${LIBCONFIG_CFLAGS}" )
113
- target_link_libraries(compton " ${LIBCONFIG_LDFLAGS}" )
141
+ add_definitions(${LIBCONFIG_CFLAGS})
142
+ target_link_libraries(compton ${LIBCONFIG_LDFLAGS})
114
143
if (LIBCONFIG_VERSION VERSION_LESS 1.4)
115
- add_definitions(" -DCONFIG_LIBCONFIG_LEGACY" )
144
+ add_definitions(-DCONFIG_LIBCONFIG_LEGACY)
116
145
message(STATUS "libconfig-1.3* detected. Enable legacy mode.")
117
146
endif ()
118
147
endif ()
119
148
149
+ # --- Find libdbus ---
150
+ if (CONFIG_DBUS)
151
+ pkg_check_modules(DBUS REQUIRED dbus-1)
152
+ add_definitions(${DBUS_CFLAGS})
153
+ target_link_libraries(compton ${DBUS_LDFLAGS})
154
+ endif ()
155
+
120
156
# --- Find libdrm ---
121
157
if (CONFIG_VSYNC_DRM)
122
158
pkg_check_modules(LIBDRM REQUIRED libdrm)
123
159
# We only use its header file
124
- add_definitions(" ${LIBDRM_CFLAGS}" )
160
+ add_definitions(${LIBDRM_CFLAGS})
125
161
endif ()
126
162
127
163
# == Install ==
0 commit comments