robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
1086016477
master
1# Copy multiple files to destination, based on a glob expression 2# - FROM_GLOB 3# - TO 4 5if ( NOT FROM_GLOB) 6message ( FATAL_ERROR "FROM_GLOB must be set" ) 7endif () 8if ( NOT TO) 9message ( FATAL_ERROR "TO must be set" ) 10endif () 11 12execute_process ( COMMAND ${ CMAKE_COMMAND } -E make_directory ${ TO }) 13 14file ( GLOB files ${ FROM_GLOB }) 15foreach ( file${ files }) 16execute_process ( COMMAND ${ CMAKE_COMMAND } -E copy ${ file } ${ TO } RESULT_VARIABLE rv ) 17if ( rv) 18message ( FATAL_ERROR "Error copying ${ file } " ) 19endif () 20endforeach ()