Skip to content

Commit b5d2913

Browse files
kcenonDeveloper
andauthored
chore(build): align vcpkg configuration with registry baseline (#246)
* chore(vcpkg): align ecosystem configuration with registry baseline Update kcenon vcpkg-registry baseline to latest commit (afdfab7) which includes 18 commits of portfile fixes for cmake config paths, dependency declarations, and FETCHCONTENT flags. Add CONFIG hint to find_package calls in UnifiedDependencies.cmake to ensure vcpkg-installed config-mode packages are found reliably. Add vcpkg manifest mode preset to CMakePresets.json referencing $env{VCPKG_ROOT} toolchain file for standardized local builds. Refs: #245 * docs(build): update documentation for vcpkg preset and baseline alignment - README.md: add vcpkg preset as build option alongside manual toolchain - BUILD_TROUBLESHOOTING.md: add section on stale vcpkg baseline issues - DEVELOPER_GUIDE.md: add vcpkg preset option to build instructions --------- Co-authored-by: Developer <developer@local>
1 parent 578a9d4 commit b5d2913

6 files changed

Lines changed: 43 additions & 5 deletions

File tree

CMakePresets.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,18 @@
66
"patch": 0
77
},
88
"configurePresets": [
9+
{
10+
"name": "vcpkg",
11+
"displayName": "vcpkg Manifest Mode",
12+
"description": "Build using vcpkg manifest mode with ecosystem dependencies",
13+
"binaryDir": "${sourceDir}/build-vcpkg",
14+
"cacheVariables": {
15+
"CMAKE_BUILD_TYPE": "Release",
16+
"CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake",
17+
"MESSAGING_USE_EXTERNAL_SYSTEMS": "ON",
18+
"MESSAGING_USE_FETCHCONTENT": "OFF"
19+
}
20+
},
921
{
1022
"name": "default",
1123
"displayName": "Default Config",
@@ -165,6 +177,10 @@
165177
}
166178
],
167179
"buildPresets": [
180+
{
181+
"name": "vcpkg",
182+
"configurePreset": "vcpkg"
183+
},
168184
{
169185
"name": "default",
170186
"configurePreset": "default"

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,11 @@ cd messaging_system
200200
cmake -B build -DMESSAGING_USE_LOCAL_SYSTEMS=ON
201201
cmake --build build -j
202202

203-
# Alternative: Build with vcpkg
203+
# Alternative: Build with vcpkg (using preset)
204+
cmake --preset vcpkg
205+
cmake --build --preset vcpkg
206+
207+
# Alternative: Build with vcpkg (manual toolchain)
204208
cmake -B build -DCMAKE_TOOLCHAIN_FILE=/path/to/vcpkg/scripts/buildsystems/vcpkg.cmake
205209
cmake --build build -j
206210
```

cmake/UnifiedDependencies.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -518,11 +518,11 @@ macro(_unified_resolve_find_package DEP_NAME VERSION IS_REQUIRED)
518518
set(_pkg_name "${DEP_NAME}")
519519
endif()
520520

521-
# Try find_package
521+
# Try find_package (CONFIG mode preferred for vcpkg-installed packages)
522522
if(VERSION)
523-
find_package(${_pkg_name} ${VERSION} QUIET)
523+
find_package(${_pkg_name} ${VERSION} CONFIG QUIET)
524524
else()
525-
find_package(${_pkg_name} QUIET)
525+
find_package(${_pkg_name} CONFIG QUIET)
526526
endif()
527527

528528
if(${_pkg_name}_FOUND)

docs/guides/BUILD_TROUBLESHOOTING.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,20 @@ If you encounter issues not covered here:
215215

216216
---
217217

218+
## vcpkg Baseline Issues
219+
220+
If dependencies fail to resolve or you see unexpected version mismatches, ensure `vcpkg-configuration.json` has a current baseline. An outdated baseline can cause missing or incompatible packages.
221+
222+
**Quick check**:
223+
```bash
224+
# View current baseline
225+
cat vcpkg-configuration.json | grep baseline
226+
```
227+
228+
If the baseline is stale, update it to the latest vcpkg commit hash from the [vcpkg repository](https://github.com/microsoft/vcpkg).
229+
230+
---
231+
218232
## Known Limitations
219233

220234
1. **FetchContent + Local Systems**: Cannot coexist due to CMake target name conflicts

docs/guides/DEVELOPER_GUIDE.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ mkdir build && cd build
4141
cmake .. -DCMAKE_BUILD_TYPE=Release \
4242
-DCMAKE_TOOLCHAIN_FILE=../vcpkg/scripts/buildsystems/vcpkg.cmake
4343
cmake --build . --parallel
44+
45+
# Or use the vcpkg preset (requires VCPKG_ROOT environment variable)
46+
cmake --preset vcpkg
47+
cmake --build --preset vcpkg
4448
```
4549

4650
### 3. Your First Application

vcpkg-configuration.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
{
88
"kind": "git",
99
"repository": "https://github.com/kcenon/vcpkg-registry.git",
10-
"baseline": "77cc46d5ba5e2aef1581f2ec674f83e1ac906b43",
10+
"baseline": "afdfab7fbc642bd71fd4764c970a91334794021c",
1111
"packages": ["kcenon-*"]
1212
}
1313
]

0 commit comments

Comments
 (0)