Clinton Stimpson wrote:
I've got two projects with one depending on the other. I include the one project as a subdirectory and build it along with my project. Its similar to how ParaView includes VTK. I'm trying to use the install(EXPORT ...) to export my project from an installation tree, but I can't figure out how to make it work. The export(TARGETS ...) works fine for exporting from the build, except I have to include libraries from the other project.

install(EXPORT ..) gives me an error
CMake Error: INSTALL(EXPORT "Foo" ...) includes target "Bar" which requires target "Baz" that is not in the export set.

Baz is from the other project I include as a subproject. It seems "Foo" is supposed to be a name specific to my project. So I can't just add my project specific name for the export set into the other project's CMakeLists.txt file.

So how do I export targets from an installation tree that contains multiple projects?

If you're building a third-party project inside your tree then your install
tree effectively uses a custom version of that project and is not meant
as a distribution of it.  Therefore it should be exported as part of your
project and can be in a single export.  The CMake code of the subproject
will have to be written to allow the superproject to configure its
export name and install locations.

Alternatively, if you're creating a package for your project for binary
distribution then you should first package the third-party project,
then import it into your project's build from its install tree.  The
requirement that all target dependencies be part of the export applies
only to targets built in your tree.

-Brad

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to