Following the wiki, we should be able to use CodeSynthesis XSD with CMake. What the FindXSD.cmake does is that
- call the executable of CodeSynthesis XSD and give an .xsd file, say test.xsd, the executable.
- pre-defined function generates a set of .cxx and .hxx files, test.cxx and test.hxx in this case.
- add a rule to make a library libtest.a from the generated files.
MACRO and FUNCTION of CMake enable this procedure. Due to some unknown reasons, these FindXSD.cmake files didn’t work on my computer. So, I manually generate a set of .cxx and .hxx files and then run cmake to find XercesC and XSD, add a rule to make a library, and make a link to the library.