Skip to content

Reworked the vcpkg templates. - #27

Merged
acdemiralp merged 3 commits into
developfrom
feature/rework_vcpkg_templates
Aug 1, 2026
Merged

acdemiralp merged 3 commits into
developfrom
feature/rework_vcpkg_templates

Conversation

@acdemiralp

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings August 1, 2026 20:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR reworks the “with_vcpkg” templates to prepare vcpkg from within CMake (via a new prepare_vcpkg() helper) instead of relying on separate bootstrap scripts, and updates presets/CI accordingly.

Changes:

  • Adds prepare_vcpkg() to the vcpkg-based templates and calls it before project() so it can set vcpkg/toolchain-related variables early.
  • Removes vcpkg bootstrap scripts and drops toolchain/installed-dir preset variables, relying on the new CMake-side preparation instead.
  • Updates CI to stop running per-template bootstrap scripts before running CMake workflows.

Reviewed changes

Copilot reviewed 19 out of 21 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
readme.md Removes bootstrap-script step from setup instructions for vcpkg templates.
library_with_vcpkg/CMakePresets.json Removes vcpkg toolchain/installed-dir cache variables from presets.
library_with_vcpkg/CMakeLists.txt Calls prepare_vcpkg() before project().
library_with_vcpkg/cmake/extensions.cmake Introduces prepare_vcpkg() implementation (clone/bootstrap + toolchain setup).
library_with_vcpkg/bootstrap.sh Removes legacy bootstrap script.
library_with_vcpkg/bootstrap.bat Removes legacy bootstrap script.
header_only_library_with_vcpkg/CMakePresets.json Removes vcpkg toolchain/installed-dir cache variables from presets.
header_only_library_with_vcpkg/CMakeLists.txt Calls prepare_vcpkg() before project().
header_only_library_with_vcpkg/cmake/extensions.cmake Introduces prepare_vcpkg() implementation (clone/bootstrap + toolchain setup).
header_only_library_with_vcpkg/bootstrap.sh Removes legacy bootstrap script.
header_only_library_with_vcpkg/bootstrap.bat Removes legacy bootstrap script.
executable_with_vcpkg/vcpkg.json Whitespace cleanup in manifest template.
executable_with_vcpkg/CMakePresets.json Removes vcpkg toolchain/installed-dir cache variables from presets.
executable_with_vcpkg/CMakeLists.txt Calls prepare_vcpkg() before project().
executable_with_vcpkg/cmake/extensions.cmake Introduces prepare_vcpkg() implementation (clone/bootstrap + toolchain setup).
executable_with_vcpkg/bootstrap.sh Removes legacy bootstrap script.
executable_with_vcpkg/bootstrap.bat Removes legacy bootstrap script.
CMakePresets.json Removes repository-root presets file.
CMakeLists.txt Removes repository-root superbuild file.
.gitignore Removes repository-root ignore file.
.github/workflows/ci.yml Removes explicit vcpkg bootstrap steps from CI matrix.
Suppressed comments (3)

library_with_vcpkg/cmake/extensions.cmake:100

  • prepare_vcpkg() writes CMAKE_TOOLCHAIN_FILE into the cache pointing into the downloaded vcpkg checkout. On the next configure, CMake will try to load the toolchain file before it executes this function, so if build/vcpkg has been deleted/moved the configure will fail before it can self-heal. Setting the toolchain file as a normal variable (before project()) avoids this trap while still enabling vcpkg for the current configure.
  set(CMAKE_TOOLCHAIN_FILE "${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" CACHE FILEPATH "VCPKG toolchain file.")
endfunction  ()

header_only_library_with_vcpkg/cmake/extensions.cmake:100

  • prepare_vcpkg() writes CMAKE_TOOLCHAIN_FILE into the cache pointing into the downloaded vcpkg checkout. On the next configure, CMake will try to load the toolchain file before it executes this function, so if build/vcpkg has been deleted/moved the configure will fail before it can self-heal. Setting the toolchain file as a normal variable (before project()) avoids this trap while still enabling vcpkg for the current configure.
  set(CMAKE_TOOLCHAIN_FILE "${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" CACHE FILEPATH "VCPKG toolchain file.")
endfunction  ()

executable_with_vcpkg/cmake/extensions.cmake:91

  • prepare_vcpkg() writes CMAKE_TOOLCHAIN_FILE into the cache pointing into the downloaded vcpkg checkout. On the next configure, CMake will try to load the toolchain file before it executes this function, so if build/vcpkg has been deleted/moved the configure will fail before it can self-heal. Setting the toolchain file as a normal variable (before project()) avoids this trap while still enabling vcpkg for the current configure.
  set(CMAKE_TOOLCHAIN_FILE "${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" CACHE FILEPATH "VCPKG toolchain file.")
endfunction  ()

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread readme.md Resolved
@acdemiralp
acdemiralp merged commit d75c983 into develop Aug 1, 2026
36 checks passed
@acdemiralp
acdemiralp deleted the feature/rework_vcpkg_templates branch August 1, 2026 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants