External project; cmake not re-building when source time stamp changes

I have an external project built by cmake (ExternalProject_Add), but cmake does not detect if any of the source files inside the external gets an updated time stamp. The only way seems to be to force it happening by setting BUILD_ALWAYS TRUE. Is that expected? The external is pulled in as a git submodule and the SOURCE_DIR is pointing that submodule.

External projects do not track every single file involved in the build as this is not possible in general. I suppose you could feed file(GLOB) output to DEPENDS for a custom step you inject into the default step graph in the meantime…

BUILD_ALWAYS TRUE is the right thing to do here. Your scenario allows files to change under ExternalProject’s feet, with no details about the external project (meaning none of the arguments passed to ExternalProject_Add()) changing. You want the behavior where the build detects if a file change, which is what BUILD_ALWAYS is there to support.