The install(FILES ...) command doesn't support generated files
CMake doesn't set the necessary dependencies in order to install a generated file.
For example:
add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/generated.txt
COMMAND ${CMAKE_COMMMAND} -E touch ${CMAKE_BINARY_DIR}/generated.txt)
install(FILES ${CMAKE_BINARY_DIR}/generated.txt)
This will fail when building the package target as the file to be installed doesn't exist.