-
Notifications
You must be signed in to change notification settings - Fork 6
/
gen_package.bat
54 lines (39 loc) · 1.43 KB
/
gen_package.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
REM Create releases for Windows with CMake
$echo off
REM *** Get source dir
set SRC_DIR=%~dp0
REM echo %SRC_DIR%
echo %SRC_DIR%
title Build mpeg2ts
echo Build mpeg2ts Windows
echo "1. Create Release/ folders for libraries"
set BUILD_RELEASE_DIR=Release
set BUILD_DEBUG_DIR=Debug
echo %BUILD_RELEASE_DIR% exist, removing %SRC_DIR%\%BUILD_RELEASE_DIR% and creating new one...
if exist %BUILD_RELEASE_DIR% (
echo %BUILD_RELEASE_DIR% exist, removing %SRC_DIR%\%BUILD_RELEASE_DIR% and creating new one...
rmdir /s /q %SRC_DIR%\%BUILD_RELEASE_DIR%
)
echo create new directory: %BUILD_RELEASE_DIR%
mkdir %BUILD_RELEASE_DIR%
cd %SRC_DIR%\%BUILD_RELEASE_DIR%
dir
echo "2.a Configure CMake"
echo Configuring for x86
set CMAKE_CONFIGURE_CMD=cmake -G "Visual Studio 15 2017" --arch "x86" -DENABLE_TESTS=OFF -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON ..
echo CMake configure command:
echo %CMAKE_CONFIGURE_CMD%
%CMAKE_CONFIGURE_CMD%
if %errorlevel% neq 0 exit /b %errorlevel%
echo "2.b Build CMake"
set CMAKE_BUILD_CMD=cmake --build . --config Release --target mpeg2ts
echo CMake build command:
echo %CMAKE_BUILD_CMD%
%CMAKE_BUILD_CMD%
if %errorlevel% neq 0 exit /b %errorlevel%
cd %SRC_DIR%
echo "3. Create CPackConfig.cmake"
echo include("Release/CPackConfig.cmake") > CPackConfig.cmake
echo set(CPACK_INSTALL_CMAKE_PROJECTS "Release;mpeg2ts;ALL;/") >> CPackConfig.cmake
echo "4. Generate package"
cpack -G WIX --config CPackConfig.cmake -C Release