From 6b22aab6fbb3c2ddce07621ca2e82f4e2b087ccd Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Mon, 5 Jan 2026 12:09:42 -0500 Subject: [PATCH] xo-cmake: streamline facet gen --- xo-cmake/cmake/xo_macros/xo_cxx.cmake | 12 +++++++++++- xo-object2/CMakeLists.txt | 8 +++++--- xo-object2/include/xo/object2/IPrintable_DFloat.hpp | 7 +++---- xo-object2/src/object2/IPrintable_DFloat.cpp | 2 +- 4 files changed, 20 insertions(+), 9 deletions(-) diff --git a/xo-cmake/cmake/xo_macros/xo_cxx.cmake b/xo-cmake/cmake/xo_macros/xo_cxx.cmake index dd382e7f..2b916698 100644 --- a/xo-cmake/cmake/xo_macros/xo_cxx.cmake +++ b/xo-cmake/cmake/xo_macros/xo_cxx.cmake @@ -1702,7 +1702,8 @@ function(xo_add_genfacetimpl) set(options "") set(oneValueArgs TARGET # Name for this generation target - FACET_DIR # facet directory + FACET_PKG # package providing abstract interface + FACET_DIR # facet directory (instead of FACET_PKG) FACET # facet name REPR # representation name INPUT # Input .json5 file @@ -1736,6 +1737,15 @@ function(xo_add_genfacetimpl) message(FATAL_ERROR "xo_add_genfacetimpl: OUTPUT_CPP_DIR is required") endif() + if(NOT DEFINED GF_FACET_DIR) + if (NOT DEFINED GF_FACET_PKG) + message(FATAL_ERROR "xo_add_genfacetimpl: FACET_PKG or FACET_DIR required") + else() + get_target_property(_facet_dir share_${GF_FACET_PKG} path) + set(GF_FACET_DIR ${_facet_dir}) + endif() + endif() + find_program(GENFACET_EXECUTABLE NAMES genfacet HINTS ${CMAKE_SOURCE_DIR}/xo-facet/codegen DOC "path to xo genfacet code generator" diff --git a/xo-object2/CMakeLists.txt b/xo-object2/CMakeLists.txt index 629d5491..70df940d 100644 --- a/xo-object2/CMakeLists.txt +++ b/xo-object2/CMakeLists.txt @@ -29,6 +29,7 @@ xo_add_genfacet( xo_add_genfacetimpl( TARGET xo-object2-facetimpl-sequence-list + FACET_PKG xo_object2 FACET Sequence REPR List INPUT idl/ISequence_DList.json5 @@ -37,12 +38,13 @@ xo_add_genfacetimpl( OUTPUT_CPP_DIR src/object2 ) -get_target_property(xo_printable2_dir share_xo_printable2 path) -message(STATUS "xo_printable2_dir=${xo_printable2_dir}") +#get_target_property(xo_printable2_dir share_xo_printable2 path) +#message(STATUS "xo_printable2_dir=${xo_printable2_dir}") xo_add_genfacetimpl( TARGET xo-object2-facetimpl-printable-float - FACET_DIR ${xo_printable2_dir} + FACET_PKG xo_printable2 +# FACET_DIR ${xo_printable2_dir} FACET Printable REPR Float INPUT idl/IPrintable_DFloat.json5 diff --git a/xo-object2/include/xo/object2/IPrintable_DFloat.hpp b/xo-object2/include/xo/object2/IPrintable_DFloat.hpp index a7140cda..0ac94b9f 100644 --- a/xo-object2/include/xo/object2/IPrintable_DFloat.hpp +++ b/xo-object2/include/xo/object2/IPrintable_DFloat.hpp @@ -2,7 +2,7 @@ * * Generated automagically from ingredients: * 1. code generator: - * [/Users/roland/proj/xo-umbrella2/xo-facet/codegen/genfacet] + * [/home/roland/proj/xo-umbrella2/xo-facet/codegen/genfacet] * arguments: * --input [idl/IPrintable_DFloat.json5] * 2. jinja2 template for abstract facet .hpp file: @@ -45,8 +45,7 @@ namespace xo { /** @defgroup scm-printable-dfloat-methods **/ ///@{ /** Pretty-printing support for this object. - See [xo-indentlog/xo/indentlog/pretty.hpp] - **/ +See [xo-indentlog/xo/indentlog/pretty.hpp] **/ static bool pretty(const DFloat & self, const ppindentinfo & ppii); ///@} @@ -55,4 +54,4 @@ namespace xo { } /*namespace scm*/ } /*namespace xo*/ -/* end */ +/* end */ \ No newline at end of file diff --git a/xo-object2/src/object2/IPrintable_DFloat.cpp b/xo-object2/src/object2/IPrintable_DFloat.cpp index 98866266..b459e384 100644 --- a/xo-object2/src/object2/IPrintable_DFloat.cpp +++ b/xo-object2/src/object2/IPrintable_DFloat.cpp @@ -2,7 +2,7 @@ * * Generated automagically from ingredients: * 1. code generator: - * [/Users/roland/proj/xo-umbrella2/xo-facet/codegen/genfacet] + * [/home/roland/proj/xo-umbrella2/xo-facet/codegen/genfacet] * arguments: * --input [idl/IPrintable_DFloat.json5] * 2. jinja2 template for abstract facet .hpp file: