mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-10-01 04:03:24 +03:00
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.
30 lines
610 B
CMake
30 lines
610 B
CMake
add_library(foo INTERFACE)
|
|
|
|
# Primarily this tests for de-duplication of the BASE_DIRS, ensuring DESTINATION
|
|
# genex have no effect on build exports is a bonus covering a very unlikely bug
|
|
|
|
target_sources(foo
|
|
INTERFACE
|
|
FILE_SET no_genex
|
|
TYPE HEADERS
|
|
BASE_DIRS ${CMAKE_CURRENT_LIST_DIR}/foo
|
|
|
|
INTERFACE
|
|
FILE_SET genex
|
|
TYPE HEADERS
|
|
BASE_DIRS ${CMAKE_CURRENT_LIST_DIR}/foo
|
|
)
|
|
|
|
install(
|
|
TARGETS foo
|
|
EXPORT foo
|
|
DESTINATION .
|
|
|
|
FILE_SET no_genex
|
|
DESTINATION no_genex
|
|
|
|
FILE_SET genex
|
|
DESTINATION $<$<CONFIG:FAKE_CONFIG>:FAKE_DEST>genex
|
|
)
|
|
export(PACKAGE_INFO foo EXPORT foo)
|