cmake: update ocv_download
[platform/upstream/opencv.git] / 3rdparty / ffmpeg / ffmpeg.cmake
1 function(download_win_ffmpeg script_var)
2   set(${script_var} "" PARENT_SCOPE)
3
4   set(ids BIN32 BIN64 CMAKE)
5   set(name_BIN32 "opencv_ffmpeg.dll")
6   set(name_BIN64 "opencv_ffmpeg_64.dll")
7   set(name_CMAKE "ffmpeg_version.cmake")
8
9   # Binary branch name: ffmpeg/master_20161202
10   # Binaries were created for OpenCV: 594c136d1fcbb5816c57516e50f9cbeffbd90835
11   set(FFMPEG_BINARIES_COMMIT "2a19d0006415955c79431116e4634f04d5eb5a74")
12   set(FFMPEG_FILE_HASH_BIN32 "f081abd9d6ca7e425d340ce586f9c090")
13   set(FFMPEG_FILE_HASH_BIN64 "a423363a6eb76d362ca6c406c96c8db6")
14   set(FFMPEG_FILE_HASH_CMAKE "5346ae1854fc7aa569a722e85af480ec")
15
16   set(FFMPEG_BINARIES_COMMIT "2a19d0006415955c79431116e4634f04d5eb5a74")
17   set(FFMPEG_DOWNLOAD_DIR "${OpenCV_BINARY_DIR}/3rdparty/ffmpeg")
18
19   set(status TRUE)
20   foreach(id ${ids})
21     ocv_download(FILENAME ${name_${id}}
22                HASH ${FFMPEG_FILE_HASH_${id}}
23                URL
24                  "$ENV{OPENCV_FFMPEG_URL}"
25                  "${OPENCV_FFMPEG_URL}"
26                  "https://raw.githubusercontent.com/opencv/opencv_3rdparty/${FFMPEG_BINARIES_COMMIT}/ffmpeg/"
27                DESTINATION_DIR ${FFMPEG_DOWNLOAD_DIR}
28                ID FFMPEG
29                RELATIVE_URL
30                STATUS res)
31     if(NOT res)
32       set(status FALSE)
33     endif()
34   endforeach()
35   if(status)
36     set(${script_var} "${FFMPEG_DOWNLOAD_DIR}/ffmpeg_version.cmake" PARENT_SCOPE)
37   endif()
38 endfunction()