Files
CMake/Tests/RunCMake/ExportPackageInfo/ProjectMetadata-check.cmake
Matthew Woehlke 755a24ccae CPS: Add export support for [default_]license
Add `LICENSE` and `DEFAULT_LICENSE` arguments to the `PACKAGE_INFO`
modes of the `install` and `export` commands. If not otherwise
specified, the `LICENSE` will be taken from the project's
`SPDX_LICENSE`, if available.
2025-06-20 14:01:25 -04:00

28 lines
1.2 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}" "BSD-3-Clause" "license")
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}" "BSD-3-Clause" "license")
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}" "Apache-2.0" "license")
expect_value("${content}" "Don't inherit" "description")
expect_value("${content}" "https://www.example.com/package/bar" "website")