X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;ds=inline;f=CMakeLists.txt;h=e527a7698e89e0312f3170f035bf3d5e1cb39e33;hb=35dc866951d48409e88a1fde5fdb52dfe60f3b18;hp=364af41e0107c10339e9b09cd45212441e76f858;hpb=5ed667450b58aee80bd200dcbb7249e4203fc02f;p=chaz%2Ftint2 diff --git a/CMakeLists.txt b/CMakeLists.txt index 364af41..e527a76 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ project( tint2 ) cmake_minimum_required( VERSION 2.6 ) include( FindPkgConfig ) -include( CheckFunctionExists ) +include( CheckLibraryExists ) pkg_check_modules( X11 REQUIRED x11 xcomposite xdamage xinerama xrender xrandr ) pkg_check_modules( PANGOCAIRO REQUIRED pangocairo ) pkg_check_modules( PANGO REQUIRED pango ) @@ -11,13 +11,13 @@ pkg_check_modules( GLIB2 REQUIRED glib-2.0 ) pkg_check_modules( GOBJECT2 REQUIRED gobject-2.0 ) pkg_check_modules( IMLIB2 REQUIRED imlib2 ) -set( CMAKE_REQUIRED_FLAGS ${IMLIB2_LDFLAGS} ${IMLIB2_CFLAGS} ) -check_function_exists( imlib_context_set_display IMLIB_BUILD_WITH_X ) +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( src +include_directories( ${PROJECT_BINARY_DIR} + src src/battery src/clock src/systray @@ -46,18 +46,20 @@ set( SOURCES src/config.c src/util/timer.c src/util/window.c ) -option( DISABLE_BATTERY "Disable battery status plugin" OFF ) -option( DISABLE_TINT2CONF "Disable tint2conf build, a GTK+2 theme switcher for tint2" OFF ) +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 ) -if( NOT DISABLE_BATTERY ) +if( ENABLE_BATTERY ) set( SOURCES ${SOURCES} src/battery/battery.c ) add_definitions( -DENABLE_BATTERY ) -endif( NOT DISABLE_BATTERY ) +endif( ENABLE_BATTERY ) -if( NOT DISABLE_TINT2CONF ) +if( ENABLE_TINT2CONF ) + add_definitions( -DBUILD_CMAKE ) add_subdirectory( src/tint2conf ) -endif( NOT DISABLE_TINT2CONF ) + add_dependencies( tint2conf version ) +endif( ENABLE_TINT2CONF ) set( MANDIR ${CMAKE_INSTALL_PREFIX}/share/man CACHE PATH "Directory for man pages" ) @@ -65,6 +67,8 @@ set( DATADIR ${CMAKE_INSTALL_PREFIX}/share CACHE PATH "Directory for shared data 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} @@ -83,12 +87,15 @@ target_link_libraries( tint2 ${X11_LIBRARIES} ${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) 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 )