Skip to content

Makefiles: Count explicitly included targets towards the progress total

Adriaan de Groot requested to merge adridg/cmake:issue-21867 into master

An explicitly included target is a target that has EXCLUDE_FROM_ALL set to FALSE. If the directory it is in is not excluded, there is nothing special going on. But if the directory is excluded, then the target should count, but the rest of the directory should not.

Refactor a little to give GlobalGenerator a method to query for an explicitly set-to-FALSE EXCLUDE_FROM_ALL, and then use that when counting targets for Makefile progress.

Here is an example directory structure with some silly targets and nonsensical inclusion and exclusion, that can be built with a flag -DTRY_INCLUDE=ON of -DTRY_INCLUDE=OFF to vary the way things are in- or excluded.

  • Tarball with CMakeLists.txt demonstrating the issue
    issue-21867.tgz
  • Makefile (to be placed in the issue-21867/ directory) that can drive the four different builds for existing and latest cmake. Invoke it as make CMAKE_NEW=/path/to/latest/bin/cmake
    Makefile

Fixes: #21867
Topic-rename: makefile-target-progress

Edited by Brad King

Merge request reports