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
6 :: http
://www.apache.org
/licenses
/LICENSE
-2.0
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.
16 :: Detect the compiler edition we
're building in and then
17 :: set the GENERATOR environment variable to one of:
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
31 :: Unix Makefiles = Generates makefiles for CYGWIN
33 :: Honors any existing GENERATOR environment variable
34 :: setting instead of overwriting it, to allow it
35 :: to be forced if needed.
37 :: Sets ERRORLEVEL to 0 if GENERATOR can be determined,
41 IF DEFINED GENERATOR (
42 ECHO [warn ] using existing environment variable GENERATOR
47 IF "%PROFILE:~0,4%" == "MING" (
48 SET GENERATOR=MinGW Makefiles
50 ) ELSE IF "%PROFILE:~0,4%" == "CYGW" (
51 SET GENERATOR=Unix Makefiles
53 ) ELSE IF "%PROFILE:~0,4%" == "MSYS" (
54 SET GENERATOR=MSYS Makefiles
56 IF /i "%PLATFORM%" == "x64" SET GENARCH= Win64
58 IF !ERRORLEVEL! == 0 SET GENERATOR=Visual Studio 10 2010!GENARCH!
60 IF !ERRORLEVEL! == 0 SET GENERATOR=Visual Studio 11 2012!GENARCH!
62 IF !ERRORLEVEL! == 0 SET GENERATOR=Visual Studio 12 2013!GENARCH!
64 IF !ERRORLEVEL! == 0 SET GENERATOR=Visual Studio 14 2015!GENARCH!
66 IF !ERRORLEVEL! == 0 SET GENERATOR=Visual Studio 15 2017!GENARCH!
69 IF NOT DEFINED GENERATOR (
70 ECHO [error] unable to determine the CMake generator to use
74 ECHO [info ] using CMake generator %GENERATOR%
78 cl /? 2>&1 | findstr /C:"Version %1%" > nul