The best I could come up with was:
if(WIN32) set(STDIN "CON") else() set(STDIN "/dev/fd/0") endif() file(READ "${STDIN}" …)