Skip to content

file: GLOB_RECURSE VerifyGlobs.cmake should have CMP0009 set to new

Shane Parris requested to merge slp091020/cmake:issue_20245_cmp0009 into master

In certain cases, rebuilds with CMake using the CONFIGURE_DEPENDS flag with GLOB_RECURSE could result in a reconfigure loop due to CMP0009 not being propogated to the generated VerifyGlobs.cmake script.

During the inital configuration phase, RecurseThroughSymlinksOn() is called for recursive glob operations either by having the CMP0009 status not set to NEW or by explicitly providing the FOLLOW_SYMLINKS flag. At the end when the VerifyGlobs script is created, the FOLLOW_SYMLINKS flag is written according to the final resolved form through a call to GetRecurseThroughSymlinks(). Thus, setting CMP0009 to NEW in the generated file is safe and allows correct behavior whether or not the end user sets the policy status to NEW or OLD.

Fixes: #20245 (closed)
Backport: release
Topic-rename: file-CONFIGURE_DEPENDS-verify-CMP0009

Edited by Brad King

Merge request reports