Protected sources

Warning

This feature is available only if version of CMake is 3.7+

Hunter can manage access to the package with sources protected by HTTP user-name/password credentials. Such packages should be marked as protected in corresponding hunter.cmake file. Passwords for protected sources can be set by file with hunter_http_password commands. Next paths will be checked (sorted by priority):

  • Path specified by HUNTER_PASSWORDS_PATH CMake variable
  • Path specified by HUNTER_PASSWORDS_PATH environment variable
  • Path based on HOME environment variable: $ENV{HOME}/.config/Hunter/passwords.cmake (including Windows hosts)
  • Path based on USERPROFILE environment variable: $ENV{USERPROFILE}/.config/Hunter/passwords.cmake (Windows only hosts)

Hint for GitHub users

You don’t have to store your personal password in passwords.cmake file. Instead you can generate personal access token and use it as PASSWORD:

hunter_http_password(Foo USERNAME "myname" PASSWORD "123...abc")

Note

Since token used to access private repositories you have to set repo scope (“Full control of private repositories”):

../../_images/repo-scope.png