Skip to content

Commit e72d353

Browse files
committed
Download cache
1 parent d0c64fc commit e72d353

File tree

13 files changed

+243
-319
lines changed

13 files changed

+243
-319
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
*.user
44
*~
55
.*.swp
6+
.cache
67
.DS_Store
78
.sw[a-z]
89
Thumbs.db

3rdparty/ffmpeg/ffmpeg.cmake

Lines changed: 33 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,37 @@
1-
# Binary branch name: ffmpeg/master_20161202
2-
# Binaries were created for OpenCV: 594c136d1fcbb5816c57516e50f9cbeffbd90835
3-
set(FFMPEG_BINARIES_COMMIT "2a19d0006415955c79431116e4634f04d5eb5a74")
4-
set(FFMPEG_FILE_HASH_BIN32 "f081abd9d6ca7e425d340ce586f9c090")
5-
set(FFMPEG_FILE_HASH_BIN64 "a423363a6eb76d362ca6c406c96c8db6")
6-
set(FFMPEG_FILE_HASH_CMAKE "5346ae1854fc7aa569a722e85af480ec")
1+
function(download_win_ffmpeg script_var)
2+
set(${script_var} "" PARENT_SCOPE)
73

8-
set(FFMPEG_DOWNLOAD_URL ${OPENCV_FFMPEG_URL};$ENV{OPENCV_FFMPEG_URL};https://raw.githubusercontent.com/opencv/opencv_3rdparty/${FFMPEG_BINARIES_COMMIT}/ffmpeg/)
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")
98

10-
ocv_download(PACKAGE opencv_ffmpeg.dll
11-
HASH ${FFMPEG_FILE_HASH_BIN32}
12-
URL ${FFMPEG_DOWNLOAD_URL}
13-
DESTINATION_DIR ${CMAKE_CURRENT_LIST_DIR})
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")
1415

15-
ocv_download(PACKAGE opencv_ffmpeg_64.dll
16-
HASH ${FFMPEG_FILE_HASH_BIN64}
17-
URL ${FFMPEG_DOWNLOAD_URL}
18-
DESTINATION_DIR ${CMAKE_CURRENT_LIST_DIR})
16+
set(FFMPEG_BINARIES_COMMIT "2a19d0006415955c79431116e4634f04d5eb5a74")
17+
set(FFMPEG_DOWNLOAD_DIR "${OpenCV_BINARY_DIR}/3rdparty/ffmpeg")
1918

20-
ocv_download(PACKAGE ffmpeg_version.cmake
21-
HASH ${FFMPEG_FILE_HASH_CMAKE}
22-
URL ${FFMPEG_DOWNLOAD_URL}
23-
DESTINATION_DIR ${CMAKE_CURRENT_LIST_DIR})
24-
25-
include(${CMAKE_CURRENT_LIST_DIR}/ffmpeg_version.cmake)
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+
RELATIVE_URL
29+
STATUS res)
30+
if(NOT res)
31+
set(status FALSE)
32+
endif()
33+
endforeach()
34+
if(status)
35+
set(${script_var} "${FFMPEG_DOWNLOAD_DIR}/ffmpeg_version.cmake" PARENT_SCOPE)
36+
endif()
37+
endfunction()

3rdparty/ippicv/.gitignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

3rdparty/ippicv/downloader.cmake

Lines changed: 0 additions & 110 deletions
This file was deleted.

