mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-09-25 04:09:36 +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.
39 lines
945 B
CMake
39 lines
945 B
CMake
add_library(foo INTERFACE)
|
|
install(TARGETS foo EXPORT foo DESTINATION .)
|
|
|
|
# Try exporting a 'properly' simple version.
|
|
export(PACKAGE_INFO foo1 EXPORT foo VERSION 1.2.3)
|
|
|
|
# Try exporting a version with many components.
|
|
export(PACKAGE_INFO foo2 EXPORT foo VERSION 1.21.23.33.37.42.9.0.12)
|
|
|
|
# Try exporting a version with a label.
|
|
export(PACKAGE_INFO foo3 EXPORT foo VERSION "1.2.3+git1234abcd")
|
|
|
|
# Try exporting a version with a different label.
|
|
export(PACKAGE_INFO foo4 EXPORT foo VERSION "1.2.3-0.example")
|
|
|
|
# Try exporting with the schema explicitly specified.
|
|
export(
|
|
PACKAGE_INFO foo5
|
|
EXPORT foo
|
|
VERSION "1.2.3-0.example"
|
|
VERSION_SCHEMA "simple"
|
|
)
|
|
|
|
# Try exporting with a custom-schema version.
|
|
export(
|
|
PACKAGE_INFO foo6
|
|
EXPORT foo
|
|
VERSION "foo!test"
|
|
VERSION_SCHEMA "custom"
|
|
)
|
|
|
|
# Try exporting with a recognized but not-checked schema.
|
|
export(
|
|
PACKAGE_INFO foo7
|
|
EXPORT foo
|
|
VERSION "invalid"
|
|
VERSION_SCHEMA "pep440"
|
|
)
|