fix(build): Update dependency list and added auto test for i3

This commit is contained in:
Michael Carlberg 2016-05-20 11:20:58 +02:00
parent 55ac6bc732
commit b74a2957c3
2 changed files with 41 additions and 23 deletions

View File

@ -23,11 +23,20 @@ endif()
# #
# Internal values and switches # Internal values and switches
# #
option(ENABLE_CCACHE "Enable ccache support" ON) option(ENABLE_CCACHE "Enable ccache support" ON)
option(ENABLE_ALSA "Enable alsa support" ON) option(ENABLE_ALSA "Enable alsa support" ON)
option(ENABLE_MPD "Enable mpd support" ON) option(ENABLE_MPD "Enable mpd support" ON)
option(ENABLE_I3 "Enable i3 support" OFF) option(ENABLE_I3 "Enable i3 support" OFF)
find_program(I3_EXECUTABLE i3)
if(I3_EXECUTABLE)
message(STATUS "Enabling i3 since executable was found")
set(ENABLE_I3 ON)
else()
message(STATUS "Coult not find i3 executable")
endif()
message(STATUS "---------------------------") message(STATUS "---------------------------")
message(STATUS " Enable ccache support ${ENABLE_CCACHE}") message(STATUS " Enable ccache support ${ENABLE_CCACHE}")
message(STATUS " Enable mpd support ${ENABLE_MPD}") message(STATUS " Enable mpd support ${ENABLE_MPD}")
@ -70,8 +79,6 @@ set(SETTING_PATH_CPU_INFO "/proc/stat"
set(SETTING_PATH_MEMORY_INFO "/proc/meminfo" set(SETTING_PATH_MEMORY_INFO "/proc/meminfo"
CACHE STRING "Path to file containing memory info") CACHE STRING "Path to file containing memory info")
configure_file("${CMAKE_SOURCE_DIR}/include/config.hpp.cmake" "${CMAKE_SOURCE_DIR}/include/config.hpp" ESCAPE_QUOTES @ONLY)
if(ENABLE_CCACHE) if(ENABLE_CCACHE)
find_program(CCACHE_FOUND "ccache") find_program(CCACHE_FOUND "ccache")
if(CCACHE_FOUND) if(CCACHE_FOUND)
@ -107,19 +114,32 @@ set(LINK_LIBS
${CMAKE_THREAD_LIBS_INIT}) ${CMAKE_THREAD_LIBS_INIT})
if(ENABLE_ALSA) if(ENABLE_ALSA)
find_package("ALSA" REQUIRED) find_package("ALSA")
include_directories(${ALSA_INCLUDE_DIRS}) if(ALSA_FOUND)
link_directories(${ALSA_LIBRARY_DIRS}) include_directories(${ALSA_INCLUDE_DIRS})
set(LINK_LIBS ${LINK_LIBS} ${ALSA_LIBRARIES}) link_directories(${ALSA_LIBRARY_DIRS})
set(LINK_LIBS ${LINK_LIBS} ${ALSA_LIBRARIES})
else(ALSA_FOUND)
# graceful fail
message(STATUS "Disabling alsa since required package wasn't found")
set(ENABLE_ALSA OFF)
endif()
endif() endif()
if(ENABLE_MPD) if(ENABLE_MPD)
find_package("LibMPDClient" REQUIRED) find_package("LibMPDClient")
include_directories(${LIBMPDCLIENT_INCLUDE_DIRS}) if(LibMPDClient_FOUND)
link_directories(${LIBMPDCLIENT_LIBRARY_DIRS}) include_directories(${LIBMPDCLIENT_INCLUDE_DIRS})
set(LINK_LIBS ${LINK_LIBS} ${LIBMPDCLIENT_LIBRARY}) link_directories(${LIBMPDCLIENT_LIBRARY_DIRS})
set(LINK_LIBS ${LINK_LIBS} ${LIBMPDCLIENT_LIBRARY})
else(LibMPDClient_FOUND)
# graceful fail
message(STATUS "Disabling mpd since required package wasn't found")
set(ENABLE_MPD OFF)
endif()
endif() endif()
# #
# Install executable and wrapper # Install executable and wrapper
# #
@ -134,6 +154,7 @@ if(ENABLE_I3)
endif() endif()
target_link_libraries(${PROJECT_NAME} ${LINK_LIBS}) target_link_libraries(${PROJECT_NAME} ${LINK_LIBS})
configure_file("${CMAKE_SOURCE_DIR}/include/config.hpp.cmake" "${CMAKE_SOURCE_DIR}/include/config.hpp" ESCAPE_QUOTES @ONLY)
install(TARGETS ${PROJECT_NAME} DESTINATION "bin") install(TARGETS ${PROJECT_NAME} DESTINATION "bin")
install(PROGRAMS "${CMAKE_CURRENT_SOURCE_DIR}/scripts/lemonbuddy_wrapper.sh" DESTINATION "bin") install(PROGRAMS "${CMAKE_CURRENT_SOURCE_DIR}/scripts/lemonbuddy_wrapper.sh" DESTINATION "bin")

View File

@ -3,7 +3,7 @@ Lemonbuddy
A fast and easy-to-use tool for [Lemonbar](https://github.com/LemonBoy/bar/). A fast and easy-to-use tool for [Lemonbar](https://github.com/LemonBoy/bar/).
**Lemonbuddy** aims to help users' build beautiful and highly customizable status bars **Lemonbuddy** aims to help users build beautiful and highly customizable status bars
without messing with named pipes, MacGyver-like scripting or non-blocking without messing with named pipes, MacGyver-like scripting or non-blocking
loops lobotomizing your CPU. loops lobotomizing your CPU.
@ -14,8 +14,11 @@ github.
## Installation ## Installation
Package builds will be released for **AUR** and **XBPS** which will make it ### Arch Linux
alot easier to install. Until then you could build it from source. Install the AUR package `lemonbuddy`
### Void Linux
A package will be written for XBPS so stay tuned.
### Dependencies: ### Dependencies:
@ -29,24 +32,18 @@ A C++ compiler with C++14 support. For example `clang`.
- libx11 - libx11
- libxrandr - libxrandr
- wireless_tools - wireless_tools
- If building with **ENABLE_ALSA** (default) - alsa-lib _optional_
- alsa-lib - libmpdclient _optional_
- If building with **ENABLE_MPD** (default) - libsigc++ _optional_
- libmpdclient
- If building with **ENABLE_I3**
- libsigc++
- i3-wm
- i3ipc-glib
**With Pacman you can install the packages using:** **With Pacman you can install the packages using:**
~~~ sh ~~~ sh
$ pacman -S boost-libs libx11 libxrandr wireless_tools alsa-lib libmpdclient libsigc++ i3-wm $ pacman -S boost-libs libx11 libxrandr wireless_tools alsa-lib libmpdclient libsigc++ i3-wm
$ "i3ipc-glib-git is located in the AUR"
~~~ ~~~
**With XBPS you can install the packages using:** **With XBPS you can install the packages using:**
~~~ sh ~~~ sh
$ xbps-install -S alsa-lib-devel boost-devel i3-devel i3ipc-glib-devel libX11-devel libXrandr-devel libmpdclient-devel libsigc++-devel wireless_tools-devel $ xbps-install -S alsa-lib-devel boost-devel i3-devel libX11-devel libXrandr-devel libmpdclient-devel libsigc++-devel wireless_tools-devel
~~~~ ~~~~
<br> <br>