blob: 5f95058d0d44800797683c4482eb5c58ba361fb8 [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
15::
16:: Detect the compiler edition we're building in and then
17:: set the GENERATOR environment variable to one of:
18::
19:: Visual Studio 15 2017 [arch] = Generates Visual Studio 2017 project files.
20:: Optional [arch] can be "Win64" or "ARM".
21:: Visual Studio 14 2015 [arch] = Generates Visual Studio 2015 project files.
22:: Optional [arch] can be "Win64" or "ARM".
23:: Visual Studio 12 2013 [arch] = Generates Visual Studio 2013 project files.
24:: Optional [arch] can be "Win64" or "ARM".
25:: Visual Studio 11 2012 [arch] = Generates Visual Studio 2012 project files.
26:: Optional [arch] can be "Win64" or "ARM".
27:: Visual Studio 10 2010 [arch] = Generates Visual Studio 2010 project files.
28:: Optional [arch] can be "Win64" or "IA64".
29:: MinGW Makefiles = Generates makefiles for MinGW
30:: MSYS Makefiles = Generates makefiles for MSYS
James E. King III860a5f12018-03-06 14:23:23 -050031:: Unix Makefiles = Generates makefiles for CYGWIN
James E. King, III07f59972017-03-10 06:18:33 -050032::
33:: Honors any existing GENERATOR environment variable
34:: setting instead of overwriting it, to allow it
35:: to be forced if needed.
36::
37:: Sets ERRORLEVEL to 0 if GENERATOR can be determined,
38:: to 1 if it cannot.
39::
40
41IF DEFINED GENERATOR (
42 ECHO [warn ] using existing environment variable GENERATOR
Mario Emmenlauerce648802021-08-05 17:10:09 +020043) ELSE IF "%PROFILE:~0,4%" == "MING" (
James E. King, III07f59972017-03-10 06:18:33 -050044 SET GENERATOR=MinGW Makefiles
James E. King III860a5f12018-03-06 14:23:23 -050045) ELSE IF "%PROFILE:~0,4%" == "CYGW" (
46 SET GENERATOR=Unix Makefiles
James E. King, III07f59972017-03-10 06:18:33 -050047) ELSE IF "%PROFILE:~0,4%" == "MSYS" (
48 SET GENERATOR=MSYS Makefiles
Mario Emmenlauerce648802021-08-05 17:10:09 +020049) ELSE IF "%PROFILE:~0,4%" == "MSVC" (
James E. King, III07f59972017-03-10 06:18:33 -050050 IF /i "%PLATFORM%" == "x64" SET GENARCH= Win64
Mario Emmenlauerce648802021-08-05 17:10:09 +020051 IF "%PROFILE%" == "MSVC2015" (
52 SET GENERATOR=Visual Studio 14 2015!GENARCH!
53 ) ELSE IF "%PROFILE%" == "MSVC2017" (
54 SET GENERATOR=Visual Studio 15 2017!GENARCH!
55 ) ELSE IF "%PROFILE%" == "MSVC2019" (
56 SET GENERATOR=Visual Studio 16 2019!GENARCH!
57 ) ELSE (
58 ECHO [error] unable to determine the CMake generator to use from MSVC profile %PROFILE%
59 EXIT /B 1
60 )
61) ELSE (
62 ECHO [error] unable to determine the CMake generator to use from profile %PROFILE%
James E. King, III07f59972017-03-10 06:18:33 -050063 EXIT /B 1
64)
65
66ECHO [info ] using CMake generator %GENERATOR%