diff --git a/CMakeLists.txt b/CMakeLists.txt index 0ed60548213..c19292be817 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,10 @@ # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +if (NOT DEFINED CMAKE_TOOLCHAIN_FILE AND EXISTS "${CMAKE_CURRENT_LIST_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake") + set(CMAKE_TOOLCHAIN_FILE "${CMAKE_CURRENT_LIST_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake") +endif() + cmake_minimum_required(VERSION 3.16) set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY) project(msvc_standard_libraries LANGUAGES CXX) diff --git a/README.md b/README.md index f092b0b191a..02cd1b3d07c 100644 --- a/README.md +++ b/README.md @@ -160,18 +160,15 @@ These instructions assume you're targeting `x64-windows`; you can change this co architectures. 1. Install [CMake][] 3.16.5 or later, [Ninja][] 1.10.0 or later, and Visual Studio 2019 16.7 Preview 3 or later. -2. Invoke `git clone https://github.com/microsoft/vcpkg` -3. Invoke `cd vcpkg` -4. Invoke `.\bootstrap-vcpkg.bat` -5. Invoke `.\vcpkg.exe install boost-math:x64-windows` to install the boost-math dependency. -6. Open an "x64 Native Tools Command Prompt for VS 2019". -7. Change directories to a location where you'd like a clone of this STL repository. -8. Invoke `git clone https://github.com/microsoft/STL` -9. Invoke `cd STL` -10. Invoke `cmake -G Ninja -DCMAKE_TOOLCHAIN_FILE={where your vcpkg clone is located}\scripts\buildsystems\vcpkg.cmake --S . -B {wherever you want binaries}` to configure the project. For example, `cmake -G Ninja --DCMAKE_TOOLCHAIN_FILE=C:\Dev\vcpkg\scripts\buildsystems\vcpkg.cmake -S . -B out\build\x64` -11. Invoke `ninja -C {wherever you want binaries}` to build the project. For example, `ninja -C out\build\x64` +2. Open an "x64 Native Tools Command Prompt for VS 2019". +3. Change directories to a location where you'd like a clone of this STL repository. +4. Invoke `git clone https://github.com/microsoft/STL` +5. Invoke `cd STL` +6. Invoke `git submodule update --init vcpkg` +7. Invoke `.\vcpkg\bootstrap-vcpkg.bat` +8. Invoke `.\vcpkg\vcpkg.exe install boost-math:x86-windows boost-math:x64-windows` to install the boost-math dependency. +9. Invoke `cmake -G Ninja -S . -B {wherever you want binaries}` to configure the project. For example, `cmake -G Ninja -S . -B out\build\x64` +10. Invoke `ninja -C {wherever you want binaries}` to build the project. For example, `ninja -C out\build\x64` # How To Consume