cmake_minimum_required(VERSION 3.15) project ( RoboMasterSDK VERSION 2.0.0 LANGUAGES C CXX ) set_property(GLOBAL PROPERTY C_STANDARD 17) set_property(GLOBAL PROPERTY CXX_STANDARD 17) add_compile_options(-Wall) add_library(robomaster src/message.c src/modules/sdk.c src/modules/chassis.c src/modules/gimbal.c src/modules/blaster.c src/modules/camera.c src/connection.c src/robomaster.c src/robo.c ) target_include_directories(robomaster PRIVATE src PUBLIC include ) find_package(SDL2 REQUIRED) find_package(OpenCV REQUIRED) find_package(PkgConfig REQUIRED) pkg_check_modules(FFMPEG REQUIRED IMPORTED_TARGET libavcodec libavformat libavutil libswscale) add_executable(robomasterapp src/sdl.cpp ) target_link_libraries(robomasterapp robomaster SDL2::SDL2 ${OpenCV_LIBS} PkgConfig::FFMPEG ) add_executable(stream src/stream.cpp ) target_link_libraries(stream SDL2::SDL2 ${OpenCV_LIBS} PkgConfig::FFMPEG )