add_library(mltopencv MODULE factory.c filter_opencv_tracker.cpp)

file(GLOB YML "*.yml")
add_custom_target(Other_opencv_Files SOURCES
  ${YML}
)
include(GenerateExportHeader)
generate_export_header(mltopencv)
target_compile_options(mltopencv PRIVATE ${MLT_COMPILE_OPTIONS})
target_include_directories(mltopencv PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
target_link_libraries(mltopencv PRIVATE mlt ${OpenCV_LIBS})
if(MSVC)
  target_link_libraries(mltopencv PRIVATE PThreads4W::PThreads4W)
endif()

set_target_properties(mltopencv PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${MLT_MODULE_OUTPUT_DIRECTORY}")

install(TARGETS mltopencv LIBRARY DESTINATION ${MLT_INSTALL_MODULE_DIR})
install(FILES filter_opencv_tracker.yml DESTINATION ${MLT_INSTALL_DATA_DIR}/opencv)
