|
1 | 1 | @echo off
|
2 |
| -rem // Runs CMake to configure htm.core for Visual Studio 2017 |
| 2 | +rem // Runs CMake to configure htm.core for Visual Studio 2017 and 2019 |
3 | 3 | rem // Execute this file to start up CMake and configure Visual Studio.
|
4 | 4 | rem //
|
5 | 5 | rem // There is no need to use Developer Command Prompt for running CMake with
|
6 | 6 | rem // Visual Studio generators, corresponding environment will be loaded automatically by CMake.
|
7 | 7 | rem //
|
8 | 8 | rem // Prerequisites:
|
9 | 9 | rem //
|
10 |
| -rem // Microsoft Visual Studio 2017 or newer (any flavor) |
| 10 | +rem // Microsoft Visual Studio 2017, 2019 or newer (any flavor) |
11 | 11 | rem //
|
12 | 12 | rem // CMake: 3.7+ Download CMake from https://cmake.org/download/
|
| 13 | +rem // NOTE: CMake 3.14+ is required for MSCV 2019 |
13 | 14 | rem //
|
14 | 15 | rem // Python 2.7 or 3.x Download from https://www.python.org/downloads/windows/ (optional)
|
15 | 16 | rem //
|
16 | 17 | rem //
|
17 | 18 | rem // This script will create a Vsual Studio solution file at build/scripts/htm_core.sln
|
18 | 19 | rem // Double click htm_core.sln to start up Visual Studio. Then perform a full build.
|
19 | 20 | rem //
|
20 |
| -rem // Tricks for executing Visual Studio is Release or Build mode. |
| 21 | +rem // Note: if you were originally using this repository with VS 2017 and you now |
| 22 | +rem // want to use VS 2019, Do the following: |
| 23 | +rem // 1) delete the build folder in the repository. This will remove the .sln and other VS files. |
| 24 | +rem // 2) run startupMSVC.bat again. It will detect that VS 2019 is installed and configure for it but it will start VS 2017. |
| 25 | +rem // 3) after .sln is re-created in build/scripts/, right click, on the .sln file, select "open with", click "choose another app", select VS 2019 |
| 26 | +rem // |
| 27 | +rem // Tricks for executing Visual Studio in Release or Build mode. |
21 | 28 | rem // https://stackoverflow.com/questions/24460486/cmake-build-type-not-being-used-in-cmakelists-txt
|
22 | 29 |
|
23 | 30 |
|
@@ -58,20 +65,36 @@ if exist "htm_core.sln" (
|
58 | 65 | exit /B 0
|
59 | 66 | )
|
60 | 67 |
|
61 |
| -rem // Run CMake using the Visual Studio generator for VS 2017 |
62 |
| -rem // -G "Visual Studio 15 2017 Win64" set the generator toolset to use. Could also set ARM rather than Win64. |
| 68 | +rem // Run CMake using the Visual Studio generator. The generator can be one of these. |
| 69 | +rem // cmake -G "Visual Studio 15 2017" -A x64 |
| 70 | +rem // cmake -G "Visual Studio 16 2017" -A ARM |
| 71 | +rem // |
| 72 | +rem // cmake -G "Visual Studio 16 2019" -A x64 |
| 73 | +rem // cmake -G "Visual Studio 16 2019" -A ARM64 |
| 74 | +rem // NOTE: MSVC 2019 tool set generator requires CMake V3.14 or greater) |
| 75 | +rem // |
| 76 | +rem // arguments: |
| 77 | +rem // -G "Visual Studio 16 2019" Sets the generator toolset (compilers/linkers) to use. |
| 78 | +rem // -A x64 Sets the platform. Note that 64bit only supported. |
63 | 79 | rem // -Thost=x64 Tell CMake to tell VS to use 64bit tools for compiler and linker
|
64 | 80 | rem // --config "Release" Start out in Release mode
|
65 | 81 | rem // -DCMAKE_CONFIGURATION_TYPES="Debug;Release" Specify the build types allowed.
|
66 | 82 | rem // ../.. set the source directory (top of repository)
|
67 | 83 |
|
68 |
| -rem // cmake -G "Visual Studio 15 2017 Win64" -Thost=x64 --config "Release" -DCMAKE_CONFIGURATION_TYPES="Debug;Release" -DBINDING_BUILD=Python3 ../.. |
69 |
| -cmake -G "Visual Studio 15 2017 Win64" -Thost=x64 --config "Release" -DCMAKE_CONFIGURATION_TYPES="Debug;Release" ../.. |
| 84 | +if exist "C:\Program Files (x86)\Microsoft Visual Studio\2019" ( |
| 85 | + set GENERATOR="Visual Studio 16 2019" |
| 86 | + set PLATFORM=x64 |
| 87 | +) else ( |
| 88 | + set GENERATOR="Visual Studio 15 2017" |
| 89 | + set PLATFORM=x64 |
| 90 | +) |
| 91 | + |
| 92 | +cmake -G %GENERATOR% -A %PLATFORM% -Thost=x64 --config "Release" -DCMAKE_CONFIGURATION_TYPES="Debug;Release" ../.. |
70 | 93 |
|
71 | 94 | if exist "htm_core.sln" (
|
72 |
| - rem //cmake --build . --target install --config "Release" |
73 | 95 | @echo " "
|
74 | 96 | @echo You can now start Visual Studio using solution file %HTM_BASE%\build\scripts\htm_core.sln
|
| 97 | + @echo Dont forget to set your default Startup Project to unit_tests. |
75 | 98 | @echo Press any key to start Visual Studio
|
76 | 99 | pause >nul
|
77 | 100 |
|
|
0 commit comments