file(CONFIGURE OUTPUT "file.txt" CONTENT "foo-$" ) file(READ ${CMAKE_CURRENT_BINARY_DIR}/file.txt out) message("${out}")