mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-14 02:08:27 +08:00

Refactor `cmFindPackageStack` to track additional metadata about <package> found. This includes two new fields, `Version` and `Location` which correspond to package version and path. The remaining package information will be implemented in a later commit
16 lines
680 B
CMake
16 lines
680 B
CMake
include(${CMAKE_CURRENT_LIST_DIR}/Assertions.cmake)
|
|
|
|
set(out_dir "${RunCMake_BINARY_DIR}/DependencyVersionCps-build/")
|
|
|
|
file(READ "${out_dir}/foo.cps" content)
|
|
expect_value("${content}" "foo" "name")
|
|
expect_array("${content}" 1 "requires" "baz" "components")
|
|
expect_value("${content}" "baz" "requires" "baz" "components" 0)
|
|
expect_value("${content}" "1.3.5" "requires" "baz" "version")
|
|
expect_array("${content}" 1 "requires" "baz" "hints")
|
|
expect_value("${content}" "${CMAKE_CURRENT_LIST_DIR}/cps" "requires" "baz" "hints" 0)
|
|
|
|
string(JSON component GET "${content}" "components" "foo")
|
|
expect_array("${component}" 1 "requires")
|
|
expect_value("${component}" "baz:baz" "requires" 0)
|