[CMake] Programmatically-generated dependencies

Miller, Frank FMiller at sjm.com
Thu Dec 11 12:23:46 EST 2014


You will want to also make sure that a reconfigure happens when the xml file changes which can be done with the recently added CMAKE_CONFIGURE_DEPENDS property. If you need to support older versions of cmake, then you can use configure_file() to copy the xml file somewhere (no need to use it).

This is unfortunate. I was hoping someone would have a better solution but it looks like the feature we want doesn't exist.

http://public.kitware.com/Bug/view.php?id=2172

Frank

> -----Original Message-----
> From: CMake [mailto:cmake-bounces at cmake.org] On Behalf Of Jakub
> Zakrzewski
> Sent: Thursday, December 11, 2014 9:06 AM
> To: ax487
> Cc: cmake at cmake.org
> Subject: Re: [CMake] Programmatically-generated dependencies
>
> Hi,
>
> CMake provides functions to execute commands and capture the output.
> You would use them as a part of configure step to get dependencies.
> Then add_custom_command to actually generate the C file and use the
> output to generate the DEPENDS section.
>
> --
> Gruesse,
> Jakub
>
>
>
>
> -----Original Message-----
> From: CMake [mailto:cmake-bounces at cmake.org] On Behalf Of ax487
> Sent: Donnerstag, 11. Dezember 2014 15:49
> To: cmake at cmake.org
> Subject: Re: [CMake] Programmatically-generated dependencies
>
> *bump*
>
> On 09.12.2014 10:38, ax487 wrote:
> > Hello all,
> >
> > I am mainly asking having glib-compile-resources in mind. This little
> > program translates files into C source code to be used with the
> > gresource system. It works in the following way: You have a file.xml
> > describing the resources:
> >
> > <?xml version="1.0" encoding="UTF-8"?> <gresources> <gresource
> > prefix="/some/prefix">
> >
> > <file>some_file.txt</file>
> > </gresource>
> > </gresources>
> >
> > To generate the source you use `glib-compile-resources
> > --generate-source --target=output.c file.xml`. Clearly the generated
> > output.c depends on file.xml. But it also depends on some_file.txt. It
> > is possible to get a list of dependencies using
> > `glib-compile-resources --generate-dependencies file.xml` which will
> > output
> >
> > some_file.txt
> >
> > The situation is similar to the case of auto-generated header
> > dependencies for C/C++ source code using the "-MM" option of gcc.
> > I saw the following version on github:
> >
> > https://github.com/bgK/vba-ttb/blob/master/cmake/GResource.cmake
> >
> > which does not correctly detect dependencies, but nothing apart from
> > that. But since the process works with C/C++ source code I figured
> > there is no reason why it shouldn't also work in this case. Could
> > anyone give me some pointers on how to get this to work?
> >
> > ax487
> >
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake

This communication, including any attachments, may contain information that is proprietary, privileged, confidential or legally exempt from disclosure. If you are not a named addressee, you are hereby notified that you are not authorized to read, print, retain a copy of or disseminate any portion of this communication without the consent of the sender and that doing so may be unlawful. If you have received this communication in error, please immediately notify the sender via return e-mail and delete it from your system. In order to safeguard its employee data as well as sensitive patient, customer, business, legal and other information, the company uses all lawful means, under all applicable law, to access, monitor, preserve, collect and review all communications between employees and all other users only when, and to the extent necessary, to fulfill investigatory and other important business and legal responsibilities. By responding to this communication, or initiating additional communication with the company, you consent to such lawful monitoring, to the extent such consent is required and valid in your local area.


More information about the CMake mailing list