diff --git a/cmake/ConkyPlatformChecks.cmake b/cmake/ConkyPlatformChecks.cmake index 8952dfe8..dfb73f9c 100644 --- a/cmake/ConkyPlatformChecks.cmake +++ b/cmake/ConkyPlatformChecks.cmake @@ -166,45 +166,48 @@ endif(BUILD_ICONV) if(BUILD_X11) include(FindX11) find_package(X11) - set(conky_includes ${conky_includes} ${X11_INCLUDE_DIR}) - set(conky_libs ${conky_libs} ${X11_LIBRARIES}) + if(X11_FOUND) + 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 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 ${INCLUDE_SEARCH_PATH} - /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) - if(NOT X11_Xext_FOUND) - message(FATAL_ERROR "Unable to find Xext library (needed for Xdbe)") - endif(NOT X11_Xext_FOUND) - set(conky_libs ${conky_libs} ${X11_Xext_LIB}) - endif(BUILD_XDBE) + # check for Xft + if(BUILD_XFT) + 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) + 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) + if(NOT X11_Xext_FOUND) + message(FATAL_ERROR "Unable to find Xext library (needed for Xdbe)") + endif(NOT X11_Xext_FOUND) + set(conky_libs ${conky_libs} ${X11_Xext_LIB}) + endif(BUILD_XDBE) + else(X11_FOUND) + message(FATAL_ERROR "Unable to find X11 library") + endif(X11_FOUND) endif(BUILD_X11) if(BUILD_LUA) diff --git a/src/x11.h b/src/x11.h index 47b4eff4..78c1ee1c 100644 --- a/src/x11.h +++ b/src/x11.h @@ -27,7 +27,6 @@ #ifndef X11_H_ #define X11_H_ -#include #include #include