extract sublib from Boost as small as possible

boost, c++, stl

Solution

BCP is functioning correctly, if you examine the inclusion hierarchy of the 'any' library, you will find the files listed above. It does seem a little excessive.

An alternative (but much slower) approach is to create an empty include directory and add in the minimum set of header files you need. Then just track down the compiler errors and add in each header the compiler complains is missing. I've had some success with this approach on C++ Boost projects .

Problem

Boost is an excellent library, but sometimes, it's inconvenient to add the whole library. So I want to extract a little part of Boost, only the necessary files are extracted. I know BCP.exe, but it didn't work as expected. BCP.exe extract too many unnecessary files. I work with Visual C++ 2010, so I don't need the Mac or Linux files. Only support for Visual C++ compiler is OK. Anybody can help me? For example, I just want to use Boost::any, but bcp extract the following file list: ``` \boost\any.hpp \boost\config \boost\config.hpp \boost\current_function.hpp \boost\detail \boost\exception \boost\mpl \boost\non_type.hpp \boost\preprocessor \boost\static_assert.hpp \boost\throw_exception.hpp \boost\type.hpp \boost\type_traits \boost\version.hpp \boost\config\abi \boost\config\abi_prefix.hpp \boost\config\abi_suffix.hpp \boost\config\auto_link.hpp \boost\config\compiler \boost\config\no_tr1 \boost\config\platform \boost\config\posix_features.hpp \boost\config\requires_threads.hpp \boost\config\select_compiler_config.hpp \boost\config\select_platform_config.hpp \boost\config\select_stdlib_config.hpp \boost\config\stdlib \boost\config\suffix.hpp \boost\config\user.hpp \boost\config\warning_disable.hpp \boost\config\abi\borland_prefix.hpp \boost\config\abi\borland_suffix.hpp \boost\config\abi\msvc_prefix.hpp \boost\config\abi\msvc_suffix.hpp \boost\config\compiler\borland.hpp \boost\config\compiler\clang.hpp \boost\config\compiler\codegear.hpp \boost\config\compiler\comeau.hpp \boost\config\compiler\common_edg.hpp \boost\config\compiler\compaq_cxx.hpp \boost\config\compiler\cray.hpp \boost\config\compiler\digitalmars.hpp \boost\config\compiler\gcc.hpp \boost\config\compiler\gcc_xml.hpp \boost\config\compiler\greenhills.hpp \boost\config\compiler\hp_acc.hpp \boost\config\compiler\intel.hpp \boost\config\compiler\kai.hpp \boost\config\compiler\metrowerks.hpp \boost\config\compiler\mpw.hpp \boost\config\compiler\nvcc.hpp \boost\config\compiler\pathscale.hpp \boost\config\compiler\pgi.hpp \boost\config\compiler\sgi_mipspro.hpp \boost\config\compiler\sunpro_cc.hpp \boost\config\compiler\vacpp.hpp \boost\config\compiler\visualc.hpp \boost\config\no_tr1\cmath.hpp \boost\config\no_tr1\complex.hpp \boost\config\no_tr1\functional.hpp \boost\config\no_tr1\memory.hpp \boost\config\no_tr1\utility.hpp \boost\config\platform\aix.hpp \boost\config\platform\amigaos.hpp \boost\config\platform\beos.hpp \boost\config\platform\bsd.hpp \boost\config\platform\cray.hpp \boost\config\platform\cygwin.hpp \boost\config\platform\hpux.hpp \boost\config\platform\irix.hpp \boost\config\platform\linux.hpp \boost\config\platform\macos.hpp \boost\config\platform\qnxnto.hpp \boost\config\platform\solaris.hpp \boost\config\platform\symbian.hpp \boost\config\platform\vms.hpp \boost\config\platform\vxworks.hpp \boost\config\platform\win32.hpp \boost\config\stdlib\dinkumware.hpp \boost\config\stdlib\libcomo.hpp \boost\config\stdlib\libcpp.hpp \boost\config\stdlib\libstdcpp3.hpp \boost\config\stdlib\modena.hpp \boost\config\stdlib\msl.hpp \boost\config\stdlib\roguewave.hpp \boost\config\stdlib\sgi.hpp \boost\config\stdlib\stlport.hpp \boost\config\stdlib\vacpp.hpp \boost\detail\workaround.hpp \boost\exception\detail \boost\exception\exception.hpp \boost\exception\detail\attribute_noreturn.hpp \boost\mpl\aux_ \boost\mpl\bool.hpp \boost\mpl\bool_fwd.hpp \boost\mpl\int.hpp \boost\mpl\integral_c.hpp \boost\mpl\integral_c_fwd.hpp \boost\mpl\integral_c_tag.hpp \boost\mpl\int_fwd.hpp \boost\mpl\aux_\adl_barrier.hpp \boost\mpl\aux_\config \boost\mpl\aux_\integral_wrapper.hpp \boost\mpl\aux_\lambda_support.hpp \boost\mpl\aux_\na_fwd.hpp \boost\mpl\aux_\nttp_decl.hpp \boost\mpl\aux_\preprocessor \boost\mpl\aux_\static_cast.hpp \boost\mpl\aux_\template_arity_fwd.hpp \boost\mpl\aux_\yes_no.hpp \boost\mpl\aux_\config\adl.hpp \boost\mpl\aux_\config\arrays.hpp \boost\mpl\aux_\config\ctps.hpp \boost\mpl\aux_\config\gcc.hpp \boost\mpl\aux_\config\intel.hpp \boost\mpl\aux_\config\lambda.hpp \boost\mpl\aux_\config\msvc.hpp \boost\mpl\aux_\config\nttp.hpp \boost\mpl\aux_\config\overload_resolution.hpp \boost\mpl\aux_\config\preprocessor.hpp \boost\mpl\aux_\config\static_constant.hpp \boost\mpl\aux_\config\ttp.hpp \boost\mpl\aux_\config\workaround.hpp \boost\mpl\aux_\preprocessor\enum.hpp \boost\mpl\aux_\preprocessor\params.hpp \boost\preprocessor\arithmetic \boost\preprocessor\cat.hpp \boost\preprocessor\comma_if.hpp \boost\preprocessor\config \boost\preprocessor\control \boost\preprocessor\debug \boost\preprocessor\detail \boost\preprocessor\facilities \boost\preprocessor\inc.hpp \boost\preprocessor\list \boost\preprocessor\logical \boost\preprocessor\punctuation \boost\preprocessor\repeat.hpp \boost\preprocessor\repetition \boost\preprocessor\tuple \boost\preprocessor\variadic \boost\preprocessor\arithmetic\inc.hpp \boost\preprocessor\config\config.hpp \boost\preprocessor\control\expr_iif.hpp \boost\preprocessor\control\if.hpp \boost\preprocessor\control\iif.hpp \boost\preprocessor\debug\error.hpp \boost\preprocessor\detail\auto_rec.hpp \boost\preprocessor\detail\check.hpp \boost\preprocessor\detail\dmc \boost\preprocessor\detail\is_binary.hpp \boost\preprocessor\detail\dmc\auto_rec.hpp \boost\preprocessor\facilities\empty.hpp \boost\preprocessor\facilities\overload.hpp \boost\preprocessor\list\adt.hpp \boost\preprocessor\list\for_each_i.hpp \boost\preprocessor\logical\bool.hpp \boost\preprocessor\logical\compl.hpp \boost\preprocessor\punctuation\comma.hpp \boost\preprocessor\punctuation\comma_if.hpp \boost\preprocessor\repetition\detail \boost\preprocessor\repetition\for.hpp \boost\preprocessor\repetition\repeat.hpp \boost\preprocessor\repetition\detail\dmc \boost\preprocessor\repetition\detail\edg \boost\preprocessor\repetition\detail\for.hpp \boost\preprocessor\repetition\detail\msvc \boost\preprocessor\repetition\detail\dmc\for.hpp \boost\preprocessor\repetition\detail\edg\for.hpp \boost\preprocessor\repetition\detail\msvc\for.hpp \boost\preprocessor\tuple\eat.hpp \boost\preprocessor\tuple\elem.hpp \boost\preprocessor\tuple\rem.hpp \boost\preprocessor\tuple\to_list.hpp \boost\preprocessor\variadic\elem.hpp \boost\preprocessor\variadic\size.hpp \boost\type_traits\broken_compiler_spec.hpp \boost\type_traits\config.hpp \boost\type_traits\detail \boost\type_traits\ice.hpp \boost\type_traits\integral_constant.hpp \boost\type_traits\is_lvalue_reference.hpp \boost\type_traits\is_reference.hpp \boost\type_traits\is_rvalue_reference.hpp \boost\type_traits\msvc \boost\type_traits\remove_reference.hpp \boost\type_traits\detail\bool_trait_def.hpp \boost\type_traits\detail\bool_trait_undef.hpp \boost\type_traits\detail\ice_and.hpp \boost\type_traits\detail\ice_eq.hpp \boost\type_traits\detail\ice_not.hpp \boost\type_traits\detail\ice_or.hpp \boost\type_traits\detail\template_arity_spec.hpp \boost\type_traits\detail\type_trait_def.hpp \boost\type_traits\detail\type_trait_undef.hpp \boost\type_traits\detail\wrap.hpp \boost\type_traits\detail\yes_no_type.hpp \boost\type_traits\msvc\remove_reference.hpp \boost\type_traits\msvc\typeof.hpp ```

Original source