[CMake] Install needed libraries from add_subdirectory(... EXCLUDE_FROM_ALL)

Dustyn Blasig dustyn at blasig.us
Mon Aug 19 00:07:10 EDT 2019


Hi All,

We have a build hierarchy of projects and generally we import needed
projects into higher-level projects with EXLUDE_FROM_ALL so only dependency
targets that are needed by the "uber" builds are built. However, if the
subdirectory build produces shared libraries, we need those shared
libraries to get installed with the uber project files.

The documentation for EXCLUDE_FROM_ALL says the install behavior is
undefined. However, I'm curious if there is a known "should work"
workaround we can use, with the caveat we'll have to test things to make
sure it works.

I added all the transitive dependencies to the install rules in the owning
package to make progress, but that will be tricky once each part needs to
be truly installed by clients separately.

Note, I'm stuck for now with supporting 3.12.4 as the minimum CMake
requirement most likely.

Thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20190818/7a434ec9/attachment.html>


More information about the CMake mailing list