forked from MRPT/mrpt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathautomated_build_msvc_binary_package.bat
77 lines (63 loc) · 2.16 KB
/
automated_build_msvc_binary_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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
REM @echo off
REM ---------------------------------------------------------------------------
REM Batch file for generating MRPT binary packages for MSVC binary releases
REM
REM Usage:
REM From a directory already with a CMakeCache.txt:
REM
REM > automated_build_msvc_binary_package.bat <PATH_TO_MRPT_SRCS>
REM
REM ---------------------------------------------------------------------------
set MSVC_VERBOSITY=normal
REM Make sure params are OK:
REM ------------------------------
IF "%1" == "" GOTO SHOW_USAGE
IF NOT EXIST "%1" GOTO SHOW_USAGE2
IF NOT EXIST "%1\version_prefix.txt" GOTO SHOW_USAGE2
IF EXIST ".\version_prefix.txt" GOTO NO_GOOD
REM 1) Compile debug libs (so Cmake find them in the next run)
REM ----------------------------------------------
cmake --build . --config Debug --target all_mrpt_libs
IF %ERRORLEVEL% NEQ 0 GOTO BAD_RETCODE
REM 2) re-call CMake to detect the debug libs
REM ----------------------------------------------
cmake .
IF %ERRORLEVEL% NEQ 0 GOTO BAD_RETCODE
REM 3) Do unit tests:
REM ----------------------------------------------
cmake --build . --config Release --target test
IF %ERRORLEVEL% NEQ 0 GOTO BAD_RETCODE
REM 4) All seem OK. Build all.
REM ----------------------------------------------
cmake --build . --config Release
IF %ERRORLEVEL% NEQ 0 GOTO BAD_RETCODE
REM 5) Build package:
REM ----------------------------------------------
cmake --build . --config Release --target PACKAGE
goto END_BATCH
REM ============== END ====================
:SHOW_USAGE
ECHO Usage:
ECHO From a directory already with a CMakeCache.txt:
ECHO.
ECHO automated_build_msvc_binary_package.bat (PATH_TO_MRPT_SRCS)
ECHO.
goto END_BATCH
:SHOW_USAGE2
ECHO Error: Supplied path "%1" doesn't exist or is not the MRPT source root dir.
echo.
goto SHOW_USAGE
:NO_GOOD
ECHO.
ECHO Error: It's not a good idea to build in the source tree.
echo Please try in another directory.
echo.
goto END_BATCH
:BAD_RETCODE
ECHO.
ECHO *****************************************
ECHO ** THE LAST COMMAND FAILED! Look at it **
ECHO *****************************************
ECHO.
goto END_BATCH
:END_BATCH