From 1f0b43632c94a0b84b6d882338d08fd5712e0477 Mon Sep 17 00:00:00 2001 From: Ryan Pavlik Date: Thu, 13 Jun 2019 15:38:18 -0500 Subject: [PATCH] build: Adjust OpenCV components add JPEG and use libusb cmake file --- CMakeLists.txt | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6cc38be82..5ee8e039d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,10 +25,9 @@ find_package(Vulkan REQUIRED) find_package(OpenGL REQUIRED COMPONENTS GLX) find_package(HIDAPI) find_package(OpenHMD) -find_package(OpenCV) - -# @TODO Turn into a find_package LIBUSB-1.0 file. -pkg_check_modules(LIBUSB REQUIRED libusb-1.0) +find_package(OpenCV COMPONENTS core calib3d highgui imgproc imgcodecs features2d video) +find_package(Libusb1) +find_package(JPEG) # @TODO Turn into a find_package LIBUVC file. pkg_check_modules(LIBUVC libuvc) @@ -52,6 +51,7 @@ cmake_dependent_option(BUILD_WITH_XLIB "Enable xlib support" ON "X11_FOUND" OFF) cmake_dependent_option(BUILD_WITH_OPENGL "Enable OpenGL Graphics API support" ON "OPENGL_FOUND" OFF) set(BUILD_WITH_LIBUSB TRUE) +cmake_dependent_option(BUILD_WITH_JPEG "Enable jpeg code (used for some video drivers)" ON "JPEG_FOUND" OFF) cmake_dependent_option(BUILD_WITH_OPENCV "Enable OpenCV backend" ON "OpenCV_FOUND" OFF) cmake_dependent_option(BUILD_WITH_LIBUVC "Enable libuvc video driver" ON "LIBUVC_FOUND" OFF) cmake_dependent_option(BUILD_WITH_FFMPEG "Enable ffmpeg testing video driver" ON "FFMPEG_FOUND" OFF) @@ -84,6 +84,10 @@ if(BUILD_WITH_OPENCV) add_definitions(-DXRT_HAVE_OPENCV) endif() +if(BUILD_WITH_JPEG) + add_definitions(-DXRT_HAVE_JPEG) +endif() + if(BUILD_WITH_LIBUVC) add_definitions(-DXRT_HAVE_LIBUVC) endif()