[CMake] INSTALL dependencies

Pau Garcia i Quiles pgquiles at elpauer.org
Wed Jan 28 16:58:04 EST 2009


On Wed, Jan 28, 2009 at 10:39 PM, Alexander Neundorf
<a.neundorf-work at gmx.net> wrote:
> On Wednesday 28 January 2009, Pau Garcia i Quiles wrote:
>> Hello,
>>
>> Is it possible to install a target's dependencies using the INSTALL(
>> TARGET ... ) signature? I. e. something like INSTALL ( TARGET mytarget
>> INSTALL_DEPENDENCIES ) which goes through the parameters of
>> TARGET_LINK_LIBRARIES and installs them too.
>
> Like this ?
> http://public.kitware.com/Bug/view.php?id=4266

More or less. In that bug report, you talk about building and
installing libraries which are built by the CMake build system you
have in place.

The main purpose I had when I proposed INSTALL ( TARGET ...
INSTALL_DEPENDENCIES ) was a bit broader: have "make install" install
not only the depending libraries I build with CMake but also the
third-party libraries I find with FIND_PACKAGE( ... )  and use in
TARGET_LINK_LIBRARIES.

>> If there is not such an option, would it be accepted if I develop it?
>
> I think so, but I also think this would require some significant changes in
> the way installation is done.

Could you please elaborate on this?

I admit I have not looked at the CMake code for INSTALL but the
implementation I had in mind would be:
* For the first signature of TARGET_LINK_LIBRARIES', take its arguments
* Skip first parameter (target 1) and for the other parameters:
  - Check if it's built by CMake. If it is, make the dependant "make
install" call the dependee's "make install"
  - If it is not built by CMake, just copy the file(s). The code
should be more or less like the code for INSTALL( FILES ...).

Is there anything wrong with that approach?

-- 
Pau Garcia i Quiles
http://www.elpauer.org
(Due to my workload, I may need 10 days to answer)


More information about the CMake mailing list