From eb960a5fc8c3ff8219c9e765712e757e5990bb88 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 --- cmake/xo_macros/xo_cxx.cmake | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/cmake/xo_macros/xo_cxx.cmake b/cmake/xo_macros/xo_cxx.cmake index dd382e7f..2b916698 100644 --- a/cmake/xo_macros/xo_cxx.cmake +++ b/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"