How to make CMake reconfiguration depend on custom file?

风格不统一 提交于 2019-11-27 09:30:36

Yes, you should be able to do that by (ab)using configure_file(). Configuring a file makes the source a dependency of the CMake run, so that any changes in it cause a reconfiguration. Simply like this:

configure_file(MyInputFile.xml DummyOutput.xml)
roolebo

It doesn't require any kind of workarounds. The standard way is to use CMAKE_CONFIGURE_DEPENDS property:

set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS <filename>)
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!