Install needed libraries from add_subdirectory(... EXCLUDE_FROM_ALL)

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Install needed libraries from add_subdirectory(... EXCLUDE_FROM_ALL)

Dustyn Blasig
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.



Powered by

Please keep messages on-topic and check the CMake FAQ at:

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support:
CMake Consulting:
CMake Training Courses:

Visit other Kitware open-source projects at

Follow this link to subscribe/unsubscribe: