Add ipcgull submodule and require glib

This commit is contained in:
pixl 2022-01-07 02:37:17 -05:00
parent 8e87b73d7d
commit 23291ec382
No known key found for this signature in database
GPG Key ID: 1866C148CD593B6E
5 changed files with 30 additions and 13 deletions

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "src/ipcgull"]
path = src/ipcgull
url = git@github.com:PixlOne/ipcgull.git

View File

@ -8,13 +8,13 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 -Wall -Wextra")
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(Git)
find_package(Git REQUIRED)
# Set version number
if(GIT_FOUND AND EXISTS ${CMAKE_SOURCE_DIR}/.git)
# Set version number and update submodules
if(EXISTS ${CMAKE_SOURCE_DIR}/.git)
execute_process(COMMAND ${GIT_EXECUTABLE} describe
OUTPUT_VARIABLE LOGIOPS_VERSION
RESULT_VARIABLE LOGIOPS_VERSION_RET
@ -25,10 +25,18 @@ if(GIT_FOUND AND EXISTS ${CMAKE_SOURCE_DIR}/.git)
OUTPUT_VARIABLE LOGIOPS_COMMIT_HASH)
set(LOGIOPS_VERSION git-${LOGIOPS_COMMIT_HASH})
endif()
execute_process(COMMAND ${GIT_EXECUTABLE}
submodule update --init --recursive)
string(REGEX REPLACE "\n$" "" LOGIOPS_VERSION ${LOGIOPS_VERSION})
elseif(EXISTS ${CMAKE_SOURCE_DIR}/version.txt)
file(READ version.txt LOGIOPS_VERSION)
string(REGEX REPLACE "\n$" "" LOGIOPS_VERSION ${LOGIOPS_VERSION})
IF(NOT EXISTS src/ipcgull)
message(FATAL_ERROR "Missing ipcgull submodule")
endif()
endif()
if(NOT LOGIOPS_VERSION)
@ -38,4 +46,5 @@ message("LogiOps Version Number: ${LOGIOPS_VERSION}")
add_definitions( -DLOGIOPS_VERSION="${LOGIOPS_VERSION}")
add_subdirectory(src/ipcgull)
add_subdirectory(src/logid)

View File

@ -13,17 +13,18 @@ Default location for the configuration file is /etc/logid.cfg, but another can b
## Dependencies
This project requires a C++14 compiler, `cmake`, `libevdev`, `libudev`, and `libconfig`. For popular distributions, I've included commands below.
This project requires a C++17 compiler, `cmake`, `libevdev`, `libudev`, `glib`, and `libconfig`.
For popular distributions, I've included commands below.
**Arch Linux:** `sudo pacman -S cmake libevdev libconfig pkgconf`
**Arch Linux:** `sudo pacman -S cmake libevdev libconfig pkgconf glib2`
**Debian/Ubuntu:** `sudo apt install cmake libevdev-dev libudev-dev libconfig++-dev`
**Debian/Ubuntu:** `sudo apt install cmake libevdev-dev libudev-dev libconfig++-dev libglib2.0`
**Fedora:** `sudo dnf install cmake libevdev-devel systemd-devel libconfig-devel gcc-c++`
**Fedora:** `sudo dnf install cmake libevdev-devel systemd-devel libconfig-devel gcc-c++ glib2`
**Gentoo Linux:** `sudo emerge dev-libs/libconfig dev-libs/libevdev dev-util/cmake virtual/libudev`
**Gentoo Linux:** `sudo emerge dev-libs/libconfig dev-libs/libevdev dev-libs/glib dev-util/cmake virtual/libudev`
**Solus:** `sudo eopkg install libevdev-devel libconfig-devel libgudev-devel`
**Solus:** `sudo eopkg install libevdev-devel libconfig-devel libgudev-devel glib2`
## Building

1
src/ipcgull Submodule

@ -0,0 +1 @@
Subproject commit 89c6103af33705320494043da86c4709cc938b32

View File

@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.10)
project(logid)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/../CMake")
@ -82,10 +82,13 @@ find_path(EVDEV_INCLUDE_DIR libevdev/libevdev.h
find_library(EVDEV_LIBRARY
NAMES evdev libevdev)
include_directories(${EVDEV_INCLUDE_DIR} ${LIBUDEV_INCLUDE_DIRECTORIES})
set(IPCGULL_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../ipcgull/src/include)
message(${IPCGULL_INCLUDE_DIRS})
include_directories(${EVDEV_INCLUDE_DIR} ${LIBUDEV_INCLUDE_DIRECTORIES} ${IPCGULL_INCLUDE_DIRS})
target_link_libraries(logid ${CMAKE_THREAD_LIBS_INIT} ${EVDEV_LIBRARY} config++
${LIBUDEV_LIBRARIES})
${LIBUDEV_LIBRARIES} ipcgull)
install(TARGETS logid DESTINATION bin)