-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathvsvars2015.sh
executable file
·129 lines (114 loc) · 3.56 KB
/
vsvars2015.sh
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
126
127
128
129
# === UCSF ChimeraX Copyright ===
# Copyright 2016 Regents of the University of California.
# All rights reserved. This software provided pursuant to a
# license agreement containing restrictions on its disclosure,
# duplication and use. For details see:
# http://www.rbvi.ucsf.edu/chimerax/docs/licensing.html
# This notice must be embedded in or attached to all copies,
# including partial copies, of the software or any revisions
# or derivations thereof.
# === UCSF ChimeraX Copyright ===
# port of VSINSTALLDIR/Common7/Tools/vsvars32.bat to bash
# and merged with Visual Studio 2008's version and 64-bit version
B64=""
AMD64=""
X64=""
if [ -e "/cygdrive/c/Program Files (x86)/Microsoft Visual Studio 14.0" ]
then
echo Setting environment for using Microsoft Visual Studio 2015
platform=2015
VSINSTALLDIR="c:\\Program Files (x86)\\Microsoft Visual Studio 14.0"
WindowsSdkDir="c:\\Program Files (x86)\\Windows Kits\\10"
MicrosoftSdkDir="c:\Program Files (x86)\Microsoft SDKs\Windows Kits\10"
if [ -d "/cygdrive/c/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/amd64" ]
then
echo Using native 64 bit tools
B64="64"
AMD64="amd64"
X64="\\x64"
else
echo Using native 32 bit tools
fi
VCINSTALLDIR="$VSINSTALLDIR\\VC"
FrameworkVersion=v4.0.30319
FrameworkVersion64=v4.0.30319
Framework40Version=v4.0
VisualStudioVersion=14.0
WindowsSDKLibVersion=10.0.10586.0
WindowsSDKVersion=10.0.10586.0
else
echo "error: Microsoft Visual C++ 2015 compiler not found"
exit 1
fi
export VSINSTALLDIR
export VCINSTALLDIR
export FrameworkDir="c:\\Windows\\Microsoft.NET\\Framework$B64"
export VisualStudioVersion
function GetMicrosoftSdkDir () {
GetMicrosoftSdkDirHelper HKLM > /dev/null 2>&1
if [ $? -ne 0 ]
then
GetMicrosoftSdkDirHelper HKCU > /dev/null 2>&1
if [ $? -ne 0 ]
then
# VS2003 location
export MicrosoftSdkDir="$VCINSTALLDIR\\PlatformSDK"
fi
fi
return 0
}
function GetMicrosoftSdkDirHelper () {
i=`regtool get "/$1/SOFTWARE/Microsoft/Microsoft SDKs/Windows/CurrentInstallFolder"`
if [ "$i" ]
then
export MicrosoftSdkDir="$i"
return 0
fi
return 1
}
GetMicrosoftSdkDir
# Don't care about .NET tools, libs or includes
#if [ "$MicrosoftSdkDir" ]
#then
# WSD=`cygpath -u "$MicrosoftSdkDir"`
# export PATH="$WSD/bin:$PATH"
# export INCLUDE="$MicrosoftSdkDir\\include;$INCLUDE"
# export LIB="$MicrosoftSdkDir\\lib$X64;$LIB"
# unset WSD
#fi
#
# Root of Visual Studio ide installed files.
#
export DevEnvDir="$VSINSTALLDIR\\Common7\\IDE"
DED=`cygpath -u "$DevEnvDir"`
VSD=`cygpath -u "$VSINSTALLDIR"`
VCD=`cygpath -u "$VCINSTALLDIR"`
FD=`cygpath -u "$FrameworkDir"`
WSD=`cygpath -u "$WindowsSdkDir"`
export PATH="$VCD/bin/$AMD64:\
$WSD/bin/x64:\
$VCD/VCPackages:\
$VSD/Common7/IDE:\
$VSD/Common7/Tools:\
$VSD/Team Tools/Performance Tools/x64:\
$PATH"
export INCLUDE="$VCINSTALLDIR\\include;\
$VCINSTALLDIR\\atlmfc\\include;\
$WindowsSdkDir\\include\\$WindowsSDKVersion\\ucrt;\
$WindowsSdkDir\\include\\$WindowsSDKVersion\\shared;\
$WindowsSdkDir\\include\\$WindowsSDKVersion\\um;\
$WindowsSdkDir\\include\\$WindowsSDKVersion\\winrt;\
$INCLUDE"
#$UniversalCRTSdkDir\\include\\$UCRTVersion\\ucrt
export LIB="$VCINSTALLDIR\\lib\\$AMD64;\
$VCINSTALLDIR\\atlmfc\\lib\\$AMD64;\
$WindowsSdkDir\\lib\\$WindowsSDKLibVersion\\ucrt$X64;\
$WindowsSdkDir\\lib\\$WindowsSDKLibVersion\\um$X64;\
$LIB"
export LIBPATH="$VCINSTALLDIR\\lib\\$AMD64;\
$VCINSTALLDIR\\atlmfc\\lib\\$AMD64;\
$WindowsSdkDir\\UnionMetadata;\
$WindowsSdkDir\\References;\
$MicrosoftSdkDir\\ExtensionSDKs\\Microsoft.VCLibs\\$VisualStudioVersion\\References\\CommonConfiguration\neutral;\
$LIBPATH"
unset DED VSD VCD FD WSD