hunter_http_passwordΒΆ

This module helps to set user-name/password for packages with protected sources.

If package Foo has protected sources and can be accessed by setting HTTP user-name to myname and HTTP password to mypassword, this can be expressed by code:

# ~/.config/Hunter/passwords.cmake

hunter_http_password(Foo USERNAME "myname" PASSWORD "mypassword")

Note that module is file with CMake code, so all regular commands available:

# ~/.config/Hunter/passwords.cmake

foreach(package Foo Boo Bar)
  hunter_http_password("${package}" USERNAME "myname" PASSWORD "mypassword")
endforeach()
# ~/.config/Hunter/passwords.cmake

set(user "myname")

set(pass1 "mypassword1")
set(pass2 "mypassword2")

foreach(package Foo1 Boo1 Bar1)
  hunter_http_password("${package}" USERNAME "${user}" PASSWORD "${pass1}")
endforeach()

foreach(package Foo2 Boo2 Bar2)
  hunter_http_password("${package}" USERNAME "${user}" PASSWORD "${pass2}")
endforeach()