Vcpkg: Add vcpkg.exe to system path when running .\bootstrap-vcpkg.bat

Created on 9 May 2019  路  6Comments  路  Source: microsoft/vcpkg

vcpkg-feature

Most helpful comment

@jepessen I think it is good when we call integrate command, I think in integration command we need to add vcpkg to global system path.

All 6 comments

Can't access vcpkg cmdlet unless I'm inside the repo folder.

Steps to reproduce:

  1. set up vcpkg up to the use-wide integration (included)
  2. change directory run vcpkg install _any_library_

Bug:
Command not found. (see error message below)(this was with powershell)

vcpkg : The term 'vcpkg' is not recognized as the name of a cmdlet, function, script file, or operable program. Check
the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ vcpkg install devil enet glew sdl2
+ ~~~~~
    + CategoryInfo          : ObjectNotFound: (vcpkg:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

Expected:
The installation of the library should succeed.

And what happens if you have two repositories with vcpkg?
At the moment I've cloned this vcpkg repository, and I've another one that's my fork. Since I run bootstrap often in order to check issues, what should it do? Add the path every time? Check every path in %PATH% see if vcpkg is in them and update it? How it manages more repositories?

And more, what's the scope of using vcpkg outside its folder?

I don't like to pollute %PATH%, so in my opinion it shouldn't be added automatically. You can change %PATH% environment variable by yourself. In my opinion is the simplest solution.

Well it should only do it for production code and not for development code, but that restricts a lot the use of vcpkg to people that like to handle things in details not for the others that don't want to bother with those.

@jepessen I think it is good when we call integrate command, I think in integration command we need to add vcpkg to global system path.

Add vcpkg.exe to system path when running .bootstrap-vcpkg.bat

Or you know, you could just use the full path...

Alternatively, an alias can be written in the profile file. Like what the Integrate command does. This is how I "fixed" it.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jasjuang picture jasjuang  路  3Comments

oahzuw picture oahzuw  路  3Comments

ghost picture ghost  路  3Comments

grandprixgp picture grandprixgp  路  3Comments

husseinalihazime picture husseinalihazime  路  3Comments