CMake configures successfully. The build starts later, tries to download an external dependency, and fails at the proxy. The earlier success did not necessarily exercise that download at all.

ExternalProject_Add() creates steps that can run during the build. The process launching those steps can have a different environment from the terminal or IDE that configured the main project. That difference is easy to miss in CI, where configuration and compilation may be separate jobs.

Locate the network operation

Do not assume the proxy setting for one program configures all three. Read the failing step's command and error before changing the dependency URL.

If the chosen downloader supports proxy environment variables, supply them to the process that actually runs that step. For public downloads whose client accepts an HTTP proxy, the HTTP proxy list offers endpoint candidates when that route is permitted. Passing an ordinary CMake cache variable with a similar name is not automatically the same as setting a child process environment variable.

Keep the distinction from FetchContent as well: its usual dependency population occurs during configuration, so a recipe that works there does not establish the environment of an ExternalProject build step.

An old answer recommending a custom downloader to work around a historical redirect limitation is not evidence that every modern failure needs a new download command. Check whether the current error is a redirect, proxy authentication, certificate trust, or simple reachability. Preserve the expected archive hash and TLS validation while fixing the relevant route.

متعلقہ مضامین