[CMake] Packaging imported target with CPack

Alexander Neundorf a.neundorf-work at gmx.net
Wed Mar 24 16:04:53 EDT 2010


On Wednesday 24 March 2010, Jaonary Rabarisoa wrote:
> Hi all,
>
> I'm using cmake to build projects and packages for delivrable. I have two
> projects that is not in the same build tree. Typically a project in a
> directory Lib and another one in a separate directory Program.
> I use the exported tragets from Lib in Program by include the exports file
> generated by Lib project.
> Now, I want to build a package with cpack inside my Program project. But
> when I try to set the installation path of my imported targets in
> Program/CMakeLists.txt I got this error :
>
> install TARGETS which not exists in this directory
>
> So, Is there any work around to package my code with all its imported
> dependencies without copying every file one by one ?

I think you should be able to use get_target_properties(LOCATION) on the 
imported targets, and then install(FILES ... ) with the locations you get.

But feel free to create a feature request for this on 
http://public.kitware.com/Bug

Alex


More information about the CMake mailing list