Force CMake to generate configure_file target every build

前端 未结 2 1505
别那么骄傲
别那么骄傲 2021-01-12 06:03

I have following command in my CMakeLists.txt file

configure_file([...]/Version.h.in [...]/Version.h @ONLY)

How do I make it r

2条回答
  •  独厮守ぢ
    2021-01-12 06:46

    Just to submit an alternative answer that seems simpler to me and does the trick if you are under any *nix OS :

    Running touch Version.h.in as a pre-build command, either implemented in your IDE, manually executed before running your cmake commands in your shell, or in your CI (where it might be useless), allows to systematically generate the Version.h file, even if it has not been modified.

提交回复
热议问题