g13gui/g13d/CMakeLists.txt
June Tate-Gans ae6cf5084a g13d: Rework and cleanup namespaces and files
This is the first half of some major rework of the g13d codebase to make things
a bit more manageable. This splits out a great deal of stuff from helper.h into
separate translation units, and also breaks out a great deal of the g13.h header
into separate translation units as well.

Doing this saves in compilation time as we make changes to the system, and also
helps to clean up a whole bunch of leaking symbols.
2021-04-25 16:35:44 -05:00

40 lines
1.0 KiB
CMake

cmake_minimum_required(VERSION 3.16.3)
project(g13d LANGUAGES CXX VERSION "0.1.0")
configure_file("config.h.in" "config.h")
include_directories(${CMAKE_CURRENT_BINARY_DIR})
set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "Configs" FORCE)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror")
add_executable(pbm2lpbm pbm2lpbm.cc)
add_executable(g13d
device.cc
g13.cc
g13_fonts.cc
g13_keys.cc
g13_lcd.cc
g13_main.cc
g13_stick.cc
helper.cc
manager.cc
)
target_compile_definitions(g13d PRIVATE BOOST_LOG_DYN_LINK=1)
find_package(PkgConfig)
pkg_check_modules(libusb-1.0 REQUIRED libusb-1.0)
find_package(Boost REQUIRED COMPONENTS system log program_options)
target_link_libraries(g13d
${Boost_SYSTEM_LIBRARY} ${Boost_LOG_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY}
${libusb-1.0_LIBRARIES})
install(TARGETS g13d pbm2lpbm RUNTIME)
install(CODE "
execute_process(COMMAND install -d -m 0660 -o root -g input /run/g13d)
message(STATUS \"Install: /run/g13d\")
")