For a certain extremely specific use case, CMake configures linking an application to the *same* library in both -L... -l... form and file pathname form
See the mailing list thread started at https://cmake.org/pipermail/cmake-developers/2019-August/031214.html for a preliminary discussion of this issue.
The following specific conditions must be met to expose this issue.
- There must be at least two library items (i.e., the target links to at least two libraries) mentioned in the target_link_libraries command.
- The two item libraries must be built in different ways, e.g., one shared and one static.
- The application must link to the two item libraries in two different ways, e.g.,
target_link_libraries(application target1 $<TARGET_LINKER_FILE:target2>)
where application is the target name of the application and target1 and target2 are the target names for the two libraries. If the above three conditions are met, then the actual link command (on Linux) refers to the library that is linked via $<TARGET_LINKER_FILE...> in both the -L... -l... form and the file pathname form.