From 4ccb726cca80ebaee41056a87fb24191aa47e66f Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Sun, 22 Oct 2023 17:26:00 -0400 Subject: [PATCH] xo-cmake: simplify api -- drop nxo_ args --- cmake/xo_macros/xo_cxx.cmake | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/cmake/xo_macros/xo_cxx.cmake b/cmake/xo_macros/xo_cxx.cmake index 27e3d02c..80429258 100644 --- a/cmake/xo_macros/xo_cxx.cmake +++ b/cmake/xo_macros/xo_cxx.cmake @@ -65,9 +65,11 @@ endmacro() # e.g. # - xo_target = xo_pyutil -# - nxo_target = pyutil # -macro(xo_include_headeronly_options5 target nxo_target) +macro(xo_include_headeronly_options target) + string(REGEX REPLACE "^xo_" "" _nxo_target ${target}) + string(REGEX REPLACE "^xo-" "" _nxo_target ${_nxo_target}) + # ---------------------------------------------------------------- # PROJECT_SOURCE_DIR: # so we can for example write @@ -84,12 +86,10 @@ macro(xo_include_headeronly_options5 target nxo_target) target_include_directories( ${target} INTERFACE $ - $ - $ # e.g. for #include "indentlog/scope.hpp" - #$ # e.g. for #include "Refcounted.hpp" in refcnt/src when ${target}=refcnt [DEPRECATED] - $ # e.g. for #include "TypeDescr.hpp" in reflect/src when ${target}=reflect - #$ # e.g. for generated .hpp files - $ # e.g. for generated .hpp files + $ + $ # e.g. for #include "indentlog/scope.hpp" + $ # e.g. for #include "TypeDescr.hpp" in reflect/src when ${target}=reflect + $ # e.g. for generated .hpp files ) # ---------------------------------------------------------------- @@ -104,7 +104,7 @@ macro(xo_include_headeronly_options5 target nxo_target) endmacro() macro(xo_include_headeronly_options2 target) - xo_include_headeronly_options5(${target} ${target}) + xo_include_headeronly_options(${target}) endmacro() # ---------------------------------------------------------------- @@ -205,9 +205,8 @@ endmacro() # # e.g. # - target=xo_pyutil cmake target name for this library -# - nxo_target=pyutil directory for this target under include/xo # -macro(xo_add_headeronly_library5 target nxo_target) +macro(xo_add_headeronly_library target) add_library(${target} INTERFACE) set_property( @@ -220,11 +219,7 @@ macro(xo_add_headeronly_library5 target nxo_target) TARGET ${target} PROPERTY xo_bindir ${PROJECT_BINARY_DIR}) - xo_include_headeronly_options5(${target} ${nxo_target}) -endmacro() - -macro(xo_add_headeronly_library target) - xo_add_headeronly_library5(${target} ${target}) + xo_include_headeronly_options(${target}) endmacro() # ----------------------------------------------------------------