I have a main library that is sent to several other libraries. In CMakeLists.txt, this is a bit like
ADD_LIBRARY (core ...) ADD_LIBRARY (branch1 ...) ADD_LIBRARY (branch2 ...) ... TARGET_LINK_LIBRARIES (branch1 core) TARGET_LINK_LIBRARIES (branch2 core) ...
I have some executables that may depend on any or all branches. For those that depend on all branches, instead of writing
ADD_EXECUTABLE (foo ...) TARGET_LINK_LIBRARIES (foo branch1 branch2 ...)
I tried
ADD_LIBRARY (all-branches) TARGET_LINK_LIBRARIES (all-branches branch1 branch2 ...)
then
TARGET_LINK_LIBRARIES (foo all-branches)
This works, but CMake issues a warning.
You have called ADD_LIBRARY for library all-branches without any source files. This typically indicates a problem with your CMakeLists.txt file
I understand the message, but this is not a mistake. What does CMake think is an acceptable way to create a meta library?
source share