如何将Libuvc编译到tina系统中
-
这个是我需要编译到系统中的库:https://github.com/libuvc/libuvc
这个库使用的是CMakeLists编译的,我不太会写顶层的makefile,而且libuvc在编译的过程中需要依赖 libc libjpeg libusb-1.0 这三个库,我尝试添加到makefile中但依然报错,请问各位大佬我应该如何修改呢
include $(TOPDIR)/rules.mk PKG_NAME:=libuvc PKG_RELEASE:=1 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) include $(INCLUDE_DIR)/package.mk define Package/libuvc SUBMENU:=Other SECTION:=utils CATEGORY:=Allwinner TITLE:= Libuvc DEPENDS:=+libc +libjpeg +libusb-1.0 endef define Build/Prepare mkdir -p $(PKG_BUILD_DIR) $(CP) ./src/* $(PKG_BUILD_DIR)/ endef define Build/Configure # 这里是cmake生成makefile的代码 endef define Build/Compile # 这里是编译makefile的代码 endef define Package/libuvc/install # 这里安装到系统 $(INSTALL_DIR) $(1)/usr/lib $(INSTALL_BIN) $(PKG_BUILD_DIR)/libuvc.a $(1)/usr/lib $(INSTALL_BIN) $(PKG_BUILD_DIR)/libuvc.so.0.0.6 $(1)/usr/lib $(INSTALL_BIN) $(PKG_BUILD_DIR)/libuvc.so $(1)/usr/lib $(INSTALL_BIN) $(PKG_BUILD_DIR)/libuvc.so.0 $(1)/usr/lib endef $(eval $(call BuildPackage,libuvc))
-
参照opencv的编写使用cmake的makefile
include $(TOPDIR)/rules.mk PKG_NAME:=opencv PKG_VERSION:=4.1.1 PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/opencv/opencv PKG_SOURCE_VERSION:=$(PKG_VERSION) PKG_MIRROR_HASH:=c8587820421d2f22acdafe4712d068ae490897dc445bdb4aa128ecaa8e65d3a1 PKG_MAINTAINER:= PKG_LICENSE:=BSD-3-Clause PKG_LICENSE_FILES:=LICENSE CMAKE_INSTALL:=1 CMAKE_BINARY_SUBDIR:=build PKG_BUILD_PARALLEL:=1 PKG_USE_MIPS16:=0 include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/cmake.mk define Package/opencv/Default/description OpenCV (Open Source Computer Vision Library) is an open source computer vision and machine learning software library. OpenCV was built to provide a common infrastructure for computer vision applications and to accelerate the use of machine perception in the commercial products. Being a BSD-licensed product, OpenCV makes it easy for businesses to utilize and modify the code. endef define Package/opencv SECTION:=libs CATEGORY:=Libraries TITLE:=OpenCV URL:=https://opencv.org/ DEPENDS:=+libpthread +librt +libatomic +libstdcpp +zlib +libjpeg +python3 +python3-numpy endef CMAKE_OPTIONS += \ -DBUILD_opencv_gpu:BOOL=OFF \ -DWITH_1394:BOOL=OFF -DBUILD_opencv_stitching:BOOL=OFF \ -DBUILD_opencv_superres:BOOL=OFF -DBUILD_opencv_ts:BOOL=OFF \ -DBUILD_opencv_highgui:BOOL=ON \ -DBUILD_opencv_videostab:BOOL=OFF \ -DWITH_FFMPEG:BOOL=OFF \ -DWITH_GSTREAMER:BOOL=OFF \ -DWITH_LIBV4L:BOOL=ON \ -DWITH_PNG:BOOL=OFF \ -DWITH_GTK:BOOL=OFF \ -DWITH_TIFF:BOOL=OFF \ -DCMAKE_VERBOSE:BOOL=OFF \ -DENABLE_PRECOMPILED_HEADERS=OFF \ -DPYTHON3_INCLUDE_PATH=$(STAGING_DIR)/usr/include/python3.9 \ -DPYTHON3_LIBRARIES=$(STAGING_DIR)/usr/lib/libpython3.9.so \ -DPYTHON3_NUMPY_INCLUDE_DIRS=$(TARGET_ROOTFS_DIR)/pypi/numpy-1.20.1/ipkg-install/usr/lib/python3.9/site-packages/numpy/core/include \ -DBUILD_OPENCV_PYTHON3:BOOL=ON TARGET_LDFLAGS += -latomic define Package/opencv/install $(INSTALL_DIR) $(1)/usr/lib $(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/ endef $(eval $(call BuildPackage,opencv))
Copyright © 2024 深圳全志在线有限公司 粤ICP备2021084185号 粤公网安备44030502007680号