You've already forked libopenshot
mirror of
https://github.com/OpenShot/libopenshot.git
synced 2026-03-02 08:53:52 -08:00
CMake: Reject OpenCV 4.5.1, prepare for 4.5.2+
This commit is contained in:
@@ -393,7 +393,14 @@ if(ENABLE_OPENCV)
|
||||
find_package(OpenCV 4)
|
||||
if(NOT OpenCV_FOUND)
|
||||
set(ENABLE_OPENCV FALSE CACHE BOOL
|
||||
"Build with OpenCV algorithms (requires Boost, Protobuf 3)" FORCE)
|
||||
"Build with OpenCV algorithms (requires Protobuf 3)" FORCE)
|
||||
# If we have version 4.5.1, all hope is lost
|
||||
elseif(OpenCV_VERSION VERSION_EQUAL 4.5.1)
|
||||
message(SEND_ERROR [[Incompatible OpenCV version detected
|
||||
OpenCV version 4.5.1 contains header errors which make it unable to be used with OpenShot. OpenCV support wil be disabled. Upgrade to OpenCV 4.5.2+ or downgrade to 4.5.0 or earlier, to enable OpenCV.
|
||||
See https://github.com/opencv/opencv/issues/19260]])
|
||||
set(ENABLE_OPENCV FALSE CACHE BOOL
|
||||
"Build with OpenCV algorithms (requires Protobuf 3)" FORCE)
|
||||
else()
|
||||
add_subdirectory(protobuf_messages)
|
||||
# Add OpenCV source files
|
||||
@@ -409,10 +416,20 @@ if(ENABLE_OPENCV)
|
||||
opencv_tracking
|
||||
openshot_protobuf
|
||||
)
|
||||
set(HAVE_OPENCV TRUE CACHE BOOL "Building with OpenCV effects" FORCE)
|
||||
mark_as_advanced(HAVE_OPENCV)
|
||||
set(HAVE_OPENCV TRUE CACHE BOOL "Building with OpenCV effects" FORCE)
|
||||
mark_as_advanced(HAVE_OPENCV)
|
||||
|
||||
# Keep track of OpenCV version, to embed in our version header
|
||||
set(OPENCV_VERSION_STR "${OpenCV_VERSION}" CACHE STRING "OpenCV version linked with" FORCE)
|
||||
mark_as_advanced(OPENCV_VERSION_STR)
|
||||
|
||||
# We may need to use Tracker as opencv::legacy::Tracker
|
||||
if(OpenCV_VERSION VERSION_GREATER_EQUAL 4.5.2)
|
||||
target_compile_definitions(openshot PUBLIC USE_LEGACY_TRACKER=1)
|
||||
endif()
|
||||
|
||||
endif()
|
||||
endif()
|
||||
endif() # ENABLE_OPENCV
|
||||
add_feature_info("OpenCV algorithms" ENABLE_OPENCV "Use OpenCV algorithms")
|
||||
|
||||
############### LINK LIBRARY #################
|
||||
|
||||
Reference in New Issue
Block a user