CMake copy if original file changed

后端 未结 3 872
無奈伤痛
無奈伤痛 2021-01-07 23:08

In CMake I have a folder containing predefined Gettext catalogs, which at build time I copy to a folder and then modify them. But the problem is that every time I run the ta

3条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-07 23:55

    Another option is to use configure_file with COPYONLY argument.

    configure_file(input_file output_file COPYONLY)
    

    This won't perform any variable substitution and will copy "input_file" when you run make. But it triggers a cmake run and this may be undesirable because of time consumption.

提交回复
热议问题