Boost logo

Boost-Build :

Subject: Re: [Boost-build] Using the install rule with a pre-built library
From: Jurko Gospodnetić (jurko.gospodnetic_at_[hidden])
Date: 2013-03-11 22:12:58


   Hi.

> I've found that if I set-up the pre-built library using the <file> feature,
> it works as expected. However, when I change to the use <name> and <search>,
> it doesn't copy the file.

   I was just looking into how to define a prebuilt lib target having a
differently named import & executable library files and ran into this
issue myself. :-)

   The best workaround I've found so far, without delving into the Boost
Build sources themselves and making tweaks there, goes something like this:

> local dllFolder = "D:/Libraries/WxWidgets/wxWidgets-2.9.4/lib/vc_dll_staticRTL_unicode_PKE_msvc-9.0" ;
> lib test-dll : : <link>shared <file>$(dllFolder)/wxbase294ud_vc_PKE.dll ;
> lib test : :
> <link>shared:<dependency>test-dll
> <name>wxbase29ud
> <search>$(dllFolder) ;
> install oklahoma : test : <install-dependencies>on <location>BBB ;

   This defines a prebuilt library target test which, on Windows, gets
resolved to import library wxbase29ud.lib and wxbase294ud_vc_PKE.dll
DLL. It installs the library file correctly - DLL when asked to use the
library as a DLL, and nothing when asked to use it as a static library.

   It also correctly links in the import library when you create an exe
from the test target with link=shared.

   Not quite happy with the solution so I'm going to dig some more, but
it does get the ball rolling. :-)

   Problems with this solution:
     - when you say you want to install the prebuilt library you also
need to explicitly tell the install rule to install the related
dependencies or it will not collect the DLL file.
     - you need to spell out the target folder & file location in
multiple places (can be remedied by using indirect conditional rules
though and thus having the values calculated in a single location)

   If anyone has any better suggestions, I'd be glad to hear them...

   Hope this helps.

   Best regards,
     Jurko Gospodnetić


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk