[cmake-developers] Need some pointers on learning the code
Brad King
brad.king at kitware.com
Wed May 29 14:22:14 EDT 2013
On 05/29/2013 12:42 PM, Robert Dailey wrote:
> I like your idea of using an external script to handle this, however,
> there is certain state I need access to from the last CMake run.
> Specifically, I have a variable with all of the 'bin' directories
> where DLLs can be found. To avoid recursive searching in my custom
> target script to find them each time I build, I suppose I could store
> them in a cache variable? I was just going to create a CMake script
> that I run from the custom target.
Configure the script with the list as part of its source using
configure_file.
> The reason I went with custom commands to begin with is because I
> originally used cmake's copy_if_different command, but it turned out
> to be MUCH slower than the out of date checks that the custom command
> did.
If you go with the external script approach use the file(COPY)
command. It uses a timestamp-based decision so incremental updates
are very fast. Underneath it is the same logic used by CMake in its
implementation of "make install".
-Brad
More information about the cmake-developers
mailing list