CONFIGURE_DEPENDS option was added in CMake v3.12. This option allows the build system to automatically re-run CMake if the glob changes, solving the major issue with globbing. May have a performance impact, but it should be negligible compared to the time spent building.