Hello,
I am trying to figure out if CMake has a feature to control the visibility of a target, as in what other target may depend on target.
This is the target visibility concept of Bazel: 顯示設定 | Bazel
I am working in a large C++ codebase with many targets owned by different teams and it is hard to enforce functional/technical dependencies between them.
It could look something like that:
add_library(A)
set_target_properties(A
PROPERTIES
TARGET_VISIBILITY B
)
// Would configure successfully
add_library(B)
target_link_libraries(B A)
// Would not configure and print an error message
add_library(C)
target_link_libraries(C A)
-> CMake: The target A cannot be used by target C, it is only visible from target B
Is something like that possible with CMake?
Thank you.