Skip to content

Add vcpkg support with megamimes overlay port#38

Merged
johnpatek merged 2 commits intomasterfrom
copilot/support-vcpkg-build
Feb 28, 2026
Merged

Add vcpkg support with megamimes overlay port#38
johnpatek merged 2 commits intomasterfrom
copilot/support-vcpkg-build

Conversation

Copy link
Contributor

Copilot AI commented Feb 28, 2026

The project previously only supported FetchContent for dependency management. This adds vcpkg manifest mode support, falling back to FetchContent when vcpkg is not detected.

Changes

vcpkg Detection (CMakeLists.txt, tests/CMakeLists.txt)

  • Detects vcpkg by matching CMAKE_TOOLCHAIN_FILE against */scripts/buildsystems/vcpkg.cmake
  • Sets VCPKG_TOOLCHAIN_ACTIVE and switches between find_package and FetchContent accordingly
  • Target name differences handled per mode (unofficial::sqlite3::sqlite3 vs SQLite::SQLite3, megamimes::megamimes vs compiled-in source)

vcpkg Manifest (vcpkg.json, vcpkg-configuration.json)

  • vcpkg.json declares dependencies: argparse, mio, sqlite3, megamimes
  • vcpkg-configuration.json registers ./ports as the overlay ports directory so megamimes is resolved automatically

MegaMimes Overlay Port (ports/megamimes/)

MegaMimes has no native CMake build system and is absent from the vcpkg registry, so it is provided as an overlay port:

  • portfile.cmake — fetches from kobbyowen/MegaMimes@b839068 (same commit as the existing FetchContent pin) with verified SHA512
  • CMakeLists.txt — wrapper that builds a static library and exports the megamimes::megamimes target
  • vcpkg.json — port manifest (MIT, version-date 2021-12-01)

Usage

cmake -B build \
  -DCMAKE_TOOLCHAIN_FILE=/path/to/vcpkg/scripts/buildsystems/vcpkg.cmake

With vcpkg active, all dependencies are resolved via find_package; without it, the original FetchContent path is unchanged.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/kobbyowen/MegaMimes/commits/b839068db99cbfcff1af8df1229bd7e41701fe96
    • Triggering command: /usr/bin/curl curl -s REDACTED (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Support vcpkg</issue_title>
<issue_description>I want this repo to support building using vcpkg the cmake system can detect if it's vcpkg using the following code:

# Check if CMAKE_TOOLCHAIN_FILE is set
if (DEFINED CMAKE_TOOLCHAIN_FILE)
    message(STATUS "CMAKE_TOOLCHAIN_FILE is set to: ${CMAKE_TOOLCHAIN_FILE}")

    # Check if the path points to the vcpkg toolchain file
    if ("${CMAKE_TOOLCHAIN_FILE}" MATCHES ".*[/\\\\]scripts[/\\\\]buildsystems[/\\\\]vcpkg.cmake$")
        message(STATUS "vcpkg toolchain file detected via path matching.")
        set(VCPKG_TOOLCHAIN_ACTIVE TRUE)
    endif()
endif()

And if it is not, proceed with old FetchContent approach. Otherwise, we should:

  1. Build megamime as an overlay port
  2. Find mio, argparse, sqlite, etc. using vcpkg.</issue_description>

<agent_instructions>No code changes should be necessary, this should only require a vcpkg.json and an overlay port.</agent_instructions>

Comments on the Issue (you are @copilot in this section)


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

@codecov
Copy link

codecov bot commented Feb 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (3b25851) to head (037c179).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master       #38   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            1         1           
  Lines           60        60           
  Branches         4         4           
=========================================
  Hits            60        60           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Co-authored-by: johnpatek <31934875+johnpatek@users.noreply.github.com>
Copilot AI changed the title [WIP] Add vcpkg support for building dependencies Add vcpkg support with megamimes overlay port Feb 28, 2026
@johnpatek johnpatek marked this pull request as ready for review February 28, 2026 23:22
@johnpatek johnpatek merged commit b679d32 into master Feb 28, 2026
2 checks passed
@johnpatek johnpatek deleted the copilot/support-vcpkg-build branch February 28, 2026 23:22
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.

Support vcpkg

2 participants