mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-09 08:40:11 -06:00
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
15 lines
316 B
CMake
15 lines
316 B
CMake
cmake_minimum_required(VERSION 4.0)
|
|
|
|
add_library(bar INTERFACE)
|
|
|
|
find_package(Symbolic REQUIRED CONFIG
|
|
COMPONENTS foo test
|
|
NO_DEFAULT_PATH
|
|
PATHS ${CMAKE_CURRENT_LIST_DIR}
|
|
)
|
|
|
|
target_link_libraries(bar INTERFACE Symbolic::test)
|
|
|
|
install(TARGETS bar EXPORT bar)
|
|
install(PACKAGE_INFO bar EXPORT bar DESTINATION .)
|