[CMake] Dependency checker

Benjamin Schindler bschindler at inf.ethz.ch
Thu Sep 9 05:23:34 EDT 2010


Hi

Thank you for your quick answer. I had a quick glance - what I don't
quite understand is how can I integrate this into my custom cmake
script? I have a ADD_CUSTOM_COMMAND, and in the depends I need this list
of dependent files (the generated files, not the xsd's themselves).

If you could shed some light on this, that would be very helpful

Thank you
Benjamin Schindler

On 09/09/2010 11:03 AM, Michael Wild wrote:
> 
> On 9. Sep, 2010, at 10:15 , Benjamin Schindler wrote:
> 
>> Hi
>>
>> I've written a cmake script for the codesynthesis xsd compiler which
>> works kindof similar to the qt scripts calling moc etc.
>> The problem is, that I have no dependency checker. I'd need to parse the
>> xsd asked for and put all included xsd's in to the dependency list. And
>> this needs to be cross platform (so exec-program is not really an option...)
>>
>> Is there a way in cmake to do that?
>>
>> Thank you
>> Benjamin Schindler
> 
> Only by modifying the CMake source code. Have a look at the Source/cmDepends* files to get an idea.
> 
> CMake already contains expat and wraps it in the cmXMLParser, so it should be pretty simple to extract the schemaLocation attributes. What will NOT be so simple is to resolve them (speaking XML catalogs), but you might decide to just skip URIs which are not local (file://) or relative if you don't expect them to change frequently.
> 
> Michael
> 
> --
> There is always a well-known solution to every human problem -- neat, plausible, and wrong.
> H. L. Mencken
> 



More information about the CMake mailing list