[CMake] howto re-run file(COPY signature ?

Eric Noulard eric.noulard at gmail.com
Wed Nov 24 13:16:19 EST 2010


2010/11/24 Dominique Belhachemi <domibel at cs.tu-berlin.de>:
>> The ${CMAKE_SOURCE_DIR}/copytree.cmake script simply looks like:
>>
>> FILE(COPY ${SRC} DESTINATION ${DST} PATTERN .svn EXCLUDE)
>>
> Thanks, I will see if this works for me.
>
>> Because FILE(COPY ...) copies files and directories only if they are new
> Does it mean it is a bug if FILE(COPY ...) doesn't copy new files?

Not in this case.
FILE( xxx) is CMake-time  command (it runs when CMake runs)

when you do "make" your are at "Build time"
at Build time, cmake may be [automatically] invoked again if some target
(library, executable, custom etc...) NEEDS a re-run because of a dependency.

In your example there is no mean for CMake to know that FILE(COPY ...)
generates a build time dependency.

So when a new file is added either your re-run cmake yourself
or you try Michael proposal
which adds this kind of "build time dependency" using custom target.

-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org


More information about the CMake mailing list