summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Golubev <fatzer2@gmail.com>2014-04-07 00:10:55 +0400
committerSlávek Banko <slavek.banko@axis.cz>2014-04-29 01:51:47 +0200
commit394545c24c0e31d84ccb3d008c8da7c2e1f06451 (patch)
tree0fe738e30697871f9c3749de1641747aad2c8df8
parent63dd66d0459abfa98d6e6eeec40fa4efd285a074 (diff)
downloadtdebase-394545c24c0e31d84ccb3d008c8da7c2e1f06451.tar.gz
tdebase-394545c24c0e31d84ccb3d008c8da7c2e1f06451.zip
twin/compton-tde: transparent pass TDE build-time configure options to compot-tde
-rw-r--r--CMakeLists.txt3
-rw-r--r--ConfigureChecks.cmake20
-rw-r--r--twin/compton-tde/CMakeLists.txt85
-rw-r--r--twin/compton-tde/common.h2
-rw-r--r--twin/compton-tde/compton_config.h.cmake28
5 files changed, 96 insertions, 42 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 35ff873d4..cddd67ff4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -72,6 +72,7 @@ option( WITH_XFIXES "Enable xfixes support" ${WITH_ALL_OPTIONS} )
option( WITH_XRANDR "Enable xrandr support" ${WITH_ALL_OPTIONS} )
option( WITH_XRENDER "Enable xrender support" ${WITH_ALL_OPTIONS} )
option( WITH_LIBCONFIG "Enable libconfig support" ${WITH_ALL_OPTIONS} )
+option( WITH_PCRE "Enable pcre regex support" ON )
option( WITH_XTEST "Enable xtest support" ${WITH_ALL_OPTIONS} )
option( WITH_OPENGL "Enable openGL support" ${WITH_ALL_OPTIONS} )
option( WITH_XSCREENSAVER "Enable xscreensaver support" ${WITH_ALL_OPTIONS} )
@@ -124,6 +125,8 @@ option( WITH_GCC_VISIBILITY "Enable fvisibility and fvisibility-inlines-hidden"
# WITH_PAM affects tdm kdesktop kcheckpass
# WITH_SHADOW affects tdm kcheckpass
# WITH_UPOWER affects ksmserver
+# WITH_LIBCONFIG affects twin/compot-tde
+# WITH_PCRE affects twin/compot-tde
# WITH_SUDO_TDESU_BACKEND affects tdesu
# WITH_SUDO_KONSOLE_SUPER_USER_COMMAND affects launching Konsole super user sessions
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake
index 757916aa5..34aff70fb 100644
--- a/ConfigureChecks.cmake
+++ b/ConfigureChecks.cmake
@@ -83,7 +83,7 @@ if( WITH_XRENDER OR BUILD_KDESKTOP OR BUILD_KONSOLE OR BUILD_KCONTROL OR BUILD_K
endif( )
-# xrender (kcontrol, twin)
+# xrandr (kcontrol)
if( WITH_XRANDR )
pkg_search_module( XRANDR xrandr )
if( NOT XRANDR_FOUND )
@@ -144,7 +144,8 @@ if( WITH_LIBCONFIG )
pkg_search_module( LIBCONFIG libconfig )
if( LIBCONFIG_FOUND )
set( HAVE_LIBCONFIG 1 )
- if( LIBCONFIG_VERSION VERSION_LESS 1.5.0 )
+ # TODO replace with functionality check
+ if( LIBCONFIG_VERSION VERSION_LESS 1.4.0 )
set( HAVE_LIBCONFIG_OLD_API 1 )
endif( )
else( LIBCONFIG_FOUND )
@@ -153,6 +154,15 @@ if( WITH_LIBCONFIG )
endif( )
+# pcre (twin/compton-tde)
+if( WITH_PCRE )
+ pkg_search_module( LIBPCRE libpcre )
+ if( NOT LIBPCRE_FOUND )
+ tde_message_fatal( "pcre support is requested, but not found on your system" )
+ endif( NOT LIBPCRE_FOUND )
+endif( )
+
+
# xtest (kxkb)
if( WITH_XTEST )
pkg_search_module( XTEST xtst )
@@ -196,7 +206,7 @@ if( WITH_XSCREENSAVER )
endif( )
-# openGL (kdesktop or kcontrol or tdescreensaver )
+# openGL (kdesktop or kcontrol or tdescreensaver or twin/compot-tde )
if( WITH_OPENGL )
pkg_search_module( GL gl )
if( GL_FOUND )
@@ -297,8 +307,8 @@ find_package( TDE )
-# dbus (tdm, kdesktop)
-if( BUILD_TDM OR BUILD_KDESKTOP )
+# dbus (tdm, kdesktop, twin/compton-tde.c)
+if( BUILD_TDM OR BUILD_KDESKTOP OR (BUILD_TWIN AND WITH_XCOMPOSITE) )
pkg_search_module( DBUS dbus-1 )
if( NOT DBUS_FOUND )
diff --git a/twin/compton-tde/CMakeLists.txt b/twin/compton-tde/CMakeLists.txt
index 8153e7c84..f73f09ee5 100644
--- a/twin/compton-tde/CMakeLists.txt
+++ b/twin/compton-tde/CMakeLists.txt
@@ -16,57 +16,70 @@ elseif( NOT WITH_XRANDR )
tde_message_fatal( "xrandr support is needed to build compton-tde.\n Pass -DWITH_XRANDR=ON to cmake arguments." )
elseif( NOT WITH_XFIXES )
tde_message_fatal( "xfixes support is needed to build compton-tde.\n Pass -DWITH_XFIXES=ON to cmake arguments." )
-elseif( NOT WITH_XINERAMA )
- tde_message_fatal( "xinerama support is needed to build compton-tde.\n Pass -DWITH_XINERAMA=ON to cmake arguments." )
-elseif( NOT WITH_LIBCONFIG )
- tde_message_fatal( "libconfig support is needed to build compton-tde.\n Pass -DWITH_LIBCONFIG=ON to cmake arguments." )
endif( )
-
include_directories(
${CMAKE_BINARY_DIR}
- ${TDE_INCLUDE_DIR}
- ${TQT_INCLUDE_DIRS}
-)
-
-link_directories(
- ${TQT_LIBRARY_DIRS}
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${DBUS_INCLUDE_DIRS}
)
##### compton-tde (executable) ###################
-add_definitions("-Wall" "-std=c99")
+# TDE to compton config option map
+# WITH_XINNERAMA -> CONFIG_XINERAMA
+# WITH_OPENGL -> CONFIG_VSYNC_OPENGL
+# WITH_OPENGL -> CONFIG_VSYNC_OPENGL_GLSL
+# WITH_PCRE -> CONFIG_REGEX_PCRE
+# WITH_PCRE -> CONFIG_REGEX_PCRE_JIT
+# WITH_LIBCONFIG -> CONFIG_LIBCONFIG
+#
+# HAVE_LIBCONFIG_OLD_API -> CONFIG_LIBCONFIG_LEGACY (set up in compton_config.h)
+#
+# CONFIG_DBUS - always ON
+# CONFIG_C2 - always ON
+# CONFIG_XSYNC - always ON (utilieses Xext)
+
+# TODO: think about some configuration option for CONFIG_VSYNC_DRM
-option(CONFIG_LIBCONFIG "Enable configuration file parsing using libconfig" ON)
-if (CONFIG_LIBCONFIG)
- add_definitions("-DCONFIG_LIBCONFIG")
-endif ()
+add_definitions("-std=c99")
-option(CONFIG_VSYNC_DRM "Enable DRM VSync support" ON)
-if (CONFIG_VSYNC_DRM)
- add_definitions("-DCONFIG_LIBCONFIG")
-endif ()
+set( compton_SRCS compton.c )
-option(CONFIG_VSYNC_OPENGL "Enable OpenGL support" ON)
-if (CONFIG_VSYNC_OPENGL)
- add_definitions("-DCONFIG_VSYNC_OPENGL")
- list(APPEND compton_SRCS src/opengl.c)
-endif ()
+if( WITH_OPENGL )
+ set( CONFIG_VSYNC_OPENGL ${WITH_OPENGL} )
+ set( CONFIG_VSYNC_OPENGL_GLSL ${WITH_OPENGL} )
+ list( APPEND compton_LIBRARIES ${GL_LIBRARIES})
+ list( APPEND compton_SRCS opengl.c )
+endif( )
+
+if( WITH_LIBCONFIG )
+ set( CONFIG_LIBCONFIG ${WITH_LIBCONFIG} )
+ list( APPEND compton_LIBRARIES ${LIBCONFIG_LIBRARIES} )
+endif( )
+
+if( WITH_XINERAMA )
+ set( CONFIG_XINERAMA ${WITH_XINERAMA} )
+ list( APPEND compton_LIBRARIES ${XINERAMA_LIBRARIES} )
+endif( )
+
+if( WITH_PCRE )
+ set( CONFIG_REGEX_PCRE ${WITH_PCRE} )
+ set( CONFIG_REGEX_PCRE_JIT ${WITH_PCRE} )
+ list( APPEND compton_LIBRARIES ${LIBPCRE_LIBRARIES} )
+endif( )
-option(CONFIG_XINERAMA "Enable additional Xinerama features" ON)
-if (CONFIG_XINERAMA)
- add_definitions("-DCONFIG_XINERAMA")
-endif ()
+configure_file( compton_config.h.cmake compton_config.h )
-option(CONFIG_C2 "Enable matching system" ON)
-if (CONFIG_C2)
- add_definitions("-DCONFIG_C2")
- list(APPEND compton_SRCS src/c2.c)
-endif ()
+# permanently turn on some optional features: dbus c2
+list( APPEND compton_SRCS dbus.c c2.c )
+list( APPEND compton_LIBRARIES ${DBUS_LIBRARIES} )
tde_add_executable( compton-tde
- SOURCES c2.c compton.c opengl.c
- LINK m GL Xinerama ${LIBCONFIG_LIBRARIES} ${XRENDER_LIBRARIES} ${XRANDR_LIBRARIES} ${XFIXES_LIBRARIES} ${XDAMAGE_LIBRARIES} ${XEXT_LIBRARIES} ${XCOMPOSITE_LIBRARIES}
+ SOURCES ${compton_SRCS}
+ LINK m ${compton_LIBRARIES} ${XRENDER_LIBRARIES}
+ ${XRANDR_LIBRARIES} ${XFIXES_LIBRARIES} ${XDAMAGE_LIBRARIES}
+ ${XEXT_LIBRARIES} ${XCOMPOSITE_LIBRARIES}
DESTINATION ${BIN_INSTALL_DIR}
)
diff --git a/twin/compton-tde/common.h b/twin/compton-tde/common.h
index 5c6392f51..44be226a5 100644
--- a/twin/compton-tde/common.h
+++ b/twin/compton-tde/common.h
@@ -12,7 +12,7 @@
#ifndef COMPTON_COMMON_H
#define COMPTON_COMMON_H
-#include "config.h"
+#include "compton_config.h"
// === Options ===
diff --git a/twin/compton-tde/compton_config.h.cmake b/twin/compton-tde/compton_config.h.cmake
new file mode 100644
index 000000000..91cfad3be
--- /dev/null
+++ b/twin/compton-tde/compton_config.h.cmake
@@ -0,0 +1,28 @@
+#include "config.h"
+
+// Whether to enable PCRE regular expression support in blacklists, enabled
+// by default
+#cmakedefine CONFIG_REGEX_PCRE 1
+// Whether to enable JIT support of libpcre. This may cause problems on PaX
+// kernels.
+#cmakedefine CONFIG_REGEX_PCRE_JIT 1
+// Whether to enable parsing of configuration files using libconfig.
+#cmakedefine CONFIG_LIBCONFIG 1
+// Whether we are using a legacy version of libconfig (1.3.x).
+#cmakedefine CONFIG_LIBCONFIG_LEGACY 1
+// Whether to enable DRM VSync support
+#cmakedefine CONFIG_VSYNC_DRM 1
+// Whether to enable OpenGL support
+#cmakedefine CONFIG_VSYNC_OPENGL 1
+// Whether to enable GLX GLSL support
+#cmakedefine CONFIG_VSYNC_OPENGL_GLSL 1
+// Whether to enable GLX FBO support
+#cmakedefine CONFIG_VSYNC_OPENGL_FBO 1
+// Whether to enable DBus support with libdbus.
+#define CONFIG_DBUS 1
+// Whether to enable condition support.
+#define CONFIG_C2 1
+// Whether to enable X Sync support.
+#define CONFIG_XSYNC 1
+// Whether to enable GLX Sync support.
+#cmakedefine CONFIG_GLX_XSYNC 1