[CMake] Controlling the targets in an export set

Adar Dembo adar at cloudera.com
Wed Jul 23 19:57:13 EDT 2014


I have a project that generates a shared library foo. As part of the build,
the bar1, bar2, and bar3 static archives are created, and eventually, foo
is linked against all of them. Thus, the project's sole deliverable is
libfoo.so; all the necessary symbols from the bar1..bar3 archives are found
within libfoo.so.

If I try to export foo using "install(TARGETS foo EXPORT foo ...) and
"install(EXPORT foo ...)", cmake complains that target foo requires targets
bar1, bar2, and bar3, which are not in the export set. I have to add
"install(TARGETS bar1 EXPORT foo ...)" for bar1..bar3 if I want this to
succeed. However, this also means that I'm exporting my static archives,
which as I wrote earlier aren't necessary.

How can I exercise finer-grained control over foo's export set? How can I
build an export set containing foo but excluding bar1, bar2, and bar3?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20140723/1b154eab/attachment.html>


More information about the CMake mailing list