My issue may be a bit more complicated than anticipated and related to another issue: Findmodule transitivity?
What I want exactly do is:
L may depend on a third party library TP that is not properly packaged.
If L uses TP, it imports TP with a FindTP.cmake file and defines a compile definition TPNEEDED
What I’d like to do is, when, in A, I find_package(L) then TP is automatically linked with A, but only if L actually needed TP.
the FindTP.cmake does not seem to be used “transitively”, and I can’t retrieve if TPNEEDED is defined so far. Besides, I suppose that it may be only defined after find_package(L) that will generate an error because TP is not found, before I can do anything about it.
Thus, what would be the proper way to manage this optional dependency?
Thanks,
A.