[CMake] What is the most reliable way to concatanate files on Windows?

Hendrik Sattler post at hendrik-sattler.de
Sun Nov 1 06:10:11 EST 2009


Am Sonntag 01 November 2009 05:25:03 schrieb Alan W. Irwin:
> The PLplot build system needs to contatanate some files together.  The
> cross-platform way we do this right now is to use cat if it is available
> (which handles the Unix case) and otherwise if the Windows cmd or command
> are available use the copy command.  This method is somewhat fragile (one
> Windows user could not find any of cat, cmd, or command), and even when
>  copy is used (for the cmd or command case), we are currently experimenting
>  to see if Windows native paths are needed or not.
> 
> Just in case the PLplot developers have missed something, is there some
>  more reliable way for us to concatanate files in a cross-platform way?
> 
> Of course, the ideal way to avoid this mess would be to use the "cmake -E
> concatanate" command, but as far as I know that hasn't been implemented
>  yet. File concatanation is a pretty fundamental capability so I am
>  entering a plea here to the CMake developers to put this idea on their
>  ToDo list (assuming it isn't there already).  If the implementation is
>  non-trivial and therefore has to be put off, let me know, and I will make
>  a wish-list bug report for it.

See the file() command. You can easily write a cmake script to use at 
configuration or at build time.

HS


More information about the CMake mailing list