Brad King:
The whole install tree can be deployed to another directory or even another machine, and still work correctly. When the targets file generated by install(EXPORT)
is loaded by a dependent project, it computes artifact locations relative to itself and generates imported targets for the consumer. It can do this because the install tree layout is known relative to its prefix. This doesn’t work for third-party imports because they come from an arbitrary location on the system and their location after deployment is not known. Maybe the files will be part of the package. Maybe they need to be found again on the destination system with new find_*
calls. install(EXPORT)
doesn’t know.
What about IMPORTED
targets exported from the build-tree with export(TARGETS...)
? Is that also not allowed by design? I haven’t been quite able to do it, but not sure if not possible or just a problem with my project…