Skip to content
Josh Petrie edited this page Jan 25, 2026 · 2 revisions

How can I temporarily skip FetchDependency during a configure?

In scenarios where you want to temporarily skip FetchDependency for a particular CMake invocation, you can set the environment variable FETCH_DEPENDENCY_FAST to 1 to enable FetchDependency's "fast" mode.

> FETCH_DEPENDENCY_FAST=1 cmake ...

Fast mode is most useful when doing extensive iteration on your project's CMakeLists.txt or other configuration support files, where the output of FetchDependency isn't relevant and its overhead just slows down your iteration.

Fast mode causes FetchDependency to only execute the logic needed to call find_package() on your dependencies. It skips all up-to-date checks, configuration and build steps that might normally occur. This can save considerable time when invoking CMake, especially on projects with a large set of dependencies.

Fast mode does require that a regular configure of your project has completed at least once before. FetchDependency will not give you a specific error message if this is not the case, but its find_package() calls will fail.

What is the workflow for making local edits to dependencies?

Sometimes it is useful or necessary to make local edits to a dependency. Perhaps you are attempting to fix a bug, or the dependency is a project you're working on parallel to your main project.

FetchDependency generates normal CMake projects under the hood, so it is possible to simply use those projects as is. FetchDependency also allows you to reproduce the configure and build steps it uses exactly by executing scripts in the State subdirectory of the dependency folder. These scripts will be named configure.sh/build.sh or configure.bat/build.bat depending on your OS.

When FetchDependency detects a local change to a dependency's source (either because LOCAL_SOURCE is in use, or because the Git working tree is dirty), it will never attempt to perform any updates to the source, and it will always attempt to trigger the build step. Note that there is no link created between dependency source files and any targets in your main project, so simply building that may not detect local changes to a dependency - you will need to explicitly run CMake against your main project or use the per-dependency scripts within their state folder.

Keep in mind that if you are using GIT_SOURCE for your dependency, the dependency's working tree is very likely in a "detached HEAD" state (confirm with git status). If that is true and you want to commit any local edits you make, you will need to make sure to create a branch from the local changes, switch over to a real branch, and merge those changes back in.

Clone this wiki locally