CMakeLists.txt 1.6 KB

123456789101112131415161718192021222324252627282930
  1. if(IOS OR WINRT OR (NOT HAVE_CUDA AND NOT BUILD_CUDA_STUBS))
  2. ocv_module_disable(cudaoptflow)
  3. endif()
  4. set(the_description "CUDA-accelerated Optical Flow")
  5. ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4127 /wd4324 /wd4512 -Wundef -Wmissing-declarations -Wshadow -Wstrict-aliasing)
  6. ocv_define_module(cudaoptflow opencv_video opencv_optflow opencv_cudaarithm opencv_cudawarping opencv_cudaimgproc OPTIONAL opencv_cudalegacy WRAP python)
  7. if(NOT CUDA_VERSION VERSION_LESS "10.0")
  8. set(NVIDIA_OPTICAL_FLOW_2_0_HEADERS_COMMIT "edb50da3cf849840d680249aa6dbef248ebce2ca")
  9. set(NVIDIA_OPTICAL_FLOW_2_0_HEADERS_MD5 "a73cd48b18dcc0cc8933b30796074191")
  10. set(NVIDIA_OPTICAL_FLOW_2_0_HEADERS_PATH "${OpenCV_BINARY_DIR}/3rdparty/NVIDIAOpticalFlowSDK_2_0_Headers")
  11. ocv_download(FILENAME "${NVIDIA_OPTICAL_FLOW_2_0_HEADERS_COMMIT}.zip"
  12. HASH ${NVIDIA_OPTICAL_FLOW_2_0_HEADERS_MD5}
  13. URL "https://github.com/NVIDIA/NVIDIAOpticalFlowSDK/archive/"
  14. DESTINATION_DIR "${NVIDIA_OPTICAL_FLOW_2_0_HEADERS_PATH}"
  15. STATUS NVIDIA_OPTICAL_FLOW_2_0_HEADERS_DOWNLOAD_SUCCESS
  16. ID "NVIDIA_OPTICAL_FLOW"
  17. UNPACK RELATIVE_URL)
  18. if(NOT NVIDIA_OPTICAL_FLOW_2_0_HEADERS_DOWNLOAD_SUCCESS)
  19. message(STATUS "Failed to download NVIDIA_Optical_Flow_2_0 Headers")
  20. else()
  21. message(STATUS "Building with NVIDIA Optical Flow API 2.0")
  22. add_definitions(-DHAVE_NVIDIA_OPTFLOW=2)
  23. ocv_include_directories(SYSTEM "${NVIDIA_OPTICAL_FLOW_2_0_HEADERS_PATH}/NVIDIAOpticalFlowSDK-${NVIDIA_OPTICAL_FLOW_2_0_HEADERS_COMMIT}")
  24. endif()
  25. endif()