3rdparty/ippicv/ippicv.cmake

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
function(download_ippicv root_var)
2+
set(${root_var} "" PARENT_SCOPE)
3+
4+
# Commit SHA in the opencv_3rdparty repo
5+
set(IPPICV_COMMIT "81a676001ca8075ada498583e4166079e5744668")
6+
# Define actual ICV versions
7+
if(APPLE)
8+
set(OPENCV_ICV_NAME "ippicv_macosx_20151201.tgz")
9+
set(OPENCV_ICV_HASH "4ff1fde9a7cfdfe7250bfcd8334e0f2f")
10+
set(OPENCV_ICV_PLATFORM "macosx")
11+
set(OPENCV_ICV_PACKAGE_SUBDIR "ippicv_osx")
12+
elseif((UNIX AND NOT ANDROID) OR (UNIX AND ANDROID_ABI MATCHES "x86"))
13+
set(OPENCV_ICV_NAME "ippicv_linux_20151201.tgz")
14+
set(OPENCV_ICV_HASH "808b791a6eac9ed78d32a7666804320e")
15+
set(OPENCV_ICV_PLATFORM "linux")
16+
set(OPENCV_ICV_PACKAGE_SUBDIR "ippicv_lnx")
17+
elseif(WIN32 AND NOT ARM)
18+
set(OPENCV_ICV_NAME "ippicv_windows_20151201.zip")
19+
set(OPENCV_ICV_HASH "04e81ce5d0e329c3fbc606ae32cad44d")
20+
set(OPENCV_ICV_PLATFORM "windows")
21+
set(OPENCV_ICV_PACKAGE_SUBDIR "ippicv_win")
22+
else()
23+
return()
24+
endif()
25+
26+
set(THE_ROOT "${OpenCV_BINARY_DIR}/3rdparty/ippicv")
27+
ocv_download(FILENAME ${OPENCV_ICV_NAME}
28+
HASH ${OPENCV_ICV_HASH}
29+
URL
30+
"${OPENCV_IPPICV_URL}"
31+
"$ENV{OPENCV_IPPICV_URL}"
32+
"https://raw.githubusercontent.com/opencv/opencv_3rdparty/${IPPICV_COMMIT}/ippicv/"
33+
DESTINATION_DIR "${THE_ROOT}"
34+
STATUS res
35+
UNPACK RELATIVE_URL)
36+
37+
if(res)
38+
set(${root_var} "${THE_ROOT}/${OPENCV_ICV_PACKAGE_SUBDIR}" PARENT_SCOPE)
39+
endif()
40+
endfunction()

3rdparty/tbb/CMakeLists.txt

Lines changed: 16 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -6,112 +6,27 @@ if (WIN32 AND NOT ARM)
66
endif()
77

88
set(tbb_ver "tbb44_20160128oss")
9-
set(tbb_url "http://www.threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb44_20160128oss_src_0.tgz")
10-
set(tbb_md5 "9d8a4cdf43496f1b3f7c473a5248e5cc")
9+
set(tbb_filename "4.4.3.tar.gz")
10+
set(tbb_subdir "tbb-4.4.3")
11+
set(tbb_md5 "8e7200af3ac16e91a0d1535c606a485c")
1112
set(tbb_version_file "version_string.ver")
1213
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4702)
1314
ocv_warnings_disable(CMAKE_CXX_FLAGS -Wshadow)
1415

