Skip to content

Commit 8416317

Browse files
authored
build: add vcpkg overlay port
1 parent 1146502 commit 8416317

File tree

4 files changed

+44
-0
lines changed

4 files changed

+44
-0
lines changed

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,22 @@ add_executable(app main.cpp)
7171
target_link_libraries(app PRIVATE time_shield::time_shield)
7272
```
7373

74+
### vcpkg
75+
76+
Install via a local overlay port:
77+
78+
```sh
79+
vcpkg install time-shield-cpp --overlay-ports=./vcpkg-overlay/ports
80+
```
81+
82+
Use the vcpkg toolchain when configuring CMake:
83+
84+
```sh
85+
cmake -B build -S . -DCMAKE_TOOLCHAIN_FILE=/path/to/vcpkg/scripts/buildsystems/vcpkg.cmake
86+
```
87+
88+
The port is intended to be upstreamed to [microsoft/vcpkg](https://github.com/microsoft/vcpkg).
89+
7490
Examples can be built with the provided scripts:
7591

7692
- `build-examples.bat` for Windows;
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
vcpkg_from_github(
2+
OUT_SOURCE_PATH SOURCE_PATH
3+
REPO NewYaroslav/time-shield-cpp
4+
REF v1.0.2
5+
SHA512 cbd0a981af568ca41d9350911f71535b8c7ed4466b36bbc9ceff9c33e0d9f2ed22ca86950836836ca7c2997f316b7612efa9234225bc41f2f0e5e9c5119358b4
6+
)
7+
8+
vcpkg_cmake_configure(
9+
SOURCE_PATH ${SOURCE_PATH}
10+
)
11+
12+
vcpkg_cmake_install()
13+
14+
vcpkg_cmake_config_fixup(
15+
PACKAGE_NAME TimeShield
16+
)
17+
18+
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME LICENSE)
19+
file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT})
20+
21+
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug)

vcpkg-overlay/ports/time-shield-cpp/vcpkg-cmake-wrapper.cmake

Whitespace-only changes.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"name": "time-shield-cpp",
3+
"version": "1.0.2",
4+
"description": "Header-only C++ library for time conversions, formatting, and utilities.",
5+
"homepage": "https://github.com/NewYaroslav/time-shield-cpp",
6+
"license": "MIT"
7+
}

0 commit comments

Comments
 (0)