Here is an example of using GLOB with configure depends.
The directory looks like this.
target_include_directories(foobar PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
)
file(GLOB SOURCES CONFIGURE_DEPENDS *.cpp *.h *.hpp)
target_sources(foobar PRIVATE ${SOURCES})
My main issue with CONFIGURE_DEPENDS is performance. It impacts configure time performance on large projects with hundreds of files. To me configure time performance is extremely important.
Perhaps this is less of an issue on Linux platforms (In general CMake is a lot faster on linux). But I’m mainly a windows dev.