diff --git a/cmake/ConkyBuildOptions.cmake b/cmake/ConkyBuildOptions.cmake index a7e512a4..dc428890 100644 --- a/cmake/ConkyBuildOptions.cmake +++ b/cmake/ConkyBuildOptions.cmake @@ -124,6 +124,7 @@ endif(OWN_WINDOW) option(BUILD_LUA_CAIRO "Build cairo bindings for Lua" false) option(BUILD_LUA_IMLIB2 "Build Imlib2 bindings for Lua" false) +option(BUILD_LUA_RSVG "Build rsvg bindings for Lua" false) option(BUILD_AUDACIOUS "Build audacious (music player) support" false) diff --git a/cmake/ConkyPlatformChecks.cmake b/cmake/ConkyPlatformChecks.cmake index e9cc1fae..7594ff24 100644 --- a/cmake/ConkyPlatformChecks.cmake +++ b/cmake/ConkyPlatformChecks.cmake @@ -252,6 +252,12 @@ if(BUILD_LUA_IMLIB2) set(luaimlib2_libs ${IMLIB2_LIB} ${LUA_LIBRARIES}) set(luaimlib2_includes ${IMLIB2_INCLUDE_PATH} ${LUA_INCLUDE_DIRS}) endif(BUILD_LUA_IMLIB2) +if(BUILD_LUA_RSVG) + set(WANT_TOLUA true) + pkg_check_modules(RSVG REQUIRED librsvg-2.0) + set(luarsvg_libs ${RSVG_LIBRARIES} ${LUA_LIBRARIES}) + set(luarsvg_includes ${RSVG_INCLUDE_DIRS} ${LUA_INCLUDE_DIRS}) +endif(BUILD_LUA_RSVG) if(BUILD_AUDACIOUS) set(WANT_GLIB true) diff --git a/cmake/config.h.in b/cmake/config.h.in index b9a8b024..2d3ef629 100644 --- a/cmake/config.h.in +++ b/cmake/config.h.in @@ -108,7 +108,9 @@ #cmakedefine BUILD_LUA_IMLIB2 1 -#if defined(BUILD_LUA_CAIRO) || defined(BUILD_LUA_IMLIB2) +#cmakedefine BUILD_LUA_RSVG 1 + +#if defined(BUILD_LUA_CAIRO) || defined(BUILD_LUA_IMLIB2) || defined(BUILD_LUA_RSVG) #define BUILD_LUA_EXTRAS #endif diff --git a/lua/CMakeLists.txt b/lua/CMakeLists.txt index 20dcaeaf..09a12fb4 100644 --- a/lua/CMakeLists.txt +++ b/lua/CMakeLists.txt @@ -52,6 +52,17 @@ if(BUILD_LUA_IMLIB2) set(lua_libs ${lua_libs} conky-imlib2) endif(BUILD_LUA_IMLIB2) +if(BUILD_LUA_RSVG) + include_directories(${luarsvg_includes} ${CMAKE_CURRENT_SOURCE_DIR}) + wrap_tolua(luarsvg_src rsvg.pkg) + + add_library(conky-rsvg SHARED ${luarsvg_src}) + set_target_properties(conky-rsvg PROPERTIES OUTPUT_NAME "rsvg") + + target_link_libraries(conky-rsvg ${luarsvg_libs} ${TOLUA_LIBS}) + set(lua_libs ${lua_libs} conky-rsvg) +endif(BUILD_LUA_RSVG) + install(TARGETS ${lua_libs} LIBRARY DESTINATION lib/conky