2009-10-03 65 views
7

在Linux上,我使用的命令,例如:Windows上的CMake命令configure_file有什么不同?

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

一些单元测试文件复制到构建目录。在Windows上,文件不会被复制。为什么会出现这种情况的具体原因?

+2

文档(http://www.cmake.org/cmake/help/cmake2.6docs.html#command:configure_file)说输入和输出必须有完整的路径。看起来在你的代码中你正在使用相对路径。 – coelhudo 2009-10-06 13:59:32

回答

9

你必须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)