From c63d1bba788d0a29996083faf48b0cf3b2177f69 Mon Sep 17 00:00:00 2001 From: Brenden Matthews Date: Sun, 6 Dec 2009 11:43:12 -0800 Subject: [PATCH] Portmon and audacious CMake support. --- cmake_modules/ConkyBuildOptions.cmake | 16 +++++++++++----- cmake_modules/ConkyPlatformChecks.cmake | 25 +++++++++++++++++++++++-- config.h.in | 15 +++++++++++++++ 3 files changed, 49 insertions(+), 7 deletions(-) diff --git a/cmake_modules/ConkyBuildOptions.cmake b/cmake_modules/ConkyBuildOptions.cmake index f94632f9..bb340807 100644 --- a/cmake_modules/ConkyBuildOptions.cmake +++ b/cmake_modules/ConkyBuildOptions.cmake @@ -13,6 +13,11 @@ set(DEFAULT_TEXT_BUFFER_SIZE "256" CACHE STRING "Default size used for temporary set(MAX_NET_INTERFACES "16" CACHE STRING "Maximum number of network devices") +# Platform specific options +if(CMAKE_SYSTEM_NAME MATCHES "Linux") + option(BUILD_PORT_MONITORS "Build TCP portmon support" true) +endif(CMAKE_SYSTEM_NAME MATCHES "Linux") + # Optional features etc option(BUILD_X11 "Build X11 support" true) if(BUILD_X11) @@ -24,9 +29,10 @@ endif(BUILD_X11) option(BUILD_LUA "Build Lua support" true) - -# Platform specific options -if(CMAKE_SYSTEM_NAME MATCHES "Linux") - option(BUILD_PORT_MONITORS "Build TCP portmon support" true) -endif(CMAKE_SYSTEM_NAME MATCHES "Linux") +option(BUILD_AUDACIOUS "Build audacious player support" false) +if(BUILD_AUDACIOUS) + option(BUILD_AUDACIOUS_LEGACY "Use legacy audacious player support" false) +else(BUILD_AUDACIOUS) + set(BUILD_AUDACIOUS_LEGACY false) +endif(BUILD_AUDACIOUS) diff --git a/cmake_modules/ConkyPlatformChecks.cmake b/cmake_modules/ConkyPlatformChecks.cmake index 66341ced..ec70ed78 100644 --- a/cmake_modules/ConkyPlatformChecks.cmake +++ b/cmake_modules/ConkyPlatformChecks.cmake @@ -6,6 +6,9 @@ check_include_files(sys/statfs.h HAVE_SYS_STATFS_H) check_include_files(sys/param.h HAVE_SYS_PARAM_H) check_include_files(sys/inotify.h HAVE_SYS_INOTIFY_H) +# standard path to search for includes +set(INCLUDE_SEARCH_PATH /usr/include /usr/local/include) + # check for Xlib if(BUILD_X11) include(FindX11) @@ -26,8 +29,8 @@ if(BUILD_X11) # check for Xft if(BUILD_XFT) - find_path(freetype_INCLUDE_PATH freetype/config/ftconfig.h /usr/include - /usr/local/include /usr/include/freetype2 + find_path(freetype_INCLUDE_PATH freetype/config/ftconfig.h ${INCLUDE_SEARCH_PATH} + /usr/include/freetype2 /usr/local/include/freetype2) if(freetype_INCLUDE_PATH) set(freetype_FOUND TRUE) @@ -65,6 +68,24 @@ if(BUILD_PORT_MONITORS) set(WANT_GLIB true) endif(BUILD_PORT_MONITORS) +if(BUILD_AUDACIOUS) + set(WANT_GLIB true) + if(NOT BUILD_AUDACIOUS_LEGACY) + pkg_check_modules(AUDACIOUS REQUIRED audacious>=1.4.0 dbus-glib-1 gobject-2.0) + # do we need this below? + #CPPFLAGS="$Audacious_CFLAGS -I`pkg-config --variable=audacious_include_dir audacious`/audacious" + #AC_CHECK_HEADERS([audacious/audctrl.h audacious/dbus.h glib.h glib-object.h], + # [], AC_MSG_ERROR([required header(s) not found])) + else(NOT BUILD_AUDACIOUS_LEGACY) + pkg_check_modules(AUDACIOUS REQUIRED audacious<1.4.0) + # do we need this below? + #CPPFLAGS="$Audacious_CFLAGS -I`pkg-config --variable=audacious_include_dir audacious`/audacious" + #AC_CHECK_HEADERS([audacious/beepctrl.h glib.h], [], AC_MSG_ERROR([required header(s) not found])) + #CPPFLAGS="$save_CPPFLAGS" + endif(NOT BUILD_AUDACIOUS_LEGACY) +endif(BUILD_AUDACIOUS) + + if(WANT_GLIB) pkg_check_modules(GLIB REQUIRED glib-2.0) set(conky_libs ${conky_libs} ${GLIB_LIBRARIES}) diff --git a/config.h.in b/config.h.in index df7bc199..a44b8171 100644 --- a/config.h.in +++ b/config.h.in @@ -41,3 +41,18 @@ #ifdef BUILD_LUA #define HAVE_LUA #endif /* BUILD_LUA */ + +#cmakedefine BUILD_PORT_MONITORS 1 +#ifdef BUILD_PORT_MONITORS +#define TCP_PORT_MONITOR +#endif /* BUILD_PORT_MONITORS */ + +#cmakedefine BUILD_AUDACIOUS 1 +#ifdef BUILD_AUDACIOUS +#define AUDACIOUS +#endif /* BUILD_AUDACIOUS */ + +#cmakedefine BUILD_AUDACIOUS_LEGACY 1 +#ifdef BUILD_AUDACIOUS_LEGACY +#define AUDACIOUS_LEGACY +#endif /* BUILD_AUDACIOUS_LEGACY */