Skip to content

VCPKG_MANIFEST_MODE can not be set to TRUE after adding a vcpkg.json file #12208

@petersteneteg

Description

@petersteneteg

If one has an existing cmake cache and adds a vcpkg.json manifest file and then set VCPKG_MANIFEST_MODE to true
the manifest file will not be found since the _VCPKG_MANIFEST_DIR internal cache variable was already set and will not be updated. Hence the manifest file it not found and an error is printed

the cache variable it set here

set(${OUT} ${_vcpkg_get_dir_out} CACHE INTERNAL "_vcpkg_get_directory_name_of_file_above: ${OUT}")

and this check prevents it from being updated

if(DEFINED ${OUT})

Environment

  • OS: Windows
  • CMake: 3.17.2

To Reproduce
Steps to reproduce the behavior:

  1. run cmake configure on a project without a manifest file
  2. add a manifest file
  3. set VCPKG_MANIFEST_MODE to true in cmake
  4. run configure again

Expected behavior
The newly added manifest file should be found
Or an error saying the one has to clear the cache to make it work

Failure logs

CMake Error at C:/Users/petst55.AD/Documents/vcpkg/vcpkg/scripts/buildsystems/vcpkg.cmake:41 (message):
  vcpkg manifest mode was enabled, but we couldn't find a manifest file
  (vcpkg.json) in any directories above
  C:/Users/petst55.AD/Documents/Inviwo/sgct/sgct.  Please add a manifest, or
  disable manifests by turning off VCPKG_MANIFEST_MODE.
Call Stack (most recent call first):
  C:/Users/petst55.AD/Documents/Inviwo/sgct/build/CMakeFiles/3.17.2/CMakeSystem.cmake:6 (include)
  CMakeLists.txt:10 (project)

Configuring incomplete, errors occurred!
See also "C:/Users/petst55.AD/Documents/Inviwo/sgct/build/CMakeFiles/CMakeOutput.log".
See also "C:/Users/petst55.AD/Documents/Inviwo/sgct/build/CMakeFiles/CMakeError.log".

FYI @strega-nil

Metadata

Metadata

Labels

category:vcpkg-bugThe issue is with the vcpkg system (including helper scripts in `scripts/cmake/`)info:manifestsThis PR or Issue pertains to the Manifests feature

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions