This reverts commit 1088b027. Wrapper dependency scanning (fix for #4147) does not work at CMake configuration time if an input file is provided by a custom command (regression #12307). Revert to original behavior until a solution is found.