Boost logo

Boost-Build :

Subject: [Boost-build] Copying an external library with the install rule
From: Oliver Koenig (koenig_at_[hidden])
Date: 2010-10-24 16:52:05

we need to link to a (platform-dependant) external library like this:

lib ext_lib
   : : <name>ext <search>$(EXT_PKG_LIB_DIR)
   : : <include>$(EXT_PKG_INC_DIR)/ext ;

lib my_lib : my_source.cpp ext_lib ;

Nothing special so far, and this works fine. In a next step we would
like to install all libs with all dependencies to a single directory in
order to make it easy to build and run a (Boost-) Python application
which uses these libraries:

install install_libs
   : my_lib
   : <location>$(ROOT)/lib <install-dependencies>on <install-type>LIB ;

The install rule does not install pre-built libraries, hence the lib
ext.dll is missing in $(ROOT)/lib. We tried then to copy this library
with a separate install rule:

install install_ext_lib : $(EXT_PKG_LIB_DIR)/ext.dll
   : <toolset>msvc <location>$(ROOT)/lib ;
install install_libs
   : my_lib install_ext_lib
   : <location>$(ROOT)/lib <install-dependencies>on <install-type>LIB ;

Trying to run this produces the following error:

error: Duplicate name of actual target: <p...>ext.dll
error: previous virtual target ( common%common.copy-ext.dll.SHARED_LIB ...

Any hints how to solve this 'dilemma'? Maybe there is a hidden option in
the install rule which copies ALL libs?


Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at