blob: ef664d17a718e36a7fece23bd0f4bc7d3ce2fa47 [file] [log] [blame]
James E. King, III07f59972017-03-10 06:18:33 -05001::
2:: Licensed under the Apache License, Version 2.0 (the "License");
3:: you may not use this file except in compliance with the License.
4:: You may obtain a copy of the License at
5::
6:: http://www.apache.org/licenses/LICENSE-2.0
7::
8:: Unless required by applicable law or agreed to in writing, software
9:: distributed under the License is distributed on an "AS IS" BASIS,
10:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11:: See the License for the specific language governing permissions and
12:: limitations under the License.
13::
14
James E. King III860a5f12018-03-06 14:23:23 -050015@ECHO OFF
16
Mario Emmenlauerce648802021-08-05 17:10:09 +020017:: PLATFORM is x86 or x64
18:: NORM_PLATFORM is 32 or 64
19:: MSVCPLAT is x86 or amd64
20IF "%PLATFORM%" == "x86" (
21 SET NORM_PLATFORM=32
22) ELSE (
23 SET NORM_PLATFORM=64
24)
25IF "%PLATFORM%" == "x86" (
26 SET MSVCPLAT=x86
27) ELSE (
28 SET MSVCPLAT=amd64
29)
30
31IF "%PROFILE%" == "MSVC2015" (
32 IF "%PLATFORM%" == "x86" (
33 CALL "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86 || EXIT /B
34 ) ELSE (
35 CALL "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64 || EXIT /B
36 CALL "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86_amd64 || EXIT /B
37 )
James E. King, III07f59972017-03-10 06:18:33 -050038) ELSE IF "%PROFILE%" == "MSVC2017" (
Mario Emmenlauerce648802021-08-05 17:10:09 +020039 IF "%PLATFORM%" == "x86" (
40 CALL "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars32.bat" || EXIT /B
41 ) ELSE (
42 CALL "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat" || EXIT /B
43 )
44) ELSE IF "%PROFILE%" == "MSVC2019" (
45 IF "%PLATFORM%" == "x86" (
46 CALL "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars32.bat" || EXIT /B
47 ) ELSE (
48 CALL "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat" || EXIT /B
49 )
James E. King, III07f59972017-03-10 06:18:33 -050050) ELSE IF "%PROFILE%" == "MINGW" (
James E. King III860a5f12018-03-06 14:23:23 -050051 REM Supported, nothing special to do here.
52) ELSE IF "%PROFILE%" == "CYGWIN" (
53 REM Supported, nothing special to do here.
James E. King, III07f59972017-03-10 06:18:33 -050054) ELSE (
55 ECHO Unsupported PROFILE=%PROFILE% or PLATFORM=%PLATFORM%
56 EXIT /B 1
57)
58
Mario Emmenlauer9e3ac852021-08-05 12:42:21 +020059CALL win_setcompiler.bat || EXIT /B
60CALL win_setgenerator.bat || EXIT /B
James E. King, III07f59972017-03-10 06:18:33 -050061
62SET APPVEYOR_SCRIPTS=%APPVEYOR_BUILD_FOLDER%\build\appveyor
James E. King III860a5f12018-03-06 14:23:23 -050063SET BUILDDIR=%APPVEYOR_BUILD_FOLDER%\..\build\%PROFILE%\%PLATFORM%
Mario Emmenlauerce648802021-08-05 17:10:09 +020064SET INSTDIR=%APPVEYOR_BUILD_FOLDER%\..\install\%PROFILE%\%PLATFORM%
James E. King, III07f59972017-03-10 06:18:33 -050065SET SRCDIR=%APPVEYOR_BUILD_FOLDER%
66
James E. King, III33df4eb2017-04-06 08:45:17 -040067
Mario Emmenlauer22bb5502021-08-05 15:40:19 +020068IF "%PROFILE_CLASS%" == "MSVC" (
James E. King, III33df4eb2017-04-06 08:45:17 -040069
James E. King III860a5f12018-03-06 14:23:23 -050070 :: FindBoost needs forward slashes so cmake doesn't see something as an escaped character
71 SET BOOST_ROOT=C:/Libraries/boost_%BOOST_VERSION:.=_%
72 SET BOOST_LIBRARYDIR=!BOOST_ROOT!/lib%NORM_PLATFORM%-msvc-%COMPILER:~-3,2%.%COMPILER:~-1,1%
73 SET OPENSSL_ROOT=C:\OpenSSL-Win%NORM_PLATFORM%
74 SET WIN3P=%APPVEYOR_BUILD_FOLDER%\thirdparty
James E. King, III33df4eb2017-04-06 08:45:17 -040075
James E. King III860a5f12018-03-06 14:23:23 -050076 IF "%PYTHON_VERSION%" == "" (
77 SET WITH_PYTHON=OFF
78 ) ELSE (
79 SET WITH_PYTHON=ON
Mario Emmenlauerce648802021-08-05 17:10:09 +020080 IF /i "%PLATFORM%" == "x64" (SET PTEXT=-x64)
James E. King III860a5f12018-03-06 14:23:23 -050081 SET PATH=C:\Python%PYTHON_VERSION:.=%!PTEXT!\scripts;C:\Python%PYTHON_VERSION:.=%!PTEXT!;!PATH!
82 )
83 IF "%CONFIGURATION%" == "Debug" (SET ZLIB_LIB_SUFFIX=d)
James E. King, III07f59972017-03-10 06:18:33 -050084
James E. King III860a5f12018-03-06 14:23:23 -050085 IF NOT "%QT_VERSION%" == "" (
Mario Emmenlauerce648802021-08-05 17:10:09 +020086 IF /i "%PLATFORM%" == "x64" (SET QTEXT=_64)
James E. King III860a5f12018-03-06 14:23:23 -050087 SET PATH=C:\Qt\%QT_VERSION%\%PROFILE%!QTEXT!\bin;!PATH!
88 )
89
Mario Emmenlauer22bb5502021-08-05 15:40:19 +020090) ELSE IF "%PROFILE_CLASS%" == "MINGW" (
James E. King III860a5f12018-03-06 14:23:23 -050091
92 :: PLATFORM = x86 means MINGWPLAT i686
93 :: PLATFORM = x64 means MINGWPLAT x86_64
Mario Emmenlauerce648802021-08-05 17:10:09 +020094 IF "%PLATFORM%" == "x86" (
95 SET MINGWPLAT=i686
96 ) ELSE (
97 SET MINGWPLAT=x86_64
98 )
James E. King, III07f59972017-03-10 06:18:33 -050099
100 SET BASH=C:\msys64\usr\bin\bash.exe
James E. King III860a5f12018-03-06 14:23:23 -0500101 !BASH! -lc "sed -i '/export PATH=\/mingw32\/bin/d' ~/.bash_profile && sed -i '/export PATH=\/mingw64\/bin/d' ~/.bash_profile && echo 'export PATH=/mingw%NORM_PLATFORM%/bin:$PATH' >> ~/.bash_profile" || EXIT /B
James E. King, III07f59972017-03-10 06:18:33 -0500102
James E. King III860a5f12018-03-06 14:23:23 -0500103 SET BUILDDIR=%BUILDDIR:\=/%
104 SET BUILDDIR=/c!BUILDDIR:~2!
105 SET INSTDIR=%INSTDIR:\=/%
106 SET INSTDIR=/c!INSTDIR:~2!
107 SET SRCDIR=%SRCDIR:\=/%
108 SET SRCDIR=/c!SRCDIR:~2!
109
Mario Emmenlauer22bb5502021-08-05 15:40:19 +0200110) ELSE IF "%PROFILE_CLASS%" == "CYGWIN" (
James E. King III860a5f12018-03-06 14:23:23 -0500111
Mario Emmenlauerce648802021-08-05 17:10:09 +0200112 IF "%PLATFORM%" == "x64" (
113 SET CYGWINROOT=C:\cygwin64
114 ) ELSE (
115 SET CYGWINROOT=C:\cygwin
116 )
117
118 IF "%PLATFORM%" == "x64" (
119 SET SETUP=!CYGWINROOT!\setup-x86_64.exe
120 ) ELSE (
121 SET SETUP=!CYGWINROOT!\setup-x86.exe
122 )
James E. King III860a5f12018-03-06 14:23:23 -0500123
124 SET BASH=!CYGWINROOT!\bin\bash.exe
James E. King III860a5f12018-03-06 14:23:23 -0500125 SET BUILDDIR=%BUILDDIR:\=/%
126 SET BUILDDIR=/cygdrive/c!BUILDDIR:~2!
127 SET INSTDIR=%INSTDIR:\=/%
Mario Emmenlauerce648802021-08-05 17:10:09 +0200128 SET INSTDIR=/cygdrive/c!INSTDIR:~2!
James E. King III860a5f12018-03-06 14:23:23 -0500129 SET SRCDIR=%SRCDIR:\=/%
130 SET SRCDIR=/cygdrive/c!SRCDIR:~2!
James E. King, III07f59972017-03-10 06:18:33 -0500131
132)