Skip to content

Revert ExternalProject and FetchContent refactoring

Craig Scott requested to merge craig.scott/cmake:ep-fc-revert-refactoring into master

Refactoring of the ExternalProject and FetchContent modules moved the commands into CMake scripts. This broke custom commands that used shell redirection or special build tool variables of the form $(MakeVar). Undo the sequence of commits that performed this refactoring and follow-up fixes associated with it.

The following commits are reverted by this change:

  • 4f3d1abb (ExternalProject: Refactor pre-configure steps to support no-target uses, 2021-02-05)
  • 17e5516e (FetchContent: Invoke steps directly and avoid a separate sub-build, 2021-01-29)
  • bd876f38 (FetchContent: Restore patch command support, 2021-02-18)
  • 404cddb7 (ExternalProject: Fix misuse of IS_NEWER_THAN in timestamp checks, 2021-02-21)
  • b0da6712 (FetchContent: Don't update timestamps if files don't change, 2021-02-18)

The following issues will need to be reopened after this is merged:

  • #21748 (closed) (FetchContent and ExternalProject fail when SOURCE_DIR changes)
  • #21703 (FetchContent has poor performance on Windows)

Note that the above commits do not revert the change that makes ExternalProject no longer scan the documentation at runtime (23aab9ec). That change does not alter the way custom commands are executed and is an improvement to maintainability, robustness and performance.

Fixes: #21892 (closed)
Backport: release

Merge request reports