Files
CMake/Tests/RunCMake/InstallPackageInfo/VersionCheckWarning.cmake
Matthew Woehlke cc508826b4 CPS: Validate package version
Add version validation to cmExportPackageInfoGenerator. Specifically, if
a package uses the "simple" version schema (which is the default if no
schema is specified), validate that the specified version actually
conforms to the schema and issue an error if it does not. Also, issue a
warning if the schema is not recognized.
2025-11-26 17:04:26 -05:00

16 lines
307 B
CMake

set(
CMAKE_EXPERIMENTAL_EXPORT_PACKAGE_INFO
"b80be207-778e-46ba-8080-b23bba22639e"
)
add_library(foo INTERFACE)
install(TARGETS foo EXPORT foo DESTINATION .)
# Try exporting with an unrecognized schema.
install(
PACKAGE_INFO foo
EXPORT foo
VERSION "irrelevant"
VERSION_SCHEMA "unrecognized"
)