Disclaimer - I took this repo and removed libtcod to get a 'cleaner' template for myself.
An example on how to setup a CMake project with vcpkg and its manifest (vcpkg.json
) experimental feature
Clone the repo with the --recurse-submodules
flag
git clone --recurse-submodules https://github.com/miredirex/cmake-vcpkg-example.git
Run ./vcpkg/bootstrap-vcpkg.sh
or .\vcpkg\bootstrap-vcpkg.bat
Fetch the dependencies (see vcpkg.json):
(This is optional, CMake should run vcpkg install
anyway)
./vcpkg/vcpkg --feature-flags=manifests install
Build the project using your IDE/build tool of choice or manually:
cmake -B build -S .
cmake --build build
To avoid long file indexing, you might want to exclude the vcpkg
directory:
- Right click on
vcpkg
in the Project window - Mark Directory as -> Library Files or Excluded (I recommend choosing the latter)
If you're getting
Could not find a package configuration file provided by "fmt" with any of
the following names:
...
or similar, try deleting cmake's build directory and rebuilding the project