holdingarea/build.bat
branchbug235_bringup_0
changeset 34 dab1d38bc12e
child 37 1a4430846fcf
equal deleted inserted replaced
33:cb4237462c04 34:dab1d38bc12e
       
     1 @echo off
       
     2 
       
     3 rem DOS batch file for building host-side libraries
       
     4 
       
     5 rem Set default values
       
     6 set USE_MINI_EGL=OFF
       
     7 set PLATSIM_EXTENSIONS=ON
       
     8 set VISUAL_STUDIO_VERSION=2005
       
     9 set CMAKE_BUILD_TARGET=Release
       
    10 set VISUAL_STUDIO_SOLUTION=OFF
       
    11 
       
    12 :PARSECOMMANDLINE
       
    13 IF '%1'=='/h' goto PRINTUSAGE
       
    14 IF '%1'=='/H' goto PRINTUSAGE
       
    15 IF '%1'=='/?' goto PRINTUSAGE
       
    16 IF '%1'=='/miniegl' goto ENABLEMINIEGL
       
    17 IF '%1'=='/MINIEGL' goto ENABLEMINIEGL
       
    18 IF '%1'=='/noplatsim' goto DISABLEPLATSIM
       
    19 IF '%1'=='/NOPLATSIM' goto DISABLEPLATSIM
       
    20 IF '%1'=='/vs' goto SETVISUALSTUDIOVERSION
       
    21 IF '%1'=='/VS' goto SETVISUALSTUDIOVERSION
       
    22 IF '%1'=='/solution' goto ENABLESOLUTION
       
    23 IF '%1'=='/SOLUTION' goto ENABLESOLUTION
       
    24 IF '%1'=='/debug' goto ENABLEDEBUG
       
    25 IF '%1'=='/DEBUG' goto ENABLEDEBUG
       
    26 
       
    27 if "%VISUAL_STUDIO_SOLUTION%"=="ON" (
       
    28 	set GENERATOR=Visual Studio 8 2005
       
    29 	if '%VISUAL_STUDIO_VERSION%'=='2008' set GENERATOR=Visual Studio 9 2008
       
    30 ) else (
       
    31 	set GENERATOR=NMake Makefiles
       
    32 )
       
    33 
       
    34 rem Print out options
       
    35 echo.
       
    36 echo USE_MINI_EGL          = %USE_MINI_EGL%
       
    37 echo PLATSIM_EXTENSIONS    = %PLATSIM_EXTENSIONS%
       
    38 echo VISUAL_STUDIO_VERSION = %VISUAL_STUDIO_VERSION%
       
    39 echo GENERATOR             = %GENERATOR%
       
    40 echo CMAKE_BUILD_TARGET    = %CMAKE_BUILD_TARGET%
       
    41 echo.
       
    42 
       
    43 rem Execute
       
    44 echo on
       
    45 rmdir /s /q build
       
    46 mkdir build
       
    47 cd build
       
    48 cmake -DUSE_MINI_EGL:Bool=%USE_MINI_EGL% -DPLATSIM_EXTENSIONS:Bool=%PLATSIM_EXTENSIONS% -DVISUAL_STUDIO_VERSION:String=%VISUAL_STUDIO_VERSION% -DCMAKE_BUILD_TYPE=%CMAKE_BUILD_TARGET% -G "%GENERATOR%" ../..
       
    49 @echo off
       
    50 if "%GENERATOR%"=="NMake Makefiles" (
       
    51 	echo on
       
    52 	nmake
       
    53 	@echo off
       
    54 )
       
    55 @echo off
       
    56 cd ..
       
    57 
       
    58 goto END
       
    59 
       
    60 :PRINTUSAGE
       
    61 echo Usage: build.bat [options]
       
    62 echo Options:"
       
    63 echo     [/H,/?]             print this message and exit
       
    64 echo     [/MINIEGL]          build with miniEGL (default: disabled)
       
    65 echo     [/VS VERSION]       set Visual Studio version
       
    66 echo                         supported versions = 2005, 2008 (default: 2005)
       
    67 echo     [/SOLUTION]         just generate VIsual Studio solution files
       
    68 echo                             (default: generate NMake makefiles and build)
       
    69 echo     [/DEBUG]            configure for debug build (default: release)
       
    70 goto END
       
    71 
       
    72 :ENABLEMINIEGL
       
    73 set USE_MINI_EGL=ON
       
    74 shift
       
    75 goto PARSECOMMANDLINE
       
    76 
       
    77 :DISABLEPLATSIM
       
    78 set PLATSIM_EXTENSIONS=OFF
       
    79 shift
       
    80 goto PARSECOMMANDLINE
       
    81 
       
    82 :SETVISUALSTUDIOVERSION
       
    83 set VISUAL_STUDIO_VERSION=%2
       
    84 shift
       
    85 shift
       
    86 goto PARSECOMMANDLINE
       
    87 
       
    88 :ENABLESOLUTION
       
    89 set VISUAL_STUDIO_SOLUTION=ON
       
    90 shift
       
    91 goto PARSECOMMANDLINE
       
    92 
       
    93 :ENABLEDEBUG
       
    94 set CMAKE_BUILD_TARGET=Debug
       
    95 shift
       
    96 goto PARSECOMMANDLINE
       
    97 
       
    98 :END
       
    99 
       
   100