15-
# 4.1 update 4 - The first release that supports Windows RT. Hangs on some Android devices
16-
#set(tbb_ver "tbb41_20130613oss")
17-
#set(tbb_url "http://threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb41_20130613oss_src.tgz")
18-
#set(tbb_md5 "108c8c1e481b0aaea61878289eb28b6a")
19-
#set(tbb_version_file "version_string.ver")
20-
#ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4702)
21-
22-
# 4.1 update 2 - works fine
23-
#set(tbb_ver "tbb41_20130116oss")
24-
#set(tbb_url "http://threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb41_20130116oss_src.tgz")
25-
#set(tbb_md5 "3809790e1001a1b32d59c9fee590ee85")
26-
#set(tbb_version_file "version_string.ver")
27-
#ocv_warnings_disable(CMAKE_CXX_FLAGS -Wshadow)
28-
29-
# 4.1 update 3 dev - Hangs on some Android devices
30-
#set(tbb_ver "tbb41_20130401oss")
31-
#set(tbb_url "http://threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb41_20130401oss_src.tgz")
32-
#set(tbb_md5 "f2f591a0d2ca8f801e221ce7d9ea84bb")
33-
#set(tbb_version_file "version_string.ver")
34-
#ocv_warnings_disable(CMAKE_CXX_FLAGS -Wshadow)
35-
36-
# 4.1 update 2 - works fine
37-
#set(tbb_ver "tbb41_20130116oss")
38-
#set(tbb_url "http://threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb41_20130116oss_src.tgz")
39-
#set(tbb_md5 "3809790e1001a1b32d59c9fee590ee85")
40-
#set(tbb_version_file "version_string.ver")
41-
#ocv_warnings_disable(CMAKE_CXX_FLAGS -Wshadow)
42-
43-
# 4.1 update 1 - works fine
44-
#set(tbb_ver "tbb41_20121003oss")
45-
#set(tbb_url "http://threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb41_20121003oss_src.tgz")
46-
#set(tbb_md5 "2a684fefb855d2d0318d1ef09afa75ff")
47-
#set(tbb_version_file "version_string.ver")
48-
49-
# 4.1 - works fine
50-
#set(tbb_ver "tbb41_20120718oss")
51-
#set(tbb_url "http://threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb41_20120718oss_src.tgz")
52-
#set(tbb_md5 "31b9ec300f3d09da2504d5d882788dd4")
53-
#set(tbb_version_file "version_string.ver")
54-
55-
# 4.0 update 5 - works fine
56-
#set(tbb_ver "tbb40_20120613oss")
57-
#set(tbb_url "http://threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb40_20120613oss_src.tgz")
58-
#set(tbb_md5 "da01ed74944ec5950cfae3476901a172")
59-
#set(tbb_version_file "version_string.ver")
60-
61-
# 4.0 update 4 - works fine
62-
#set(tbb_ver "tbb40_20120408oss")
63-
#set(tbb_url "http://threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb40_20120408oss_src.tgz")
64-
#set(tbb_md5 "734b356da7fe0ed308741f3e6018251e")
65-
#set(tbb_version_file "version_string.ver")
66-
67-
# 4.0 update 3 - build broken
68-
#set(tbb_ver "tbb40_20120201oss")
69-
#set(tbb_url "http://threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb40_20120201oss_src.tgz")
70-
#set(tbb_md5 "4669e7d4adee018de7a7b8b972987218")
71-
#set(tbb_version_file "version_string.tmp")
72-
73-
set(tbb_tarball "${CMAKE_CURRENT_SOURCE_DIR}/${tbb_ver}_src.tgz")
74-
set(tbb_src_dir "${CMAKE_CURRENT_BINARY_DIR}/${tbb_ver}")
75-
76-
if(EXISTS "${tbb_tarball}")
77-
file(MD5 "${tbb_tarball}" tbb_local_md5)
78-
if(NOT tbb_local_md5 STREQUAL tbb_md5)
79-
message(WARNING "Local copy of TBB source tarball has invalid MD5 hash: ${tbb_local_md5} (expected: ${tbb_md5})")
80-
file(REMOVE "${tbb_tarball}")
81-
if(EXISTS "${CMAKE_CURRENT_BINARY_DIR}/${tbb_ver}")
82-
file(REMOVE_RECURSE "${CMAKE_CURRENT_BINARY_DIR}/${tbb_ver}")
83-
endif()
84-
endif()
85-
endif()
86-
87-
if(NOT EXISTS "${tbb_tarball}")
88-
message(STATUS "Downloading ${tbb_ver}_src.tgz")
89-
file(DOWNLOAD "${tbb_url}" "${tbb_tarball}" TIMEOUT 600 STATUS __statvar)
90-
if(NOT __statvar EQUAL 0)
91-
message(FATAL_ERROR "Failed to download TBB sources (${__statvar}): ${tbb_url}")
92-
endif()
93-
file(MD5 "${tbb_tarball}" tbb_local_md5)
94-
if(NOT tbb_local_md5 STREQUAL tbb_md5)
95-
file(REMOVE "${tbb_tarball}")
96-
message(FATAL_ERROR "Downloaded TBB source tarball has invalid MD5 hash: ${tbb_local_md5} (expected: ${tbb_md5})")
97-
endif()
98-
99-
if(EXISTS "${tbb_src_dir}")
100-
file(REMOVE_RECURSE "${tbb_src_dir}")
101-
endif()
102-
endif()
103-
104-
# untar TBB sources
105-
if(NOT EXISTS "${tbb_src_dir}")
106-
message(STATUS "Unpacking ${tbb_ver}_src.tgz to ${tbb_src_dir}")
107-
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xz "${tbb_tarball}"
108-
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
109-
RESULT_VARIABLE tbb_untar_RESULT)
110-
111-
if(NOT tbb_untar_RESULT EQUAL 0 OR NOT EXISTS "${tbb_src_dir}")
112-
message(FATAL_ERROR "Failed to unpack TBB sources from ${tbb_tarball} to ${tbb_src_dir} with error ${tbb_untar_RESULT}")
113-
endif()
16+
set(tbb_src_dir "${OpenCV_BINARY_DIR}/3rdparty/tbb")
17+
ocv_download(FILENAME ${tbb_filename}
18+
HASH ${tbb_md5}
19+
URL
20+
"${OPENCV_TBB_URL}"
21+
"$ENV{OPENCV_TBB_URL}"
22+
"https://github.com/01org/tbb/archive/"
23+
DESTINATION_DIR ${tbb_src_dir}
24+
STATUS res
25+
UNPACK RELATIVE_URL)
26+
if(NOT res)
27+
return()
11428
endif()
29+
set(tbb_src_dir "${tbb_src_dir}/${tbb_subdir}")
11530

