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

James Turner james.turner at kdab.com
Thu Jun 9 05:06:16 EDT 2016


> On 9 Jun 2016, at 09:51, Petr Kmoch <petr.kmoch at gmail.com> wrote:
> 
> 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.

That is indeed exactly what I needed, I am trying to figure out if I would ever have got that from Googling. I never think of ‘running Cmake again’ as ‘configure’ but it makes sense now you pointed it out.

Thank you again,
James

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3868 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/cmake/attachments/20160609/99adc52a/attachment-0001.bin>


More information about the CMake mailing list