Files
Matthew Woehlke 254916dfc6 export: Make PACKAGE_INFO, SBOM sub-commands
Change the interface of the `export` command so that `PACKAGE_INFO` and
`SBOM` are proper, first-level sub-commands, rather than being implemented via
`export(EXPORT ... (PACKAGE_INFO|SBOM) ...)`. This brings consistency with the
`install` command and also simplifies argument parsing.

Update the documentation and test cases accordingly. Some of the
argument handling test cases are now rather gratuitous, and are removed,
which also improves consistency with the `install` tests.
2026-01-12 14:05:27 -05:00

21 lines
466 B
CMake

find_package(
test REQUIRED CONFIG
NO_DEFAULT_PATH
PATHS ${CMAKE_CURRENT_LIST_DIR}
)
add_library(libb INTERFACE)
add_library(libc INTERFACE)
add_library(libd INTERFACE)
add_library(foo ALIAS libb)
add_library(bar ALIAS libc)
target_link_libraries(libd INTERFACE test::liba foo bar)
install(TARGETS libb EXPORT foo DESTINATION .)
export(PACKAGE_INFO foo EXPORT foo)
install(TARGETS libc libd EXPORT bar DESTINATION .)
export(PACKAGE_INFO bar EXPORT bar)