From 3858cc736fb9326857cbbd1877b9f00e6a729824 Mon Sep 17 00:00:00 2001 From: Brenden Matthews Date: Sat, 5 Dec 2009 13:04:31 -0800 Subject: [PATCH] More work on CMake stuff, add missing files. Also updated gitignore. --- .gitignore | 1 + cmake_modules/ConkyBuildOptions.cmake | 24 +++++++++++ cmake_modules/ConkyPlatformChecks.cmake | 54 +++++++++++++++++++++++++ config.h.in | 17 ++++++++ 4 files changed, 96 insertions(+) create mode 100644 cmake_modules/ConkyBuildOptions.cmake create mode 100644 cmake_modules/ConkyPlatformChecks.cmake diff --git a/.gitignore b/.gitignore index 080950fc..56bb0fa9 100644 --- a/.gitignore +++ b/.gitignore @@ -46,3 +46,4 @@ doc/*.mxml patches/ doc/conky.1 README +build* diff --git a/cmake_modules/ConkyBuildOptions.cmake b/cmake_modules/ConkyBuildOptions.cmake new file mode 100644 index 00000000..57bc1a50 --- /dev/null +++ b/cmake_modules/ConkyBuildOptions.cmake @@ -0,0 +1,24 @@ +# vim: ts=4 sw=4 noet ai cindent syntax=cmake + + +# Some standard options +set(SYSTEM_CONFIG_FILE "/etc/conky/conky.conf" CACHE STRING "Default system-wide Conky configuration file") +# use FORCE below to make sure this changes when CMAKE_INSTALL_PREFIX is modified +set(PACKAGE_LIBRARY_DIR "${CMAKE_INSTALL_PREFIX}/lib/conky" CACHE STRING "Package library path (where Lua bindings are installed" FORCE) +set(DEFAULTNETDEV "eth0" CACHE STRING "Default networkdevice") +set(CONFIG_FILE "$HOME/.conkyrc" CACHE STRING "Configfile of the user") +set(MAX_SPECIALS_DEFAULT "512" CACHE STRING "Default maximum number of special things, e.g. fonts, offsets, aligns, etc.") +set(MAX_USER_TEXT_DEFAULT "16384" CACHE STRING "Default maximum size of config TEXT buffer, i.e. below TEXT line.") +set(DEFAULT_TEXT_BUFFER_SIZE "256" CACHE STRING "Default size used for temporary, static text buffers") +set(MAX_NET_INTERFACES "16" CACHE STRING "Maximum number of network devices") + + +# Optional features etc +option(BUILD_X11 "Build X11 support" true) +if(BUILD_X11) + option(OWN_WINDOW "Enable own_window support" true) + option(BUILD_XDAMAGE "Build Xdamage support" true) + option(BUILD_XDBE "Build Xdbe (double-buffer) support" true) + option(BUILD_XFT "Build Xft (freetype fonts) support" true) +endif(BUILD_X11) + diff --git a/cmake_modules/ConkyPlatformChecks.cmake b/cmake_modules/ConkyPlatformChecks.cmake new file mode 100644 index 00000000..e9db2aa9 --- /dev/null +++ b/cmake_modules/ConkyPlatformChecks.cmake @@ -0,0 +1,54 @@ +# vim: ts=4 sw=4 noet ai cindent syntax=cmake + +check_include_files(sys/statfs.h HAVE_SYS_STATFS_H) +check_include_files(sys/param.h HAVE_SYS_PARAM_H) + +# check for Xlib +if(BUILD_X11) + include(FindX11) + find_package(X11) + set(conky_includes ${conky_includes} ${X11_INCLUDE_DIR}) + set(conky_libs ${conky_libs} ${X11_LIBRARIES}) + + # check for Xdamage + if(BUILD_XDAMAGE) + if(NOT X11_Xdamage_FOUND) + message(FATAL_ERROR "Unable to find Xdamage library") + endif(NOT X11_Xdamage_FOUND) + if(NOT X11_Xfixes_FOUND) + message(FATAL_ERROR "Unable to find Xfixes library") + endif(NOT X11_Xfixes_FOUND) + set(conky_libs ${conky_libs} ${X11_Xdamage_LIB} ${X11_Xfixes_LIB}) + endif(BUILD_XDAMAGE) + + # check for Xft + if(BUILD_XFT) + find_path(freetype_INCLUDE_PATH freetype/config/ftconfig.h /usr/include + /usr/local/include /usr/include/freetype2 + /usr/local/include/freetype2) + if(freetype_INCLUDE_PATH) + set(freetype_FOUND TRUE) + set(conky_includes ${conky_includes} ${freetype_INCLUDE_PATH}) + else(freetype_INCLUDE_PATH) + message(FATAL_ERROR "Unable to find freetype library") + endif(freetype_INCLUDE_PATH) + if(NOT X11_Xft_FOUND) + message(FATAL_ERROR "Unable to find Xft library") + endif(NOT X11_Xft_FOUND) + set(conky_libs ${conky_libs} ${X11_Xft_LIB}) + endif(BUILD_XFT) + + # check for Xdbe + if(BUILD_XDBE) + find_path(X11_Xdbe_INCLUDE_PATH X11/extensions/Xdbe.h ${X11_INC_SEARCH_PATH}) + if(X11_Xdbe_INCLUDE_PATH) + set(X11_Xdbe_FOUND TRUE) + set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xdbe_INCLUDE_PATH}) + endif(X11_Xdbe_INCLUDE_PATH) + if(NOT X11_Xdbe_FOUND) + message(FATAL_ERROR "Unable to find Xdbe library") + endif(NOT X11_Xdbe_FOUND) + endif(BUILD_XDBE) + +endif(BUILD_X11) + diff --git a/config.h.in b/config.h.in index 57c35187..2c5ab341 100644 --- a/config.h.in +++ b/config.h.in @@ -18,3 +18,20 @@ #ifdef BUILD_X11 #define X11 #endif /* BUILD_X11 */ + +#cmakedefine OWN_WINDOW 1 + +#cmakedefine BUILD_XDAMAGE 1 +#ifdef BUILD_XDAMAGE +#define HAVE_XDAMAGE +#endif /* BUILD_XDAMAGE */ + +#cmakedefine BUILD_XFT 1 +#ifdef BUILD_XFT +#define XFT +#endif /* BUILD_XFT */ + +#cmakedefine BUILD_XDBE 1 +#ifdef BUILD_XDBE +#define HAVE_XDBE +#endif /* BUILD_XDBE */