Hello,
I have the following situation: I build a third-party library as source and it expects to be configured with a header configuration file. To correctly compile, the library needs to find the header and therefore the folder of this header file needs to be in the include directories. Now the library does the correct thing and abstracts away the internal targets with known good namespaced ones with an ALIAS
. In my opinion, the correct way to make the header file available to the library would be to target_link_libraries()
an INTERFACE
library with the header to the third-party library. Or maybe, use target_include_directories()
with the ALIAS
of the third-party library.
Obviously this does not work, because CMake disallows using an ALIAS
with the target commands. But what is the reasoning behind this and what would be the correct way to handle this situation?
Thanks for your help!