[CMake] Wanted : Macro to copy files if touched

Ken Martin ken.martin at kitware.com
Fri Jan 13 13:44:49 EST 2006


FYI I think you need to quote most of those arguments to be safe. Otherwise
files with spaces in the path will fail, same for CMAKE_COMMAND etc.

> > MACRO(COPY_IF_DIFFERENT source dest
> >   EXEC_PROGRAM(
> >     ${CMAKE_COMMAND}
> >     ARGS -E copy_if_different ${source} ${dest})
> > ENDMACRO(MACRO(COPY_IF_DIFFERENT)
> >
> > use COPY_IF_DIFFERENT with FOREACH
> >
> 
> Excellent, this is exactly what I wanted
> > The files are copied when CMakeLists.txt is processed. If you need the
> > files to be copied when a specific target is built use a custom rule
> >
> No. I didn't want to create custom rules. The one above is just what I
> was looking for. Concise and simple. thanks very much




More information about the CMake mailing list