CMakeLists.txt: add files_hook function