How to make CMake reconfiguration depend on custom file?

后端 未结 2 1729
有刺的猬
有刺的猬 2020-11-30 11:45

I have a project under CMake with some files generated with python generator from XML files. I cannot specify all files generated by this generator in CMakeLists.txt so I us

2条回答
  •  温柔的废话
    2020-11-30 12:21

    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)
    

提交回复
热议问题