11631
ocv_include_directories("${tbb_src_dir}/include"
11732
"${tbb_src_dir}/src/"

CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ ocv_cmake_eval(DEBUG_PRE ONCE)
119119

120120
ocv_clear_vars(OpenCVModules_TARGETS)
121121

122+
include(cmake/OpenCVDownload.cmake)
123+
122124
# ----------------------------------------------------------------------------
123125
# Break in case of popular CMake configuration mistakes
124126
# ----------------------------------------------------------------------------
@@ -301,8 +303,6 @@ OCV_OPTION(CV_ENABLE_INTRINSICS "Use intrinsic-based optimized code" ON )
301303
OCV_OPTION(CV_DISABLE_OPTIMIZATION "Disable explicit optimized code (dispatched code/intrinsics/loop unrolling/etc)" OFF )
302304

303305

304-
OCV_OPTION(DOWNLOAD_EXTERNAL_TEST_DATA "Download external test data (Python executable and OPENCV_TEST_DATA_PATH environment variable may be required)" OFF )
305-
306306

307307
if(ENABLE_IMPL_COLLECTION)
308308
add_definitions(-DCV_COLLECT_IMPL_DATA)
@@ -1108,7 +1108,7 @@ endif(DEFINED WITH_1394)
11081108

11091109
if(DEFINED WITH_FFMPEG OR HAVE_FFMPEG)
11101110
if(WIN32)
1111-
status(" FFMPEG:" WITH_FFMPEG THEN "YES (prebuilt binaries)" ELSE NO)
1111+
status(" FFMPEG:" HAVE_FFMPEG THEN "YES (prebuilt binaries)" ELSE NO)
11121112
else()
11131113
status(" FFMPEG:" HAVE_FFMPEG THEN YES ELSE NO)
11141114
endif()

cmake/OpenCVDetectTBB.cmake

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,9 @@ endfunction()
6868

6969
if(BUILD_TBB)
7070
add_subdirectory("${OpenCV_SOURCE_DIR}/3rdparty/tbb")
71-
message(STATUS "Found TBB: build")
71+
if(NOT TARGET tbb)
72+
return()
73+
endif()
7274
set(HAVE_TBB TRUE)
7375
endif()
7476

0 commit comments

Comments
 (0)