Copy resources to build folder

I’m doing an OpenGL project where I mostly write shaders and have several texture files. Is there a way I can copy it to the build folder so the binary can access it?

configure_file(COPYONLY) should be able to do it. You can also run it from a script via add_custom_command so that it gets copied at build time and CMake doesn’t need to rerun on any shader/texture changes.