xo-facet xo-object2 xo-cmake: facet tidy + build integration
This commit is contained in:
parent
f988340c78
commit
ec7a39135f
4 changed files with 21 additions and 3 deletions
|
|
@ -30,6 +30,23 @@ xo_export_cmake_config(${PROJECT_NAME} ${PROJECT_VERSION} ${PROJECT_NAME}Targets
|
|||
|
||||
# ----------------------------------------------------------------
|
||||
|
||||
# Install the generator script
|
||||
install(
|
||||
PROGRAMS codegen/genfacet
|
||||
DESTINATION share/xo-facet/codegen
|
||||
COMPONENT codegen
|
||||
)
|
||||
|
||||
# Install all .j2 template files
|
||||
install(
|
||||
DIRECTORY codegen/
|
||||
DESTINATION share/xo-facet/codegen
|
||||
COMPONENT codegen
|
||||
FILES_MATCHING PATTERN "*.j2"
|
||||
)
|
||||
|
||||
# ----------------------------------------------------------------
|
||||
|
||||
# docs targets depend on other library/utest/exec targets above,
|
||||
# --> must come after them.
|
||||
#
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
#! /usr/bin/env python3
|
||||
#
|
||||
# genfacet.py
|
||||
|
||||
import json5
|
||||
import argparse
|
||||
|
|
@ -54,6 +53,7 @@ def format_args_routing(args):
|
|||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('--templates', required=True, help='.j2 template directory')
|
||||
parser.add_argument('--input', required=True, help='input IDL JSON5 file')
|
||||
parser.add_argument('--output-impl-hpp', required=True, help='.hpp detail subdir')
|
||||
parser.add_argument('--output-hpp', required=True, help='.hpp output directory')
|
||||
|
|
@ -75,7 +75,8 @@ def main():
|
|||
output_cpp_dir.mkdir(parents=False, exist_ok=True)
|
||||
|
||||
# setup jinja2
|
||||
template_dir = Path(__file__).parent
|
||||
template_dir = Path(args.templates)
|
||||
#template_dir = Path(__file__).parent
|
||||
#template_dir = Path(__file__).parent / 'codegen'
|
||||
|
||||
print(f'template_dir: [{template_dir}]')
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
*
|
||||
**/
|
||||
|
||||
#include "{{iface_facet_any_hpp_fname}}"
|
||||
#include "{{impl_hpp_subdir}}/{{iface_facet_any_hpp_fname}}"
|
||||
#include <iostream>
|
||||
|
||||
namespace {{facet_ns1}} {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue