2010-06-09 09:14:56 +00:00
|
|
|
project( tint2 )
|
|
|
|
cmake_minimum_required( VERSION 2.6 )
|
2010-06-08 19:56:22 +00:00
|
|
|
|
|
|
|
include( FindPkgConfig )
|
2010-06-09 13:50:22 +00:00
|
|
|
include( CheckLibraryExists )
|
2010-06-08 19:56:22 +00:00
|
|
|
pkg_check_modules( X11 REQUIRED x11 xcomposite xdamage xinerama xrender xrandr )
|
|
|
|
pkg_check_modules( PANGOCAIRO REQUIRED pangocairo )
|
|
|
|
pkg_check_modules( PANGO REQUIRED pango )
|
|
|
|
pkg_check_modules( CAIRO REQUIRED cairo )
|
|
|
|
pkg_check_modules( GLIB2 REQUIRED glib-2.0 )
|
|
|
|
pkg_check_modules( GOBJECT2 REQUIRED gobject-2.0 )
|
|
|
|
pkg_check_modules( IMLIB2 REQUIRED imlib2 )
|
2010-06-12 07:45:16 +00:00
|
|
|
find_library( RT_LIBRARY rt )
|
2010-06-08 19:56:22 +00:00
|
|
|
|
2010-06-13 13:02:53 +00:00
|
|
|
string( REPLACE ";" " " FLAGS_REPLACED "${IMLIB2_LDFLAGS}" )
|
2010-06-13 12:27:56 +00:00
|
|
|
set( CMAKE_REQUIRED_FLAGS "${FLAGS_REPLACED}" )
|
2010-06-09 13:50:22 +00:00
|
|
|
check_library_exists( "${IMLIB2_LIBRARIES}" "imlib_context_set_display" "${IMLIB2_LIBRARY_DIRS}" IMLIB_BUILD_WITH_X )
|
2010-06-09 09:14:56 +00:00
|
|
|
if( NOT IMLIB_BUILD_WITH_X )
|
|
|
|
message( FATAL_ERROR "Imlib is not build with x support" )
|
|
|
|
endif( NOT IMLIB_BUILD_WITH_X )
|
|
|
|
|
2010-06-09 15:31:18 +00:00
|
|
|
include_directories( ${PROJECT_BINARY_DIR}
|
|
|
|
src
|
2010-06-08 20:03:38 +00:00
|
|
|
src/battery
|
2010-06-08 19:56:22 +00:00
|
|
|
src/clock
|
|
|
|
src/systray
|
|
|
|
src/taskbar
|
|
|
|
src/tooltip
|
|
|
|
src/util
|
|
|
|
${X11_INCLUDE_DIRS}
|
|
|
|
${PANGOCAIRO_INCLUDE_DIRS}
|
|
|
|
${PANGO_INCLUDE_DIRS}
|
|
|
|
${CAIRO_INCLUDE_DIRS}
|
|
|
|
${GLIB2_INCLUDE_DIRS}
|
|
|
|
${GOBJECT2_INCLUDE_DIRS}
|
|
|
|
${IMLIB2_INCLUDE_DIRS} )
|
|
|
|
|
2010-06-09 09:14:56 +00:00
|
|
|
set( SOURCES src/config.c
|
|
|
|
src/panel.c
|
|
|
|
src/server.c
|
|
|
|
src/tint.c
|
|
|
|
src/clock/clock.c
|
|
|
|
src/systray/systraybar.c
|
|
|
|
src/taskbar/task.c
|
|
|
|
src/taskbar/taskbar.c
|
|
|
|
src/tooltip/tooltip.c
|
|
|
|
src/util/area.c
|
|
|
|
src/util/common.c
|
|
|
|
src/util/timer.c
|
|
|
|
src/util/window.c )
|
|
|
|
|
2010-06-09 13:50:22 +00:00
|
|
|
option( ENABLE_BATTERY "Enable battery status plugin" ON )
|
|
|
|
option( ENABLE_TINT2CONF "Enable tint2conf build, a GTK+2 theme switcher for tint2" ON )
|
2010-06-09 09:14:56 +00:00
|
|
|
option( ENABLE_EXAMPLES "Install additional tin2rc examples" OFF )
|
2010-06-08 19:56:22 +00:00
|
|
|
|
2010-06-09 13:50:22 +00:00
|
|
|
if( ENABLE_BATTERY )
|
2010-06-08 19:56:22 +00:00
|
|
|
set( SOURCES ${SOURCES} src/battery/battery.c )
|
2010-06-08 20:03:38 +00:00
|
|
|
add_definitions( -DENABLE_BATTERY )
|
2010-06-09 13:50:22 +00:00
|
|
|
endif( ENABLE_BATTERY )
|
2010-06-08 19:56:22 +00:00
|
|
|
|
2010-06-09 13:50:22 +00:00
|
|
|
if( ENABLE_TINT2CONF )
|
2010-06-12 21:21:06 +00:00
|
|
|
add_definitions( -DHAVE_VERSION_H )
|
2010-06-08 20:18:13 +00:00
|
|
|
add_subdirectory( src/tint2conf )
|
2010-06-09 15:31:18 +00:00
|
|
|
add_dependencies( tint2conf version )
|
2010-06-09 13:50:22 +00:00
|
|
|
endif( ENABLE_TINT2CONF )
|
2010-06-08 20:18:13 +00:00
|
|
|
|
2010-06-12 09:27:18 +00:00
|
|
|
set( MANDIR share/man CACHE PATH "Directory for man pages" )
|
|
|
|
set( DATADIR share CACHE PATH "Directory for shared data" )
|
|
|
|
set( SYSCONFDIR /etc CACHE PATH "Directory for configuration files" )
|
|
|
|
set( DOCDIR share/doc/tint2 CACHE PATH "Directory for documentation files" )
|
2010-06-09 09:14:56 +00:00
|
|
|
|
2010-06-09 15:31:18 +00:00
|
|
|
add_custom_target( version ALL "${PROJECT_SOURCE_DIR}/get_svnrev.sh" "\"${PROJECT_SOURCE_DIR}\"" )
|
|
|
|
|
2010-06-09 09:14:56 +00:00
|
|
|
link_directories( ${X11_LIBRARY_DIRS}
|
|
|
|
${PANGOCAIRO_LIBRARY_DIRS}
|
|
|
|
${PANGO_LIBRARY_DIRS}
|
|
|
|
${CAIRO_LIBRARY_DIRS}
|
|
|
|
${GLIB2_LIBRARY_DIRS}
|
|
|
|
${GOBJECT2_LIBRARY_DIRS}
|
|
|
|
${IMLIB2_LIBRARY_DIRS} )
|
2010-06-13 13:02:53 +00:00
|
|
|
add_executable(tint2 ${SOURCES})
|
2010-06-08 19:56:22 +00:00
|
|
|
target_link_libraries( tint2 ${X11_LIBRARIES}
|
|
|
|
${PANGOCAIRO_LIBRARIES}
|
|
|
|
${PANGO_LIBRARIES}
|
|
|
|
${CAIRO_LIBRARIES}
|
|
|
|
${GLIB2_LIBRARIES}
|
|
|
|
${GOBJECT2_LIBRARIES}
|
2010-06-12 07:45:16 +00:00
|
|
|
${IMLIB2_LIBRARIES} )
|
|
|
|
if( RT_LIBRARY )
|
|
|
|
target_link_libraries( tint2 ${RT_LIBRARY} )
|
|
|
|
endif( RT_LIBRARY )
|
2010-06-08 19:56:22 +00:00
|
|
|
|
2010-06-12 09:27:18 +00:00
|
|
|
add_dependencies( tint2 version )
|
2010-06-14 09:48:40 +00:00
|
|
|
set_target_properties( tint2 PROPERTIES COMPILE_FLAGS "-Wall -pthread" )
|
|
|
|
set_target_properties(tint2 PROPERTIES LINK_FLAGS "-pthread" )
|
2010-06-09 09:14:56 +00:00
|
|
|
|
|
|
|
install( TARGETS tint2 DESTINATION bin )
|
|
|
|
install( FILES sample/tint2rc DESTINATION ${SYSCONFDIR}/xdg/tint2 )
|
2010-06-09 13:50:22 +00:00
|
|
|
install( FILES default_icon.png DESTINATION ${DATADIR}/tint2 )
|
2010-06-09 09:14:56 +00:00
|
|
|
install( FILES AUTHORS ChangeLog README DESTINATION ${DOCDIR} )
|
2010-06-09 21:44:41 +00:00
|
|
|
install( FILES doc/tint2.1 DESTINATION ${MANDIR}/man1 )
|
2010-06-09 09:14:56 +00:00
|
|
|
if( ENABLE_EXAMPLES )
|
|
|
|
file( GLOB SAMPLEFILES sample/*.tint2rc )
|
|
|
|
install( FILES ${SAMPLEFILES} DESTINATION ${DOCDIR}/examples )
|
|
|
|
endif( ENABLE_EXAMPLES )
|