xo-cmake: comments on modules vs configs

This commit is contained in:
Roland Conybeare 2025-07-05 16:16:47 -05:00
commit 5d020e5928
2 changed files with 5 additions and 2 deletions

View file

@ -1,6 +1,6 @@
{ {
# dependencies # dependencies
stdenv, cmake, catch2, stdenv, cmake, catch2, replxx,
xo-cmake, xo-expression, xo-tokenizer xo-cmake, xo-expression, xo-tokenizer
} : } :

View file

@ -1348,11 +1348,14 @@ endmacro()
# e.g. # e.g.
# add_library(foo ..) or add_executable(foo ...) # add_library(foo ..) or add_executable(foo ...)
# then # then
# xo_external_namespaced_dependency(foo Catch2 Catch2::Catch2) # xo_external_target_dependency(foo Catch2 Catch2::Catch2)
# equivalent to # equivalent to
# find_package(Catch2 CONFIG REQUIRED) # find_package(Catch2 CONFIG REQUIRED)
# target_link_libraries(foo PUBLIC Catch2::Catch2) # target_link_libraries(foo PUBLIC Catch2::Catch2)
# #
# NOTE: this won't work for builtin module targets. For Threads we need just
# find_package(${pkg} Threads)
#
macro(xo_external_target_dependency target pkg pkgtarget) macro(xo_external_target_dependency target pkg pkgtarget)
message("-- [${target}] find_package(${pkg}) (xo_external_target_dependency)") message("-- [${target}] find_package(${pkg}) (xo_external_target_dependency)")
find_package(${pkg} CONFIG REQUIRED) find_package(${pkg} CONFIG REQUIRED)