RISCSoftware / cpacs_tigl_gen

Generates CPACS schema based classes for TiGL
Apache License 2.0
5 stars 5 forks source link

Build Status

CPACSGen

CPACSGen (short for CPACS generator) creates source code for classes and enums from the types defined in a CPACS XML schema file for the TiGL library.

GitHub

CPACSGen is hosted on Github: https://github.com/RISCSoftware/cpacs_tigl_gen

Dependencies

The following components are required to build and run CPACSGen

Input files

Given an input directory, CPACSGen searches for the following input files:

These files are typically part of the TiGL distribution and do not have to be created. Altering these files influences CPACSGen’s output and may require further adaption of the TiGL code depending on the generated code.

In addition to these files, three more files have existed with are now compiled into CPACSGen and inside Tables.cpp:

Furthermore, in addition to the discussed input files, subdirectories may be present containing the same input files as listed above. For each subdirectory, CPACSGen runs an additional pass, putting the generated files into an equally named subfolder in the output directory and generating an equally named additional namespace in the generated code.

Workflow

  1. Clone the CPACSGen repository from Github
  2. Clone the TiGL repository Github
  3. Use CMake to configure CPACSGen
    1. Set BOOST_ROOT
    2. Set TIXI_PATH
    3. Set TIGL_PATH to the directory of your TiGL clone
  4. Build CPACSGen
  5. Build target generate
    executes CPACSGen.exe ${TIGL_DIR}/cpacs_gen_input ${CPACSGEN_DIR}/src ${TIGL_DIR}/src/generated
  6. Use CMake to configure TiGL (which picks up generated files)
  7. Build TiGL

Command line options

The CPACSGen executable takes the following positional command line options:

  1. Input directory
    The directory containing the CPACS schema and the table files
  2. runtime src directory
    The directory of the runtime source code copied to the output directory, typically src/lib/runtime inside your working copy
  3. Output directory
    The directory to which the CPACSGen output files are written
  4. (optional) output Graphviz file
    If a filename is specified, writes a Graphviz dot file containing a directed graph of the created CPACS types. This is especially useful when optimizing PruneList.txt

Table details

Generated code dependencies

The classes generated by CPACSGen depend upon the following helper files, which are part of CPACSGen and will be written to the output directory when CPACSGen is invoked: