I’ve lost something in translation when reading this bit of documentation on Transitive Usage Requirements in cmake-buildsystem(7):
Usage requirements are propagated by reading the
INTERFACE_variants of target properties from dependencies and appending the values to the non-
INTERFACE_variants of the operand. For example, the
INTERFACE_INCLUDE_DIRECTORIESof dependencies is read and appended to the
INCLUDE_DIRECTORIESof the operand.
From this, I would expect that if I had 2 targets, libA and libB, and libA specified a PUBLIC or INTERFACE include dir using
target_include_directory(libA PUBLIC includeA), if I were to specify
add_library(libB b.c) target_link_libraries(libB INTERFACE libA)
that the source file
b.c would get compiled with
I don’t observe this and I don’t understand why. Please explain?
PS - as an aside, I’m trying to use INTERFACE for just the headers, as I would want libB to dlsym lookup the symbols from libA (or any other libA equivalent interface library).