Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/neeky/vcpkg-template
https://github.com/neeky/vcpkg-template
Last synced: 6 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/neeky/vcpkg-template
- Owner: Neeky
- Created: 2024-04-06T05:55:44.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-04-06T06:09:15.000Z (9 months ago)
- Last Synced: 2024-11-07T14:15:00.547Z (about 2 months ago)
- Language: CMake
- Size: 1.95 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## vcpkg-template
vcpkg 管理 C/C++ 依赖的模板项目;## 第一步 通过 vcpkg 增加依赖
```bash
vcpkg new --application
vcpkg add port fmt```
## 第二步 cmake 引入依赖
```cmake
cmake_minimum_required(VERSION 3.10)project(vcpkg-template)
find_package(fmt CONFIG REQUIRED)
add_executable(vcpkg-template src/main.cpp)
target_link_libraries(vcpkg-template PRIVATE fmt::fmt)
```## 第三步 设置工具链让 cmake 知道在哪里找依赖
```bash
mkdir build && cd build && cmake .. -DCMAKE_VERBOSE_MAKEFILE=on -DCMAKE_TOOLCHAIN_FILE=/usr/local/vcpkg/scripts/buildsystems/vcpkg.cmake && cmake --build .
```---