cmake: How to make a script for copying Data files accompanying my program

后端 未结 1 1560
滥情空心
滥情空心 2021-02-15 12:10

I am trying to automate my build process with cmake. There is currently only one issue:

Where is, in cmake\'s philosophy (if there is one), the best place to put the cop

相关标签:
1条回答
  • 2021-02-15 13:03

    As recently seen in this question, you can use configure_file to copy files to the build directory:

    configure_file(${CMAKE_CURRENT_SOURCE_DIR}/input.txt
        ${CMAKE_CURRENT_BINARY_DIR}/output.txt COPYONLY)
    

    That does it once at build time and only when needed.

    0 讨论(0)
提交回复
热议问题