36 lines
863 B
CMake
36 lines
863 B
CMake
cmake_minimum_required(VERSION 3.10)
|
|
project(azeron-linux VERSION 1.0.0 LANGUAGES C)
|
|
|
|
set(CMAKE_C_STANDARD 11)
|
|
set(CMAKE_C_STANDARD_REQUIRED ON)
|
|
|
|
option(AZERON_DEBUG "Enable debug logging" OFF)
|
|
if(AZERON_DEBUG)
|
|
add_definitions(-DAZERON_DEBUG)
|
|
endif()
|
|
|
|
# Find required packages
|
|
find_package(PkgConfig REQUIRED)
|
|
pkg_check_modules(LIBUSB REQUIRED libusb-1.0>=1.0.16)
|
|
pkg_check_modules(JSON REQUIRED json-c)
|
|
|
|
# Include directories
|
|
include_directories(${LIBUSB_INCLUDE_DIRS})
|
|
include_directories(${JSON_INCLUDE_DIRS})
|
|
|
|
# Library directory
|
|
add_subdirectory(libazeron)
|
|
|
|
# CLI tool
|
|
add_subdirectory(azeron-cli)
|
|
|
|
# Install udev rules
|
|
install(FILES scripts/udev-rules/99-azeron.rules
|
|
DESTINATION /etc/udev/rules.d
|
|
COMPONENT udev)
|
|
|
|
# Install documentation
|
|
install(FILES README.md plan.md
|
|
DESTINATION share/doc/azeron-linux
|
|
COMPONENT doc)
|