# SPDX-License-Identifier: BSD-2-Clause # # daedalus-v4l2 userspace daemon — CMake build. # # Notes: # - FFmpeg is dlopen'd at runtime (Option γ), so we link only # -ldl + -lpthread. Headers from libavformat-dev / # libavcodec-dev / libavutil-dev are used at compile time # for struct definitions. # - Strict warnings enforced. cmake_minimum_required(VERSION 3.20) project(daedalus_v4l2_daemon C) set(CMAKE_C_STANDARD 11) set(CMAKE_C_STANDARD_REQUIRED ON) if (NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Release) endif() add_compile_options(-Wall -Wextra -Wpedantic -Wno-unused-parameter) # FFmpeg headers (we dlopen the libs but include the headers for # struct definitions). pkg-config is the canonical way. find_package(PkgConfig REQUIRED) pkg_check_modules(FFMPEG REQUIRED IMPORTED_TARGET libavformat libavcodec libavutil) add_executable(daedalus_v4l2_daemon src/main.c src/ffmpeg_loader.c src/log.c src/parser.c ) target_include_directories(daedalus_v4l2_daemon PRIVATE src ${FFMPEG_INCLUDE_DIRS} ) # dl for dlopen, pthread for future threading work. target_link_libraries(daedalus_v4l2_daemon PRIVATE dl pthread ) install(TARGETS daedalus_v4l2_daemon RUNTIME DESTINATION /usr/local/bin)