Files
CMake/Tests/RunCMake/ExportPackageInfo/ProjectMetadata-check.cmake
Matthew Woehlke da97747dac CPS: Support additional metadata
Add support for specifying CPS's supplemental `description` and
`website` attributes. Add ability to inherit these from the `project()`,
similar to how version information can be inherited.
2025-06-03 16:50:46 -04:00

25 lines
1.0 KiB
CMake

include(${CMAKE_CURRENT_LIST_DIR}/Assertions.cmake)
set(out_dir "${RunCMake_BINARY_DIR}/ProjectMetadata-build")
file(READ "${out_dir}/foo.cps" content)
expect_value("${content}" "foo" "name")
expect_value("${content}" "1.2.3" "version")
expect_value("${content}" "1.1.0" "compat_version")
expect_value("${content}" "Sample package" "description")
expect_value("${content}" "https://www.example.com/package/foo" "website")
file(READ "${out_dir}/test1.cps" content)
expect_value("${content}" "test1" "name")
expect_value("${content}" "1.2.3" "version")
expect_value("${content}" "1.1.0" "compat_version")
expect_value("${content}" "Sample package" "description")
expect_value("${content}" "https://www.example.com/package/foo" "website")
file(READ "${out_dir}/test2.cps" content)
expect_value("${content}" "test2" "name")
expect_value("${content}" "1.4.7" "version")
expect_missing("${content}" "compat_version")
expect_value("${content}" "Don't inherit" "description")
expect_value("${content}" "https://www.example.com/package/bar" "website")