X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=CMakeLists.txt;h=496f9f78cd2fb4a82141b0cf9ec0c4ed561e4901;hb=b079f35351d4dbe5e4bb23bccc1c4338b2f538e3;hp=b521e98e14616b379b9e70baa0c36523aeabb80a;hpb=f8f6e7f277a6e09fb4a9fa7db532867d51d229be;p=chaz%2Ftint2 diff --git a/CMakeLists.txt b/CMakeLists.txt index b521e98..496f9f7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,13 +10,21 @@ 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 ) +find_library( RT_LIBRARY rt ) +if( NOT (X11_FOUND AND PANGOCAIRO_FOUND AND PANGO_FOUND AND CAIRO_FOUND AND GLIB2_FOUND AND GOBJECT2_FOUND AND IMLIB2_FOUND) ) + message( FATAL_ERROR "Not all dependencies fulfilled. See http://code.google.com/p/tint2/wiki/Install" ) +endif( NOT (X11_FOUND AND PANGOCAIRO_FOUND AND PANGO_FOUND AND CAIRO_FOUND AND GLIB2_FOUND AND GOBJECT2_FOUND AND 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( src +include_directories( ${PROJECT_BINARY_DIR} + src src/battery src/clock src/systray @@ -55,40 +63,46 @@ if( ENABLE_BATTERY ) endif( ENABLE_BATTERY ) if( ENABLE_TINT2CONF ) + add_definitions( -DHAVE_VERSION_H ) add_subdirectory( src/tint2conf ) + add_dependencies( tint2conf version ) endif( ENABLE_TINT2CONF ) - -set( MANDIR ${CMAKE_INSTALL_PREFIX}/share/man CACHE PATH "Directory for man pages" ) -set( DATADIR ${CMAKE_INSTALL_PREFIX}/share CACHE PATH "Directory for shared data" ) +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 ${CMAKE_INSTALL_PREFIX}/share/doc/tint2 CACHE PATH "Directory for documentation files" ) +set( DOCDIR 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} ${PANGOCAIRO_LIBRARY_DIRS} ${PANGO_LIBRARY_DIRS} ${CAIRO_LIBRARY_DIRS} ${GLIB2_LIBRARY_DIRS} ${GOBJECT2_LIBRARY_DIRS} ${IMLIB2_LIBRARY_DIRS} ) +add_executable(tint2 ${SOURCES}) target_link_libraries( tint2 ${X11_LIBRARIES} ${PANGOCAIRO_LIBRARIES} ${PANGO_LIBRARIES} ${CAIRO_LIBRARIES} ${GLIB2_LIBRARIES} ${GOBJECT2_LIBRARIES} - ${IMLIB2_LIBRARIES} - rt ) + ${IMLIB2_LIBRARIES} ) +if( RT_LIBRARY ) + target_link_libraries( tint2 ${RT_LIBRARY} ) +endif( RT_LIBRARY ) -set_target_properties(tint2 PROPERTIES COMPILE_FLAGS -Wall) -set_target_properties(tint2 PROPERTIES LINK_FLAGS -Wl,--as-needed) +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 )