IceGStreamer/CMakeLists.txt

25 lines
1.1 KiB
CMake

cmake_minimum_required(VERSION 3.22) # CMake version check
project(IceGStreamer) # Create project "IceGStreamer"
set(CMAKE_CXX_STANDARD 17) # Enable c++17 standard
set(CMAKE_CXX_STANDARD_REQUIRED ON) # Enforce c++17 standard
set(CMAKE_CXX_COMPILER clang++)
find_package(PkgConfig REQUIRED)
pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0>=2.70.2)
pkg_check_modules(GST-B REQUIRED IMPORTED_TARGET gstreamer-base-1.0>=1.18.6)
pkg_check_modules(YAML-CPP REQUIRED IMPORTED_TARGET yaml-cpp>=0.7.0)
pkg_check_modules(LIBCURL REQUIRED IMPORTED_TARGET libcurl>=7.81.0)
# Add main.cpp file of project root directory as source file
file(GLOB MODULE_FILES src/modules/*.cpp)
# Add executable target with source files listed in MODULE_FILES variable
add_library(icegstreamer-modules ${MODULE_FILES})
add_executable(icegstreamer src/main.cpp)
target_link_libraries(icegstreamer-modules PUBLIC PkgConfig::GLIB PkgConfig::GST-B PkgConfig::YAML-CPP PkgConfig::LIBCURL)
target_link_libraries(icegstreamer PUBLIC icegstreamer-modules)
install(TARGETS icegstreamer RUNTIME DESTINATION bin)