-
Notifications
You must be signed in to change notification settings - Fork 7.2k
Description
Describe the bug
After deleting of ${CURRENT_HOST_INSTALLED_DIR}/share/vcpkg-cmake/, it is not being reinstalled and CMake helper functions from it are not available to the port, resulting in "Unknown CMake command" errors.
Steps to reproduce
-
Create a manifest with some dependency (which uses
vcpkg_cmake_configure):{ "dependencies": [ "curl" ] } -
Create an overlay port for the declared depdendency:
mkdir "my-ports" cp -r "$VCPKG_ROOT/ports/curl" "my-ports/"
-
Run vcpkg install with custom install-root and the created overlay port:
vcpkg install --x-install-root=./build --x-manifest-root=./ --overlay-ports=./my-ports/curl
-
Remove the
share/vcpkg-cmake/directory:rm -rf ./build/*/share/vcpkg-cmake/ -
Modify the portfile (e.g., add a comment) to invalidate it
-
Rerun install (see the step 3)
Expected behavior
It would be great if vcpkg either:
- Verify that installed packages' files actually exist before trusting the status file
- Detect missing files and automatically repair the installation
Actual behavior
Error: CMake Error at portfile.cmake:XX (vcpkg_cmake_configure): Unknown CMake command "vcpkg_cmake_configure".
The vcpkg-cmake package is marked as installed in the status file, but its CMake modules are not available to the overlay port.
Environment
- vcpkg version: 2025.10.17 (commit bd52fac)
- OS: macOS (Darwin 23.6.0)
- Compiler: Apple Clang
Additional context
I do not understand why vcpkg-cmake had been deleted from my install root. So I'm not sure how vcpkg ended up in this state. But it took quite some time to figure out the root cause and fix it.