this also works for me.
This is only generated at install time. So in order to make this command work, you have to build the "install" cmake target.
install(DIRECTORY "myDir/"
DESTINATION "myDestination"
FILES_MATCHING PATTERN "*.h" )