From 8c1bbb09356ce896c103cc4da02186da2528d9bf Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Wed, 4 Oct 2023 13:32:58 -0400 Subject: [PATCH] xo-cmake: + xo_dependency_headeronly + xo_dependency --- cmake/xo_cxx.cmake | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/cmake/xo_cxx.cmake b/cmake/xo_cxx.cmake index 66ac7962..84ca488e 100644 --- a/cmake/xo_cxx.cmake +++ b/cmake/xo_cxx.cmake @@ -219,11 +219,22 @@ endmacro() # # dep: name of required dependency, e.g. indentlog # -macro(xo_internal_dependency target dep) +macro(xo_dependency target dep) find_package(${dep} CONFIG REQUIRED) target_link_libraries(${target} PUBLIC ${dep}) endmacro() +macro(xo_internal_dependency target dep) + xo_dependency(target dep) +endmacro() + +# dependency on a header-only library +# +macro(xo_dependency_headeronly target dep) + find_package(${dep} CONFIG REQUIRED) + target_link_libraries(${target} INTERFACE ${dep}) +endmacro() + # dependency on namespaced target # e.g. # add_library(foo ..) or add_executable(foo ...)