【问题标题】:What is different about the CMake command configure_file on Windows?Windows 上的 CMake 命令 configure_file 有什么不同?
【发布时间】:2010-12-03 15:20:18
【问题描述】:

在 linux 上我使用如下命令:

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

将一些单元测试文件复制到构建目录。在 Windows 上,文件不会被复制。发生这种情况是否有特定原因?

【问题讨论】:

标签: c++ unit-testing cmake


【解决方案1】:

你必须specify the complete directory path。以下适用于 Windows,并且也考虑了源外构建:

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

【讨论】:

    猜你喜欢
    • 2018-06-07
    • 1970-01-01
    • 1970-01-01
    • 2023-01-26
    • 2022-01-09
    • 2021-09-06
    • 1970-01-01
    • 1970-01-01
    • 2019-04-06
    相关资源
    最近更新 更多