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
735 B
CMake
16 lines
735 B
CMake
include(${CMAKE_CURRENT_LIST_DIR}/Assertions.cmake)
|
|
|
|
set(out_dir "${RunCMake_BINARY_DIR}/DependencyVersionCMake-build/CMakeFiles/Export/5058f1af8388633f609cadb75a75dc9d")
|
|
|
|
file(READ "${out_dir}/foo.cps" content)
|
|
expect_value("${content}" "foo" "name")
|
|
expect_array("${content}" 1 "requires" "bar" "components")
|
|
expect_value("${content}" "bar" "requires" "bar" "components" 0)
|
|
expect_value("${content}" "1.3.5" "requires" "bar" "version")
|
|
expect_array("${content}" 1 "requires" "bar" "hints")
|
|
expect_value("${content}" "${CMAKE_CURRENT_LIST_DIR}/config" "requires" "bar" "hints" 0)
|
|
|
|
string(JSON component GET "${content}" "components" "foo")
|
|
expect_array("${component}" 1 "requires")
|
|
expect_value("${component}" "bar:bar" "requires" 0)
|