forked from ctabin/libzippp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompile.bat
113 lines (96 loc) · 3.32 KB
/
compile.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
@echo off
SET vs2012devprompt=C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\Tools\VsDevCmd.bat
SET zlib=lib\zlib-1.2.11
SET libzip=lib\libzip-1.5.2
if not exist "%zlib%" goto error_zlib_not_found
if not exist "%libzip%" goto error_libzip_not_found
if not exist "%vs2012devprompt%" goto error_vs2012_not_found
call "%vs2012devprompt%"
:compile_zlib
if exist "%zlib%\build" goto compile_libzip
echo Compiling zlib...
cd "%zlib%"
mkdir build
cd "build"
cmake .. -G"Visual Studio 11" -DCMAKE_INSTALL_PREFIX="install"
if %ERRORLEVEL% GEQ 1 goto error_zlib
msbuild /P:Configuration=Debug INSTALL.vcxproj
if %ERRORLEVEL% GEQ 1 goto error_zlib
msbuild /P:Configuration=Release INSTALL.vcxproj
if %ERRORLEVEL% GEQ 1 goto error_zlib
cd "..\..\.."
:compile_libzip
if exist "%libzip%\build" goto prepare_libzippp
echo Compiling libzip...
cd "%libzip%"
mkdir build
cd "build"
cmake .. -G"Visual Studio 11" -DCMAKE_PREFIX_PATH="../../%zlib%/build/install" -DENABLE_COMMONCRYPTO=OFF -DENABLE_GNUTLS=OFF -DENABLE_MBEDTLS=OFF -DENABLE_OPENSSL=OFF -DENABLE_WINDOWS_CRYPTO=ON -DENABLE_BZIP2=OFF -DBUILD_TOOLS=OFF -DBUILD_REGRESS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_DOC=OFF
if %ERRORLEVEL% GEQ 1 goto error_libzip
msbuild /P:Configuration=Debug ALL_BUILD.vcxproj
if %ERRORLEVEL% GEQ 1 goto error_libzip
msbuild /P:Configuration=Release ALL_BUILD.vcxproj
if %ERRORLEVEL% GEQ 1 goto error_libzip
cd "..\..\.."
:prepare_libzippp
if exist "build" goto compile_libzippp
echo Compiling lizippp...
mkdir build
cd "build"
cmake .. -G"Visual Studio 11" -DCMAKE_PREFIX_PATH="%zlib%/build/install" -DLIBZIP_HOME="%libzip%"
if %ERRORLEVEL% GEQ 1 goto error_libzippp
cd ".."
:compile_libzippp
cd "build"
if exist "libzippp_static.lib" goto package_libzippp
msbuild /P:Configuration=Debug ALL_BUILD.vcxproj
if %ERRORLEVEL% GEQ 1 goto error_libzippp
msbuild /P:Configuration=Release ALL_BUILD.vcxproj
if %ERRORLEVEL% GEQ 1 goto error_libzippp
cd ".."
:package_libzippp
if exist "dist\libzippp_static.lib" goto end
mkdir "dist"
cd "dist"
mkdir release
copy ..\src\libzippp.h release
copy ..\build\Release\libzippp_shared_test.exe release
copy ..\build\Release\libzippp_static_test.exe release
copy ..\build\Release\libzippp.dll release
copy ..\build\Release\libzippp.lib release
copy ..\build\Release\libzippp_static.lib release
copy ..\%zlib%\build\Release\zlib.dll release
copy ..\%libzip%\build\lib\Release\zip.dll release
mkdir debug
copy ..\src\libzippp.h debug
copy ..\build\Debug\libzippp_shared_test.exe debug
copy ..\build\Debug\libzippp_static_test.exe debug
copy ..\build\Debug\libzippp.dll debug
copy ..\build\Debug\libzippp.lib debug
copy ..\build\Debug\libzippp_static.lib debug
copy ..\%zlib%\build\Debug\zlibd.dll debug
copy ..\%libzip%\build\lib\Debug\zip.dll debug
cd ..
goto end
:error_zlib_not_found
echo [ERROR] The path was not found: %zlib%.
echo You have to download zlib 1.2.8 and put in the folder %zlib%.
goto end
:error_zlib
echo [ERROR] Unable to compile zlib
goto end
:error_libzip_not_found
echo [ERROR] The path was not found: %libzip%.
echo You have to download libzip 1.0.1 and put it in the folder %libzip%.
goto end
:error_libzip
echo [ERROR] Unable to compile libzip
goto end
:error_vs2012_not_found
echo [ERROR] VS2012 was not found (path not found: %vs2012devprompt%).
goto end
:error_libzippp
echo [ERROR] Unable to compile libzippp
goto end
:end
cmd