[CMake] automatic cmake run when specific files change

James Bigler jamesbigler at gmail.com
Wed Oct 14 11:58:07 EDT 2009


On Tue, Oct 13, 2009 at 4:16 PM, Hendrik Sattler
<post at hendrik-sattler.de> wrote:
> Hi,
>
> when changing a CMakeLists.txt file and calling make, then cmake automatically
> runs. I want to achieve the same thing but for specific files.
>
> The situation: DocBook/XML files are parsed at cmake times to get the names of
> the output files. If the docbook files change, the names of the output files may
> also change, so cmake needs to be run again to update the rules.
>
> How can this be done?
>
> Thanks
>
> HS
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>

Yes.  What you need to do is add the DocBook/XML files to the
dependency list of the add_custom_command that is used to generate the
output file.  When those files change, then the add_custom_command
will be run again.  See the documentation for add_custom_command.

James


More information about the CMake mailing list