[CMake] Copying data files from source tree to binary tree during the build

William A. Hoffman billlist at nycap.rr.com
Wed Jan 11 08:04:17 EST 2006


At 05:35 AM 1/11/2006, Filipe Sousa wrote:
>But do I really need to do a
>> 
>> IF(WIN32) xcopy ...
>> IF (UNIX) cp ...
>> etc. ???
>> 
Filipe's suggestion of config.h is the right way to do it IMO.
However, if you want to copy files in cmake, you can do this:
${CMAKE_COMMAND} -E copy

For a full list of cmake -E commands just run cmake -E:

$ ../CMake\ nmake/bin/cmake -E
CMake Error: cmake version 2.3-20051230
Usage: c:\Hoffman\CMake nmake\bin\cmake.exe -E [command] [arguments ...]
Available commands:
  chdir dir cmd [args]... - run command in a given directory
  copy file destination   - copy file to destination (either file or directory)
  copy_if_different in-file out-file   - copy file if input has changed
  copy_directory source destination    - copy directory 'source' content to dire
ctory 'destination'
  compare_files file1 file2 - check if file1 is same as file2
  echo [string]...        - displays arguments as text
  remove file1 file2 ...  - remove the file(s)
  tar [cxt][vfz] file.tar file/dir1 file/dir2 ... - create a tar.
  time command [args] ... - run command and return elapsed time
  write_regv key value    - write registry value
  delete_regv key         - delete registry value
  comspec                 - on windows 9x use this for RunCommand




More information about the CMake mailing list