[CMake] INSTALL dependencies

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


On Wed, Jan 28, 2009 at 11:41 PM, Andreas Pakulat <apaku at gmx.de> wrote:
> On 28.01.09 22:58:04, Pau Garcia i Quiles wrote:
>> 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.
>
> But why? You've already found them, so they are already installed. There's
> no point in installing them again. I guess you actually want to create a
> distributable package of your app containing all dependencies? For that
> install is IMHO simply the wrong tool.

No, you are wrong.

For instance, in our case Windows developers have a "3rdparty"
directory which contains compiled versions of all the libraries we use
for all our projects, for all the compilers we develop with. That
"3rdparty" directory is a svn external in the svn repository for each
project:

3rdparty
   |---> msvc2003
   |            |---> ace
   |            |---> boost
   |            |---> ice
   |            |---> isc_cache2007.1
   |            |---> isc_cache2007.2
   |            |---> isc_cache2008.2
   |            |---> qt4
   |            |---> qwt5
   |            |---> osg
   |            |---> snmp++
   |---> msvc2005
   |            |---> ace
   |            |---> boost
   |            |---> ice
   |            |---> isc_cache2007.1
   |            |---> isc_cache2007.2
   |            |---> isc_cache2008.2
   |            |---> qt4
   |            |---> qwt5
   |            |---> osg
   |            |---> snmp++
   |---> msvc2008
   |            |---> ace
   |            |---> boost
   |            |---> ice
   |            |---> isc_cache2007.1
   |            |---> isc_cache2007.2
   |            |---> isc_cache2008.2
   |            |---> qt4
   |            |---> qwt5
   |            |---> osg
   |            |---> snmp++

By means of CMAKE_PREFIX_PATH, INCLUDE_DIRECTORIES(), etc you can find
the libraries and header files and not have them installed. So no,
finding the libraries and header files does not imply they are
installed.

When I develop an application which uses Qwt5, Qt4 and OSG, it would
be convenient that a "nmake install" would install my application and
the Qwt5, Qt4 and OSG DLLs in the same directory (using RUNTIME
DESTINATION, LIBRARY DESTINATION, etc) without me having to INSTALL(
FILES ... ) or INSTALL( PROGRAMS ... ).

-- 
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