After stripping down the question to "can I install an imported target"? - with 
the purpose to copy the shared libraries also into the lib directory of the 
importing project - I could actually also use Google and look for an answer 
that somebody else might have been asked.

And indeed: this seems to be a rather common question!

And the "official answer" seems to be something like "this bug is a feature". 
It must have been a change request already years ago, and it was refused with 
different arguments, like:

1) proper RPATH handling is not possible in this case, because CMake cannot 
know the way how the shared library was built initially, so it is not able to 
manipulate it.

At first this looks plausible, but then I was thinking that in Linux you always 
deal with ELF binaries, and there you have tools to manipulate RPATH/RUNPATH 
easily, and in Windows there is nothing similar - and others I don't know...

2) the target is already installed, so it makes no sense to install it again; 
it would only be a waste of disk space.

Well, in my case it would make a lot of sense, and also for any kind of 
packager that might use the install directory it would be much easier if all 
the stuff is already in one location.

3...) maybe others - I did not follow further.

In any case the conclusion is: It's like it is, and all my confusion came 
basically from this strange behaviour - that "install" is not always really 
"install" (but now I know at least when and why!). And the only way around - if 
I want to avoid the configure_file solution - would be to do some proper 
install(FILES...) instead - together with a little hacking regarding what the 
right files actually are.

Best regards, Cornelis
-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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

Reply via email to