A template project for C++ projects with dependencies managed with vcpkg.
- Install vcpkg
git clone https://github.com/microsoft/vcpkg.git
cd vcpkg
bootstrap-vcpkg.bat
- Integrate with Visual Studio
vcpkg integrate install
- Install dependencies
vcpkg install opengl glew glfw3 glm freetype eastl --triplet=x64-windows-static
- Clone this project
cd ..
git clone https://github.com/rbento/cmake-vcpkg.git
cd cmake-vcpkg
- Configure vcpkg home
Set the path to the vcpkg home directory in init.bat
.
cmake -DCMAKE_TOOLCHAIN_FILE=<VCPKG HOME PATH HERE>/vcpkg/scripts/buildsystems/vcpkg.cmake
- Configure the Visual Studio solution and project name
Set the project
value in CMakeLists.txt
.
project("<SOLUTION NAME HERE>")
- Generate the Visual Studio project
init.bat
- Done
Now open the generated project solution on Visual Studio.