mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-30 11:10:06 -05:00
d92b6c3e20
Adds support for "symbolic" components, which represent feature-level capabilities of a package that do not correspond to actual build targets. These are modeled as pseudo-targets, using the INTERFACE type as a base, and can be queried via: get_target_property(... <tgt> "SYMBOLIC") This enables consumers to declare requirements on optional features (e.g., SSL support) even when they do not map to concrete targets. Fixes: #27187
17 lines
717 B
CMake
17 lines
717 B
CMake
include(${CMAKE_CURRENT_LIST_DIR}/Assertions.cmake)
|
|
|
|
set(out_dir "${RunCMake_BINARY_DIR}/TransitiveSymbolicComponent-build")
|
|
|
|
|
|
file(READ "${out_dir}/bar.cps" content)
|
|
expect_value("${content}" "bar" "name")
|
|
expect_array("${content}" 1 "requires" "Symbolic" "components")
|
|
expect_value("${content}" "test" "requires" "Symbolic" "components" 0)
|
|
expect_value("${content}" "1.0" "requires" "Symbolic" "version")
|
|
expect_array("${content}" 1 "requires" "Symbolic" "hints")
|
|
expect_value("${content}" "${CMAKE_CURRENT_LIST_DIR}/cps" "requires" "Symbolic" "hints" 0)
|
|
|
|
string(JSON component GET "${content}" "components" "bar")
|
|
expect_array("${component}" 1 "requires")
|
|
expect_value("${component}" "Symbolic:test" "requires" 0)
|