如何从源代码树目录复制到二叉树? [英] How to copy directory from source tree to binary tree?

查看:151
本文介绍了如何从源代码树目录复制到二叉树?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从源树二叉树复制目录。例如:如何WWW复制到bin文件夹

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

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

感谢。

推荐答案

通过CMake的2.8,使用的 文件(复制...) 命令。

With CMake 2.8, use the file(COPY ...) command.

使用较旧版本的CMake,这个宏复制从一个目录到另一个文件。如果你不希望在复制的文件替代变量,改变configure_file @ONLY说法。

With older CMake versions, this macro copies files from one directory to another. If you don't want to substitute variables in the copied files, change the configure_file @ONLY argument.

# Copy files from source directory to destination directory, substituting any
# variables.  Create destination directory if it does not exist.

macro(configure_files srcDir destDir)
    message(STATUS "Configuring directory ${destDir}")
    make_directory(${destDir})

    file(GLOB templateFiles RELATIVE ${srcDir} ${srcDir}/*)
    foreach(templateFile ${templateFiles})
        set(srcTemplatePath ${srcDir}/${templateFile})
        if(NOT IS_DIRECTORY ${srcTemplatePath})
            message(STATUS "Configuring file ${templateFile}")
            configure_file(
                    ${srcTemplatePath}
                    ${destDir}/${templateFile}
                    @ONLY)
        endif(NOT IS_DIRECTORY ${srcTemplatePath})
    endforeach(templateFile)
endmacro(configure_files)

这篇关于如何从源代码树目录复制到二叉树?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