1 Star 0 Fork 0

microbee/rtsp_opencv_publisher

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
CMakeLists.txt 1.70 KB
一键复制 编辑 原始数据 按行查看 历史
breederbai 提交于 2024-09-20 15:38 +08:00 . 修改cmake文件
cmake_minimum_required(VERSION 3.5)
project(rtsp_opencv_publisher)
# Default to C99
if(NOT CMAKE_C_STANDARD)
set(CMAKE_C_STANDARD 99)
endif()
# Default to C++14
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 14)
endif()
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
# find dependencies
find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
find_package(sensor_msgs REQUIRED)
find_package(cv_bridge REQUIRED)
find_package(OpenCV REQUIRED)
# 添加GStreamer的头文件和库
find_package(PkgConfig REQUIRED)
pkg_check_modules(GSTREAMER REQUIRED gstreamer-1.0)
pkg_check_modules(GSTREAMER_BASE REQUIRED gstreamer-base-1.0)
# 添加可执行文件
add_executable(rtsp_publisher_node src/rtsp_publisher_node.cpp)
# 包含头文件
ament_target_dependencies(rtsp_publisher_node rclcpp sensor_msgs cv_bridge OpenCV)
# 链接 OpenCV 库
target_include_directories(rtsp_publisher_node PUBLIC ${GSTREAMER_INCLUDE_DIRS} ${OpenCV_INCLUDE_DIRS})
target_link_libraries(rtsp_publisher_node ${GSTREAMER_LIBRARIES} ${OpenCV_LIBS} avcodec avformat avutil swscale)
if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
# the following line skips the linter which checks for copyrights
# uncomment the line when a copyright and license is not present in all source files
#set(ament_cmake_copyright_FOUND TRUE)
# the following line skips cpplint (only works in a git repo)
# uncomment the line when this package is not in a git repo
#set(ament_cmake_cpplint_FOUND TRUE)
ament_lint_auto_find_test_dependencies()
endif()
# 安装可执行文件
install(TARGETS
rtsp_publisher_node
DESTINATION lib/${PROJECT_NAME})
ament_package()
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/microbee/rtsp_opencv_publisher.git
git@gitee.com:microbee/rtsp_opencv_publisher.git
microbee
rtsp_opencv_publisher
rtsp_opencv_publisher
master

搜索帮助