message( FATAL_ERROR "Imlib is not build with x support" )
endif( NOT IMLIB_BUILD_WITH_X )
-include_directories( src
+include_directories( ${PROJECT_BINARY_DIR}
+ src
src/battery
src/clock
src/systray
endif( ENABLE_BATTERY )
if( ENABLE_TINT2CONF )
+ add_definitions( -DBUILD_CMAKE )
add_subdirectory( src/tint2conf )
+ add_dependencies( tint2conf version )
endif( ENABLE_TINT2CONF )
set( SYSCONFDIR /etc CACHE PATH "Directory for configuration files" )
set( DOCDIR ${CMAKE_INSTALL_PREFIX}/share/doc/tint2 CACHE PATH "Directory for documentation files" )
+add_custom_target( version ALL "${PROJECT_SOURCE_DIR}/get_svnrev.sh" "\"${PROJECT_SOURCE_DIR}\"" )
+
add_executable(tint2 ${SOURCES})
link_directories( ${X11_LIBRARY_DIRS}
${X11_LIBRARY_DIRS}
${IMLIB2_LIBRARIES}
rt )
+add_dependencies(tint2 version)
set_target_properties(tint2 PROPERTIES COMPILE_FLAGS -Wall)
set_target_properties(tint2 PROPERTIES LINK_FLAGS -Wl,--as-needed)
--- /dev/null
+#!/bin/bash
+
+FALLBACK="0.10-svn"
+
+if [[ $# -eq 0 ]]; then
+ DIR=.
+else
+ DIR=$1
+fi
+
+if [[ -f version.h ]]; then
+ REV_OLD=$(cat version.h | cut -d" " -f3)
+else
+ REV_OLD=""
+fi
+
+if [[ -x "$(which svnversion 2>/dev/null)" && -d "${DIR}/.svn" ]] ; then
+ REV=\"$(svnversion -n ${DIR})\"
+else
+ REV=${FALLBACK}
+fi
+
+if [[ ${REV_OLD} != ${REV} ]]; then
+ echo "Building new version.h"
+ echo "#define VERSION_STRING "${REV}"" > version.h
+fi
+
+
XSendEvent(server.dsp, id, False, 0xFFFFFF, &e);
}
- printf("Adding systray with window: %d\n", id);
traywin = g_new0(TrayWindow, 1);
traywin->id = parent_window;
traywin->tray_id = id;
{
XErrorHandler old;
- printf("Removing systray with window: %d\n", traywin->tray_id);
// remove from our list
systray.list_icons = g_slist_remove(systray.list_icons, traywin);
systray.area.resize = 1;