When is the TARGET_NAME generator expression necessary?
I was reading the CMake documentation regarding generator expressions, and I found the following:
Marks ... as being the name of a target. This is required if exporting targets to multiple dependent export sets. The ... must be a literal name of a target- it may not contain generator expressions."
From that I understand that if some targets from an export set depend on other targets from other export set, the dependencies should be specified using $<TARGET_NAME:...> instead of the targets' names.
I found the thread (this message specifically: https://www.mail-archive.com/cmake-developers@.../msg05498.html) that is responsible for the introduction of the TARGET_NAME generator expression, however I cannot find an example for its use.
I believe it has something to do with adding the correct namespace to the "required library".
I tried an example of dependent export sets in which I do not use $<TARGET_NAME:...>, I even use the target's name inside another generator expression, but no error is generated and the output files contain the correct "imported" targets (with the correct namespaces):