Copy file from source directory to binary directory using CMake

后端 未结 8 1820
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-28 03:37

I\'m trying to create a simple project on CLion. It uses CMake (I\'m new here) to generate Makefiles to build project (or some sort of it)

All I need to is transfer

8条回答
  •  渐次进展
    2020-11-28 04:26

    This is what I used to copy some resource files: the copy-files is an empty target to ignore errors

     add_custom_target(copy-files ALL
        COMMAND ${CMAKE_COMMAND} -E copy_directory
        ${CMAKE_BINARY_DIR}/SOURCEDIRECTORY
        ${CMAKE_BINARY_DIR}/DESTINATIONDIRECTORY
        )
    

提交回复
热议问题