[CMake] Exporting imported target

Asmodehn Shade asmodehn at gmail.com
Tue Mar 24 13:01:02 EDT 2009


Hi,

I am assuming it is at the moment (cmake 2.6.2 ) not possible to export an
imported target...

When I do :

# ${MyProject_EXPORT_CMAKE} contains the file path to a cmake script
generated by export,
# declaring ADD_LIBRARY(MyProject SHARED IMPORTED) ( among other stuff )
include(${MyProject_EXPORT_CMAKE})
export(TARGETS MyProject APPEND FILE Export.cmake)

I get :
export given target "MyProject" which is not built by this project.

What about having the imported target and its properties transitively
exported again ?
Has this been planned for the future or ruled out already ?

If you wonder why I might want to do this, its in the case where I have :

ProjectA depending on ProjectB depending on ProjectC
ProjectC is an imported target into ProjectB
However to build projectA and link ProjectB I must also be able to access
ProjectC properties...
I was planning to export projectC from projectB, so that projectA can access
it and do what it needs with it ( link properly the target without fullpath,
copy the binary built target (.so ) to run little executable tests in place,
etc.)

Just working on some cmake scripts right now, to make it easier to startup
cmake based projects...
I can give links to people interested to have a look... just let me know.

Thank you,

--
Alex
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090325/a333664f/attachment.htm>


More information about the CMake mailing list