在Windows上CMa​​ke命令configure_file有什么不同? [英] What is different about the CMake command configure_file on Windows?

查看:203
本文介绍了在Windows上CMa​​ke命令configure_file有什么不同?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在linux我使用一个命令,如:

On linux I am using a command such as:

configure_file(dot_alpha_16.bmp test/dot_samples/dot_alpha_16.bmp COPYONLY)

将一些单元测试文件复制到构建目录。在Windows上,文件未被复制。

to copy some unit test files to the build directory. On windows the files aren't getting copied. Is there a specific reason why this happens?

推荐答案

您必须指定完整的目录路径。下面的代码在Windows上运行,并将非源代码构建也考虑在内:

You have to specify the complete directory path. The following works on Windows and takes out-of-source builds into account too:

configure_file(${CMAKE_CURRENT_SOURCE_DIR}/dot_alpha_16.bmp
    ${CMAKE_CURRENT_BINARY_DIR}/test/dot_samples/dot_alpha_16.bmp COPYONLY)

这篇关于在Windows上CMa​​ke命令configure_file有什么不同?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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