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 114 115 116 117 118 119 120 121 122 123 124 125
|
::
:: Copyright (C) 2005-2020 Centre National d'Etudes Spatiales (CNES)
::
:: This file is part of Orfeo Toolbox
::
:: https://www.orfeo-toolbox.org/
::
:: Licensed under the Apache License, Version 2.0 (the "License");
:: you may not use this file except in compliance with the License.
:: You may obtain a copy of the License at
::
:: http://www.apache.org/licenses/LICENSE-2.0
::
:: Unless required by applicable law or agreed to in writing, software
:: distributed under the License is distributed on an "AS IS" BASIS,
:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
:: See the License for the specific language governing permissions and
:: limitations under the License.
@echo off
:: check input arguments
if %1.==. (
echo "No arch"
call :Help
goto :eof
)
if %2.==. (
echo "No project"
call :Help
goto :eof
)
if /I "%1"=="help" (
call :Help
goto :eof
)
if /I "%1"=="/help" (
call :Help
goto :eof
)
if /I "%1"=="-help" (
call :Help
goto :eof
)
set ARCH=%1
set PROJECT=%2
if %3.==. (
set SHORT_TARGET=10
) else (
set SHORT_TARGET=%3
)
if %4.==. (
set VCVER=14.0
) else (
set VCVER=%4
)
set TARGET=%SHORT_TARGET%
if "%TARGET%"=="10" (
set TARGET=10.0.17763.0
)
:: Setup home dir (so that ssh configuration works fine)
:: if "%USERNAME%"=="otbbot" (
set HOMEDRIVE=C:
set HOMEPATH=\Users\otbbot
::)
echo Home dir: %HOMEDRIVE%%HOMEPATH%
:: Setup Python
set PATH=C:\tools\Python35-%ARCH%;%PATH%
set PATH=C:\tools\Python35-%ARCH%\Scripts;%PATH%
:: Setup GL dlls
set PATH=%PATH%;C:\tools\GL\%ARCH%\bin
:: Setup compiler
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" %ARCH% %TARGET% -vcvars_ver=%VCVER%
:: Setup Clcache
set CLCACHE_DIR=C:\clcache\%PROJECT%-%ARCH%-%TARGET%-%VCVER%
set CLCACHE_HARDLINK=1
:: set CLCACHE_SERVER=1
set CLCACHE_CL=
for /F "delims=" %%a in ('where cl.exe') do @if defined CLCACHE_CL (break ) else (set CLCACHE_CL=%%a)
echo CL path: "%CLCACHE_CL%"
:: install clcache.exe as cl.exe
copy C:\tools\Python35-%ARCH%\Scripts\clcache.exe C:\clcache\cl.exe
set PATH=C:\clcache;%PATH%
:: we need to change cache max size: clcache -M <size-in-bytes>
if "%PROJECT%"=="xdk" (
call "clcache.exe" -M 3000000000
)
if "%PROJECT%"=="otb" (
call "clcache.exe" -M 2000000000
)
set IMAGE_NAME=windows-%SHORT_TARGET%-%ARCH%-vc%VCVER%
echo Generated IMAGE_NAME: %IMAGE_NAME%
:: setup path to perl, but add it last ... (there is a libstdc++.dll in that folder...)
set PATH=%PATH%;C:\tools\perl\perl\bin
goto :eof
:Help
setlocal
echo "Usage: dev_env.bat <compiler_arch> <project> [<target-os> [<vc_version>]]"
echo " <compiler_arch> : 'x86' | 'x64'"
echo " <project> : 'xdk' | 'otb'"
echo " <target-os> : '8.1' | '10' (default)"
echo " <vc_version> :"
echo " '14.20' (i.e. VS 2019)"
echo " '14.16' (i.e. VS 2017)"
echo " '14.0' (i.e. VS 2015) (default)"
endlocal
|