We're using Pococapsule to define a configuration XML file which will eventually end up in a .cpp file which contains factories for the various classes. This XML file contains references to other modules' XML files like this:
<!DOCTYPE poco-application-context
SYSTEM "http://www.pocomatic.com/poco-application-context.dtd" [
<!ENTITY ModuleX SYSTEM "../../ModuleX/conf/ModuleX.xml" >
<!ENTITY ModuleY SYSTEM "../../ModuleY/conf/ModuleY.xml" >
<!ENTITY ModuleZ SYSTEM "../../ModuleZ/conf/ModuleZ.xml" >
]>
<!DOCTYPE poco-application-context
SYSTEM "http://www.pocomatic.com/poco-application-context.dtd" [
<!ENTITY ModuleX SYSTEM "../../ModuleX/conf/ModuleX.xml" >
<!ENTITY ModuleY SYSTEM "../../ModuleY/conf/ModuleY.xml" >
<!ENTITY ModuleZ SYSTEM "../../ModuleZ/conf/ModuleZ.xml" >
]>
To copy to clipboard, switch view to plain text mode
When any of these or the master XML file is touched the .cpp file needs to be rebuilt. I already have it working for the master XML file but I'm having problems trying to figure out how to extract the individual includes and add them to the dependency list. My first thought was to extract the contents of the XML file using the undocumented cat function but I can't get that to work
# Hard coded for test
CONFIGCONTENT = cat(/path/to/ModuleX.xml)
message($$CONFIGCONTENT)
# Hard coded for test
CONFIGCONTENT = cat(/path/to/ModuleX.xml)
message($$CONFIGCONTENT)
To copy to clipboard, switch view to plain text mode
This only prints the actual command (cat /....) and not the file's content. Am I missing something here or is there some better way of doing this? I want to try to avoid external programs since it will be built on multiple platforms.
Bookmarks