[CMake] Native Pathsupport under Windows

alexander at camek.de alexander at camek.de
Wed Oct 24 09:37:15 EDT 2007


Hi,


>> To copy files, use "${CMAKE_COMMAND} -E copy".

>He doesn't just want to copy files, he wants to concatenate two files >(copy file1+file2 destfile).  I doesn't look like cmake provides a built >in "cmake -E" command for that.

>One possibility is to use a separate cmake script to do the >concatenation and run it as a command:

>cmake_concatenate.cmake

>EXECUTE_PROCESS(      COMMAND      ${CMAKE_COMMAND} -E copy ${FILE1} $ 
>{DEST_FILE})
>FILE(READ ${FILE2} file2_contents)
>FILE(APPEND ${DEST_FILE} ${file2_contents})
>########################
>call it from regular CMakeLists.txt file

>    COMMAND ${CMAKE_COMMAND}
>    ARGS -P cmake_concatenate.cmake -DFILE1:STRING=${RESULT}/image.h - >DFILE2:STRING=${RESULT}/test.h -DDEST_FILE:STRING=${RESULT}/image.h
>In this particular case the destination and the first source file are >the same, so a modified cmake_concatenate.cmake file could be more >appropriate.

That doesn't work. I think it is the same problem why I can't use FILE() at all.
Because the file i want to append is both, generated before and used as a source file.

Greetings

Alexander


More information about the CMake mailing list