https://github.com/artempyanykh/vcpkg-cmake-example
Example repo demonstrating a C++ project setup with CMake and vcpkg
https://github.com/artempyanykh/vcpkg-cmake-example
cmake cpp dependencies vcpkg
Last synced: 4 months ago
JSON representation
Example repo demonstrating a C++ project setup with CMake and vcpkg
- Host: GitHub
- URL: https://github.com/artempyanykh/vcpkg-cmake-example
- Owner: artempyanykh
- Created: 2022-01-07T13:43:16.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-01-07T15:20:14.000Z (almost 4 years ago)
- Last Synced: 2025-04-14T14:15:36.204Z (8 months ago)
- Topics: cmake, cpp, dependencies, vcpkg
- Language: C++
- Homepage:
- Size: 3.91 KB
- Stars: 7
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# C++ with cmake and vcpkg
An example project that demonstrates a setup using CMake + vcpkg for a
reasonable build with reasonable dependency management:
1. `CMakeLists.txt` contains a project definition and `vcpkg` integration bits.
2. `vcpkg.json` is a manifest file that defines a list of project dependencies.
3. `vcpkg` itself is checked-out as a submodule, so don' forget to run:
1. `git submodule update --init`.
2. `vcpkg/bootstrap-vcpkg.sh`.
* How to setup the build: `cmake -S . -B build [-G Ninja]`
* How to build the binary: `cmake --build build`
* How to run the built binary: run `build/main`
The top-level `Makefile` defines a number of phony targets that act as shortcuts for specific cmake invocations:
* `bootstrap` sets up `vcpkg`.
* `configure/reconfigure` prepare cmake build.
* `build/run` to compile and run the binary.
* `clean`.