[CMake] Build-system dependency (as opposed to target)

Petr Kmoch petr.kmoch at gmail.com
Thu Jun 9 04:51:21 EDT 2016


Hi James,

I believe you're looking for the directory property CMAKE_CONFIGURE_DEPENDS
( https://cmake.org/cmake/help/latest/prop_dir/CMAKE_CONFIGURE_DEPENDS.html
). Adding a file path to that property causes any changes to that file to
trigger a regeneration:

  set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS version)

If you are using CMake old enough not to have this property, an alternative
workaround is to run configure_file() on the file (even if you never use
the configured result). This will introduce the exact same dependency.

Petr
​
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20160609/7ea7f6d8/attachment.html>


More information about the CMake mailing list