How to copy directory from source tree to binary tree?

Jiang Bian picture Jiang Bian · Mar 30, 2009 · Viewed 86.1k times · Source

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.

Answer

Chty picture Chty · Feb 1, 2010

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