The compile_resources() function of the windows module can now be used on custom targets as well as regular files.
compile_resources()
windows