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

James Turner james.turner at kdab.com
Thu Jun 9 04:39:35 EDT 2016


Hi,

Is there a way to make the entire build-system depend on a file? I have some data I’m reading into my CMakeList.txt via file(READ), and I want changes to that file to effectively act as if the CMakeList.txt itself was modified.

The read values are used to populate some variables via string parsing, which is then used in generated headers and a few other places:

> # read 'version' file into a variable (stripping any newlines or spaces)
> file(READ version versionFile)
> string(STRIP ${versionFile} FOO_VERSION)

The file is part of the source distribution alongside the build-system, it’s not user-supplied or anything complex like that.

Right now changes to the file contents don’t trigger the downstream variables being updated.

Kind regards,
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/964509a4/attachment.bin>


More information about the CMake mailing list