-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
126 lines (113 loc) · 4.93 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
119
120
121
122
123
124
125
126
project( tint2 )
cmake_minimum_required( VERSION 2.6 )
include( FindPkgConfig )
include( CheckLibraryExists )
pkg_check_modules( X11 REQUIRED x11 xcomposite xdamage xinerama xrender xrandr>=1.3 )
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>=1.4.2 )
pkg_check_modules( SN libstartup-notification-1.0>=0.12 )
find_library( RT_LIBRARY rt )
if( NOT X11_FOUND OR NOT PANGOCAIRO_FOUND OR NOT PANGO_FOUND OR NOT CAIRO_FOUND OR NOT GLIB2_FOUND OR NOT GOBJECT2_FOUND OR NOT IMLIB2_FOUND )
message( FATAL_ERROR "Not all dependencies fulfilled. See http://code.google.com/p/tint2/wiki/Install" )
endif( NOT X11_FOUND OR NOT PANGOCAIRO_FOUND OR NOT PANGO_FOUND OR NOT CAIRO_FOUND OR NOT GLIB2_FOUND OR NOT GOBJECT2_FOUND OR NOT IMLIB2_FOUND )
string( REPLACE ";" " " FLAGS_REPLACED "${IMLIB2_LDFLAGS}" )
set( CMAKE_REQUIRED_FLAGS "${FLAGS_REPLACED}" )
check_library_exists( "${IMLIB2_LIBRARIES}" "imlib_context_set_display" "${IMLIB2_LIBRARY_DIRS}" IMLIB_BUILD_WITH_X )
if( NOT IMLIB_BUILD_WITH_X )
message( FATAL_ERROR "Imlib is not build with x support" )
endif( NOT IMLIB_BUILD_WITH_X )
include_directories( ${PROJECT_BINARY_DIR}
src
src/battery
src/clock
src/systray
src/taskbar
src/launcher
src/tooltip
src/freespace
src/util
${X11_INCLUDE_DIRS}
${PANGOCAIRO_INCLUDE_DIRS}
${PANGO_INCLUDE_DIRS}
${CAIRO_INCLUDE_DIRS}
${GLIB2_INCLUDE_DIRS}
${GOBJECT2_INCLUDE_DIRS}
${IMLIB2_INCLUDE_DIRS}
${SN_INCLUDE_DIRS} )
set( SOURCES src/config.c
src/panel.c
src/server.c
src/tint.c
src/clock/clock.c
src/systray/systraybar.c
src/launcher/launcher.c
src/launcher/xsettings-client.c
src/launcher/xsettings-common.c
src/taskbar/task.c
src/taskbar/taskbar.c
src/taskbar/taskbarname.c
src/tooltip/tooltip.c
src/freespace/freespace.c
src/util/area.c
src/util/common.c
src/util/timer.c
src/util/window.c )
option( ENABLE_BATTERY "Enable battery status plugin" ON )
option( ENABLE_TINT2CONF "Enable tint2conf build, a GTK+2 theme switcher for tint2" ON )
option( ENABLE_EXAMPLES "Install additional tin2rc examples" OFF )
option( ENABLE_SN "Startup notification support" ON )
if( ENABLE_SN )
if( SN_FOUND )
add_definitions( -DHAVE_SN -DSN_API_NOT_YET_FROZEN )
endif( SN_FOUND )
endif( ENABLE_SN)
if( ENABLE_BATTERY )
set( SOURCES ${SOURCES} src/battery/battery.c )
add_definitions( -DENABLE_BATTERY )
endif( ENABLE_BATTERY )
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" )
if( ENABLE_TINT2CONF )
add_definitions( -DHAVE_VERSION_H )
add_subdirectory( src/tint2conf )
add_dependencies( tint2conf version )
endif( ENABLE_TINT2CONF )
add_custom_target( version ALL "${PROJECT_SOURCE_DIR}/get_svnrev.sh" "\"${PROJECT_SOURCE_DIR}\"" )
link_directories( ${X11_LIBRARY_DIRS}
${PANGOCAIRO_LIBRARY_DIRS}
${PANGO_LIBRARY_DIRS}
${CAIRO_LIBRARY_DIRS}
${GLIB2_LIBRARY_DIRS}
${GOBJECT2_LIBRARY_DIRS}
${IMLIB2_LIBRARY_DIRS}
${SN_LIBRARY_DIRS} )
add_executable(tint2 ${SOURCES})
target_link_libraries( tint2 ${X11_LIBRARIES}
${PANGOCAIRO_LIBRARIES}
${PANGO_LIBRARIES}
${CAIRO_LIBRARIES}
${GLIB2_LIBRARIES}
${GOBJECT2_LIBRARIES}
${IMLIB2_LIBRARIES}
${SN_LIBRARIES} )
if( RT_LIBRARY )
target_link_libraries( tint2 ${RT_LIBRARY} )
endif( RT_LIBRARY )
add_dependencies( tint2 version )
set_target_properties( tint2 PROPERTIES COMPILE_FLAGS "-Wall -pthread" )
set_target_properties(tint2 PROPERTIES LINK_FLAGS "-pthread" )
install( TARGETS tint2 DESTINATION bin )
install( FILES sample/tint2rc DESTINATION ${SYSCONFDIR}/xdg/tint2 )
install( FILES default_icon.png DESTINATION ${DATADIR}/tint2 )
install( FILES AUTHORS ChangeLog README DESTINATION ${DOCDIR} )
install( FILES doc/tint2.1 DESTINATION ${MANDIR}/man1 )
if( ENABLE_EXAMPLES )
file( GLOB SAMPLEFILES sample/*.tint2rc )
install( FILES ${SAMPLEFILES} DESTINATION ${DOCDIR}/examples )
endif( ENABLE_EXAMPLES )