ULRE/BUILD.md

49 lines
1.7 KiB
Markdown
Raw Permalink Normal View History

# Build on Windows
Tested with Visual Studio 2019/2022 and Windows 11
please first install [Git](https://git-scm.com/download/win) and [CMake](https://cmake.org/download/)
and then clone [vcpkg package manager](https://docs.microsoft.com/en-us/cpp/build/vcpkg?view=vs-2022) by git:
git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
bootstrap-vcpkg.bat
Install [vcpkg package manager](https://docs.microsoft.com/en-us/cpp/build/vcpkg?view=vs-2022) to build required libraries:
vcpkg install glm:x64-windows jsoncpp:x64-windows expat:x64-windows
vcpkg integrate install
finish step you can use "cmake" create project file with vcpkg toolchain:
cmake . -DCMAKE_TOOLCHAIN_FILE=\????\vcpkg\scripts\buildsystems\vcpkg.cmake
or use "cmake-gui" with "Specify toolchain file for cross-compiling."
#
# 在Windows下编译工程
以下在Windows 11以及Visual Studio 2019/2022下测试通过
首先请安装[Git](https://git-scm.com/download/win)和[CMake](https://cmake.org/download/)
然后使用git安装[vcpkg package manager](https://docs.microsoft.com/en-us/cpp/build/vcpkg?view=vs-2022)
git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
bootstrap-vcpkg.bat
接着使用[vcpkg package manager](https://docs.microsoft.com/en-us/cpp/build/vcpkg?view=vs-2022)来安装我们所需要的第三方依赖库:
vcpkg install glm:x64-windows jsoncpp:x64-windows expat:x64-windows
vcpkg integrate install
最后你就可以使用CMake创建工程文件了:
cmake . -DCMAKE_TOOLCHAIN_FILE=\????\vcpkg\scripts\buildsystems\vcpkg.cmake
或是使用cmake-gui以图形界面形式创建但请在第一个界面选择“Specify toolchain file for cross-compiling”并指定使用vcpkg.cmake做为工具链。