Answer the question
In order to leave comments, you need to log in
What is the scope of CMake's "global entities"?
If I bring subdirectory
in link_libraries
several libraries, will the added libraries be visible in the root CMakeLists? If not, how can I do it link_libraries
locally for all targets in a subdirectory?
Answer the question
In order to leave comments, you need to log in
Here they write: https://cmake.org/cmake/help/v3.10/command/link_li...
that this will only affect targets created in the current or lower CMakeLists.
I suspect that the link_libraries just changes the variable. And the variables in cmake behave by default as described, i.e. The changes are visible here and below. In order for them to be visible above, dances with a tambourine are needed, which, apparently, is not in link_libraries.
At the same time, targets created in nested CMakeLists are perfectly visible in all other CMakeLists, not necessarily lower in the hierarchy, but also in another branch.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question