Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to copy directory from source tree to binary tree?

Tags:

c

copy

cmake

Copying directory from source tree to binary tree. For example: How to copy www to bin folder.

work ├─bin └─src     ├─doing     │  └─www     ├─include     └─lib 

Thanks.

like image 208
Jiang Bian Avatar asked Mar 30 '09 14:03

Jiang Bian


People also ask

How do I copy a directory tree?

Type "xcopy", "source", "destination" /t /e in the Command Prompt window. Instead of “ source ,” type the path of the folder hierarchy you want to copy. Instead of “ destination ,” enter the path where you want to store the copied folder structure. Press “Enter” on your keyboard.

Can you copy a directory using cp command?

Use the cp command to create a copy of the contents of the file or directory specified by the SourceFile or SourceDirectory parameters into the file or directory specified by the TargetFile or TargetDirectory parameters.

How do you copy an entire directory in terminal?

Copy a Directory and Its Contents ( cp -r ) Similarly, you can copy an entire directory to another directory using cp -r followed by the directory name that you want to copy and the name of the directory to where you want to copy the directory (e.g. cp -r directory-name-1 directory-name-2 ).

How do I copy a directory tree in Linux?

In order to copy a directory on Linux, you have to execute the “cp” command with the “-R” option for recursive and specify the source and destination directories to be copied.


1 Answers

Since version 2.8, the file command has a copy argument:

file(COPY yourDir DESTINATION yourDestination) 

Note that:

Relative input paths are evaluated with respect to the current source directory, and a relative destination is evaluated with respect to the current build directory

like image 54
Chty Avatar answered Oct 07 '22 02:10

Chty