forked from kcwongjoe/directshow_camera
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcopy_dll.bat
82 lines (64 loc) · 2.32 KB
/
copy_dll.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
@echo off
setlocal enabledelayedexpansion
:: Get current path
SET CURRENT_PATH=%~dp0
:: Load vcpkg path from config folder. If vcpkg_path.txt is not found, current folder will be used.
set "VCPKG_PATH_TXT_FILE=.\config\vcpkg_path.txt"
if exist %VCPKG_PATH_TXT_FILE% (
set /p VCPKG_PATH=<%VCPKG_PATH_TXT_FILE%
) else (
set "VCPKG_PATH=.\vcpkg"
)
:: Window version
if "%~1" == "x86" (
set "VCPKG_PATH=%VCPKG_PATH%\installed\x86-windows"
)
if "%~1" == "x64" (
set "VCPKG_PATH=%VCPKG_PATH%\installed\x64-windows"
)
:: Get vcpkg dll location
set "VCPKG_PATH_DEBUG=%VCPKG_PATH%\debug\bin"
set "VCPKG_PATH_RELEASE=%VCPKG_PATH%\bin"
:: Set Copy target information
set "TARGET_DIR[0]=build/examples"
set "TARGET_DIR[1]=build/test"
mkdir build
for /l %%i in (0,1,1) do (
call set "CURRENT_TARGET_DIR=%%TARGET_DIR[%%i]%%"
:: Make folder
mkdir "!CURRENT_TARGET_DIR!"
mkdir "!CURRENT_TARGET_DIR!/Debug"
mkdir "!CURRENT_TARGET_DIR!/Release"
:: Go to Debug
cd !CURRENT_TARGET_DIR!/Debug
echo "Start to copy dll from %VCPKG_PATH_DEBUG% to !CURRENT_TARGET_DIR!/Debug"
:: Copy dll
xcopy "%VCPKG_PATH_DEBUG%\jpeg62.dll" "."
xcopy "%VCPKG_PATH_DEBUG%\libpng16d.dll" "."
xcopy "%VCPKG_PATH_DEBUG%\lzmad.dll" "."
xcopy "%VCPKG_PATH_DEBUG%\opencv_cored.dll" "."
xcopy "%VCPKG_PATH_DEBUG%\opencv_imgcodecsd.dll" "."
xcopy "%VCPKG_PATH_DEBUG%\opencv_imgprocd.dll" "."
xcopy "%VCPKG_PATH_DEBUG%\opencv_photod.dll" "."
xcopy "%VCPKG_PATH_DEBUG%\tiffd.dll" "."
xcopy "%VCPKG_PATH_DEBUG%\webpd.dll" "."
xcopy "%VCPKG_PATH_DEBUG%\zlibd1.dll" "."
:: Exit Debug
cd %CURRENT_PATH%
echo "Start to copy dll from %VCPKG_PATH_RELEASE% to !CURRENT_TARGET_DIR!/Release"
:: Go to Release
cd !CURRENT_TARGET_DIR!/Release
:: Copy dll
xcopy "%VCPKG_PATH_RELEASE%\jpeg62.dll" "."
xcopy "%VCPKG_PATH_RELEASE%\libpng16.dll" "."
xcopy "%VCPKG_PATH_RELEASE%\lzma.dll" "."
xcopy "%VCPKG_PATH_RELEASE%\opencv_core.dll" "."
xcopy "%VCPKG_PATH_RELEASE%\opencv_imgcodecs.dll" "."
xcopy "%VCPKG_PATH_RELEASE%\opencv_imgproc.dll" "."
xcopy "%VCPKG_PATH_RELEASE%\opencv_photo.dll" "."
xcopy "%VCPKG_PATH_RELEASE%\tiff.dll" "."
xcopy "%VCPKG_PATH_RELEASE%\webp.dll" "."
xcopy "%VCPKG_PATH_RELEASE%\zlib1.dll" "."
:: Exit Debug
cd %CURRENT_PATH%
)