-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathenvsetupsdk.cmd
98 lines (82 loc) · 3.39 KB
/
envsetupsdk.cmd
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
@echo off
SET MG_VER_MAJOR=%1
SET MG_VER_MINOR=%2
SET MG_VER_REV=%3
SET MG_VER_BUILD=%4
SET MG_VERSION=%1.%2
SET MG_VER_TRIPLET=%1.%2.%3
SET SWIG_TOOL_PATH=D:\swigwin-3.0.12
SET MG_SDK_DIR=sdk/%MG_VERSION%
IF NOT EXIST %MG_SDK_DIR% (
echo No SDK found at [%MG_SDK_DIR%]
exit /b 1
)
SET PHP_SRC=%CD%/thirdparty/php7/src/php-7.2.6
SET MG_OEM_ACE_INCLUDE_DIR=../../../%MG_SDK_DIR%/Inc/ACE_wrappers
SET MG_HTTPHANDLER_INCLUDE_DIR=../../../%MG_SDK_DIR%/Inc/Web/HttpHandler
SET MG_WEBAPP_INCLUDE_DIR=../../../%MG_SDK_DIR%/Inc/Web/WebApp
SET MG_WEBSUPPORT_INCLUDE_DIR=../../../%MG_SDK_DIR%/Inc/Web/WebSupport
SET MG_MDFMODEL_INCLUDE_DIR=../../../%MG_SDK_DIR%/Inc/Common/MdfModel
SET MG_FOUNDATION_INCLUDE_DIR=../../../%MG_SDK_DIR%/Inc/Common/Foundation
SET MG_GEOMETRY_INCLUDE_DIR=../../../%MG_SDK_DIR%/Inc/Common/Geometry
SET MG_PLATFORMBASE_INCLUDE_DIR=../../../%MG_SDK_DIR%/Inc/Common/PlatformBase
SET MG_MAPGUIDECOMMON_INCLUDE_DIR=../../../%MG_SDK_DIR%/Inc/Common/MapGuideCommon
SET PHP_LIB=%CD%/thirdparty/php7/dev
SET PHP_LIB64=%CD%/thirdparty/php7/dev64
SET MG_SDK_INC=../../../%MG_SDK_DIR%/Inc
SET MG_SDK_LIB=../../../%MG_SDK_DIR%/Lib
SET MG_SDK_LIB64=../../../%MG_SDK_DIR%/Lib64
REM restore nuget packages just in case
pushd src\Tools
call dotnet restore
popd
echo Preparing SWIG configurations
pushd src\Tools\SwigPrepare
call dotnet run ..\..\..\sdk\%MG_VERSION% ..\..\Bindings\MapGuideApi
popd
echo Stamping version [%MG_VER_MAJOR%.%MG_VER_MINOR%.%MG_VER_REV%.%MG_VER_BUILD%]
pushd src\Tools\StampVer
call dotnet run ..\.. %MG_VER_MAJOR% %MG_VER_MINOR% %MG_VER_REV% %MG_VER_BUILD%
popd
echo Preparing native binaries for nuget package
copy /y "sdk\%MG_VERSION%\Bin\*.dll" "src\Bindings\DotNet\MapGuideDotNetApi\runtimes\win-x86\native"
copy /y "sdk\%MG_VERSION%\Bin64\*.dll" "src\Bindings\DotNet\MapGuideDotNetApi\runtimes\win-x64\native"
IF "%MG_VERSION%"=="3.3" goto setvcvarsall_2015
IF "%MG_VERSION%"=="3.1" goto setvcvarsall_2015
goto error
:setvcvarsall_2015
if "%CALLED_VCVARS%"=="1" (
echo Already set up vcvars
goto done
)
set PARAM1=x86_amd64
rem VS 2015 will be default from now
SET VCBEXTENSION=_vs15
SET VC_COMPILER=vc140
SET ACTIVENAMECHECK="Microsoft Visual Studio 15"
rem Test [VS2017 + 2015 compiler workload] cases first
SET ACTIVEPATHCHECK=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build
if exist "%ACTIVEPATHCHECK%" goto VS17Exist
SET ACTIVEPATHCHECK=C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Auxiliary\Build
if exist "%ACTIVEPATHCHECK%" goto VS17Exist
SET ACTIVEPATHCHECK=C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build
if exist "%ACTIVEPATHCHECK%" goto VS17Exist
rem Then test for original VS 2015
SET ACTIVEPATHCHECK=C:\Program Files\Microsoft Visual Studio 14.0\VC
if exist "%ACTIVEPATHCHECK%" goto VSExist
SET ACTIVEPATHCHECK=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC
if exist "%ACTIVEPATHCHECK%" goto VSExist
goto error
:VS17Exist
rem This will instruct the 2017 vcvarsall to use the v140 toolset
rem https://docs.microsoft.com/en-us/visualstudio/releasenotes/vs2017-relnotes-v15.3#C++ToolsetLibs15
SET PARAM2=-vcvars_ver=14.0
:VSExist
call "%ACTIVEPATHCHECK%/vcvarsall.bat" %PARAM1% %PARAM2%
set CALLED_VCVARS=1
goto done
:error
echo Unable to find Visual Studio or your version of MapGuide is not supported by this script
exit /B 1
:done
echo Environment set for [%MG_VERSION%] using SDK in [%MG_SDK_DIR%]