1

I am behind a proxy on a Win10 system. I have set it up as a system-wide proxy and also as a global git proxy (after discovering that I can't even do a simple clone to any repo outside the internal network). So git works as well as anything that relies on the OS proxy settings. However now I'm in a situation where CMake is trying to fetch some external dependencies (building VTK). Here is the output:

P C:/Qt/Tools/CMake_64/share/cmake-3.19/Modules/ExternalData.cmake"
-- Fetching "https://data.kitware.com/api/v1/file/hashsum/SHA512/bafaaffbbf27e5908e709c8d6181ff5e277ed0efe1706aededef77da74ab96758594d2d2ee96e6edde184c1c0914d6c25f84772b5d14ce56057bd23c541a395b/download"
-- Fetching "https://www.vtk.org/files/ExternalData/SHA512/bafaaffbbf27e5908e709c8d6181ff5e277ed0efe1706aededef77da74ab96758594d2d2ee96e6edde184c1c0914d6c25f84772b5d14ce56057bd23c541a395b"
CMake Error at C:/Qt/Tools/CMake_64/share/cmake-3.19/Modules/ExternalData.cmake:1121 (message):
  

  Object
  SHA512=bafaaffbbf27e5908e709c8d6181ff5e277ed0efe1706aededef77da74ab96758594d2d2ee96e6edde184c1c0914d6c25f84772b5d14ce56057bd23c541a395b
  not found at:

    https://data.kitware.com/api/v1/file/hashsum/SHA512/bafaaffbbf27e5908e709c8d6181ff5e277ed0efe1706aededef77da74ab96758594d2d2ee96e6edde184c1c0914d6c25f84772b5d14ce56057bd23c541a395b/download ("Couldn't connect to server")
    https://www.vtk.org/files/ExternalData/SHA512/bafaaffbbf27e5908e709c8d6181ff5e277ed0efe1706aededef77da74ab96758594d2d2ee96e6edde184c1c0914d6c25f84772b5d14ce56057bd23c541a395b ("Couldn't connect to server")

I am running CMake through Qt Creator. At first I thought it might have something to do with the IDE. However Qt Creator has no proxy settings (at least none I could find) so it takes its proxy settings from the system-wise ones. And indeed checking for updates of the IDE using the "Check now" button in the updates section of the settings doesn't give any errors and say that there are no new versions (actually the case since I just downloaded the latest using the official installer).

Is there a way to make CMake use the system-wide proxy settings? Preferably without changing the CMake configuration files.

UPDATE: I took one of the URLs (like this one ) and pasted it in my web browser. I can download the file.

rbaleksandar
  • 8,713
  • 7
  • 76
  • 161

1 Answers1

2

Apparently CMake relies on the environment variables HTTP_PROXY and HTTPS_PROXY. I am used to setting those on Linux but didn't know that the same apply to Windows. All I had to do is add the two (chances are both HTTP and HTTPS URLs will be called in the future from CMake) to my environment variables (user-specific is enough) and CMake was able to download all external dependencies.

rbaleksandar
  • 8,713
  • 7
  • 76
  • 161