[CMake] How to have build steps operate on files in a copied directory?

Christopher E Robison cerobison at utexas.edu
Mon Jul 10 13:46:23 EDT 2017


I've recently begun using CMake on an existing project I've taken over, and
I feel like I'm mostly getting used to it, though there is still a vast
amount to learn.  I've got nearly the entire project building successfully,
with the exception of a directory of external scripts that need to be
configured at the end of the install process to create some index files.

So, in a nutshell, there's a script that takes care of this post-install
configuration, that needs to be executed once the target tree of
directories and script files are in place, copied from the source tree. And
I'm finding that when the script is called during the build, the
INSTALL(DIRECTORY ...) command from the CMakeLists.txt directory hasn't
been run yet, so the tree of script files hasn't been put in place yet and
the script (and the build) fails.

FWIW, if I leave out the add_custom_command and add_custom_target that
execute the script, the directory tree does copy correctly.

I have not found any guidance on how to specify that the directory tree
gets copied first. How is this normally done?


Thanks,
CR
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20170710/f218a7f8/attachment.html>


More information about the CMake mailing list